From: skodak Date: Sun, 27 Sep 2009 18:08:27 +0000 (+0000) Subject: MDL-11896 added hint if entry awaits approval X-Git-Url: http://git.mjollnir.org/gw?a=commitdiff_plain;h=ebb621f6a9daf51ea6455354566ea3f662449ea0;p=moodle.git MDL-11896 added hint if entry awaits approval --- diff --git a/lang/en_utf8/data.php b/lang/en_utf8/data.php index 00838457af..e59622fc8e 100644 --- a/lang/en_utf8/data.php +++ b/lang/en_utf8/data.php @@ -200,6 +200,7 @@ $string['nomaximum'] = 'No maximum'; $string['norecords'] = 'No entries in database'; $string['norating'] = 'This activity does not use ratings'; $string['nosingletemplate'] = 'Single template is not yet defined'; +$string['notapproved'] = 'Entry is not approved yet.'; $string['notinjectivemap'] = 'Not an injective map'; $string['number'] = 'Number'; $string['numberrssarticles'] = 'RSS articles'; diff --git a/mod/data/view.php b/mod/data/view.php index d24b3b99fa..f08be89b17 100755 --- a/mod/data/view.php +++ b/mod/data/view.php @@ -303,6 +303,13 @@ $currentgroup = groups_get_activity_group($cm); $groupmode = groups_get_activity_groupmode($cm); + // deletect entries not approved yet and show hint instead of not found error + if ($record and $data->approval and !$record->approved and $record->userid != $USER->id and !has_capability('mod/data:manageentries', $context)) { + if (!$currentgroup or $record->groupid == $currentgroup or $record->groupid == 0) { + print_error('notapproved', 'data'); + } + } + echo $OUTPUT->heading(format_string($data->name)); // Do we need to show a link to the RSS feed for the records?