mirror of
https://github.com/moodle/moodle.git
synced 2025-08-08 18:36:42 +02:00
Merged branch 'MDL-22232_easier_turn_off_notifications' from git://github.com/andyjdavis/moodle.git with conflict resolution
This commit is contained in:
commit
32ec60d142
7 changed files with 62 additions and 9 deletions
|
@ -6709,8 +6709,16 @@ FROM
|
|||
upgrade_main_savepoint(true, 2011090700.01);
|
||||
}
|
||||
|
||||
if ($oldversion < 2011091200.00) {
|
||||
//preference not required since 2.0
|
||||
$DB->delete_records('user_preferences', array('name'=>'message_showmessagewindow'));
|
||||
|
||||
//re-introducing emailstop. check that its turned off so people dont suddenly stop getting notifications
|
||||
$DB->set_field('user', 'emailstop', 0, array('emailstop' => 1));
|
||||
|
||||
upgrade_main_savepoint(true, 2011091200.00);
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
//TODO: AFTER 2.0 remove the column user->emailstop and the user preference "message_showmessagewindow"
|
||||
|
|
|
@ -131,6 +131,7 @@ function message_send($eventdata) {
|
|||
}
|
||||
|
||||
// Find out if user has configured this output
|
||||
// Some processors cannot function without settings from the user
|
||||
$userisconfigured = $processor->object->is_user_configured($eventdata->userto);
|
||||
|
||||
// DEBUG: notify if we are forcing unconfigured output
|
||||
|
@ -142,7 +143,7 @@ function message_send($eventdata) {
|
|||
if ($permitted == 'forced' && $userisconfigured) {
|
||||
// We force messages for this processor, so use this processor unconditionally if user has configured it
|
||||
$processorlist[] = $processor->name;
|
||||
} else if ($permitted == 'permitted' && $userisconfigured) {
|
||||
} else if ($permitted == 'permitted' && $userisconfigured && !$eventdata->userto->emailstop) {
|
||||
// User settings are permitted, see if user set any, otherwise use site default ones
|
||||
$userpreferencename = 'message_provider_'.$preferencebase.'_'.$userstate;
|
||||
if ($userpreference = get_user_preferences($userpreferencename, null, $eventdata->userto->id)) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue