X-Git-Url: http://git.freeside.biz/gitweb/?p=freeside.git;a=blobdiff_plain;f=rt%2Fshare%2Fhtml%2FSearch%2FCalendar.html;fp=rt%2Fshare%2Fhtml%2FSearch%2FCalendar.html;h=0fb5414aa0c295c71a057add549371f79762d682;hp=e5a1c28a5d26e976c549856076b9ca0ede6f03c2;hb=e83205c66c30456c657053287a271b074e8da015;hpb=d5933aea7be7beddc995fb35cdd034231d2c515f diff --git a/rt/share/html/Search/Calendar.html b/rt/share/html/Search/Calendar.html index e5a1c28a5..0fb5414aa 100644 --- a/rt/share/html/Search/Calendar.html +++ b/rt/share/html/Search/Calendar.html @@ -28,9 +28,9 @@ $NewQuery => 0 % } «<%$rtdate->GetMonth($PMonth)%> - -Calendar Preferences and Help - + + <% $rtdate->GetMonth($Month). " $Year" %> + % my ($NMonth, $NYear) = ($Month + 1, $Year); % if ($NMonth > 11) { @@ -43,32 +43,50 @@ $NewQuery => 0 + - % for ( @{$week{$weekstart}} ) { % } + % while ($date <= $end) { +% +% my $offmonth = $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); + + + +% $date = $set->next($date); % if ( $date->day_of_week == $startday_of_week ) { - + % } - -% $date = $set->next($date); -% if ( $date->day_of_week == $startday_of_week ) { - -% } + % } @@ -79,16 +97,8 @@ $NewQuery => 0 - - -
<%$rtdate->GetWeekday($_)%>
+
<%$date->day%>
+ +% my $sp = 3; +% for my $t ( @{ $Tickets{$date->strftime("%F")} } ) { +% $sp--; + <& /Elements/CalendarEvent, Object => $t, Date => $date, DateTypes => \%DateTypes &> +% } + <% ($sp>0) ? '
'x$sp : '' |n %> + +
<% $date->week_number %>
-

<%$date->day%>

-% for my $t ( @{ $Tickets{$date->strftime("%F")} } ) { -<& /Elements/CalendarEvent, Object => $t, Date => $date, DateTypes => \%DateTypes &> -% } -
«<%$rtdate->GetMonth($PMonth)%> -<%$rtdate->GetMonth($NMonth)%>» -
- - - - - + +
+
-<& /Elements/Submit&> +%# <& /Elements/Submit&> + +
- : <&|/l&>Created
- : <&|/l&>Due
- : <&|/l&>Resolved
- : <&|/l&>Last Updated
- : <&|/l&>Created, <&|/l&>Due
- : <&|/l&>Reminders
- : <&|/l&>Starts
- : <&|/l&>Started
- : <&|/l&>Starts, <&|/l&>Due
+
+<%$rtdate->GetMonth($NMonth)%>» +
+ + + + + +% foreach my $legend (keys %legend) { + + + + +% } +
+
+ Calendar Preferences and Help
+ + +% my $more = 0; +% foreach ( @{$legend{$legend}} ) { + <% $more++ ? ', ' : '' %> + <&|/l&><% $_ %> +% } +
- +<%ONCE> + +my %legend = ( + 'created' => ['Created'], + 'due' => ['Due'], + 'resolved' => ['Resolved'], + 'updated' => ['Last Updated'], + 'created_due' => ['Created','Due'], + 'reminder' => ['Reminders'], + 'started' => ['Started'], + 'starts_due' => ['Starts','Due'], +); + + <%INIT> use RTx::Calendar qw(FirstDay LastDay); @@ -143,6 +185,8 @@ my $startday_of_week = ${$week{$weekstart}}[0] || 7; my $endday_of_week = ${$week{$weekstart}}[-1] || 7; my $today = DateTime->today; +my $yesterday = $today->clone->subtract( days=>1 ); +my $aweekago = $today->clone->subtract( days=>7 ); my $date = FirstDay($Year, $Month + 1, $startday_of_week ); my $end = LastDay ($Year, $Month + 1, $endday_of_week );