Skip to content

Commit

Permalink
MDL-28980 fix notification defaults to use new expirynotify combo logic
Browse files Browse the repository at this point in the history
  • Loading branch information
skodak committed Oct 10, 2012
1 parent da6cf13 commit 9f4a3c7
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions enrol/manual/lib.php
Original file line number Diff line number Diff line change
Expand Up @@ -150,12 +150,19 @@ public function get_newinstance_link($courseid) {
* @return int id of new instance, null if can not be created
*/
public function add_default_instance($course) {
$expirynotify = $this->get_config('expirynotify', 0);
if ($expirynotify == 2) {
$expirynotify = 1;
$notifyall = 1;
} else {
$notifyall = 0;
}
$fields = array(
'status' => $this->get_config('status'),
'roleid' => $this->get_config('roleid', 0),
'enrolperiod' => $this->get_config('enrolperiod', 0),
'expirynotify' => $this->get_config('expirynotify', 0),
'notifyall' => $this->get_config('notifyall', 0),
'expirynotify' => $expirynotify,
'notifyall' => $notifyall,
'expirythreshold' => $this->get_config('expirythreshold', 86400),
);
return $this->add_instance($course, $fields);
Expand Down

0 comments on commit 9f4a3c7

Please sign in to comment.