diff options
author | Ivan Kohler <ivan@freeside.biz> | 2014-04-13 17:15:29 -0700 |
---|---|---|
committer | Ivan Kohler <ivan@freeside.biz> | 2014-04-13 17:15:29 -0700 |
commit | ddcefead29544e7813f942e0eca062bf6433763e (patch) | |
tree | 1344ad6402a7390dc5d095c7a5f9c65460162d5e /rt | |
parent | 7ad03f9ad66d734f082e860c71ca467a43842426 (diff) |
installers (calendaring), RT#16584
Diffstat (limited to 'rt')
-rw-r--r-- | rt/share/html/Elements/CalendarSlotSchedule | 32 | ||||
-rw-r--r-- | rt/share/html/Search/Calendar.html | 2 | ||||
-rw-r--r-- | rt/share/html/Search/Schedule.html | 61 |
3 files changed, 82 insertions, 13 deletions
diff --git a/rt/share/html/Elements/CalendarSlotSchedule b/rt/share/html/Elements/CalendarSlotSchedule index 8a0c617d9..5b4004062 100644 --- a/rt/share/html/Elements/CalendarSlotSchedule +++ b/rt/share/html/Elements/CalendarSlotSchedule @@ -1,11 +1,12 @@ <%ARGS> - $Date => undef - @Tickets => () - $slots => $default_slots - $sday => undef - $tod_row => undef - $timestep => $default_timestep - @username => () + $Date => undef + @Tickets => () + $slots => $default_slots + $sday => undef + $tod_row => undef + $timestep => $default_timestep + @username => () + $LengthMin => $default_timestep </%ARGS> % foreach my $username ( @username ) { % @@ -16,12 +17,17 @@ % % my $bgcolor = '666666;border-color:#555555'; % my $content = ''; +% my $onmouse = 0; % % #white out available times % foreach my $avail ( @{ $schedule{'avail'} } ) { % my( $start, $end ) = @$avail; % next if $start >= ($tod_row+$timestep) || $end <= $tod_row; % $bgcolor = 'FFFFFF'; +% $onmouse = 1 +% if $LengthMin <= $end - $tod_row #the slot is long enough +% && ! grep { $_ > $tod_row && $LengthMin > $_ - $tod_row } +% map $_->[0], values %{ $schedule{'scheduled'} }; % } % % #block out / show / color code existing appointments @@ -31,11 +37,11 @@ % % next if $starts >= ($tod_row+$timestep) || $due < $tod_row; % -% if ( $starts >= $tod_row ) { -% $bgcolor = $col; +% $bgcolor = $col; +% $onmouse = 0; +% +% if ( $starts >= $tod_row ) { #first row % $content .= ($content?', ':''). $id; #XXX more -% } else { -% $bgcolor = $col; % } % } @@ -45,6 +51,10 @@ %# : $is_aweekago ? 'aweekago' %# : '' %# %>" +% if ( $onmouse ) { + onmouseover="boxon(this);" + onmouseout ="boxoff(this);" +% } ><% $content %></td> % } <%ONCE> diff --git a/rt/share/html/Search/Calendar.html b/rt/share/html/Search/Calendar.html index 55b2b5a8a..092f6a5a1 100644 --- a/rt/share/html/Search/Calendar.html +++ b/rt/share/html/Search/Calendar.html @@ -516,7 +516,7 @@ my %Tickets = FindTickets($session{'CurrentUser'}, $TempQuery, \@Dates, $start-> $QueryString => undef $Embed => undef </%args> - <a href="<%$RT::WebPath%>/Search/<%$Embed||'Calendar.html'%>?Month=<% $Month %>&Year=<% $Year %>&<%$QueryString%>"><img src="<%$RT::WebPath%>/NoAuth/images/week-collapse.gif" STYLE="height:384px;width:11px"></a> + <a href="<%$RT::WebPath%>/Search/<%$Embed||'Calendar.html'%>?Month=<% $Month %>&Year=<% $Year %>&<%$QueryString%>"><img src="<%$RT::WebPath%>/NoAuth/images/week-collapse.gif" STYLE="height:384px;width:11px;border:none"></a> </%def> <%def td_time> diff --git a/rt/share/html/Search/Schedule.html b/rt/share/html/Search/Schedule.html index 14956b2db..4bc5134cb 100644 --- a/rt/share/html/Search/Schedule.html +++ b/rt/share/html/Search/Schedule.html @@ -5,6 +5,51 @@ <SCRIPT TYPE="text/javascript" SRC="<%$fsurl%>elements/<%$file%>.js"></SCRIPT> %} +<SCRIPT TYPE="text/javascript" SRC="<%$fsurl%>elements/jquery.js"></SCRIPT> + +<SCRIPT TYPE="text/javascript"> + + function boxon(what) { + var $this = $(what); + for ( var c=0; c < <%$cells%>; c++) { + + $this.css('background-color', '#ffffdd'); + if ( c == 0 ) { + $this.css('border-top', '1px double black'); + $this.css('border-left', '1px double black'); + $this.css('border-right', '1px solid black'); + } else if ( c == <%$cells-1%> ) { + $this.css('border-left', '1px double black'); + $this.css('border-right', '1px solid black'); + $this.css('border-bottom', '1px solid black'); + } else { + $this.css('border-left', '1px double black'); + $this.css('border-right', '1px solid black'); + } + + var rownum = $this.parent().prevAll('tr').length; + var colnum = $this.prevAll('td').length; + $this = $this.parent().parent().children('tr').eq(rownum+1).children('td').eq(colnum); + } + } + + function boxoff(what) { + var $this = $(what); + for ( var c=0; c < <%$cells%>; c++) { + + //$this.css('background-color', ''); + //$this.css('border', ''); //IE8 woes, removes cell borders + $this.removeAttr('style'); //slightly "flashy" on cell changes under IE8 + //but at least it doesn't remove cell borders + + var rownum = $this.parent().prevAll('tr').length; + var colnum = $this.prevAll('td').length; + $this = $this.parent().parent().children('tr').eq(rownum+1).children('td').eq(colnum); + } + } + +</SCRIPT> + <& /Search/Calendar.html, @_, Query => "( Status = 'new' OR Status = 'open' OR Status = 'stalled') @@ -14,13 +59,27 @@ Embed => 'Schedule.html', DimPast => 1, Display => 'Schedule', - DisplayArgs => [ username => $ARGS{username} ], + DisplayArgs => [ username => $ARGS{username}, + LengthMin => $LengthMin, + ], &> +<%ONCE> + +my $timestep = RT->Config->Get('CalendarWeeklySizeMin') || 30; #1/2h + +</%ONCE> <%init> + my @files = (); #if ( ! $initialized ) { push @files, map "overlibmws$_", ( '', qw( _iframe _draggable _crossframe ) ); push @files, map { "${_}contentmws" } qw( iframe ajax ); #%} + +my $LengthMin = 180; #XXX $ARGS{LengthMin};, passed in + +my $cells = int($LengthMin / $timestep); +$cells++ if $LengthMin % $timestep; + </%init> |