X-Git-Url: http://git.freeside.biz/gitweb/?a=blobdiff_plain;f=rt%2Fshare%2Fhtml%2FSearch%2FSchedule.html;h=df7b53d81e83e65b7ba2ad8255def4d6e715d128;hb=b8fa095812b8ad74263a2d4a25caa97871d7d34b;hp=12d2685007b2a64daf65f520df2dd7760fa7c77d;hpb=4f7725315c140dac53d390ec607b8d221166f6ac;p=freeside.git diff --git a/rt/share/html/Search/Schedule.html b/rt/share/html/Search/Schedule.html index 12d268500..df7b53d81 100644 --- a/rt/share/html/Search/Schedule.html +++ b/rt/share/html/Search/Schedule.html @@ -1,9 +1,400 @@ -<& /Elements/Header, Title => 'Schedule' &> +<& /Elements/Header, Title => 'Schedule', JavaScript => 0 &> + + <& /Search/Calendar.html, @_, - Embed => 'Schedule.html', - DayDisplay => 'Schedule', - DayDisplayArgs => [ username => $ARGS{username} ], + Query => "( Status = 'new' OR Status = 'open' OR Status = 'stalled') + AND ( Type = 'reminder' OR 'Type' = 'ticket' ) + AND Queue = $queueid ", + slots => scalar(@usernames), + Embed => 'Schedule.html', + DimPast => 1, + Display => 'Schedule', + DisplayArgs => [ username => \@usernames, + LengthMin => $LengthMin, + #oops, more freeside abstraction-leaking + custnum => $ARGS{custnum}, + pkgnum => $ARGS{pkgnum}, + RedirectToBasics => $ARGS{RedirectToBasics}, + ], &> +<%ONCE> + +my $timestep = RT->Config->Get('CalendarWeeklySizeMin') || 30; #1/2h + + +<%init> + +#abstraction-leaking +my $conf = new FS::Conf; +my $queueid = $conf->config('ticket_system-appointment-queueid') + or die "ticket_system-appointment-queueid configuration not set"; + +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 { + #look them up ourslves... again, more FS abstraction-leaking, but + # we want to link to the schedule view, and better than doing this every + # menu render + use FS::Record qw( qsearch ); + use FS::sched_item; + my @sched_item = qsearch('sched_item', { 'disabled' => '', }); + @usernames = map $_->access_user->username, @sched_item; +} + +( my $LengthMin = $ARGS{LengthMin} ) =~ /^\d+$/ or die 'non-numeric LengthMin'; + +my $cells = int($LengthMin / $timestep); +$cells++ if $LengthMin % $timestep; + +