diff options
author | Ivan Kohler <ivan@freeside.biz> | 2014-04-05 23:15:29 -0700 |
---|---|---|
committer | Ivan Kohler <ivan@freeside.biz> | 2014-04-05 23:15:57 -0700 |
commit | 9a51fd5542ee9979bea99a39c83d63e221e59155 (patch) | |
tree | 3df4a866000b46d160aa6743e20ac363f5aff95f /rt | |
parent | 19cae13fbfa17207f58c2ad44cb94f57caf64356 (diff) |
weekly view for RTx::Calendar, RT#16584
Diffstat (limited to 'rt')
-rw-r--r-- | rt/share/html/NoAuth/images/week-collapse.gif | bin | 137 -> 137 bytes | |||
-rw-r--r-- | rt/share/html/NoAuth/images/week-expand.gif | bin | 150 -> 150 bytes | |||
-rw-r--r-- | 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 Binary files differindex 3c300bbc3..54a123f88 100644 --- a/rt/share/html/NoAuth/images/week-collapse.gif +++ b/rt/share/html/NoAuth/images/week-collapse.gif diff --git a/rt/share/html/NoAuth/images/week-expand.gif b/rt/share/html/NoAuth/images/week-expand.gif Binary files differindex 959687e29..d0f42e9a6 100644 --- a/rt/share/html/NoAuth/images/week-expand.gif +++ b/rt/share/html/NoAuth/images/week-expand.gif 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); - <td class="<% ($offmonth && !$WeekDay) ? 'offmonth' - : $is_today ? 'today' - : $is_yesterday ? 'yesterday' - : $is_aweekago ? 'aweekago' - : '' + <td class="<% $offmonth ? 'offmonth' + : $is_today ? 'today' + : $is_yesterday ? 'yesterday' + : $is_aweekago ? 'aweekago' + : '' %>" > - <div class="<% $is_today ? 'todays' - : ($offmonth && !$WeekDay) ? 'offmonth' - :'' %>calendardate" - ><% ( $WeekDay ? $rtdate->GetMonth($date->month). ' ' : '' ). + <div class="<% $is_today ? 'todays' + : $offmonth ? 'offmonth' + : '' + %>calendardate" + ><% ( $WeekDay ? $rtdate->GetMonth($date->month-1). ' ' : '' ). $date->day %></div> @@ -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 </%args> <td class="controls"> - <a href="<%$RT::WebPath%>/Search/Calendar.html?WeekDay=<% $date->day %>&WeekMonth=<% $date->month %>&WeekYear=<% $date->year %>&OrigMonth=<% $Month %>&OrigYear=<% $Year %>&<%$QueryString%>"><img src="<%$RT::WebPath%>/NoAuth/images/week-expand.gif"></a> + <a href="<%$RT::WebPath%>/Search/Calendar.html?WeekDay=<% $date->day %>&WeekMonth=<% $date->month -1 %>&WeekYear=<% $date->year %>&OrigMonth=<% $Month %>&OrigYear=<% $Year %>&<%$QueryString%>"><img src="<%$RT::WebPath%>/NoAuth/images/week-expand.gif"></a> </td> </%def> |