Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Merge branch 'wip-mdl-31405-m24' of git://github.com/rajeshtaneja/moo…

…dle into MOODLE_24_STABLE
  • Loading branch information...
commit 57bafe6ebcf293235e9c77f05e5705f6ac8726c5 2 parents b6ced2f + ca4349c
@danpoltawski danpoltawski authored
View
12 mod/assign/lib.php
@@ -77,6 +77,18 @@ function assign_reset_userdata($data) {
$status = array_merge($status, $assignment->reset_userdata($data));
}
}
+ // Updating dates - shift may be negative too.
+ $componentstr = get_string('modulenameplural', 'assign');
+
+ if ($data->timeshift) {
+ shift_course_mod_dates('assign',
+ array('duedate', 'allowsubmissionsfromdate', 'cutoffdate'),
+ $data->timeshift,
+ $data->courseid);
+ $status[] = array('component' => $componentstr,
+ 'item' => get_string('datechanged'),
+ 'error' => false);
+ }
return $status;
}
View
10 mod/assign/locallib.php
@@ -621,16 +621,6 @@ public function reset_userdata($data) {
assign_reset_gradebook($data->courseid);
}
}
- // Updating dates - shift may be negative too.
- if ($data->timeshift) {
- shift_course_mod_dates('assign',
- array('duedate', 'allowsubmissionsfromdate','cutoffdate'),
- $data->timeshift,
- $data->courseid);
- $status[] = array('component'=>$componentstr,
- 'item'=>get_string('datechanged'),
- 'error'=>false);
- }
return $status;
}
View
23 mod/assignment/lib.php
@@ -2369,13 +2369,6 @@ function reset_userdata($data) {
assignment_reset_gradebook($data->courseid, $this->type);
}
}
-
- /// 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;
}
@@ -3888,6 +3881,22 @@ 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;
}
Please sign in to comment.
Something went wrong with that request. Please try again.