Commit 3cfbd58d authored by Ghada El-Zoghbi's avatar Ghada El-Zoghbi Committed by Robert Lyon

Bug 1832805: Add missing lang strings when saving page to timeline

Four new lang strings:
* cantversionviewinvalid
* cantversionvieweditpermissions
* cantversionviewsubmitted
* cantversionviewgroupeditwindow

Have separated the scenarios out for better feedback to the user.

Sponsored by The Australian National University

behatnotneeded

Change-Id: Id4952c37f35631b2f6a1dfad8129bac48108d733
(cherry picked from commit 1a08674a)
parent 0ac5ce6d
......@@ -264,6 +264,11 @@ $string['updatedaccessfornumviews1'] = array(
'Access rules were updated for %d pages.',
);
$string['cantversionviewinvalid'] = 'The supplied page identifier is invalid.';
$string['cantversionvieweditpermissions'] = 'You do not permission to edit this page.';
$string['cantversionviewsubmitted'] = 'You cannot edit this page because it has been submitted for assessment. You will have to wait until it is released.';
$string['cantversionviewgroupeditwindow'] = 'You cannot edit this page. It is outside of the group editable date window.';
$string['invalidcolumn'] = 'Column %s out of range';
$string['confirmcancelcreatingview'] = 'This page has not been completed. Do you really want to cancel?';
......
......@@ -16,12 +16,19 @@ $viewid = param_integer('view');
$view = new View($viewid, null);
if (!$view || !$USER->can_edit_view($view) || $view->is_submitted()) {
throw new AccessDeniedException(get_string('cantversionview', 'view'));
if (!$view ) {
throw new AccessDeniedException(get_string('cantversionviewinvalid', 'view'));
}
if (!$USER->can_edit_view($view)) {
throw new AccessDeniedException(get_string('cantversionvieweditpermissions', 'view'));
}
if ($view->is_submitted()) {
throw new AccessDeniedException(get_string('cantversionviewsubmitted', 'view'));
}
$groupid = $view->get('group');
if ($groupid && !group_within_edit_window($groupid)) {
throw new AccessDeniedException(get_string('cantversionview', 'view'));
throw new AccessDeniedException(get_string('cantversionviewgroupeditwindow', 'view'));
}
$version = new stdClass();
......
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