3 $slots => $default_slots,
6 $timestep => $default_timestep,
9 my @slots = ( [], [], [], [], [], [], [] );
12 % #for my $t ( @{ $Tickets{$date->strftime("%F")} } ) {
13 % for my $t (@Tickets) {
15 % #XXX off by 1h on daylight savings boundaries... 2 sundays a year
16 % my $starts = ($t->StartsObj->Unix - $t->StartsObj->SetToMidnight(Timezone=>'user'))/60;
18 % if ( $starts >= $tod_row && $starts < ($tod_row + $timestep) ) {
19 % #then we're a new entry, find a slot for us
21 % while ( ref($slots[$sday]->[$s]) ) { $s++ }
22 % $slots[$sday]->[$s] = [ $t->Id, $t ];
25 % #XXX also off by 1h on daylight savings boundaries
26 % my $due = $t->DueObj->Unix - $t->DueObj->SetToMidnight;
28 % if ( $due <= $tod_row && $due > ($tod_row + $timestep ) ) {
29 % #then find our slot and remove us
30 % @{ $slots[$sday] } =
31 % map { (!ref($_) || $_->[0] != $t->Id) ? $_ : '' }
37 % pop @{ $slots[$sday] } while @{ $slots[$sday] } && !ref($slots[$sday]->[-1]);
41 % if ( scalar(@{$slots[$sday]}) > $slots ) {
42 % #overflow situation, eek... could be handled better, how?
44 <td colspan=<%$slots%>
46 %# <% $is_today ? 'today'
47 %# : $is_yesterday ? 'yesterday'
48 %# : $is_aweekago ? 'aweekago'
57 % foreach my $slot ( @{ $slots[$sday] } ) {
58 % my( $id, $ticket ) = @$slot;
61 %# <% $is_today ? 'today'
62 %# : $is_yesterday ? 'yesterday'
63 %# : $is_aweekago ? 'aweekago'
72 % if ( scalar(@{$slots[$sday]}) < $slots ) {
74 <td colspan=<% $slots - scalar(@{$slots[$sday]}) %>
76 %# <% $is_today ? 'today'
77 %# : $is_yesterday ? 'yesterday'
78 %# : $is_aweekago ? 'aweekago'
88 my $default_slots = RT->Config->Get('CalendarWeeklySlots') || 5;
89 my $default_timestep = RT->Config->Get('CalendarWeeklySizeMin') || 30; #1/2h