Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

mdl-24033 ported on Moodle 2.0. Thanks to Daniele Cordella

  • Loading branch information...
commit 570de7a6da55ad04986d3d421df663149fab2635 1 parent 0b259d9
@andreabix andreabix authored
Showing with 6 additions and 4 deletions.
  1. +5 −3 mod/data/edit.php
  2. +1 −1  mod/data/tabs.php
View
8 mod/data/edit.php
@@ -303,9 +303,9 @@
$patterns[]="[[".$field->field->name."#id]]";
$replacements[] = 'field_'.$field->field->id;
}
- $newtext = str_ireplace($patterns, $replacements, $data->{$mode});
+ $newtext = str_ireplace($patterns, $replacements, $data->{$mode});
-} else { //if the add template is not yet defined, print the default form!
+} else { //if the add template is not yet defined, print the default form!
echo data_generate_default_template($data, 'addtemplate', $rid, true, false);
$newtext = '';
}
@@ -317,7 +317,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 ( (!$data->maxentries) || (data_numentries($data)<($data->maxentries-1)) ) {
+ echo '&nbsp;<input type="submit" value="'.get_string('saveandadd','data').'" />';
+ }
}
echo '</div>';
echo $OUTPUT->box_end();
View
2  mod/data/tabs.php
@@ -49,7 +49,7 @@
$row[] = new tabobject('asearch', $CFG->wwwroot.'/mod/data/view.php?d='.$data->id.'&amp;mode=asearch', get_string('search', 'data'));
if (isloggedin()) { // just a perf shortcut
- 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);
}
Please sign in to comment.
Something went wrong with that request. Please try again.