* Calendar: fixed EGroupware owner got notified about status changes, even if email-notification preference was "never", now only external chairs get always notified

This commit is contained in:
Ralf Becker 2012-07-17 12:36:48 +00:00
parent ab1fdb0617
commit f8ae428f32

View File

@ -551,13 +551,15 @@ class calendar_boupdate extends calendar_bo
} }
break; break;
case 'no': case 'no':
if ($msg_is_response && $role == 'CHAIR') // always notify chairs! // always notify externals chairs
// EGroupware owner only get notified about responses, if pref is NOT "no"
if (!is_numeric($userid) && $msg_is_response && $role == 'CHAIR')
{ {
++$want_update; ++$want_update;
} }
break; break;
} }
//error_log(__METHOD__."(userid=$userid,,msg_type=$msg_type,...) msg_is_response=$msg_is_response, want_update=$want_update"); //error_log(__METHOD__."(userid=$userid, receive_updates='$ru', msg_type=$msg_type, ..., role='$role') msg_is_response=$msg_is_response --> want_update=$want_update");
return $want_update > 0; return $want_update > 0;
} }
@ -633,7 +635,7 @@ class calendar_boupdate extends calendar_bo
$owner = $old_event ? $old_event['owner'] : $new_event['owner']; $owner = $old_event ? $old_event['owner'] : $new_event['owner'];
if ($owner && !isset($to_notify[$owner]) && $msg_type != MSG_ALARM) if ($owner && !isset($to_notify[$owner]) && $msg_type != MSG_ALARM)
{ {
$to_notify[$owner] = 'owner'; // always include the event-owner $to_notify[$owner] = 'OCHAIR'; // always include the event-owner
} }
$version = $GLOBALS['egw_info']['apps']['calendar']['version']; $version = $GLOBALS['egw_info']['apps']['calendar']['version'];
@ -897,6 +899,7 @@ class calendar_boupdate extends calendar_bo
if($GLOBALS['egw_info']['apps']['notifications']['enabled']) if($GLOBALS['egw_info']['apps']['notifications']['enabled'])
{ {
try { try {
//error_log(__METHOD__."() notifying $userid from $senderid: $subject");
$notification = new notifications(); $notification = new notifications();
$notification->set_receivers(array($userid)); $notification->set_receivers(array($userid));
$notification->set_message($body); $notification->set_message($body);