X-Git-Url: http://git.freeside.biz/gitweb/?a=blobdiff_plain;ds=sidebyside;f=rt%2Fshare%2Fhtml%2FSearch%2FSchedule.html;h=34ba142bdf0e24345c56cb210dfe97d7027fda05;hb=9c7f208cc849ea4019447884288bf2c04d43dfc6;hp=9ba41c7e3aab4d2b588283cfcbbdee894bae9f30;hpb=778b8c70120cce490e8c6ddb534f1302200e0ad6;p=freeside.git
diff --git a/rt/share/html/Search/Schedule.html b/rt/share/html/Search/Schedule.html
index 9ba41c7e3..34ba142bd 100644
--- a/rt/share/html/Search/Schedule.html
+++ b/rt/share/html/Search/Schedule.html
@@ -5,21 +5,95 @@
%}
+
+
+
+
<& /Search/Calendar.html,
@_,
Query => "( Status = 'new' OR Status = 'open' OR Status = 'stalled')
AND ( Type = 'reminder' OR 'Type' = 'ticket' )",
#XXX and we have the magic custom field
- slots => scalar( @{ $ARGS{username} } ),
+ slots => scalar(@usernames),
Embed => 'Schedule.html',
+ DimPast => 1,
Display => 'Schedule',
- DisplayArgs => [ username => $ARGS{username} ],
+ DisplayArgs => [ username => \@usernames,
+ LengthMin => $LengthMin,
+ #oops, more freeside abstraction-leaking
+ custnum => $ARGS{custnum},
+ pkgnum => $ARGS{pkgnum},
+ ],
&>
+<%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 @usernames = ();
+if ( ref($ARGS{username}) ) {
+ @usernames = @{ $ARGS{username} };
+} elsif ( $ARGS{username} ) {
+ @usernames = ( $ARGS{username} );
+} else {
+ #XXX shouldn't even get offered the link in the first place rather than perl
+ # barf, but this is better than erroring out later or empty @username
+ die "Can't schedule an appointment - no employees are configured as installers";
+}
+
+( my $LengthMin = $ARGS{LengthMin} ) =~ /^\d+$/ or die 'non-numeric LengthMin';
+
+my $cells = int($LengthMin / $timestep);
+$cells++ if $LengthMin % $timestep;
+
%init>