Merge branch 'wip-MDL-49861-29' of git://github.com/abgreeve/moodle into MOODLE_29_STABLE

This commit is contained in:
Dan Poltawski
2016-04-04 12:10:21 +01:00
2 changed files with 5 additions and 1 deletions
+4 -1
View File
@@ -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 '&nbsp;<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 '&nbsp;<input type="submit" value="'.get_string('saveandadd','data').'" />';
echo '&nbsp;<input type="submit" name="saveandadd" value="' . get_string('saveandadd', 'data') . '" />';
}
}
echo '</div>';
+1
View File
@@ -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"