X-Git-Url: http://git.freeside.biz/gitweb/?a=blobdiff_plain;f=rt%2Fshare%2Fhtml%2FSearch%2FSchedule.html;h=cfa4558be8d51c9f2c3d606662a0abc0698d0311;hb=b3ecf9c3a19f00676ff9091602be6d793748b756;hp=34ba142bdf0e24345c56cb210dfe97d7027fda05;hpb=2cb16bcb5d43d9194ca1eaf95fe5e59ec9076b76;p=freeside.git diff --git a/rt/share/html/Search/Schedule.html b/rt/share/html/Search/Schedule.html index 34ba142bd..cfa4558be 100644 --- a/rt/share/html/Search/Schedule.html +++ b/rt/share/html/Search/Schedule.html @@ -1,13 +1,55 @@ -<& /Elements/Header, Title => 'Schedule' &> +<& /Elements/Header, Title => 'Schedule', JavaScript => 0 &> -%#init_overlib.html -%foreach my $file (@files) { - -%} + + // gives cell the appearance dictated by its data + function set_data_cell ($cell) { + $cell.css('border', '1px solid #D7D7D7' ); + $cell.css('background-color', $cell.data('bgcolor')); + $cell.html($cell.data('content')); + } - <& /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 + AND ( Type = 'reminder' OR 'Type' = 'ticket' ) + AND Queue = $queueid ", slots => scalar(@usernames), Embed => 'Schedule.html', DimPast => 1, @@ -64,6 +318,7 @@ #oops, more freeside abstraction-leaking custnum => $ARGS{custnum}, pkgnum => $ARGS{pkgnum}, + RedirectToBasics => $ARGS{RedirectToBasics}, ], &> @@ -74,6 +329,11 @@ 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 ) ); @@ -86,9 +346,13 @@ if ( ref($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"; + #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';