[freeside-commits] branch master updated. d1bfdbf97b2950f5f6ccb1255db387479d483955

Ivan ivan at 420.am
Sat Apr 12 12:29:19 PDT 2014


The branch, master has been updated
       via  d1bfdbf97b2950f5f6ccb1255db387479d483955 (commit)
      from  b3cecd1976e92c32740c3e2e1227a7d718e07b57 (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
commit d1bfdbf97b2950f5f6ccb1255db387479d483955
Author: Ivan Kohler <ivan at freeside.biz>
Date:   Sat Apr 12 12:29:18 2014 -0700

    installers (calendaring), RT#16584

diff --git a/htetc/freeside-rt.conf b/htetc/freeside-rt.conf
index 71ebfbd..bcc5de3 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 08e1a51..0f9f909 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 14cbabc..96241e7 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 0000000..5e834a0
--- /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 e6282b5..c425751 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 12d2685..bbbfffd 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>

-----------------------------------------------------------------------

Summary of changes:
 htetc/freeside-rt.conf                     |    6 ++++
 rt/share/html/Elements/CalendarDaySchedule |   22 +++++++++++++++-
 rt/share/html/NoAuth/css/calendar.css      |    1 +
 rt/share/html/Schedule/UserBar             |   39 ++++++++++++++++++++++++++++
 rt/share/html/Search/Calendar.html         |    2 +-
 rt/share/html/Search/Schedule.html         |   12 ++++++++
 6 files changed, 80 insertions(+), 2 deletions(-)
 create mode 100644 rt/share/html/Schedule/UserBar




More information about the freeside-commits mailing list