forked from extern/egroupware
fix for socal::search to read alarms of recuring events
This commit is contained in:
parent
d342357b4c
commit
04dc015e0e
@ -422,15 +422,23 @@ class socal
|
|||||||
// alarms, atm. we read all alarms in the system, as this can be done in a single query
|
// alarms, atm. we read all alarms in the system, as this can be done in a single query
|
||||||
foreach((array)$this->async->read('cal'.(is_array($ids) ? '' : ':'.(int)$ids).':%') as $id => $job)
|
foreach((array)$this->async->read('cal'.(is_array($ids) ? '' : ':'.(int)$ids).':%') as $id => $job)
|
||||||
{
|
{
|
||||||
list(,$cal_id) = explode(':',$cal_id);
|
list(,$cal_id) = explode(':',$id);
|
||||||
if (!isset($events[$cal_id])) continue; // not needed
|
|
||||||
|
|
||||||
$alarm = $job['data']; // text, enabled
|
$alarm = $job['data']; // text, enabled
|
||||||
$alarm['id'] = $id;
|
$alarm['id'] = $id;
|
||||||
$alarm['time'] = $job['next'];
|
$alarm['time'] = $job['next'];
|
||||||
|
|
||||||
|
$event_start = $alarm['time'] + $alarm['offset'];
|
||||||
|
|
||||||
|
if (isset($events[$cal_id])) // none recuring event
|
||||||
|
{
|
||||||
$events[$cal_id]['alarm'][$id] = $alarm;
|
$events[$cal_id]['alarm'][$id] = $alarm;
|
||||||
}
|
}
|
||||||
|
elseif (isset($events[$cal_id.'-'.$event_start])) // recuring event
|
||||||
|
{
|
||||||
|
$events[$cal_id.'-'.$event_start]['alarm'][$id] = $alarm;
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
//echo "<p>socal::search\n"; _debug_array($events);
|
//echo "<p>socal::search\n"; _debug_array($events);
|
||||||
return $events;
|
return $events;
|
||||||
|
Loading…
Reference in New Issue
Block a user