5e834a0236bcefb988d3a38c3f49ed09fed4a5a8
[freeside.git] / rt / share / html / Schedule / UserBar
1 <%perl>
2
3 use GD;
4
5 my $im = new GD::Image($width, $height) or die;
6
7 my $white = $im->colorAllocate(255,255,255);
8 my $black = $im->colorAllocate(0,0,0); 
9
10 # Put a black frame around the picture
11 $im->rectangle(0,0,$width-1,$height-1,$black);
12
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?
16
17 #XXX block out / show / color code existing appointments
18
19 $r->content_type('image/png');
20 $m->clear_buffer;
21 $m->out($im->png);
22 $m->abort;
23
24 </%perl>
25 <%args>
26 $Username => undef
27 $Date     => undef
28 </%args>
29 <%once>
30
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
35
36 my $width = ( $etime - $stime ) / 10;
37 my $height = 12;
38
39 </%once>