new template for day view

This commit is contained in:
skeeter 2001-01-10 05:01:36 +00:00
parent 6fef46cceb
commit 8ee04f6ca4
8 changed files with 101 additions and 62 deletions

View File

@ -1148,7 +1148,7 @@
$this->rowspan_arr[$ind] = $this->rowspan; $this->rowspan_arr[$ind] = $this->rowspan;
} }
$this->hour_arr[$ind] .= "] "; $this->hour_arr[$ind] .= "] ";
$this->hour_arr[$ind] .= "<img src=\"".$phpgw_info["server"]["webserver_url"]."/calendar/templates/default/images/circle.gif\" border=0 alt=\"" . $event->description . "\"></a>"; $this->hour_arr[$ind] .= "<img src=\"".$phpgw->common->get_image_path('calendar')."/circle.gif\" border=0 alt=\"" . $event->description . "\"></a>";
if ($event->priority == 3) if ($event->priority == 3)
$this->hour_arr[$ind] .= "<font color=\"CC0000\">"; $this->hour_arr[$ind] .= "<font color=\"CC0000\">";
$this->hour_arr[$ind] .= $event->name; $this->hour_arr[$ind] .= $event->name;
@ -1164,9 +1164,13 @@
$this->read_repeated_events($owner); $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 .= "<table border=\"0\" width=\"100%\" cellspacing=\"1\" cellpadding=\"2\" border=\"0\">";
if (! $phpgw_info["user"]["preferences"]["calendar"]["workdaystarts"] && if (! $phpgw_info["user"]["preferences"]["calendar"]["workdaystarts"] &&
! $phpgw_info["user"]["preferences"]["calendar"]["workdayends"]) { ! $phpgw_info["user"]["preferences"]["calendar"]["workdayends"]) {
@ -1186,8 +1190,8 @@
} else { } else {
$event = new calendar_item; $event = new calendar_item;
for($i=0;$i<count($events);$i++) { for($i=0;$i<count($events);$i++) {
$event = $events[$i]; $event = $events[$i];
if($event) $this->html_for_event_day_at_a_glance($event); if($event) $this->html_for_event_day_at_a_glance($event);
} }
} }
@ -1197,67 +1201,68 @@
$this->rowspan = 0; $this->rowspan = 0;
$this->last_row = -1; $this->last_row = -1;
for ($i=0;$i<24;$i++) { for ($i=0;$i<24;$i++) {
if(isset($this->rowspan_arr[$i])) $r = $this->rowspan_arr[$i]; else $r = 0; 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(isset($this->hour_arr[$i])) $h = $this->hour_arr[$i]; else $h = "";
if ($this->rowspan > 1) { if ($this->rowspan > 1) {
if (strlen($h)) { if (strlen($h)) {
$this->hour_arr[$this->last_row] .= $this->hour_arr[$i]; $this->hour_arr[$this->last_row] .= $this->hour_arr[$i];
$this->hour_arr[$i] = ""; $this->hour_arr[$i] = "";
$this->rowspan_arr[$i] = 0; $this->rowspan_arr[$i] = 0;
} }
$this->rowspan--; $this->rowspan--;
} elseif ($r > 1) { } elseif ($r > 1) {
$this->rowspan = $this->rowspan_arr[$i]; $this->rowspan = $this->rowspan_arr[$i];
$this->last_row = $i; $this->last_row = $i;
} }
} }
if (isset($this->hour_arr[99]) && strlen($this->hour_arr[99])) { if (isset($this->hour_arr[99]) && strlen($this->hour_arr[99])) {
$str .= "<tr><td bgcolor=\"".$phpgw_info["theme"]["bg_color"]."\">" $p->set_var('bgcolor1',$phpgw_info["theme"]["cal_dayview"]);
. "&nbsp;</td><td bgcolor=\"".$phpgw_info["theme"]["cal_dayview"] $p->set_var('text',$this->hour_arr[99]);
."\">".$this->hour_arr[99]."</td></tr>\n"; $p->set_var('bgcolor',$phpgw->nextmatchs->alternate_row_color());
$p->set_var('time','&nbsp;');
$p->parse('row','day_row',True);
} }
$this->rowspan = 0; $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++) { for ($i=$this->first_hour;$i<=$this->last_hour;$i++) {
if(isset($this->hour_arr[$i])) $h = $this->hour_arr[$i]; else $h = ""; $p->set_var('bgcolor',$phpgw->nextmatchs->alternate_row_color());
$time = $this->build_time_for_display($i * 10000); if(isset($this->hour_arr[$i])) $h = $this->hour_arr[$i]; else $h = "";
$str .= "<tr><th width=\"14%\" bgcolor=\"" $time = $this->build_time_for_display($i * 10000);
. $phpgw_info["theme"]["bg_color"]."\"><font color=\"" $p->set_var('extras','');
. $phpgw_info["theme"]["bg_text"]."\">"; $p->set_var('event','&nbsp');
if ($this->rowspan > 1) {
// tooley: the hour - 36400 is a HACK for improper storage of hour allows // this might mean there's an overlap, or it could mean one event
// in user preference land. // ends at 11:15 and another starts at 11:30.
if(!$this->printer_friendly) { if (strlen($h))
$str .= "<a href=\"".$phpgw->link($phpgw_info["server"]["webserver_url"]."/calendar/edit_entry.php","year=".$date["year"] $p->set_var('event',$this->hour_arr[$i]);
. "&month=".$date["month"]."&day=".$date["day"] $this->rowspan--;
. "&hour=".substr($time,0,strpos($time,":")) } else {
. "&minute=".substr($time,strpos($time,":")+1,2))."\">"; if (strlen($h)) {
} $this->rowspan = isset($this->rowspan_arr[$i])?$this->rowspan_arr[$i]:0;
$str .= $time; if ($this->rowspan > 1) {
if(!$this->printer_friendly) { $p->set_var('extras','valign="top" rowspan="'.$this->rowspan.'"');
$str .= "</a>"; $p->set_var('event',$this->hour_arr[$i]);
} } else {
$str .= "</font></th>"; $p->set_var('event',$this->hour_arr[$i]);
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('open_link','');
$str .= "<td bgcolor=\"".$phpgw_info["theme"]["cal_dayview"]."\">".$this->hour_arr[$i]."</td></tr>\n"; $p->set_var('close_link','');
$this->rowspan--; if(!$this->printer_friendly) {
} else { $p->set_var('open_link','<a href="'.$phpgw->link($phpgw_info["server"]["webserver_url"]."/calendar/edit_entry.php","year=".$date["year"]
if (!strlen($h)) . "&month=".$date["month"]."&day=".$date["day"]
$str .= "<td bgcolor=\"".$phpgw_info["theme"]["cal_dayview"]."\">&nbsp;</td></tr>\n"; . "&hour=".substr($time,0,strpos($time,":"))
else { . "&minute=".substr($time,strpos($time,":")+1,2)).'">');
$this->rowspan = isset($this->rowspan_arr[$i])?$this->rowspan_arr[$i]:0; }
if ($this->rowspan > 1) $p->set_var('time',$time);
$str .= "<td valign=\"top\" bgcolor=\"".$phpgw_info["theme"]["cal_dayview"]."\" rowspan=\"".$this->rowspan."\">" if(!$this->printer_friendly) {
. $this->hour_arr[$i]."</td></tr>\n"; $p->set_var('close_link','</a>');
else }
$str .= "<td bgcolor=\"".$phpgw_info["theme"]["cal_dayview"]."\">".$this->hour_arr[$i]."</td></tr>\n"; $p->parse('row','day_row',True);
}
}
} // end for } // end for
$str .= "</table>"; return $p->pparse('output','day_cal');
return $str;
} // end function } // end function
function prep($calid) { function prep($calid) {

View File

@ -0,0 +1,5 @@
<!-- $Id$ -->
<table border="0" width="100%" cellspacing="1" cellpadding="2" border="0">
{row}
</table>

View File

@ -0,0 +1,7 @@
<!-- $Id$ -->
<!-- BEGIN day_row -->
<tr>
<td bgcolor="{bgcolor}"{extras}>{event}</td>
<th width="14%" bgcolor="{bgcolor1}"><font color="{font_color}">{open_link}{time}{close_link}</font></th>
</tr>
<!-- END day_row -->

View File

@ -0,0 +1,5 @@
<!-- $Id$ -->
<!-- BEGIN day_row_99 -->
<tr><td bgcolor="{bgcolor}">{text}</td><td bgcolor="{bgcolor1}">{time}</td></tr>
<!-- END day_row_99 -->

View File

@ -0,0 +1,5 @@
<!-- $Id$ -->
<table border="0" width="100%" cellspacing="1" cellpadding="2" border="0">
{row}
</table>

View File

@ -0,0 +1,7 @@
<!-- $Id$ -->
<!-- BEGIN day_row -->
<tr>
<td bgcolor="{bgcolor}"{extras}>{event}</td>
<th width="14%" bgcolor="{bgcolor1}"><font color="{font_color}">{open_link}{time}{close_link}</font></th>
</tr>
<!-- END day_row -->

View File

@ -0,0 +1,5 @@
<!-- $Id$ -->
<!-- BEGIN day_row_99 -->
<tr><td bgcolor="{bgcolor}">{text}</td><td bgcolor="{bgcolor1}">{time}</td></tr>
<!-- END day_row_99 -->

View File

@ -19,7 +19,7 @@
$phpgw_info["flags"] = array("noheader" => True, "nonavbar" => True, "currentapp" => "home", $phpgw_info["flags"] = array("noheader" => True, "nonavbar" => True, "currentapp" => "home",
"enable_network_class" => True, "enable_todo_class" => True, "enable_network_class" => True, "enable_todo_class" => True,
"enable_addressbook_class" => True "enable_addressbook_class" => True, "enable_nextmatchs_class" => True
); );
include("header.inc.php"); include("header.inc.php");
// Note: I need to add checks to make sure these apps are installed. // Note: I need to add checks to make sure these apps are installed.
@ -156,4 +156,4 @@
</TABLE> </TABLE>
<?php <?php
$phpgw->common->phpgw_footer(); $phpgw->common->phpgw_footer();
?> ?>