mirror of
https://github.com/moodle/moodle.git
synced 2025-08-04 16:36:37 +02:00
Revert "MDL-37490 Assign: Minor patch cleanup"
This reverts commit 06b9df1145
.
This commit is contained in:
parent
2b46a31a3f
commit
3e69c074ac
4 changed files with 21 additions and 18 deletions
|
@ -206,6 +206,19 @@ function xmldb_assign_upgrade($oldversion) {
|
|||
}
|
||||
|
||||
// Moodle v2.4.0 release upgrade line.
|
||||
// Put any upgrade step following this.
|
||||
if ($oldversion < 2012112902) {
|
||||
// Define field displayduedate to be added to assign.
|
||||
$table = new xmldb_table('assign');
|
||||
$field = new xmldb_field('displayduedate', XMLDB_TYPE_INTEGER, '2', null, null, null, '0', 'duedate');
|
||||
if (!$dbman->field_exists($table, $field)) {
|
||||
$dbman->add_field($table, $field);
|
||||
}
|
||||
|
||||
// Assign savepoint reached.
|
||||
upgrade_mod_savepoint(true, 2012112902, 'assign');
|
||||
}
|
||||
|
||||
if ($oldversion < 2013030600) {
|
||||
upgrade_set_timeout(60*20);
|
||||
|
||||
|
@ -420,17 +433,7 @@ function xmldb_assign_upgrade($oldversion) {
|
|||
}
|
||||
|
||||
// Moodle v2.5.0 release upgrade line.
|
||||
if ($oldversion < 2013050100) {
|
||||
// Define field displayduedate to be added to assign.
|
||||
$table = new xmldb_table('assign');
|
||||
$field = new xmldb_field('displayduedate', XMLDB_TYPE_INTEGER, '2', null, null, null, '0', 'duedate');
|
||||
if (!$dbman->field_exists($table, $field)) {
|
||||
$dbman->add_field($table, $field);
|
||||
}
|
||||
|
||||
// Assign savepoint reached.
|
||||
upgrade_mod_savepoint(true, 2013050100, 'assign');
|
||||
}
|
||||
// Put any upgrade step following this.
|
||||
|
||||
|
||||
return true;
|
||||
|
|
|
@ -115,8 +115,8 @@ $string['deletepluginareyousure'] = 'Delete assignment plugin {$a}: are you sure
|
|||
$string['deletepluginareyousuremessage'] = 'You are about to completely delete the assignment plugin {$a}. This will completely delete everything in the database associated with this assignment plugin. Are you SURE you want to continue?';
|
||||
$string['deletingplugin'] = 'Deleting plugin {$a}.';
|
||||
$string['description'] = 'Description';
|
||||
$string['displayduedate'] = 'Display on course page';
|
||||
$string['displayduedate_help'] = 'If enabled the due date will be displayed on the course page if one has been set and enabled.';
|
||||
$string['displayduedate'] = 'Display due date';
|
||||
$string['displayduedate_help'] = "If enabled the due date will be displayed on the course page if one has been set and enabled.";
|
||||
$string['downloadall'] = 'Download all submissions';
|
||||
$string['download all submissions'] = 'Download all submissions in a zip file.';
|
||||
$string['duedate'] = 'Due date';
|
||||
|
|
|
@ -42,7 +42,7 @@ class mod_assign_mod_form extends moodleform_mod {
|
|||
* @return void
|
||||
*/
|
||||
public function definition() {
|
||||
global $CFG, $DB, $PAGE;
|
||||
global $CFG, $DB, $PAGE, $OUTPUT;
|
||||
$mform = $this->_form;
|
||||
|
||||
$mform->addElement('header', 'general', get_string('general', 'form'));
|
||||
|
@ -83,7 +83,7 @@ class mod_assign_mod_form extends moodleform_mod {
|
|||
$mform->addHelpButton('allowsubmissionsfromdate', 'allowsubmissionsfromdate', 'assign');
|
||||
$mform->setDefault('allowsubmissionsfromdate', time());
|
||||
|
||||
$name = get_string('duedate', 'assign').$assignment->get_renderer()->help_icon('duedate', 'assign');
|
||||
$name = get_string('duedate', 'assign').$OUTPUT->help_icon('duedate', 'assign');
|
||||
$duedateelements[] = $mform->createElement('date_time_selector', 'duedate', $name);
|
||||
$duedateelements[] = $mform->createElement('checkbox', 'duedateenable', null, get_string('enable'));
|
||||
try {
|
||||
|
@ -97,15 +97,13 @@ class mod_assign_mod_form extends moodleform_mod {
|
|||
} else {
|
||||
$mform->setDefault('duedate', time()+7*24*3600);
|
||||
$mform->setDefault('duedateenable', 0);
|
||||
$mform->setType('duedateenable', PARAM_BOOL);
|
||||
}
|
||||
|
||||
$dddname = get_string('displayduedate', 'assign').$assignment->get_renderer()->help_icon('displayduedate', 'assign');
|
||||
$dddname = get_string('displayduedate', 'assign').$OUTPUT->help_icon('displayduedate', 'assign');
|
||||
$duedateelements[] = $mform->createElement('checkbox', 'displayduedate', null, $dddname);
|
||||
$mform->setDefault('displayduedate', 0);
|
||||
|
||||
$mform->addGroup($duedateelements, 'duedategrp', $name, null, false);
|
||||
$mform->setType('displayduedate', PARAM_BOOL);
|
||||
$mform->disabledIf('duedategrp', 'duedateenable');
|
||||
|
||||
$name = get_string('cutoffdate', 'assign');
|
||||
|
|
|
@ -28,3 +28,5 @@ $module->component = 'mod_assign'; // Full name of the plugin (used for diagnost
|
|||
$module->version = 2013050100; // The current module version (Date: YYYYMMDDXX).
|
||||
$module->requires = 2013050100; // Requires this Moodle version.
|
||||
$module->cron = 60;
|
||||
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue