]> git.mjollnir.org Git - moodle.git/commitdiff
MDL-11896 added hint if entry awaits approval
authorskodak <skodak>
Sun, 27 Sep 2009 18:08:27 +0000 (18:08 +0000)
committerskodak <skodak>
Sun, 27 Sep 2009 18:08:27 +0000 (18:08 +0000)
lang/en_utf8/data.php
mod/data/view.php

index 00838457af39b2ad64c436471fe880f30fa84e5a..e59622fc8e69bb07ea7d8ad7559ddb0f09a0821c 100644 (file)
@@ -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';
index d24b3b99fa1931d6fbc788d7e70e1d3a4b5a8b31..f08be89b17a256d9ab2f56865e108a25c5800cbc 100755 (executable)
     $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?