Merge branch 'wip-MDL-49861-29' of git://github.com/abgreeve/moodle into MOODLE_29_STABLE
This commit is contained in:
+4
-1
@@ -268,6 +268,9 @@ if ($datarecord = data_submitted() and confirm_sesskey()) {
|
||||
'rid' => $recordid,
|
||||
));
|
||||
redirect($viewurl);
|
||||
} else if (!empty($datarecord->saveandadd)) {
|
||||
// User has clicked "Save and add another". Reset all of the fields.
|
||||
$datarecord = null;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -354,7 +357,7 @@ if ($rid) {
|
||||
echo ' <input type="submit" name="cancel" value="'.get_string('cancel').'" onclick="javascript:history.go(-1)" />';
|
||||
} else {
|
||||
if ((!$data->maxentries) || has_capability('mod/data:manageentries', $context) || (data_numentries($data) < ($data->maxentries - 1))) {
|
||||
echo ' <input type="submit" value="'.get_string('saveandadd','data').'" />';
|
||||
echo ' <input type="submit" name="saveandadd" value="' . get_string('saveandadd', 'data') . '" />';
|
||||
}
|
||||
}
|
||||
echo '</div>';
|
||||
|
||||
@@ -52,6 +52,7 @@ Feature: Users can add entries to database activities
|
||||
And I add an entry to "Test database name" database with:
|
||||
| Test field name | Student second entry |
|
||||
And I press "Save and add another"
|
||||
And the field "Test field name" does not match value "Student second entry"
|
||||
And I add an entry to "Test database name" database with:
|
||||
| Test field name | Student third entry |
|
||||
And I press "Save and view"
|
||||
|
||||
Reference in New Issue
Block a user