<%ARGS> $Date => undef @Tickets => () $slots => $default_slots $sday => undef $tod_row => undef $timestep => $default_timestep @username => () % foreach my $username ( @username ) { % % my %schedule = UserDaySchedule( username => $username, % 'date' => $Date->strftime('%F'), % Tickets => \@Tickets, % ); % % my $bgcolor = 'ffffff'; % my $content = ''; % % #XXX block out unavailable times % % #block out / show / color code existing appointments % foreach my $id ( keys %{ $schedule{'scheduled'} } ) { % % my( $starts, $due, $col, $t ) = @{ $schedule{'scheduled'}->{$id} }; % % next if $starts >= ($tod_row+$timestep) || $due < $tod_row; % % if ( $starts >= $tod_row ) { % $bgcolor = $col; % $content .= ($content?', ':''). $id; #XXX more % } else { % $bgcolor = $col; % } % } <% $content %> % } <%ONCE> my $default_slots = RT->Config->Get('CalendarWeeklySlots') || 5; my $default_timestep = RT->Config->Get('CalendarWeeklySizeMin') || 30; #1/2h <%INIT> use RTx::Schedule qw( UserDaySchedule );