forked from extern/egroupware
update of event-start-time updates the alarms now
This commit is contained in:
parent
e5f6a0ae08
commit
43a72ad4a4
@ -960,13 +960,14 @@
|
|||||||
if ($l_cal['alarmdays'] > 0 || $l_cal['alarmhours'] > 0 ||
|
if ($l_cal['alarmdays'] > 0 || $l_cal['alarmhours'] > 0 ||
|
||||||
$l_cal['alarmminutes'] > 0)
|
$l_cal['alarmminutes'] > 0)
|
||||||
{
|
{
|
||||||
$time = $this->maketime($event['start']) -
|
$offset = ($l_cal['alarmdays'] * 24 * 3600) +
|
||||||
($l_cal['alarmdays'] * 24 * 3600) -
|
($l_cal['alarmhours'] * 3600) + ($l_cal['alarmminutes'] * 60);
|
||||||
($l_cal['alarmhours'] * 3600) -
|
|
||||||
($l_cal['alarmminutes'] * 60);
|
$time = $this->maketime($event['start']) - $offset;
|
||||||
|
|
||||||
$event['alarm'][] = Array(
|
$event['alarm'][] = Array(
|
||||||
'time' => $time,
|
'time' => $time,
|
||||||
|
'offset' => $offset,
|
||||||
'owner' => $this->owner,
|
'owner' => $this->owner,
|
||||||
'enabled' => 1
|
'enabled' => 1
|
||||||
);
|
);
|
||||||
@ -1040,6 +1041,19 @@
|
|||||||
print_debug('Updating Event ID',$event['id']);
|
print_debug('Updating Event ID',$event['id']);
|
||||||
$new_event = $event;
|
$new_event = $event;
|
||||||
$old_event = $this->read_entry($event['id']);
|
$old_event = $this->read_entry($event['id']);
|
||||||
|
// if old event has alarm and the start-time changed => update them
|
||||||
|
//echo "<p>checking ".count($old_event['alarm'])." alarms of event #$event[id] start moved from ".print_r($old_event['start'],True)." to ".print_r($event['start'],True)."</p>\n";
|
||||||
|
if ($old_event['alarm'] &&
|
||||||
|
$this->maketime($old_event['start']) != $this->maketime($event['start']))
|
||||||
|
{
|
||||||
|
$this->so->delete_alarms($old_event['id']);
|
||||||
|
foreach($old_event['alarm'] as $id => $alarm)
|
||||||
|
{
|
||||||
|
$alarm['time'] = $this->maketime($event['start']) - $alarm['offset'];
|
||||||
|
$event['alarm'][] = $alarm;
|
||||||
|
}
|
||||||
|
//echo "updated alarms<pre>".print_r($event['alarm'],True)."</pre>\n";
|
||||||
|
}
|
||||||
$this->so->cal->event = $event;
|
$this->so->cal->event = $event;
|
||||||
$this->so->add_entry($event);
|
$this->so->add_entry($event);
|
||||||
$this->prepare_recipients($new_event,$old_event);
|
$this->prepare_recipients($new_event,$old_event);
|
||||||
|
@ -211,6 +211,11 @@
|
|||||||
return $this->cal->delete_alarm($id);
|
return $this->cal->delete_alarm($id);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function delete_alarms($cal_id)
|
||||||
|
{
|
||||||
|
return $this->cal->delete_alarms($cal_id);
|
||||||
|
}
|
||||||
|
|
||||||
function delete_entry($id)
|
function delete_entry($id)
|
||||||
{
|
{
|
||||||
return $this->cal->delete_event($id);
|
return $this->cal->delete_event($id);
|
||||||
|
Loading…
Reference in New Issue
Block a user