From 9a51fd5542ee9979bea99a39c83d63e221e59155 Mon Sep 17 00:00:00 2001 From: Ivan Kohler Date: Sat, 5 Apr 2014 23:15:29 -0700 Subject: [PATCH] weekly view for RTx::Calendar, RT#16584 --- rt/share/html/NoAuth/images/week-collapse.gif | Bin 137 -> 137 bytes rt/share/html/NoAuth/images/week-expand.gif | Bin 150 -> 150 bytes rt/share/html/Search/Calendar.html | 49 ++++++++++++++++++-------- 3 files changed, 34 insertions(+), 15 deletions(-) diff --git a/rt/share/html/NoAuth/images/week-collapse.gif b/rt/share/html/NoAuth/images/week-collapse.gif index 3c300bbc3d11c54d006b9aed30c3f60c90afb03c..54a123f888d205c459a295b5ed8e7d871602c708 100644 GIT binary patch delta 16 XcmeBV>|~ta%*I~XeQMf)iJlGsFB%3j delta 16 XcmeBV>|~ta%%)!1eQMf~iJlGsFiHkj diff --git a/rt/share/html/NoAuth/images/week-expand.gif b/rt/share/html/NoAuth/images/week-expand.gif index 959687e29eb6fe73df05cc250589ee3a208e40a9..d0f42e9a658b1c19b1cf513a7962113569d3480c 100644 GIT binary patch delta 40 tcmbQnIE_)#-P6s&GLf6XhG8KS!-NSFjvqh%9}Ff+YBBRJ=a}dg001j85R(7^ delta 40 ycmV+@0N4MP0hR$7M@dFFIbjO`JOH5s0FaQ7$H&M2|Nj600FfCg11+a0kw#Dmt_{}! diff --git a/rt/share/html/Search/Calendar.html b/rt/share/html/Search/Calendar.html index db781d81b..f66f27d79 100644 --- a/rt/share/html/Search/Calendar.html +++ b/rt/share/html/Search/Calendar.html @@ -17,8 +17,26 @@ $OrigYear => undef <& /Elements/Header, Title => $title &> <& /Elements/Tabs &> +% my $title; +% if ( $WeekMonth ) { +% if ( $date->month == $end->month ) { +% $title = $rtdate->GetMonth( $date->month -1 ). ' '. +% $date->day. '-'. $end->day. ', '. $date->year; +% } elsif ( $date->year == $end->year ) { +% $title = +% $rtdate->GetMonth( $date->month -1 ). ' '. $date->day. ' - '. +% $rtdate->GetMonth( $end->month -1 ). ' '. $end->day. ', '. $end->year; +% } else { +% $title = +% $rtdate->GetMonth( $date->month -1 ). ' '.$date->day. ', '. $date->year. +% ' - '. +% $rtdate->GetMonth( $end->month -1 ). ' '.$end->day. ', '. $end->year; +% } +% } else { +% $title = $rtdate->GetMonth($Month) . " $Year" +% } <&| /Widgets/TitleBox, - title => loc('Calendar for ') . $rtdate->GetMonth($Month) . " $Year" , + title => loc('Calendar for '). $title, title_class=> 'inverse', color => "#993333" &> @@ -70,22 +88,23 @@ $OrigYear => undef % } % while ($date <= $end) { % -% my $offmonth = $date->month != ($Month + 1); +% my $offmonth = !$WeekDay && $date->month != ($Month + 1); % my $is_today = (DateTime->compare($today, $date) == 0); % my $is_yesterday = (DateTime->compare($yesterday, $date) == 0); % my $is_aweekago = (DateTime->compare($aweekago, $date) == 0); - " > -
<% ( $WeekDay ? $rtdate->GetMonth($date->month). ' ' : '' ). +
<% ( $WeekDay ? $rtdate->GetMonth($date->month-1). ' ' : '' ). $date->day %>
@@ -218,10 +237,10 @@ my $today = DateTime->today; my $yesterday = $today->clone->subtract( days=>1 ); my $aweekago = $today->clone->subtract( days=>7 ); -my( $date, $end); +my( $date, $end ); if ( $WeekDay ) { - $date = DateTime->new( year=>$WeekYear, month=>$WeekMonth, day=>$WeekDay ); - $end = LastDayOfWeek( $WeekYear, $WeekMonth, $WeekDay, $endday_of_week ); + $date = DateTime->new( year=>$WeekYear, month=>$WeekMonth+1, day=>$WeekDay ); + $end = LastDayOfWeek( $WeekYear, $WeekMonth+1, $WeekDay, $endday_of_week ); } else { $date = FirstDay($Year, $Month + 1, $startday_of_week ); $end = LastDay ($Year, $Month + 1, $endday_of_week ); @@ -281,7 +300,7 @@ my %Tickets = RTx::Calendar::FindTickets($session{'CurrentUser'}, $TempQuery, \@ $QueryString => undef - + -- 2.11.0