Add 'Do not notify of these changes' checkbox to edit dialog

This commit is contained in:
Nathan Gray 2011-03-09 17:26:20 +00:00
parent a58a7892c9
commit f28fb14572
4 changed files with 24 additions and 18 deletions

View File

@ -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 "<p>calendar_boupdate::set_status($cal_id,$uid,$status,$recur_date)</p>\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

View File

@ -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 "<p>$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!').'<br />'.
lang('Copy your changes to the clipboard, %1reload the entry%2 and merge them.','<a href="'.
@ -689,7 +689,7 @@ class calendar_uiforms extends calendar_ui
}
}
$edit_series_confirmed = false;
$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']);
unset($event['ignore']);
}
if (is_array($conflicts))
@ -758,7 +758,7 @@ class calendar_uiforms extends calendar_ui
$alarms[] = $alarm;
}
$event['alarm'] = $alarms;
$this->bo->update($exception, true, true, true);
$this->bo->update($exception, true, true, true,true,null,$content['no_notifications']);
}
}
}
@ -835,7 +835,7 @@ class calendar_uiforms extends calendar_ui
if (!($exception = $this->bo->read($id))) 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']);
$exceptions_kept = true;
}
}
@ -925,6 +925,7 @@ class calendar_uiforms extends calendar_ui
echo "<html><body onload=\"$js\"></body></html>\n";
common::egw_exit();
}
unset($event['no_notifications']);
return $this->edit($event,$preserv,$msg,$js,$event['id'] ? $event['id'] : $content['link_to']['to_id']);
}

View File

@ -126,6 +126,7 @@ display status of events calendar en Display status of events
displayed view calendar en Displayed view
displays this calendar view on the home page (page you get when you enter egroupware or click on the home page icon)? calendar en Displays this calendar view on the home page (page you get when you enter EGroupware or click on the home page icon)?
do not include events of group members calendar en Do not include events of group members
do not notify of these changes calendar en Do not notify of these changes
do you really want to change the start of this series? if you do, the original series will be terminated as of today and a new series for the future reflecting your changes will be created. calendar en Do you really want to change the start of this series? If you do, the original series will be terminated as of today and a new series for the future reflecting your changes will be created.
do you want a weekview with or without weekend? calendar en Do you want a weekview with or without weekend?
do you want to be notified about changes of appointments you modified? calendar en Do you want to be notified about changes of appointments you modified?

File diff suppressed because one or more lines are too long