diff --git a/calendar/inc/class.calendar.inc.php b/calendar/inc/class.calendar.inc.php index dd519f7a30..9b577866f6 100755 --- a/calendar/inc/class.calendar.inc.php +++ b/calendar/inc/class.calendar.inc.php @@ -656,7 +656,8 @@ class calendar extends calendar_ 'bgcolor' => $phpgw_info['theme']['bg_color'], 'bgcolor1' => $phpgw_info['theme']['bg_color'], 'month' => $month, - 'bgcolor2' => $phpgw_info['theme']['cal_dayview'] + 'bgcolor2' => $phpgw_info['theme']['cal_dayview'], + 'holiday_color' => (substr($phpgw_info['theme']['bg07'],0,1)=='#'?'':'#').$phpgw_info['theme']['bg07'] ); $p->set_var($var); @@ -701,21 +702,35 @@ class calendar extends calendar_ { $str = ''; $cal = $this->gmtdate($i + ($j * 24 * 3600)); + $cal = $this->makegmttime(0,0,0,$cal['month'],$cal['day'],$cal['year']); if($cal['full'] >= $monthstart && $cal['full'] <= $monthend) { + $day_image = ''; if ($cal['full'] == $this->today['full']) { - $p->set_var('day_image',' background="'.$this->image_dir.'/mini_day_block.gif"'); + $day_image .= ' background="'.$this->image_dir.'/mini_day_block.gif"'; + } +// else +// { +// $p->set_var('bgcolor2','#FFFFFF'); +// } + + $p->set_var('day_image',$day_image); + + + $holiday_found = $this->holidays->find_date($cal['raw']); + if($holiday_found != False) + { + $class = 'minicalhol'; } else { - $p->set_var('day_image',''); - $p->set_var('bgcolor2','#FFFFFF'); + $class = 'minicalendar'; } - + if(!$this->printer_friendly) { - $str .= ''; + $str .= ''; } $str .= $cal['day']; @@ -736,15 +751,24 @@ class calendar extends calendar_ } else { + $holiday_found = $this->holidays->find_date($cal['raw']); if($outside_month == True) { - $p->set_var('bgcolor2','#FEFEFE'); - $p->set_var('dayname',''.$cal['day'].''); + if($holiday_found == False) + { + $class = 'minicalendargrey'; + } + else + { + $class = 'minicalgreyhol'; + } + $p->set_var('day_image',''); + $p->set_var('dayname',''.$cal['day'].''); } else { $p->set_var('day_image',''); - $p->set_var('bgcolor2','#FEFEFE'); +// $p->set_var('bgcolor2','#FEFEFE'); $p->set_var('dayname',''); } } @@ -982,7 +1006,7 @@ class calendar extends calendar_ { while(list(,$value) = each($holiday_found)) { - $p->set_var('month_filler_text',$this->holidays->get_name($value)); + $p->set_var('month_filler_text',$this->holidays->get_name($value).'
'); $p->parse('column_data','month_filler',True); } } @@ -1368,6 +1392,10 @@ class calendar extends calendar_ $time = Array(); + $date = $this->localdates($date['raw'] - $this->tz_offset); + +// echo 'Searching for events on : '.$phpgw->common->show_date($date['raw'])."
\n"; + $events = $this->get_sorted_by_date($date['raw'],$this->owner); if(!$events) @@ -1418,12 +1446,25 @@ class calendar extends calendar_ $this->last_row = $i; } } + $holiday_found = $this->holidays->find_date($date['raw']); + if($holiday_found == False) + { + $bgcolor = $phpgw->nextmatchs->alternate_row_color(); + } + else + { + $bgcolor = $phpgw_info['theme']['bg04']; + while(list(,$value) = each($holiday_found)) + { + $time[99] = '
'.$this->holidays->get_name($value).'
'.$time[99]; + } + } if (isset($time[99]) && strlen($time[99]) > 0) { $var = Array( 'event' => $time[99], - 'bgcolor' => $phpgw->nextmatchs->alternate_row_color() + 'bgcolor' => $bgcolor ); $p->set_var($var); $p->parse('monthweek_day','day_row_event',False); diff --git a/calendar/inc/class.calendar_holiday.inc.php b/calendar/inc/class.calendar_holiday.inc.php index d02df47b09..33e396fa09 100755 --- a/calendar/inc/class.calendar_holiday.inc.php +++ b/calendar/inc/class.calendar_holiday.inc.php @@ -189,7 +189,7 @@ class calendar_holiday { if($this->holidays[$i]['date'] > $date) { - continue; + $i = $c_holidays + 1; } elseif($this->holidays[$i]['date'] == $date) { diff --git a/calendar/templates/default/mini_cal.tpl b/calendar/templates/default/mini_cal.tpl index 4be1ba60b0..0f998e8a4d 100755 --- a/calendar/templates/default/mini_cal.tpl +++ b/calendar/templates/default/mini_cal.tpl @@ -13,6 +13,18 @@ color: #999999; } + .minicalhol + { + color: #000000; + background-color: {holiday_color}; + } + + .minicalgreyhol + { + color: #999999; + background-color: {holiday_color}; + } + --> diff --git a/calendar/templates/idsociety/mini_cal.tpl b/calendar/templates/idsociety/mini_cal.tpl index 4be1ba60b0..0f998e8a4d 100755 --- a/calendar/templates/idsociety/mini_cal.tpl +++ b/calendar/templates/idsociety/mini_cal.tpl @@ -13,6 +13,18 @@ color: #999999; } + .minicalhol + { + color: #000000; + background-color: {holiday_color}; + } + + .minicalgreyhol + { + color: #999999; + background-color: {holiday_color}; + } + -->