diff options
author | Ivan Kohler <ivan@freeside.biz> | 2014-04-13 13:23:38 -0700 |
---|---|---|
committer | Ivan Kohler <ivan@freeside.biz> | 2014-04-13 13:23:38 -0700 |
commit | 5c0e4713132f9ab262938a58154b078d408ebd06 (patch) | |
tree | ec304c5f68c9da72a92239da28c604054ed6684f /rt/share/html/Schedule | |
parent | 8420caa62848813b7aeb2e6c1e2bb3430aa79d92 (diff) |
installers (calendaring), RT#16584
Diffstat (limited to 'rt/share/html/Schedule')
-rw-r--r-- | rt/share/html/Schedule/UserBar | 18 |
1 files changed, 15 insertions, 3 deletions
diff --git a/rt/share/html/Schedule/UserBar b/rt/share/html/Schedule/UserBar index 2345fe821..321107dac 100644 --- a/rt/share/html/Schedule/UserBar +++ b/rt/share/html/Schedule/UserBar @@ -6,17 +6,29 @@ use RTx::Schedule qw( UserDaySchedule ); my $im = new GD::Image($width, $height) or die; my $white = $im->colorAllocate(255,255,255); -my $black = $im->colorAllocate(0,0,0); -# Put a black frame around the picture +my $black = $im->colorAllocate(0,0,0); $im->rectangle(0,0,$width-1,$height-1,$black); +my $darkgray = $im->colorAllocate(102, 102, 102); +$im->filledRectangle(0, 1, $width-1, $height-2, $darkgray); + my %schedule = UserDaySchedule( CurrentUser => $session{CurrentUser}, username => $Username, 'date' => $Date, ); -#XXX block out unavailable times +#white out available times +foreach my $avail ( @{ $schedule{'avail'} } ) { + my( $start, $end ) = @$avail; + + $im->filledRectangle( $start >= $stime ? int(($start-$stime)/10) : 0, + 1, + int(($end-$stime)/10)-1, + $height-2, + $white, + ); +} #block out / show / color code existing appointments foreach my $id ( keys %{ $schedule{'scheduled'} } ) { |