4 $slots => $default_slots,
7 $timestep => $default_timestep,
11 my @slots = ( [], [], [], [], [], [], [] );
13 % #for my $t ( @{ $Tickets{$date->strftime("%F")} } ) {
14 % for my $t (@Tickets) {
16 % my($sm, $sh) = ($t->StartsObj->Localtime('user'))[1,2];
17 % my $starts = $sh*60 + $sm;
19 % if ( RTx::Calendar::LocalDate($t->StartsObj->Unix) eq $Date->strftime('%F') #today
20 % && $starts >= $tod_row && $starts < ($tod_row + $timestep) ) {
21 % #then we're a new entry, find a slot for us
23 % while ( ref($slots[$sday]->[$s]) ) { $s++ }
24 % $slots[$sday]->[$s] = [ $t->Id, $t ];
27 % my($dm, $dh) = ($t->DueObj->Localtime('user'))[1,2];
28 % my $due = $dh*60 + $dm;
30 % if ( RTx::Calendar::LocalDate($t->DueObj->Unix) eq $Date->strftime('%F') #today
31 % && $due <= $tod_row && $due > ($tod_row + $timestep ) ) {
32 % #then find our slot and remove us
33 % @{ $slots[$sday] } =
34 % map { (!ref($_) || $_->[0] != $t->Id) ? $_ : '' }
40 % pop @{ $slots[$sday] } while @{ $slots[$sday] } && !ref($slots[$sday]->[-1]);
44 % if ( scalar(@{$slots[$sday]}) > $slots ) {
45 % #overflow situation, eek... could be handled better, how?
47 <td colspan=<%$slots%>
49 %# <% $is_today ? 'today'
50 %# : $is_yesterday ? 'yesterday'
51 %# : $is_aweekago ? 'aweekago'
60 % foreach my $slot ( @{ $slots[$sday] } ) {
61 % my( $id, $ticket ) = @$slot;
64 %# <% $is_today ? 'today'
65 %# : $is_yesterday ? 'yesterday'
66 %# : $is_aweekago ? 'aweekago'
75 % if ( scalar(@{$slots[$sday]}) < $slots ) {
77 <td colspan=<% $slots - scalar(@{$slots[$sday]}) %>
79 %# <% $is_today ? 'today'
80 %# : $is_yesterday ? 'yesterday'
81 %# : $is_aweekago ? 'aweekago'
91 my $default_slots = RT->Config->Get('CalendarWeeklySlots') || 5;
92 my $default_timestep = RT->Config->Get('CalendarWeeklySizeMin') || 30; #1/2h