installers (calendaring), RT#16584
[freeside.git] / rt / share / html / Elements / CalendarSlotSchedule
index 8a0c617..5b40040 100644 (file)
@@ -1,11 +1,12 @@
 <%ARGS>
-  $Date     => undef
-  @Tickets  => ()
-  $slots    => $default_slots
-  $sday     => undef
-  $tod_row  => undef
-  $timestep => $default_timestep
-  @username => ()
+  $Date      => undef
+  @Tickets   => ()
+  $slots     => $default_slots
+  $sday      => undef
+  $tod_row   => undef
+  $timestep  => $default_timestep
+  @username  => ()
+  $LengthMin => $default_timestep
 </%ARGS>
 % foreach my $username ( @username ) {
 %
 %
 %   my $bgcolor = '666666;border-color:#555555';
 %   my $content = '';
+%   my $onmouse = 0;
 %
 %   #white out available times
 %   foreach my $avail ( @{ $schedule{'avail'} } ) {
 %     my( $start, $end ) = @$avail;
 %     next if $start >= ($tod_row+$timestep) || $end <= $tod_row;
 %     $bgcolor = 'FFFFFF';
+%     $onmouse = 1
+%       if $LengthMin <= $end - $tod_row  #the slot is long enough
+%       && ! grep { $_ > $tod_row && $LengthMin > $_ - $tod_row }
+%              map $_->[0], values %{ $schedule{'scheduled'} };
 %   }
 %
 %   #block out / show / color code existing appointments
 %
 %     next if $starts >= ($tod_row+$timestep) || $due < $tod_row;
 %
-%     if ( $starts >= $tod_row ) {
-%       $bgcolor = $col;
+%     $bgcolor = $col;
+%     $onmouse = 0;
+%
+%     if ( $starts >= $tod_row ) { #first row
 %       $content .= ($content?', ':''). $id; #XXX more
-%     } else {
-%       $bgcolor = $col;
 %     }
 %   }
 
 %#                  : $is_aweekago  ? 'aweekago'
 %#                  : ''
 %#               %>"
+%     if ( $onmouse ) {
+        onmouseover="boxon(this);"
+        onmouseout ="boxoff(this);"
+%     }
     ><% $content %></td>
 % }
 <%ONCE>