9 %if ( DateTime->compare( $Date, $today ) == -1 ) {#flag to show the past anyway?
10 % #the past already happened...
12 % foreach my $username ( @username ) {
13 % my $mapname = "$username-$date";
14 % my $img = "$RT::WebPath/Schedule/UserBar?Username=$username;Date=$date";
15 <span class="calendarright"
16 ><% $username %><img src = "<%$img|n%>"
17 useMap = "#<%$mapname%>"
22 <MAP name="<%$mapname%>">
24 % my %schedule = UserDaySchedule( CurrentUser => $CurrentUser,
25 % username => $username,
26 % 'date' => $date, #$Date->strftime('%F'),
29 % #block out / show / color code existing appointments
30 % foreach my $id ( keys %{ $schedule{'scheduled'} } ) {
31 % my( $starts, $due, $col, $t ) = @{ $schedule{'scheduled'}->{$id} };
32 % my $s = int(($starts-$stime)/10);
33 % my $e = int(($due-$stime)/10)-1;
35 % #false laziness w/misc/xmlhttp-ticket-update.html & CalendarSlotSchedule
36 % my %hash = $m->comp('/Ticket/Elements/Customers', Ticket => $t);
37 % my @cust_main = values( %{$hash{cust_main}} );
40 onmouseover = "overlib('<% FS::sched_avail::pretty_time($starts). '-'. FS::sched_avail::pretty_time($due) %><BR>' + <% $cust_main[0]->_FreesideURILabel |js_string %>, WRAP, BGCOLOR, '#000000', FGCOLOR, '#<%$col%>')"
41 onmouseout = "nd(); return true;"
43 coords = "<%$s%>,0,<%$e%>,<%$height%>"
50 % #white out available times
51 % foreach my $avail ( @{ $schedule{'avail'} } ) {
52 % my( $start, $end ) = @$avail;
54 % my $s = $start >= $stime ? int(($start-$stime)/10) : 0;
55 % my $e = int(($end-$stime)/10)-1;
57 onmouseover = "overlib('Available', WRAP, BGCOLOR, '#000000', FGCOLOR, '#FFFFFF')"
58 onmouseout = "nd(); return true;"
60 coords = "<%$s%>,0,<%$e%>,<%$height%>"
61 %# XXX link to book - if the appointment we want can fit
69 onmouseover = "overlib('Not available', WRAP, BGCOLOR, '#000000', FGCOLOR, '#666666', TEXTCOLOR, '#FFFFFF' )"
70 onmouseout = "nd(); return true;"
83 my $stime = RT->Config->Get('CalendarWeeklyStartMin');
84 $stime = 480 unless $stime =~ /^\d+$/; #8am
85 my $etime = RT->Config->Get('CalendarWeeklyEndMin');
86 $etime = 1080 unless $etime =~ /^\d+$/; #6pm
88 my $width = int( ( $etime - $stime ) / 10 );
89 my $height = 12; #Schedule/UserBar
94 use RTx::Schedule qw( UserDaySchedule );
95 use FS::sched_avail; #just for pretty_time
97 #my( $date, $time ) = split('T', $Date);
98 my $date = $Date->strftime('%F');