4 $slots => $default_slots
7 $timestep => $default_timestep
9 $LengthMin => $default_timestep
11 % foreach my $username ( @username ) {
13 % my %schedule = UserDaySchedule( username => $username,
14 % 'date' => $Date->strftime('%F'),
15 % Tickets => \@Tickets,
18 % my $bgcolor = '666666;border-color:#555555';
22 % #white out available times
23 % foreach my $avail ( @{ $schedule{'avail'} } ) {
24 % my( $start, $end ) = @$avail;
25 % next if $start >= ($tod_row+$timestep) || $end <= $tod_row;
26 % $bgcolor = 'FFFFFF';
28 % if $LengthMin <= $end - $tod_row #the slot is long enough
29 % && ! grep { $_ > $tod_row && $LengthMin > $_ - $tod_row }
30 % map $_->[0], values %{ $schedule{'scheduled'} };
33 % #block out / show / color code existing appointments
34 % foreach my $id ( keys %{ $schedule{'scheduled'} } ) {
36 % my( $starts, $due, $col, $t ) = @{ $schedule{'scheduled'}->{$id} };
38 % next if $starts >= ($tod_row+$timestep) || $due < $tod_row;
43 % if ( $starts >= $tod_row ) { #first row
44 % $content .= ($content?', ':''). $id; #XXX more
48 <td style="background:#<%$bgcolor%>" class="weekly"
49 %# <% $is_today ? 'today'
50 %# : $is_yesterday ? 'yesterday'
51 %# : $is_aweekago ? 'aweekago'
55 onmouseover="boxon(this);"
56 onmouseout ="boxoff(this);"
61 my $default_slots = RT->Config->Get('CalendarWeeklySlots') || 5;
62 my $default_timestep = RT->Config->Get('CalendarWeeklySizeMin') || 30; #1/2h
66 use RTx::Schedule qw( UserDaySchedule );