diff --git a/calendar/inc/class.calendar_boupdate.inc.php b/calendar/inc/class.calendar_boupdate.inc.php index 00300a4589..492ad9adca 100644 --- a/calendar/inc/class.calendar_boupdate.inc.php +++ b/calendar/inc/class.calendar_boupdate.inc.php @@ -111,7 +111,7 @@ class calendar_boupdate extends calendar_bo * + + + C + which is clearly wrong for everything with a maximum quantity > 1 * ++++++++ ++++++++ */ - function update(&$event,$ignore_conflicts=false,$touch_modified=true,$ignore_acl=false,$updateTS=true,&$messages=null) + function update(&$event,$ignore_conflicts=false,$touch_modified=true,$ignore_acl=false,$updateTS=true,&$messages=null, $skip_notification=false) { //error_log(__METHOD__."(".array2string($event).",$ignore_conflicts,$touch_modified,$ignore_acl)"); @@ -376,14 +376,18 @@ class calendar_boupdate extends calendar_bo $this->log2file($event2save,$event,$old_event); } // send notifications - if ($new_event) + if(!$skip_notification) { - $this->send_update(MSG_ADDED,$event['participants'],'',$event); - } - else // update existing event - { - $this->check4update($event,$old_event); + if ($new_event) + { + $this->send_update(MSG_ADDED,$event['participants'],'',$event); + } + else // update existing event + { + $this->check4update($event,$old_event); + } } + // notify the link-class about the update, as other apps may be subscribt to it egw_link::notify_update('calendar',$cal_id,$event); @@ -1180,7 +1184,7 @@ class calendar_boupdate extends calendar_bo * @param boolean $updateTS=true update the content history of the event * @return int number of changed recurrences */ - function set_status($event,$uid,$status,$recur_date=0,$ignore_acl=false,$updateTS=true) + function set_status($event,$uid,$status,$recur_date=0,$ignore_acl=false,$updateTS=true,$skip_notification=false) { $cal_id = is_array($event) ? $event['id'] : $event; //echo "
calendar_boupdate::set_status($cal_id,$uid,$status,$recur_date)
\n"; @@ -1210,7 +1214,7 @@ class calendar_boupdate extends calendar_bo 'A' => MSG_ACCEPTED, 'D' => MSG_DELEGATED, ); - if (isset($status2msg[$status])) + if (isset($status2msg[$status]) && !$skip_notification) { if (!is_array($event)) $event = $this->read($cal_id); if (isset($recur_date)) $event = $this->read($event['id'],$recur_date); //re-read the actually edited recurring event diff --git a/calendar/inc/class.calendar_uiforms.inc.php b/calendar/inc/class.calendar_uiforms.inc.php index f07ae10dcf..bf3a121233 100644 --- a/calendar/inc/class.calendar_uiforms.inc.php +++ b/calendar/inc/class.calendar_uiforms.inc.php @@ -199,7 +199,7 @@ class calendar_uiforms extends calendar_ui $exception['recurrence'] != $content['recur_exception'][$key]) continue; $exception['uid'] = common::generate_uid('calendar', $id); $exception['reference'] = $exception['recurrence'] = 0; - $this->bo->update($exception, true); + $this->bo->update($exception, true, true,false,true,null,$content['no_notifications']); break; } unset($content['recur_exception'][$key]); @@ -393,7 +393,7 @@ class calendar_uiforms extends calendar_ui { //echo "$uid: status changed '$data[old_status]' --> '$status<'/p>\n";
$new_status = calendar_so::combine_status($status, $quantity, $role);
- if ($this->bo->set_status($event['id'],$uid,$new_status,isset($content['edit_single']) ? $content['participants']['status_date'] : 0))
+ if ($this->bo->set_status($event['id'],$uid,$new_status,isset($content['edit_single']) ? $content['participants']['status_date'] : 0, false, true, $content['no_notifications']))
{
// refreshing the calendar-view with the changed participant-status
if($event['recur_type'] != MCAL_RECUR_NONE)
@@ -551,7 +551,7 @@ class calendar_uiforms extends calendar_ui
$event['reference'] = $event['id'];
$event['recurrence'] = $content['edit_single'];
unset($event['id']);
- $conflicts = $this->bo->update($event,$ignore_conflicts,true,false,true,$messages);
+ $conflicts = $this->bo->update($event,$ignore_conflicts,true,false,true,$messages,$content['no_notifications']);
if (!is_array($conflicts) && $conflicts)
{
// now we need to add the original start as recur-execption to the series
@@ -632,7 +632,7 @@ class calendar_uiforms extends calendar_ui
($last = $occurrence));
$last->setTime(0, 0, 0);
$old_event['recur_enddate'] = egw_time::to($last, 'ts');
- if (!$this->bo->update($old_event,true))
+ if (!$this->bo->update($old_event,true,true,false,true,null,$content['no_notifications']))
{
$msg .= ($msg ? ', ' : '') .lang('Error: the entry has been updated since you opened it for editing!').'
'.
lang('Copy your changes to the clipboard, %1reload the entry%2 and merge them.','