mirror of
https://github.com/moodle/moodle.git
synced 2025-04-19 07:25:30 +02:00
MDL-59523 course_reset: Added date update message when resetting.
This commit is contained in:
parent
2a2f7b6493
commit
39b8357c5a
@ -834,6 +834,7 @@ function scorm_reset_userdata($data) {
|
||||
// Any changes to the list of dates that needs to be rolled should be same during course restore and course reset.
|
||||
// See MDL-9367.
|
||||
shift_course_mod_dates('scorm', array('timeopen', 'timeclose'), $data->timeshift, $data->courseid);
|
||||
$status[] = array('component' => $componentstr, 'item' => get_string('datechanged'), 'error' => false);
|
||||
|
||||
return $status;
|
||||
}
|
||||
|
@ -234,6 +234,7 @@ function wiki_reset_userdata($data) {
|
||||
// Any changes to the list of dates that needs to be rolled should be same during course restore and course reset.
|
||||
// See MDL-9367.
|
||||
shift_course_mod_dates('wiki', array('editbegin', 'editend'), $data->timeshift, $data->courseid);
|
||||
$status[] = array('component' => $componentstr, 'item' => get_string('datechanged'), 'error' => false);
|
||||
|
||||
return $status;
|
||||
}
|
||||
|
@ -1894,25 +1894,27 @@ function workshop_reset_userdata(stdClass $data) {
|
||||
// See MDL-9367.
|
||||
shift_course_mod_dates('workshop', array('submissionstart', 'submissionend', 'assessmentstart', 'assessmentend'),
|
||||
$data->timeshift, $data->courseid);
|
||||
$status = array();
|
||||
$status[] = array('component' => get_string('modulenameplural', 'workshop'), 'item' => get_string('datechanged'),
|
||||
'error' => false);
|
||||
|
||||
if (empty($data->reset_workshop_submissions)
|
||||
and empty($data->reset_workshop_assessments)
|
||||
and empty($data->reset_workshop_phase) ) {
|
||||
// Nothing to do here.
|
||||
return array();
|
||||
return $status;
|
||||
}
|
||||
|
||||
$workshoprecords = $DB->get_records('workshop', array('course' => $data->courseid));
|
||||
|
||||
if (empty($workshoprecords)) {
|
||||
// What a boring course - no workshops here!
|
||||
return array();
|
||||
return $status;
|
||||
}
|
||||
|
||||
require_once($CFG->dirroot . '/mod/workshop/locallib.php');
|
||||
|
||||
$course = $DB->get_record('course', array('id' => $data->courseid), '*', MUST_EXIST);
|
||||
$status = array();
|
||||
|
||||
foreach ($workshoprecords as $workshoprecord) {
|
||||
$cm = get_coursemodule_from_instance('workshop', $workshoprecord->id, $course->id, false, MUST_EXIST);
|
||||
|
Loading…
x
Reference in New Issue
Block a user