diff options
-rw-r--r-- | htetc/freeside-rt.conf | 6 | ||||
-rw-r--r-- | rt/share/html/Elements/CalendarDaySchedule | 22 | ||||
-rw-r--r-- | rt/share/html/NoAuth/css/calendar.css | 1 | ||||
-rw-r--r-- | rt/share/html/Schedule/UserBar | 39 | ||||
-rw-r--r-- | rt/share/html/Search/Calendar.html | 2 | ||||
-rw-r--r-- | rt/share/html/Search/Schedule.html | 12 |
6 files changed, 80 insertions, 2 deletions
diff --git a/htetc/freeside-rt.conf b/htetc/freeside-rt.conf index 71ebfbd0b..bcc5de3bd 100644 --- a/htetc/freeside-rt.conf +++ b/htetc/freeside-rt.conf @@ -84,3 +84,9 @@ PerlHandler HTML::Mason PerlHandler HTML::Mason </FilesMatch> </DirectoryMatch> + +<Directory %%%FREESIDE_DOCUMENT_ROOT%%%/rt/Schedule> +SetHandler perl-script +PerlHandler HTML::Mason +</Directory> + diff --git a/rt/share/html/Elements/CalendarDaySchedule b/rt/share/html/Elements/CalendarDaySchedule index 08e1a51a5..0f9f9092e 100644 --- a/rt/share/html/Elements/CalendarDaySchedule +++ b/rt/share/html/Elements/CalendarDaySchedule @@ -5,8 +5,28 @@ $DateTypes => undef @username => () </%args> % foreach my $username ( @username ) { -<span class="calendarright"><% $username %>---sparkline--*</span><br> +% my $mapname = "$username-$date"; +<span class="calendarright"><% $username %><img src="<%$RT::WebPath%>/Schedule/UserBar?Username=<%$username%>;Date=<%$date%>" useMap="#<%$mapname%>"><span><br> +<MAP name="<%$mapname%>"> +%# false laziness w/Schedule/UserBar +%#XXX block out unavailable times +%#alas. abstractions break, freeside-specific stuff to get availability +%# move availability to RT side? make it all callback/pluggable? +% +%#XXX block out / show / color code existing appointments +% +<AREA onmouseover="overlib('XX miles away<BR>more info')" + onmouseout="nd(); return true;" + shape = "rect" + coords="0,0,59,11" + href="test_href" +%# alt= +%# title= +> +</MAP> % } <%init> +my( $date, $time ) = split('T', $Date); + </%init> diff --git a/rt/share/html/NoAuth/css/calendar.css b/rt/share/html/NoAuth/css/calendar.css index 14cbabc73..96241e73f 100644 --- a/rt/share/html/NoAuth/css/calendar.css +++ b/rt/share/html/NoAuth/css/calendar.css @@ -37,6 +37,7 @@ color:#505050; } .calendarright { + text-align: right; float: right; } diff --git a/rt/share/html/Schedule/UserBar b/rt/share/html/Schedule/UserBar new file mode 100644 index 000000000..5e834a023 --- /dev/null +++ b/rt/share/html/Schedule/UserBar @@ -0,0 +1,39 @@ +<%perl> + +use GD; + +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 +$im->rectangle(0,0,$width-1,$height-1,$black); + +#XXX block out unavailable times +#alas. abstractions break, freeside-specific stuff to get availability +# move availability to RT side? make it all callback/pluggable? + +#XXX block out / show / color code existing appointments + +$r->content_type('image/png'); +$m->clear_buffer; +$m->out($im->png); +$m->abort; + +</%perl> +<%args> +$Username => undef +$Date => undef +</%args> +<%once> + +my $stime = RT->Config->Get('CalendarWeeklyStartMin'); +$stime = 480 unless $stime =~ /^\d+$/; #8am +my $etime = RT->Config->Get('CalendarWeeklyEndMin'); +$etime = 1080 unless $etime =~ /^\d+$/; #6pm + +my $width = ( $etime - $stime ) / 10; +my $height = 12; + +</%once> diff --git a/rt/share/html/Search/Calendar.html b/rt/share/html/Search/Calendar.html index e6282b58a..c425751ff 100644 --- a/rt/share/html/Search/Calendar.html +++ b/rt/share/html/Search/Calendar.html @@ -82,7 +82,7 @@ $DayDisplay => undef <tr> <td class="labels" colspan=<% $WeekDay ? 2 : 1 %>></td> % for ( @{$week{$weekstart}} ) { -<th width="14%" colspan=<% $WeekDay ? $slots : 1 %>><%$rtdate->GetWeekday($_)%></th> +<th colspan=<% $WeekDay ? $slots : 1 %>><%$rtdate->GetWeekday($_)%></th> % } </tr> </thead> diff --git a/rt/share/html/Search/Schedule.html b/rt/share/html/Search/Schedule.html index 12d268500..bbbfffdc9 100644 --- a/rt/share/html/Search/Schedule.html +++ b/rt/share/html/Search/Schedule.html @@ -1,5 +1,10 @@ <& /Elements/Header, Title => 'Schedule' &> +%#init_overlib.html +%foreach my $file (@files) { +<SCRIPT TYPE="text/javascript" SRC="<%$fsurl%>elements/<%$file%>.js"></SCRIPT> +%} + <& /Search/Calendar.html, @_, Embed => 'Schedule.html', @@ -7,3 +12,10 @@ DayDisplayArgs => [ username => $ARGS{username} ], &> +<%init> +my @files = (); +#if ( ! $initialized ) { + push @files, map "overlibmws$_", ( '', qw( _iframe _draggable _crossframe ) ); + push @files, map { "${_}contentmws" } qw( iframe ajax ); +#%} +</%init> |