mirror of
https://github.com/moodle/moodle.git
synced 2025-08-05 00:46:50 +02:00
MDL-31405 Assignment: Fixed date in reset to be called for every assignment
This commit is contained in:
parent
f8eff10319
commit
e63515ba93
5 changed files with 56 additions and 9 deletions
|
@ -2368,12 +2368,6 @@ class assignment_base {
|
|||
}
|
||||
}
|
||||
|
||||
/// updating dates - shift may be negative too
|
||||
if ($data->timeshift) {
|
||||
shift_course_mod_dates('assignment', array('timedue', 'timeavailable'), $data->timeshift, $data->courseid);
|
||||
$status[] = array('component'=>$componentstr, 'item'=>get_string('datechanged').': '.$typestr, 'error'=>false);
|
||||
}
|
||||
|
||||
return $status;
|
||||
}
|
||||
|
||||
|
@ -3886,6 +3880,23 @@ function assignment_reset_userdata($data) {
|
|||
$status = array_merge($status, $ass->reset_userdata($data));
|
||||
}
|
||||
|
||||
// Updating dates - shift may be negative too.
|
||||
if ($data->timeshift) {
|
||||
$plugintypestrkey = 'type'.$this->type;
|
||||
if (get_string_manager()->string_exists($plugintypestrkey, 'assignment')) {
|
||||
$typestr = get_string_manager()->get_string($plugintypestrkey, 'assignment');
|
||||
} else {
|
||||
$typestr = get_string_manager()->get_string($plugintypestrkey, 'assignment_'.$this->type);
|
||||
}
|
||||
shift_course_mod_dates('assignment',
|
||||
array('timedue', 'timeavailable'),
|
||||
$data->timeshift,
|
||||
$data->courseid);
|
||||
$status[] = array('component' => get_string('modulenameplural', 'assignment'),
|
||||
'item' => get_string('datechanged').': '.$typestr,
|
||||
'error' => false);
|
||||
}
|
||||
|
||||
return $status;
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue