Commit 5d89bfbf authored by Hugh Davenport's avatar Hugh Davenport
Browse files

Fix lang string 'canteditdontown' for certain sections



Most of these get_string calls were not using a section
name. This patch fixes this by adding these strings to
each section responsible.

Bug #787866

Change-Id: I81ec38d7572f9472cf54885d6b35d542b933bca6
Signed-off-by: default avatarHugh Davenport <hugh@catalyst.net.nz>
parent b18a996c
......@@ -27,6 +27,7 @@
defined('INTERNAL') || die();
/* Plans */
$string['canteditdontownplan'] = 'You can\'t edit this plan because you don\'t own it.';
$string['description'] = 'Description';
$string['deleteplanconfirm'] = 'Are you sure you wish to delete this plan? Deleting this plan will also remove any tasks it contains.';
$string['deleteplan'] = 'Delete plan';
......@@ -52,6 +53,7 @@ $string['titledesc'] = 'The title will be used to display each task in the Plans
/* Tasks */
$string['alltasks'] = 'All tasks';
$string['canteditdontowntask'] = 'You can\'t edit this task because you don\'t own it.';
$string['completed'] = 'Completed';
$string['completiondate'] = 'Completion date';
$string['completeddesc'] = 'Mark your task completed.';
......
......@@ -147,7 +147,7 @@ class ArtefactTypePlan extends ArtefactType {
$id = (int) $values['plan'];
$artefact = new ArtefactTypePlan($id);
if (!$USER->can_edit_artefact($artefact)) {
$form->set_error('submit', get_string('canteditdontown'));
$form->set_error('submit', get_string('canteditdontownplan', 'artefact.plans'));
}
}
}
......@@ -488,7 +488,7 @@ class ArtefactTypeTask extends ArtefactType {
$id = (int) $values['task'];
$artefact = new ArtefactTypeTask($id);
if (!$USER->can_edit_artefact($artefact)) {
$form->set_error('submit', get_string('canteditdontown'));
$form->set_error('submit', get_string('canteditdontowntask', 'artefact.plans'));
}
}
}
......
......@@ -42,7 +42,7 @@ $id = param_integer('id');
$data = get_record_select('collection', 'id = ?', array($id));
$collection = new Collection($id, (array)$data);
if (!$USER->can_edit_collection($collection)) {
$SESSION->add_error_msg(get_string('canteditdontown'));
$SESSION->add_error_msg(get_string('cantdeletecollection', 'collection'));
redirect('/collection/');
}
$form = pieform(array(
......
......@@ -43,7 +43,7 @@ $data = null;
if ($data = get_record_select('collection', 'id = ?', array($id))) {
$collection = new Collection($id, (array)$data);
if (!$USER->can_edit_collection($collection)) {
$SESSION->add_error_msg(get_string('canteditdontown'));
$SESSION->add_error_msg(get_string('canteditdontown', 'collection'));
redirect('/collection/');
}
}
......
......@@ -47,7 +47,7 @@ $direction = param_variable('direction','');
$data = get_record_select('collection', 'id = ?', array($id), '*');
$collection = new Collection($id, (array)$data);
if (!$USER->can_edit_collection($collection)) {
$SESSION->add_error_msg(get_string('canteditdontown'));
$SESSION->add_error_msg(get_string('canteditdontown', 'collection'));
redirect('/collection/');
}
......
......@@ -42,7 +42,7 @@ $group_data = get_record_sql("SELECT g.*
AND g.deleted = 0", array($USER->get('id'), $id));
if (!$group_data) {
$SESSION->add_error_msg(get_string('canteditdontown'));
$SESSION->add_error_msg(get_string('canteditdontown', 'group'));
redirect('/group/mygroups.php');
}
$elements = array();
......
......@@ -40,6 +40,8 @@ $string['add'] = 'Add';
$string['addviews'] = 'Add pages';
$string['addviewstocollection'] = 'Add pages to collection';
$string['back'] = 'Back';
$string['cantdeletecollection'] = 'You cannot delete this collection.';
$string['canteditdontown'] = 'You can\'t edit this collection because you don\'t own it.';
$string['collection'] = 'collection';
$string['Collection'] = 'Collection';
$string['collections'] = 'Collections';
......
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