diff --git a/calendar/inc/functions.inc.php b/calendar/inc/functions.inc.php index 89f0483592..692af2e884 100755 --- a/calendar/inc/functions.inc.php +++ b/calendar/inc/functions.inc.php @@ -1148,7 +1148,7 @@ $this->rowspan_arr[$ind] = $this->rowspan; } $this->hour_arr[$ind] .= "] "; - $this->hour_arr[$ind] .= "\""description . "\">"; + $this->hour_arr[$ind] .= "common->get_image_path('calendar')."/circle.gif\" border=0 alt=\"" . $event->description . "\">"; if ($event->priority == 3) $this->hour_arr[$ind] .= ""; $this->hour_arr[$ind] .= $event->name; @@ -1164,9 +1164,13 @@ $this->read_repeated_events($owner); - $str = ""; + $p = new Template($phpgw->common->get_tpl_dir('calendar')); + $p->set_unknowns("remove"); + $p->set_file(array('day_cal' => 'day_cal.tpl', + 'day_row_99' => 'day_row_99.tpl', + 'day_row' => 'day_row.tpl')); + $p->set_block('day_cal','day_row_99','day_row'); - $str .= ""; if (! $phpgw_info["user"]["preferences"]["calendar"]["workdaystarts"] && ! $phpgw_info["user"]["preferences"]["calendar"]["workdayends"]) { @@ -1186,8 +1190,8 @@ } else { $event = new calendar_item; for($i=0;$ihtml_for_event_day_at_a_glance($event); + $event = $events[$i]; + if($event) $this->html_for_event_day_at_a_glance($event); } } @@ -1197,67 +1201,68 @@ $this->rowspan = 0; $this->last_row = -1; for ($i=0;$i<24;$i++) { - if(isset($this->rowspan_arr[$i])) $r = $this->rowspan_arr[$i]; else $r = 0; - if(isset($this->hour_arr[$i])) $h = $this->hour_arr[$i]; else $h = ""; - if ($this->rowspan > 1) { - if (strlen($h)) { - $this->hour_arr[$this->last_row] .= $this->hour_arr[$i]; - $this->hour_arr[$i] = ""; - $this->rowspan_arr[$i] = 0; - } - $this->rowspan--; - } elseif ($r > 1) { - $this->rowspan = $this->rowspan_arr[$i]; - $this->last_row = $i; - } + if(isset($this->rowspan_arr[$i])) $r = $this->rowspan_arr[$i]; else $r = 0; + if(isset($this->hour_arr[$i])) $h = $this->hour_arr[$i]; else $h = ""; + if ($this->rowspan > 1) { + if (strlen($h)) { + $this->hour_arr[$this->last_row] .= $this->hour_arr[$i]; + $this->hour_arr[$i] = ""; + $this->rowspan_arr[$i] = 0; + } + $this->rowspan--; + } elseif ($r > 1) { + $this->rowspan = $this->rowspan_arr[$i]; + $this->last_row = $i; + } } if (isset($this->hour_arr[99]) && strlen($this->hour_arr[99])) { - $str .= "\n"; + $p->set_var('bgcolor1',$phpgw_info["theme"]["cal_dayview"]); + $p->set_var('text',$this->hour_arr[99]); + $p->set_var('bgcolor',$phpgw->nextmatchs->alternate_row_color()); + $p->set_var('time',' '); + $p->parse('row','day_row',True); } $this->rowspan = 0; + $p->set_var('bgcolor1',$phpgw_info["theme"]["cal_dayview"]); + $p->set_var('font_color',$phpgw_info["theme"]["bg_text"]); for ($i=$this->first_hour;$i<=$this->last_hour;$i++) { - if(isset($this->hour_arr[$i])) $h = $this->hour_arr[$i]; else $h = ""; - $time = $this->build_time_for_display($i * 10000); - $str .= ""; - if ($this->rowspan > 1) { - // this might mean there's an overlap, or it could mean one event - // ends at 11:15 and another starts at 11:30. - if (strlen($h)) - $str .= "\n"; - $this->rowspan--; - } else { - if (!strlen($h)) - $str .= "\n"; - else { - $this->rowspan = isset($this->rowspan_arr[$i])?$this->rowspan_arr[$i]:0; - if ($this->rowspan > 1) - $str .= "\n"; - else - $str .= "\n"; - } - } + $p->set_var('bgcolor',$phpgw->nextmatchs->alternate_row_color()); + if(isset($this->hour_arr[$i])) $h = $this->hour_arr[$i]; else $h = ""; + $time = $this->build_time_for_display($i * 10000); + $p->set_var('extras',''); + $p->set_var('event',' '); + if ($this->rowspan > 1) { + // this might mean there's an overlap, or it could mean one event + // ends at 11:15 and another starts at 11:30. + if (strlen($h)) + $p->set_var('event',$this->hour_arr[$i]); + $this->rowspan--; + } else { + if (strlen($h)) { + $this->rowspan = isset($this->rowspan_arr[$i])?$this->rowspan_arr[$i]:0; + if ($this->rowspan > 1) { + $p->set_var('extras','valign="top" rowspan="'.$this->rowspan.'"'); + $p->set_var('event',$this->hour_arr[$i]); + } else { + $p->set_var('event',$this->hour_arr[$i]); + } + } + } + $p->set_var('open_link',''); + $p->set_var('close_link',''); + if(!$this->printer_friendly) { + $p->set_var('open_link',''); + } + $p->set_var('time',$time); + if(!$this->printer_friendly) { + $p->set_var('close_link',''); + } + $p->parse('row','day_row',True); } // end for - $str .= "
" - . " ".$this->hour_arr[99]."
"; - - // tooley: the hour - 36400 is a HACK for improper storage of hour allows - // in user preference land. - if(!$this->printer_friendly) { - $str .= "link($phpgw_info["server"]["webserver_url"]."/calendar/edit_entry.php","year=".$date["year"] - . "&month=".$date["month"]."&day=".$date["day"] - . "&hour=".substr($time,0,strpos($time,":")) - . "&minute=".substr($time,strpos($time,":")+1,2))."\">"; - } - $str .= $time; - if(!$this->printer_friendly) { - $str .= ""; - } - $str .= "".$this->hour_arr[$i]."
 
rowspan."\">" - . $this->hour_arr[$i]."
".$this->hour_arr[$i]."
"; - return $str; + return $p->pparse('output','day_cal'); } // end function function prep($calid) { diff --git a/calendar/templates/default/day_cal.tpl b/calendar/templates/default/day_cal.tpl new file mode 100755 index 0000000000..8f9a28aea9 --- /dev/null +++ b/calendar/templates/default/day_cal.tpl @@ -0,0 +1,5 @@ + + +{row} +
+ diff --git a/calendar/templates/default/day_row.tpl b/calendar/templates/default/day_row.tpl new file mode 100755 index 0000000000..729c1c6535 --- /dev/null +++ b/calendar/templates/default/day_row.tpl @@ -0,0 +1,7 @@ + + + + {event} + {open_link}{time}{close_link} + + diff --git a/calendar/templates/default/day_row_99.tpl b/calendar/templates/default/day_row_99.tpl new file mode 100755 index 0000000000..5f6524520d --- /dev/null +++ b/calendar/templates/default/day_row_99.tpl @@ -0,0 +1,5 @@ + + +{text}{time} + + diff --git a/calendar/templates/verdilak/day_cal.tpl b/calendar/templates/verdilak/day_cal.tpl new file mode 100755 index 0000000000..8f9a28aea9 --- /dev/null +++ b/calendar/templates/verdilak/day_cal.tpl @@ -0,0 +1,5 @@ + + +{row} +
+ diff --git a/calendar/templates/verdilak/day_row.tpl b/calendar/templates/verdilak/day_row.tpl new file mode 100755 index 0000000000..729c1c6535 --- /dev/null +++ b/calendar/templates/verdilak/day_row.tpl @@ -0,0 +1,7 @@ + + + + {event} + {open_link}{time}{close_link} + + diff --git a/calendar/templates/verdilak/day_row_99.tpl b/calendar/templates/verdilak/day_row_99.tpl new file mode 100755 index 0000000000..5f6524520d --- /dev/null +++ b/calendar/templates/verdilak/day_row_99.tpl @@ -0,0 +1,5 @@ + + +{text}{time} + + diff --git a/index.php b/index.php index 271c807ad2..5be30e065e 100755 --- a/index.php +++ b/index.php @@ -19,7 +19,7 @@ $phpgw_info["flags"] = array("noheader" => True, "nonavbar" => True, "currentapp" => "home", "enable_network_class" => True, "enable_todo_class" => True, - "enable_addressbook_class" => True + "enable_addressbook_class" => True, "enable_nextmatchs_class" => True ); include("header.inc.php"); // Note: I need to add checks to make sure these apps are installed. @@ -156,4 +156,4 @@ common->phpgw_footer(); -?> \ No newline at end of file +?>