mirror of
https://github.com/EGroupware/egroupware.git
synced 2024-11-22 07:53:39 +01:00
Calendar: Check if there is a real change, not assume every save is a change
Fixes snoozing an alarm over CalDAV sends out a change notification
This commit is contained in:
parent
3ada84be0f
commit
7c6e322dc8
@ -567,7 +567,6 @@ class calendar_boupdate extends calendar_bo
|
||||
*
|
||||
* @param array $new_event the updated event
|
||||
* @param array $old_event the event before the update
|
||||
* @todo check if there is a real change, not assume every save is a change
|
||||
*/
|
||||
function check4update($new_event,$old_event)
|
||||
{
|
||||
@ -575,15 +574,23 @@ class calendar_boupdate extends calendar_bo
|
||||
$modified = $added = $deleted = array();
|
||||
|
||||
//echo "<p>calendar_boupdate::check4update() new participants = ".print_r($new_event['participants'],true).", old participants =".print_r($old_event['participants'],true)."</p>\n";
|
||||
foreach(['start','end','tz_id','owner','category','priority','public','title','description','location'] as $field)
|
||||
{
|
||||
if($new_event[$field] !== $old_event[$field])
|
||||
{
|
||||
$modified = array_keys($new_event['participants']);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
// Find modified and deleted participants ...
|
||||
foreach ((array)$old_event['participants'] as $old_userid => $old_status)
|
||||
{
|
||||
if (isset($new_event['participants'][$old_userid]))
|
||||
if (isset($new_event['participants'][$old_userid]) && $old_status !== $new_event['participants'][$old_userid])
|
||||
{
|
||||
$modified[$old_userid] = $new_event['participants'][$old_userid];
|
||||
}
|
||||
else
|
||||
else if (!isset($new_event['participants'][$old_userid]))
|
||||
{
|
||||
$deleted[$old_userid] = $old_status;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user