From 9f1a3b2bd30562d52fa9d2d0c7afab08f5efff41 Mon Sep 17 00:00:00 2001 From: Ivan Kohler Date: Sat, 12 Apr 2014 19:18:27 -0700 Subject: installers (calendaring), RT#16584 --- rt/share/html/Search/Calendar.html | 74 +++++++++++++++++++++----------------- 1 file changed, 41 insertions(+), 33 deletions(-) (limited to 'rt/share/html/Search/Calendar.html') diff --git a/rt/share/html/Search/Calendar.html b/rt/share/html/Search/Calendar.html index bf07ff3e2..a6df9fc75 100644 --- a/rt/share/html/Search/Calendar.html +++ b/rt/share/html/Search/Calendar.html @@ -79,52 +79,54 @@ $slots => $default_slots - - - -% for ( @{$week{$weekstart}} ) { - + + +% unless ( $WeekDay ) { + + + +% for ( @{$week{$weekstart}} ) { + +% } + + + + % } - - - -% if ( $WeekDay ) { - - -% } else { +% unless ( $WeekDay ) { <& td_week_expand, date=>$start, Month=>$Month, Year=>$Year, QueryString=>$QueryString, Embed=>$Embed, &> % } % if ( $WeekDay ) { - + % my $date = $start; +% my $sday = 0; % while ($date <= $end) { % % my $is_today = (DateTime->compare($today, $date) == 0); % my $is_yesterday = (DateTime->compare($yesterday, $date) == 0); % my $is_aweekago = (DateTime->compare($aweekago, $date) == 0); - + % $date = $set->next($date); % if ( $date->day_of_week == $startday_of_week ) { @@ -141,7 +143,15 @@ $slots => $default_slots + + + + + + % #slot header callback % if ( defined($Display) && $Display =~ /^(\w+)$/ ) { % @@ -192,10 +202,8 @@ $slots => $default_slots % grep { % my $meth = $_.'Obj'; % -% #XXX off by 1h on daylight savings boundaries.. 2 sundays a year -% my $tod = ( $Ticket->$meth->Unix -% - $Ticket->$meth->SetToMidnight(Timezone=>'user') -% ) / 60; +% my($m, $h) = ($Ticket->$meth->Localtime('user'))[1,2]; +% my $tod = $h*60 + $m; % % RTx::Calendar::LocalDate($Ticket->$meth->Unix) eq $date->strftime('%F') #today % && $tod >= $row && $tod < ($row+$timestep); #and in timeslot -- cgit v1.2.1
>><%$rtdate->GetWeekday($_)%>
>><%$rtdate->GetWeekday($_)%>
valign="middle"> - <& week_collapse, date=>$start, Month=>$OrigMonth, Year=>$OrigYear, QueryString=>$QueryString, Embed=>$Embed, &> - - class="weekly - <% $is_today ? 'today' - : $is_yesterday ? 'yesterday' - : $is_aweekago ? 'aweekago' - : '' - %>" - > -
<% $rtdate->GetMonth($date->month-1). ' '. $date->day %>
- -
+ class="labels" +%# <% $is_today ? 'today' +%# : $is_yesterday ? 'yesterday' +%# : $is_aweekago ? 'aweekago' +%# : '' +%# %>" +%#
<% $rtdate->GetWeekday( $week{$weekstart}->[$sday++] ). ' '. + $rtdate->GetMonth($date->month-1). ' '. + $date->day + %> +
valign="middle"> + <& week_collapse, date=>$start, Month=>$OrigMonth, Year=>$OrigYear, QueryString=>$QueryString, Embed=>$Embed, &> +