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"]) {
@ -1212,52 +1216,53 @@
} }
} }
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++) {
$p->set_var('bgcolor',$phpgw->nextmatchs->alternate_row_color());
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 = "";
$time = $this->build_time_for_display($i * 10000); $time = $this->build_time_for_display($i * 10000);
$str .= "<tr><th width=\"14%\" bgcolor=\"" $p->set_var('extras','');
. $phpgw_info["theme"]["bg_color"]."\"><font color=\"" $p->set_var('event','&nbsp');
. $phpgw_info["theme"]["bg_text"]."\">";
// tooley: the hour - 36400 is a HACK for improper storage of hour allows
// in user preference land.
if(!$this->printer_friendly) {
$str .= "<a href=\"".$phpgw->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 .= "</a>";
}
$str .= "</font></th>";
if ($this->rowspan > 1) { if ($this->rowspan > 1) {
// this might mean there's an overlap, or it could mean one event // this might mean there's an overlap, or it could mean one event
// ends at 11:15 and another starts at 11:30. // ends at 11:15 and another starts at 11:30.
if (strlen($h)) if (strlen($h))
$str .= "<td bgcolor=\"".$phpgw_info["theme"]["cal_dayview"]."\">".$this->hour_arr[$i]."</td></tr>\n"; $p->set_var('event',$this->hour_arr[$i]);
$this->rowspan--; $this->rowspan--;
} else { } else {
if (!strlen($h)) if (strlen($h)) {
$str .= "<td bgcolor=\"".$phpgw_info["theme"]["cal_dayview"]."\">&nbsp;</td></tr>\n";
else {
$this->rowspan = isset($this->rowspan_arr[$i])?$this->rowspan_arr[$i]:0; $this->rowspan = isset($this->rowspan_arr[$i])?$this->rowspan_arr[$i]:0;
if ($this->rowspan > 1) if ($this->rowspan > 1) {
$str .= "<td valign=\"top\" bgcolor=\"".$phpgw_info["theme"]["cal_dayview"]."\" rowspan=\"".$this->rowspan."\">" $p->set_var('extras','valign="top" rowspan="'.$this->rowspan.'"');
. $this->hour_arr[$i]."</td></tr>\n"; $p->set_var('event',$this->hour_arr[$i]);
else } else {
$str .= "<td bgcolor=\"".$phpgw_info["theme"]["cal_dayview"]."\">".$this->hour_arr[$i]."</td></tr>\n"; $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','<a href="'.$phpgw->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)).'">');
}
$p->set_var('time',$time);
if(!$this->printer_friendly) {
$p->set_var('close_link','</a>');
}
$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.