diff --git a/mod/data/classes/external.php b/mod/data/classes/external.php index 4568cb7c76d..e4e22192ea7 100644 --- a/mod/data/classes/external.php +++ b/mod/data/classes/external.php @@ -527,7 +527,7 @@ class mod_data_external extends external_api { // Check correct record entry. Group check was done before. if (!data_can_view_record($database, $record, $record->groupid, $canmanageentries)) { - throw new moodle_exception('notapproved', 'data'); + throw new moodle_exception('notapprovederror', 'data'); } $related = array('context' => $context, 'database' => $database, 'user' => null); diff --git a/mod/data/classes/template.php b/mod/data/classes/template.php index 97199e2915c..fec7402f261 100644 --- a/mod/data/classes/template.php +++ b/mod/data/classes/template.php @@ -605,7 +605,7 @@ class template { if (!$this->instance->approval) { return ''; } - return ($entry->approved) ? get_string('approved', 'data') : get_string('notapproved', 'data'); + return ($entry->approved) ? '' : html_writer::div(get_string('notapproved', 'data'), 'mod-data-approval-status-badge'); } /** diff --git a/mod/data/lang/en/data.php b/mod/data/lang/en/data.php index 07a7e80b807..9ceef0f8d69 100644 --- a/mod/data/lang/en/data.php +++ b/mod/data/lang/en/data.php @@ -300,7 +300,8 @@ $string['nomatch'] = 'No matching entries found!'; $string['nomaximum'] = 'No maximum'; $string['nopreviewavailable'] = 'No preview available for {$a}'; $string['norecords'] = 'No entries yet'; -$string['notapproved'] = 'Entry is not approved yet.'; +$string['notapproved'] = 'Pending approval'; +$string['notapprovederror'] = 'Entry is not approved yet.'; $string['notinjectivemap'] = 'Not an injective map'; $string['notopenyet'] = 'Sorry, this activity is not available until {$a}'; $string['number'] = 'Number'; diff --git a/mod/data/lib.php b/mod/data/lib.php index 32348b77e30..9643740463f 100644 --- a/mod/data/lib.php +++ b/mod/data/lib.php @@ -3637,7 +3637,7 @@ function data_comment_validate($comment_param) { //check if approved if ($data->approval and !$record->approved and !data_isowner($record) and !has_capability('mod/data:approve', $context)) { - throw new comment_exception('notapproved', 'data'); + throw new comment_exception('notapprovederror', 'data'); } // group access diff --git a/mod/data/preset/imagegallery/listtemplate.html b/mod/data/preset/imagegallery/listtemplate.html index add132c7187..8dcf32e6907 100644 --- a/mod/data/preset/imagegallery/listtemplate.html +++ b/mod/data/preset/imagegallery/listtemplate.html @@ -9,7 +9,10 @@
- +
diff --git a/mod/data/preset/imagegallery/singletemplate.html b/mod/data/preset/imagegallery/singletemplate.html index f63601e5825..3d6589f3fcc 100644 --- a/mod/data/preset/imagegallery/singletemplate.html +++ b/mod/data/preset/imagegallery/singletemplate.html @@ -1,7 +1,8 @@

[[title]]

-
##actionsmenu##
+
##approvalstatus##
+
##actionsmenu##
diff --git a/mod/data/preset/journal/listtemplate.html b/mod/data/preset/journal/listtemplate.html index 0d97a960cc9..2e58d0b7e2e 100644 --- a/mod/data/preset/journal/listtemplate.html +++ b/mod/data/preset/journal/listtemplate.html @@ -2,7 +2,8 @@

[[Title]]

-
##actionsmenu##
+
##approvalstatus##
+
##actionsmenu##
[[Content]]

##userpicture## ##user##

diff --git a/mod/data/preset/journal/singletemplate.html b/mod/data/preset/journal/singletemplate.html index fa7b4ea6aeb..8d9bc608850 100644 --- a/mod/data/preset/journal/singletemplate.html +++ b/mod/data/preset/journal/singletemplate.html @@ -1,7 +1,8 @@

[[Title]]

-
##actionsmenu##
+
##approvalstatus##
+
##actionsmenu##
diff --git a/mod/data/preset/proposals/listtemplate.html b/mod/data/preset/proposals/listtemplate.html index 1e8a5cb25ee..cbb46ab90f6 100644 --- a/mod/data/preset/proposals/listtemplate.html +++ b/mod/data/preset/proposals/listtemplate.html @@ -2,14 +2,17 @@