Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Fix for MDL-24033

  • Loading branch information...
commit 9398995df678262fc678670fed391aa9f737233d 1 parent d4bd146
@andreabix andreabix authored
Showing with 6 additions and 4 deletions.
  1. +3 −1 mod/data/edit.php
  2. +3 −3 mod/data/tabs.php
View
4 mod/data/edit.php
@@ -290,7 +290,9 @@
if ($rid) {
echo '&nbsp;<input type="submit" name="cancel" value="'.get_string('cancel').'" onclick="javascript:history.go(-1)" />';
} else {
- echo '<input type="submit" value="'.get_string('saveandadd','data').'" />';
+ if ( (has_capability('mod/data:manageentries',$context)) || (!$data->maxentries) || (data_numentries($data)<($data->maxentries-1)) ) {
+ echo '&nbsp;<input type="submit" value="'.get_string('saveandadd','data').'" />';
+ }
}
echo '</div>';
print_simple_box_end();
View
6 mod/data/tabs.php
@@ -38,7 +38,7 @@
$row = array();
$row[] = new tabobject('list', $CFG->wwwroot.'/mod/data/view.php?d='.$data->id, get_string('list','data'));
-
+
if (isset($record)) {
$row[] = new tabobject('single', $CFG->wwwroot.'/mod/data/view.php?d='.$data->id.'&amp;rid='.$record->id, get_string('single','data'));
} else {
@@ -49,13 +49,13 @@
$row[] = new tabobject('asearch', $CFG->wwwroot.'/mod/data/view.php?d='.$data->id.'&amp;mode=asearch', get_string('search', 'data'));
if (isloggedin()) {
- if (data_user_can_add_entry($data, $currentgroup, $groupmode)) { // took out participation list here!
+ if (data_user_can_add_entry($data, $currentgroup, $groupmode) && !data_atmaxentries($data)) { // took out participation list here!
$addstring = empty($editentry) ? get_string('add', 'data') : get_string('editentry', 'data');
$row[] = new tabobject('add', $CFG->wwwroot.'/mod/data/edit.php?d='.$data->id, $addstring);
}
if (has_capability(DATA_CAP_EXPORT, $context)) {
// The capability required to Export database records is centrally defined in 'lib.php'
- // and should be weaker than those required to edit Templates, Fields and Presets.
+ // and should be weaker than those required to edit Templates, Fields and Presets.
$row[] = new tabobject('export', $CFG->wwwroot.'/mod/data/export.php?d='.$data->id,
get_string('export', 'data'));
}
Please sign in to comment.
Something went wrong with that request. Please try again.