Commit cd089eae authored by Robert Lyon's avatar Robert Lyon
Browse files

Bug 1513306: Add collection id to 'Share page' link



So it can be passed to 'edit access' page from the 'edit page' page
on the 'Share page' link

Change-Id: I1968d205b12840cd3dcfbd80a6ffdd26a498361d
Signed-off-by: Robert Lyon's avatarRobert Lyon <robertl@catalyst.net.nz>
parent d8859ba8
......@@ -26,7 +26,7 @@
{str tag=displayview section=view}
</a>
{if $edittitle || $viewtype == 'profile'}
<a href="{$WWWROOT}view/access.php?id={$viewid}{if $new}&new=1{/if}">
<a href="{$WWWROOT}view/access.php?id={$viewid}{if $collectionid}&collection={$collectionid}{/if}{if $new}&new=1{/if}">
<span class="icon icon-unlock-alt"></span>
{str tag=shareview section=view}
</a>
......
......@@ -271,6 +271,11 @@ if (get_config('userscanchooseviewthemes') && $view->is_themeable() && $view->ge
}
$smarty->assign('viewid', $view->get('id'));
$collectionid = false;
if ($collection = $view->get('collection')) {
$collectionid = $collection->get('id');
}
$smarty->assign('collectionid', $collectionid);
if ($blockid) {
// Configuring a single block
......
@javascript @core @core_view @core_portfolio @bob1
Feature: The 'Share page' link on the "Edit content" screen
In order to be able to see the right view access selections I need to
add a page to a collection.
Background:
Given the following "users" exist:
| username | password | email | firstname | lastname | institution | authname | role |
| userA | Kupuhipa1 | test01@example.com | Pete | Mc | mahara | internal | member |
And the following "pages" exist:
| title | description| ownertype | ownername |
| Page 1 | This is the page in collection | user | userA |
| Page 2 | This is the solo page | user | userA |
And the following "collections" exist:
| title | description| ownertype | ownername | pages |
| Collection One | collection C1 | user | userA | Page 1 |
Scenario: Testing that view access for views in collections are editable properly
# Checking the right selected options display on view access
Given I log in as "userA" with password "Kupuhipa1"
And I choose "Pages" in "Portfolio"
And I follow "Edit \"Page 1\""
And I follow "Share page"
Then I should see "Collection One"
And I should not see "Page 1"
And I choose "Pages" in "Portfolio"
And I follow "Edit \"Page 2\""
And I follow "Share page"
Then I should see "Page 2"
And I should not see "Collection One"
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment