5 my $im = new GD::Image($width, $height) or die;
7 my $white = $im->colorAllocate(255,255,255);
8 my $black = $im->colorAllocate(0,0,0);
10 # Put a black frame around the picture
11 $im->rectangle(0,0,$width-1,$height-1,$black);
13 #XXX block out unavailable times
14 #alas. abstractions break, freeside-specific stuff to get availability
15 # move availability to RT side? make it all callback/pluggable?
17 #XXX block out / show / color code existing appointments
19 $r->content_type('image/png');
31 my $stime = RT->Config->Get('CalendarWeeklyStartMin');
32 $stime = 480 unless $stime =~ /^\d+$/; #8am
33 my $etime = RT->Config->Get('CalendarWeeklyEndMin');
34 $etime = 1080 unless $etime =~ /^\d+$/; #6pm
36 my $width = ( $etime - $stime ) / 10;