Commit 467c1163 authored by Cecilia Vela Gurovic's avatar Cecilia Vela Gurovic Committed by Robert Lyon

Bug 1800319: redirect to review persmissions when adding views to collection

this will change the redirect page
after editing the access rules from a view in a collection.
Instead of taking you to the edit page of the view,
it will redirect to pages and collections
for a portfolio

behatnotneeded

Change-Id: I14ad1f02048b1952d4531da854880ddcb2f93ff7
parent ffbade6d
......@@ -55,40 +55,32 @@ EOF;
$owner = $collection->get('owner');
$groupid = $collection->get('group');
$institutionname = $collection->get('institution');
$urlparams = array();
if (!empty($groupid)) {
define('MENUITEM', 'engage/index');
define('MENUITEM_SUBPAGE', 'views');
define('GROUP', $groupid);
$group = group_current_group();
define('TITLE', $group->name . ' - ' . get_string('editviews', 'collection'));
$baseurl = get_config('wwwroot') . 'view/groupviews.php';
$urlparams['group'] = $groupid;
}
else if (!empty($institutionname)) {
if ($institutionname == 'mahara') {
define('ADMIN', 1);
define('MENUITEM', 'configsite/views');
$baseurl = get_config('wwwroot') . 'admin/site/views.php';
}
else {
define('INSTITUTIONALADMIN', 1);
define('MENUITEM', 'manageinstitutions/institutionviews');
$baseurl = get_config('wwwroot') . 'view/institutionviews.php';
}
define('TITLE', get_string('editviews', 'collection'));
$urlparams['institution'] = $institutionname;
}
else {
define('MENUITEM', 'create/views');
define('TITLE', get_string('editviews', 'collection'));
$baseurl = get_config('wwwroot') . 'view/index.php';
}
define('SUBSECTIONHEADING', $collection->get('name'));
if ($urlparams) {
$baseurl .= '?' . http_build_query($urlparams);
}
$accessurl = get_config('wwwroot') . 'view/accessurl.php?collection=' . $id;
if ($collection->is_submitted()) {
$submitinfo = $collection->submitted_to();
throw new AccessDeniedException(get_string('canteditsubmitted', 'collection', $submitinfo->name));
......@@ -170,7 +162,7 @@ setpageicon($smarty, 'icon-folder-open');
$smarty->assign('id', $id);
$smarty->assign('INLINEJAVASCRIPT', $inlinejs);
$smarty->assign('baseurl', $baseurl);
$smarty->assign('accessurl', $accessurl);
$smarty->assign('displayurl', get_config('wwwroot') . 'collection/views.php?id=' . $id);
$smarty->assign('removeurl', get_config('wwwroot') . 'collection/deleteview.php?id=' . $id);
$smarty->assign('views', $views);
......
......@@ -76,6 +76,7 @@ $string['manageviewsspecific'] = 'Manage pages in "%s"';
$string['name'] = 'Collection name';
$string['needtoselectaview'] = 'You need to select a page to add to the collection.';
$string['newcollection'] = 'New collection';
$string['nexteditaccess'] = 'Next: Edit access';
$string['nocollections'] = 'No collections yet.';
$string['nocollectionsaddone'] = 'No collections yet. %sAdd one%s.';
$string['nooverride'] = 'No override';
......
......@@ -70,7 +70,7 @@
</div>
</div>
<div id="collectiondonewrap">
<a class="btn btn-primary" href="{$baseurl}">{str tag=done}</a>
<a class="btn btn-primary" href="{$accessurl}">{str tag=nexteditaccess section=collection}</a>
</div>
{include file="footer.tpl"}
......@@ -410,7 +410,7 @@ function accessurl_cancel_submit() {
}
function accessurl_submit(Pieform $form, $values) {
global $SESSION, $institution, $view, $group, $collection;
global $SESSION, $institution, $view, $group, $collection, $collectionid, $shareurl;
if ($values['accesslist']) {
$dateformat = get_string('strftimedatetimeshort');
......@@ -510,6 +510,10 @@ function accessurl_submit(Pieform $form, $values) {
}
}
set_progress_done('copyviewexistingmembersprogress');
if ($collectionid && $shareurl) {
redirect($shareurl);
}
if ($view->get('owner')) {
redirect(get_config('wwwroot') . 'view/blocks.php?id=' . $view->get('id'));
}
......
......@@ -48,14 +48,13 @@ Scenario: SmartEvidence interaction by member / staff
And I press "Next: Edit collection pages"
And I follow "All"
And I press "Add pages"
When I follow "Done"
Then I should see "Pages and collections"
When I follow "Next: Edit access"
Then I click on "Return to pages and collections"
# Mahara member makes page visible to public
And I click on "Manage access" in "Smart Evidence Collection 1" card access menu
And I select "Public" from "accesslist[0][searchtype]"
And I click on "Save"
And I click on "Return to pages and collections"
# Mahara member must make comment on competencies before it can be accessed by admin/staff
When I follow "Smart Evidence Collection 1"
# click the standard group 3.1 to make an annotation for page 1 column
......@@ -112,5 +111,3 @@ Scenario: SmartEvidence interaction by member / staff
# verify that user cannot delete Other user's annotations.
And I should see "Edit" in the "//*[starts-with(@id,'annotation_feedbacktable')]/div/div/div[2]/li[3]/div[1]/div" "xpath_element"
And I should not see "Edit" in the "//*[starts-with(@id,'annotation_feedbacktable')]/div/div/div[2]/li[2]/div[1]/div" "xpath_element"
......@@ -60,14 +60,14 @@ Scenario: 1) Mahara member creates a collection of 3 pages and submits for marki
# Verifying that the pages were added
Then I should see "Page UserA_01"
And I should see "Page UserA_03"
When I follow "Done"
Then I should see "Pages and collections"
When I follow "Next: Edit access"
Then I should see "Edit access"
# Mahara member makes to page visible to public
And I choose "Pages and collections" in "Create" from main menu
And I click on "Manage access" in "Smart Evidence Collection 1" card access menu
And I select "Public" from "accesslist[0][searchtype]"
And I click on "Save"
And I click on "Return to pages and collections"
# Verify user is on correct page
And I should see "Smart Evidence Collection 1"
......
......@@ -57,7 +57,7 @@ Scenario: Accessing the popup window in the Copy or page or collection (Bug 1361
And I check "Page admin_02"
And I press "Add pages"
And I should see "1 page added to collection"
And I follow "Done"
And I follow "Next: Edit access"
# Copy a collection directly from its location
And I choose "Pages and collections" in "Create" from main menu
......@@ -66,16 +66,17 @@ Scenario: Accessing the popup window in the Copy or page or collection (Bug 1361
And I follow "Copy"
And I press "Collection"
And I press "Next: Edit collection pages"
And I follow "Done"
And I follow "Next: Edit access"
# Copy a collection
And I choose "Pages and collections" in "Create" from main menu
And I follow "Copy"
And I click on "Copy collection" in "Collection admin_01" row
And I press "Next: Edit collection pages"
And I follow "Done"
And I follow "Next: Edit access"
#veryfying if the collection is copied directly from its location
And I choose "Pages and collections" in "Create" from main menu
And I click on "Collection admin_01 v.2"
And I press "Next page"
And I press "Next page"
......
......@@ -36,7 +36,8 @@ Scenario: Meta test testing Behat's functionality (Bug #1387836)
And I check "test page name 1"
And the "test page name 1" checkbox should be checked
And I press "Add pages"
And I follow "Done"
And I follow "Next: Edit access"
And I click on "Return to pages and collections"
And I click on "test collection name" card menu
And I should see "Delete"
And I go to the homepage
......
Markdown is supported
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