From f41e44fee711e4323f1aa1bb4fb41a6b80b8f452 Mon Sep 17 00:00:00 2001 From: Nathan Gray Date: Fri, 18 Feb 2011 15:30:21 +0000 Subject: [PATCH] Prevent first event in the range from filling in empty dates when using 2432day/date2432 --- calendar/inc/class.calendar_merge.inc.php | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/calendar/inc/class.calendar_merge.inc.php b/calendar/inc/class.calendar_merge.inc.php index c7de8ffb71..92d274e4c4 100644 --- a/calendar/inc/class.calendar_merge.inc.php +++ b/calendar/inc/class.calendar_merge.inc.php @@ -221,10 +221,11 @@ class calendar_merge extends bo_merge if(strpos($repeat, '$$day/date$$') !== false) { $date_marker = array('$$day/date$$' => date($GLOBALS['egw_info']['user']['preferences']['common']['dateformat'], strtotime($day))); if(!is_array($days[date('Ymd',$_date)][date('l',strtotime($day))])) { - $days[date('Ymd',$_date)][date('l',strtotime($day))] = array($date_marker); - } else { - $days[date('Ymd',$_date)][date('l',strtotime($day))][0] += $date_marker; + $blank = $this->calendar_replacements(array()); + foreach($blank as &$value) $value = ''; + $days[date('Ymd',$_date)][date('l',strtotime($day))][] = $blank; } + $days[date('Ymd',$_date)][date('l',strtotime($day))][0] += $date_marker; } } return $days[date('Ymd',$_date)][$plugin][0]; @@ -289,10 +290,11 @@ class calendar_merge extends bo_merge if(strpos($repeat, '$$day/date$$') !== false) { $date_marker = array('$$day/date$$' => date($GLOBALS['egw_info']['user']['preferences']['common']['dateformat'], strtotime($day))); if(!is_array($days[date('Ymd',$_date)][$plugin])) { - $days[date('Ymd',$_date)][$plugin] = array($date_marker); - } else { - $days[date('Ymd',$_date)][$plugin][0] += $date_marker; + $blank = $this->calendar_replacements(array()); + foreach($blank as &$value) $value = ''; + $days[date('Ymd',$_date)][$plugin][] = $blank; } + $days[date('Ymd',$_date)][$plugin][0] += $date_marker; } } return $days[date('Ymd',$_date)][$plugin][0];