From 7cfd11c02730df0bd27f03b8da765666af0a0edc Mon Sep 17 00:00:00 2001 From: Ivan Kohler Date: Sun, 13 Apr 2014 13:23:37 -0700 Subject: installers (calendaring), RT#16584 --- rt/share/html/Elements/CalendarDaySchedule | 43 +++++++++++++++++++++++++---- rt/share/html/Elements/CalendarSlotSchedule | 34 +++++++++++++---------- 2 files changed, 56 insertions(+), 21 deletions(-) (limited to 'rt/share/html/Elements') diff --git a/rt/share/html/Elements/CalendarDaySchedule b/rt/share/html/Elements/CalendarDaySchedule index f378674ff..a8cda6533 100644 --- a/rt/share/html/Elements/CalendarDaySchedule +++ b/rt/share/html/Elements/CalendarDaySchedule @@ -1,10 +1,14 @@ <%args> $Date => undef +$today => undef $Tickets => undef $DateTypes => undef @username => () $CurrentUser => undef +%if ( DateTime->compare( $Date, $today ) == -1 ) {#flag to show the past anyway? +% #the past already happened... +%} else { % foreach my $username ( @username ) { % my $mapname = "$username-$date"; % my $img = "$RT::WebPath/Schedule/UserBar?Username=$username;Date=$date"; @@ -19,10 +23,8 @@ $CurrentUser => undef % my %schedule = UserDaySchedule( CurrentUser => $CurrentUser, % username => $username, -% 'date' => $Date->strftime('%F'), +% 'date' => $date, #$Date->strftime('%F'), % ); - -% #XXX block out unavailable times % % #block out / show / color code existing appointments % foreach my $id ( keys %{ $schedule{'scheduled'} } ) { @@ -30,19 +32,47 @@ $CurrentUser => undef % my $s = int(($starts-$stime)/10); % my $e = int(($due-$stime)/10)-1; +%# +% } +% +% #white out available times +% foreach my $avail ( @{ $schedule{'avail'} } ) { +% my( $start, $end ) = @$avail; +% +% my $s = $start >= $stime ? int(($start-$stime)/10) : 0; +% my $e = int(($end-$stime)/10)-1; + %# % } + +%# + % } +%} <%once> my $stime = RT->Config->Get('CalendarWeeklyStartMin'); @@ -58,6 +88,7 @@ my $height = 12; #Schedule/UserBar use RTx::Schedule qw( UserDaySchedule ); -my( $date, $time ) = split('T', $Date); +#my( $date, $time ) = split('T', $Date); +my $date = $Date->strftime('%F'); diff --git a/rt/share/html/Elements/CalendarSlotSchedule b/rt/share/html/Elements/CalendarSlotSchedule index fb5b7c1ab..8a0c617d9 100644 --- a/rt/share/html/Elements/CalendarSlotSchedule +++ b/rt/share/html/Elements/CalendarSlotSchedule @@ -14,33 +14,37 @@ % Tickets => \@Tickets, % ); % -% my $bgcolor = 'ffffff'; +% my $bgcolor = '666666;border-color:#555555'; % my $content = ''; % -% #XXX block out unavailable times +% #white out available times +% foreach my $avail ( @{ $schedule{'avail'} } ) { +% my( $start, $end ) = @$avail; +% next if $start >= ($tod_row+$timestep) || $end <= $tod_row; +% $bgcolor = 'FFFFFF'; +% } % % #block out / show / color code existing appointments -% foreach my $id ( keys %{ $schedule{'scheduled'} } ) { +% foreach my $id ( keys %{ $schedule{'scheduled'} } ) { % -% my( $starts, $due, $col, $t ) = @{ $schedule{'scheduled'}->{$id} }; +% my( $starts, $due, $col, $t ) = @{ $schedule{'scheduled'}->{$id} }; % -% next if $starts >= ($tod_row+$timestep) || $due < $tod_row; +% next if $starts >= ($tod_row+$timestep) || $due < $tod_row; % -% if ( $starts >= $tod_row ) { -% $bgcolor = $col; -% $content .= ($content?', ':''). $id; #XXX more -% } else { -% $bgcolor = $col; -% } -% } +% if ( $starts >= $tod_row ) { +% $bgcolor = $col; +% $content .= ($content?', ':''). $id; #XXX more +% } else { +% $bgcolor = $col; +% } +% } - " class="weekly" %# <% $is_today ? 'today' %# : $is_yesterday ? 'yesterday' %# : $is_aweekago ? 'aweekago' %# : '' -%# %> - " +%# %>" ><% $content %> % } <%ONCE> -- cgit v1.2.1