mirror of
https://github.com/EGroupware/egroupware.git
synced 2024-11-07 16:44:07 +01:00
fix for day view with spanning items across multiple time frames and printer firendly
This commit is contained in:
parent
59b453b9f4
commit
1564fffc27
@ -88,8 +88,8 @@
|
||||
$phpgw->template->set_var("small_calendar",$phpgw->calendar->pretty_small_calendar($now["day"],$now["month"],$now["year"],"day.php"));
|
||||
|
||||
if (!$friendly) {
|
||||
$param = "year=".$now["year"]."&month=".$now["month"]."&day=".$now["day"]."&friendly=1&filter=".$filter;
|
||||
$phpgw->template->set_var("print","<a href=\"".$phpgw->link($PHP_SELF,$param)."\" TARGET=\"cal_printer_friendly\" onMouseOver=\"window.status = '".lang("Generate printer-friendly version")."'\">[".lang("Printer Friendly")."]</A>");
|
||||
$param = 'year='.$thisyear.'&month='.$thismonth.'&friendly=1&filter='.$filter;
|
||||
$phpgw->template->set_var("print","<a href=\"".$phpgw->link("",$param)."\" TARGET=\"cal_printer_friendly\" onMouseOver=\"window.status = '".lang("Generate printer-friendly version")."'\">[".lang("Printer Friendly")."]</A>");
|
||||
$phpgw->template->parse("out","day_t");
|
||||
$phpgw->template->pparse("out","day_t");
|
||||
} else {
|
||||
|
@ -1169,9 +1169,11 @@
|
||||
$p = new Template($phpgw->common->get_tpl_dir('calendar'));
|
||||
$p->set_unknowns("remove");
|
||||
$p->set_file(array('day_cal' => 'day_cal.tpl',
|
||||
'mini_week' => 'mini_week.tpl',
|
||||
'day_row_99' => 'day_row_99.tpl',
|
||||
'day_row' => 'day_row.tpl'));
|
||||
$p->set_block('day_cal','day_row_99','day_row');
|
||||
'day_row_event' => 'day_row_event.tpl',
|
||||
'day_row_time' => 'day_row_time.tpl'));
|
||||
$p->set_block('day_cal','mini_week','day_row_99','day_row_event','day_row_time');
|
||||
|
||||
|
||||
if (! $phpgw_info["user"]["preferences"]["calendar"]["workdaystarts"] &&
|
||||
@ -1222,11 +1224,13 @@
|
||||
$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);
|
||||
$p->parse('mini_week','day_row_99',False);
|
||||
$p->parse('row','mini_week',True);
|
||||
}
|
||||
$this->rowspan = 0;
|
||||
$p->set_var('bgcolor1',$phpgw_info["theme"]["cal_dayview"]);
|
||||
$p->set_var('font_color',$phpgw_info["theme"]["bg_text"]);
|
||||
$times = 0;
|
||||
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 = "";
|
||||
@ -1236,17 +1240,28 @@
|
||||
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))
|
||||
if (strlen($h)) {
|
||||
$p->set_var('event',$this->hour_arr[$i]);
|
||||
$p->parse('monthweek_day','day_row_event',False);
|
||||
$rows = 1;
|
||||
}
|
||||
$this->rowspan--;
|
||||
} else {
|
||||
if (strlen($h)) {
|
||||
if (!strlen($h)) {
|
||||
$p->set_var('event',' ');
|
||||
$p->parse('monthweek_day','day_row_event',False);
|
||||
$rows = 1;
|
||||
} else {
|
||||
$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('extras',' valign="top" rowspan="'.$this->rowspan.'"');
|
||||
$p->set_var('event',$this->hour_arr[$i]);
|
||||
$p->parse('monthweek_day','day_row_event',False);
|
||||
$rows = $this->rowspan;
|
||||
} else {
|
||||
$p->set_var('event',$this->hour_arr[$i]);
|
||||
$p->parse('monthweek_day','day_row_event',False);
|
||||
$rows = 1;
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -1262,7 +1277,11 @@
|
||||
if(!$this->printer_friendly) {
|
||||
$p->set_var('close_link','</a>');
|
||||
}
|
||||
$p->parse('row','day_row',True);
|
||||
$p->parse('monthweek_day','day_row_time',True);
|
||||
// $times++;
|
||||
// if ($times == $rows) { $p->set_var('monthweek_day',''); $times = 0; }
|
||||
$p->parse('row','mini_week',True);
|
||||
$p->set_var('monthweek_day','');
|
||||
} // end for
|
||||
return $p->finish($p->parse('out','day_cal'));
|
||||
} // end function
|
||||
|
@ -78,8 +78,8 @@
|
||||
$phpgw->template->set_var("small_calendar_next",$phpgw->calendar->mini_calendar($thisday,$next["month"],$next["year"],"day.php"));
|
||||
$phpgw->template->set_var("large_month",$phpgw->calendar->display_large_month($thismonth,$thisyear,True,$owner));
|
||||
if (!$friendly) {
|
||||
$param = "year=".$now["year"]."&month=".$now["month"]."&friendly=1&filter=".$filter;
|
||||
$phpgw->template->set_var("print","<a href=\"".$phpgw->link($PHP_SELF,$param)."\" TARGET=\"cal_printer_friendly\" onMouseOver=\"window."
|
||||
$param = 'year='.$thisyear.'&month='.$thismonth.'&friendly=1&filter='.$filter;
|
||||
$phpgw->template->set_var("print","<a href=\"".$phpgw->link("",$param)."\" TARGET=\"cal_printer_friendly\" onMouseOver=\"window."
|
||||
. "status = '" . lang("Generate printer-friendly version"). "'\">[". lang("Printer Friendly") . "]</a>");
|
||||
$phpgw->template->parse("out","index_t");
|
||||
$phpgw->template->pparse("out","index_t");
|
||||
|
4
calendar/templates/default/day_row_event.tpl
Executable file
4
calendar/templates/default/day_row_event.tpl
Executable file
@ -0,0 +1,4 @@
|
||||
<!-- $Id$ -->
|
||||
<!-- BEGIN day_row_event -->
|
||||
<td bgcolor="{bgcolor}"{extras}>{event}</td>
|
||||
<!-- END day_row_event -->
|
4
calendar/templates/default/day_row_time.tpl
Executable file
4
calendar/templates/default/day_row_time.tpl
Executable file
@ -0,0 +1,4 @@
|
||||
<!-- $Id$ -->
|
||||
<!-- BEGIN day_row_time -->
|
||||
<th width="14%" bgcolor="{bgcolor1}"><font color="{font_color}">{open_link}{time}{close_link}</font></th>
|
||||
<!-- END day_row_time -->
|
@ -1,5 +1,5 @@
|
||||
<!-- $Id$ -->
|
||||
<!-- BEGIN day_row_99 -->
|
||||
<tr><td bgcolor="{bgcolor}">{text}</td><td bgcolor="{bgcolor1}">{time}</td></tr>
|
||||
<td bgcolor="{bgcolor}">{text}</td><td bgcolor="{bgcolor1}">{time}</td>
|
||||
<!-- END day_row_99 -->
|
||||
|
||||
|
4
calendar/templates/verdilak/day_row_event.tpl
Executable file
4
calendar/templates/verdilak/day_row_event.tpl
Executable file
@ -0,0 +1,4 @@
|
||||
<!-- $Id$ -->
|
||||
<!-- BEGIN day_row_event -->
|
||||
<td bgcolor="{bgcolor}"{extras}>{event}</td>
|
||||
<!-- END day_row_event -->
|
4
calendar/templates/verdilak/day_row_time.tpl
Executable file
4
calendar/templates/verdilak/day_row_time.tpl
Executable file
@ -0,0 +1,4 @@
|
||||
<!-- $Id$ -->
|
||||
<!-- BEGIN day_row_time -->
|
||||
<th width="14%" bgcolor="{bgcolor1}"><font color="{font_color}">{open_link}{time}{close_link}</font></th>
|
||||
<!-- END day_row_time -->
|
@ -1,5 +1,6 @@
|
||||
<!-- $Id$ -->
|
||||
<!-- BEGIN mini_week -->
|
||||
<tr>{monthweek_day}
|
||||
<tr>
|
||||
{monthweek_day}
|
||||
</tr>
|
||||
<!-- END mini_week -->
|
||||
|
@ -115,8 +115,8 @@
|
||||
$phpgw->template->set_var("week_display",$phpgw->calendar->display_large_week($thisday,$thismonth,$thisyear,true,$owner));
|
||||
|
||||
if (!$friendly) {
|
||||
$param = "year=".$thisyear."&month=".$thismonth."&day=".$thisday."&friendly=1&filter=".$filter;
|
||||
$phpgw->template->set_var("print","<a href=\"".$phpgw->link($PHP_SELF,$param)."\" TARGET=\"cal_printer_friendly\" onMouseOver=\"window."
|
||||
$param = 'year='.$thisyear.'&month='.$thismonth.'&friendly=1&filter='.$filter;
|
||||
$phpgw->template->set_var("print","<a href=\"".$phpgw->link("",$param)."\" TARGET=\"cal_printer_friendly\" onMouseOver=\"window."
|
||||
. "status = '" . lang("Generate printer-friendly version"). "'\">[". lang("Printer Friendly") . "]</A>");
|
||||
$phpgw->template->parse("out","week_t");
|
||||
$phpgw->template->pparse("out","week_t");
|
||||
|
Loading…
Reference in New Issue
Block a user