MDL-28980 fix notification defaults to use new expirynotify combo logic
This commit is contained in:
@@ -150,12 +150,19 @@ class enrol_manual_plugin extends enrol_plugin {
|
||||
* @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);
|
||||
|
||||
Reference in New Issue
Block a user