diff options
Diffstat (limited to 'rt/share')
-rw-r--r-- | rt/share/html/Elements/CalendarDaySchedule | 7 | ||||
-rw-r--r-- | rt/share/html/Elements/CalendarSlotSchedule | 18 | ||||
-rw-r--r-- | rt/share/html/Elements/ShowCustomFieldDate | 6 | ||||
-rw-r--r-- | rt/share/html/Elements/ShowCustomFieldDateTime | 6 | ||||
-rw-r--r-- | rt/share/html/Search/Elements/ResultsStructuredView | 2 | ||||
-rw-r--r-- | rt/share/html/Search/Results.xls | 5 | ||||
-rw-r--r-- | rt/share/html/Search/Schedule.html | 10 | ||||
-rwxr-xr-x | rt/share/html/Ticket/Display.html | 2 |
8 files changed, 43 insertions, 13 deletions
diff --git a/rt/share/html/Elements/CalendarDaySchedule b/rt/share/html/Elements/CalendarDaySchedule index 5be5b06bc..bac9a78d4 100644 --- a/rt/share/html/Elements/CalendarDaySchedule +++ b/rt/share/html/Elements/CalendarDaySchedule @@ -31,8 +31,13 @@ $CurrentUser => undef % my( $starts, $due, $col, $t ) = @{ $schedule{'scheduled'}->{$id} }; % my $s = int(($starts-$stime)/10); % my $e = int(($due-$stime)/10)-1; + +% #false laziness w/misc/xmlhttp-ticket-update.html & CalendarSlotSchedule +% my %hash = $m->comp('/Ticket/Elements/Customers', Ticket => $t); +% my @cust_main = values( %{$hash{cust_main}} ); + <AREA - onmouseover = "overlib('<%$id%>: <% FS::sched_avail::pretty_time($starts). '-'. FS::sched_avail::pretty_time($due) %><BR>XX miles away<BR>more info', WRAP, BGCOLOR, '#000000', FGCOLOR, '#<%$col%>')" + onmouseover = "overlib('<% FS::sched_avail::pretty_time($starts). '-'. FS::sched_avail::pretty_time($due) %><BR>' + <% $cust_main[0]->_FreesideURILabel |js_string %>, WRAP, BGCOLOR, '#000000', FGCOLOR, '#<%$col%>')" onmouseout = "nd(); return true;" shape = "rect" coords = "<%$s%>,0,<%$e%>,<%$height%>" diff --git a/rt/share/html/Elements/CalendarSlotSchedule b/rt/share/html/Elements/CalendarSlotSchedule index 045d6e436..251347148 100644 --- a/rt/share/html/Elements/CalendarSlotSchedule +++ b/rt/share/html/Elements/CalendarSlotSchedule @@ -9,6 +9,7 @@ $LengthMin => $default_timestep $custnum => undef $pkgnum => undef + $RedirectToBasics => 0 </%ARGS> % foreach my $username ( @username ) { % @@ -48,10 +49,16 @@ % $selectable = 0; % % if ( $starts >= $tod_row ) { #first row +% +% #false laziness w/misc/xmlhttp-ticket-update.html & CalendarDaySchedule +% my %hash = $m->comp('/Ticket/Elements/Customers', Ticket => $t); +% my @cust_main = values( %{$hash{cust_main}} ); +% % $content .= ($content?', ':''). #$id. ': '. % #false laziness w/xmlhttp-ticket-update.html % FS::sched_avail::pretty_time($starts). '-'. -% FS::sched_avail::pretty_time($due); +% FS::sched_avail::pretty_time($due). +% ': '. encode_entities($cust_main[0]->_FreesideURILabel); % #'install for custname XX miles away'; #XXX placeholder/more % $draggable_ticketid = $id; % $draggable_length = $due - $starts; @@ -87,7 +94,11 @@ % # (XXX and eventually, package) % my $cust_main = qsearchs('cust_main', { custnum=>$custnum } ) % or die "unknown custnum $custnum"; -% my $Queue = $cust_main->agent->ticketing_queueid || 1; # || $default_queueid;#XXX really, pick pkg_category queue +% +% my $conf = new FS::Conf; +% my $Queue = $conf->config('ticket_system-appointment-queueid') +% or die "ticket_system-appointment-queueid configuration not set"; +% % my $member = "freeside://freeside/cust_main/$custnum"; % %warn my $Starts = int($tod_row/60). ':'. sprintf('%02d',$tod_row%60). ':00'; @@ -100,7 +111,8 @@ % '&Starts='. $Date->strftime('%F').'%20'. $Starts. % '&Due='. $Date->strftime('%F').'%20'. $Due. % '&new-MemberOf='. $member. #XXX uri_escape? -% '&Status=new'; +% '&Status=new'. +% '&RedirectToBasics='.$RedirectToBasics; % #'&Requestors='. #XXX Freeside customer requestor(s) (package? onmouseover = "boxon(this);" diff --git a/rt/share/html/Elements/ShowCustomFieldDate b/rt/share/html/Elements/ShowCustomFieldDate index 92ab7679a..1536935c5 100644 --- a/rt/share/html/Elements/ShowCustomFieldDate +++ b/rt/share/html/Elements/ShowCustomFieldDate @@ -49,7 +49,11 @@ my $content = $Object->Content; my $DateObj = RT::Date->new ( $session{'CurrentUser'} ); $DateObj->Set( Format => 'unknown', Value => $content, Timezone => 'utc' ); - $content = $DateObj->AsString(Time => 0, Timezone => 'utc'); + if ($m->notes('FormatDate')) { + $content = $m->notes('FormatDate')->($DateObj); + } else { + $content = $DateObj->AsString(Time => 0, Timezone => 'utc'); + } </%INIT> <%$content|n%> <%ARGS> diff --git a/rt/share/html/Elements/ShowCustomFieldDateTime b/rt/share/html/Elements/ShowCustomFieldDateTime index 2ba873aad..e179d6a4b 100644 --- a/rt/share/html/Elements/ShowCustomFieldDateTime +++ b/rt/share/html/Elements/ShowCustomFieldDateTime @@ -49,7 +49,11 @@ my $content = $Object->Content; my $DateObj = RT::Date->new ( $session{'CurrentUser'} ); $DateObj->Set( Format => 'ISO', Value => $content ); - $content = $DateObj->AsString; + if ($m->notes('FormatDate')) { + $content = $m->notes('FormatDate')->($DateObj); + } else { + $content = $DateObj->AsString; + } </%INIT> <%$content|n%> <%ARGS> diff --git a/rt/share/html/Search/Elements/ResultsStructuredView b/rt/share/html/Search/Elements/ResultsStructuredView index 0e9457c45..5b9db4ee1 100644 --- a/rt/share/html/Search/Elements/ResultsStructuredView +++ b/rt/share/html/Search/Elements/ResultsStructuredView @@ -54,7 +54,6 @@ $Format => undef #Callbacks $WriteHeader => sub { $RT::Logger->error('WriteHeader callback required'); '' } $WriteRow => sub { $RT::Logger->error('WriteRow callback required'); '' } -$FormatDate => sub { $_[0]->AsString } </%ARGS> <%INIT> @@ -146,7 +145,6 @@ while ( my $Ticket = $Tickets->Next()) { push @out, ProcessColumnMapValue( $ColumnMap->{$col}{'value'}, Arguments => [ $Ticket, $row ], - FormatDate => $FormatDate, ); } #foreach $subcol $value = join('', '<span>', @out, '</span>'); diff --git a/rt/share/html/Search/Results.xls b/rt/share/html/Search/Results.xls index 8b94e22ba..d9d83568c 100644 --- a/rt/share/html/Search/Results.xls +++ b/rt/share/html/Search/Results.xls @@ -118,11 +118,11 @@ my $WriteRow = sub { $row++; }; -my $FormatDate = sub { +$m->notes('FormatDate', sub { my $DateObj = shift; return '' if $DateObj->Unix == 0; return time2str('%Y-%m-%dT%H:%M', $DateObj->Unix); -}; +}); # Write everything to the worksheet $m->comp('Elements/ResultsStructuredView', @@ -132,7 +132,6 @@ $m->comp('Elements/ResultsStructuredView', Format => $Format, WriteHeader => $WriteHeader, WriteRow => $WriteRow, - FormatDate => $FormatDate, ); # Set column widths diff --git a/rt/share/html/Search/Schedule.html b/rt/share/html/Search/Schedule.html index be5a140ef..ccd844bf8 100644 --- a/rt/share/html/Search/Schedule.html +++ b/rt/share/html/Search/Schedule.html @@ -201,8 +201,8 @@ <& /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, @@ -212,6 +212,7 @@ #oops, more freeside abstraction-leaking custnum => $ARGS{custnum}, pkgnum => $ARGS{pkgnum}, + RedirectToBasics => $ARGS{RedirectToBasics}, ], &> @@ -222,6 +223,11 @@ my $timestep = RT->Config->Get('CalendarWeeklySizeMin') || 30; #1/2h </%ONCE> <%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 ) ); diff --git a/rt/share/html/Ticket/Display.html b/rt/share/html/Ticket/Display.html index 41684c5be..96a49d4e4 100755 --- a/rt/share/html/Ticket/Display.html +++ b/rt/share/html/Ticket/Display.html @@ -99,6 +99,7 @@ $id => undef $TicketObj => undef $ShowHeaders => 0 $ForceShowHistory => 0 +$RedirectToBasics => 0 </%ARGS> <%INIT> @@ -217,6 +218,7 @@ $m->callback( ); # This code does automatic redirection if any updates happen. +$m->notes('RedirectToBasics' => 1) if $RedirectToBasics; my $path = '/Ticket/'. ( $m->notes('RedirectToBasics') ? 'Modify.html' : 'Display.html' ); MaybeRedirectForResults( |