X-Git-Url: http://git.freeside.biz/gitweb/?a=blobdiff_plain;ds=sidebyside;f=httemplate%2Fview%2Fcust_main%2Ftickets.html;h=adfaead6ea1cc9f90e657a0d0b3a6df7c2e07166;hb=5f1cd2ddf1b38ce35bb6c49de8bf4268f208df41;hp=2175110e4f95a2cd80db83b659778720b029338a;hpb=2238711675eefa60cd2feb47c8d3e43d3e6f1860;p=freeside.git diff --git a/httemplate/view/cust_main/tickets.html b/httemplate/view/cust_main/tickets.html index 2175110e4..adfaead6e 100644 --- a/httemplate/view/cust_main/tickets.html +++ b/httemplate/view/cust_main/tickets.html @@ -12,8 +12,7 @@ function updateTicketLink() { <% mt('Create new ticket') |h %> <% mt('in queue') |h %> %# fetch list of queues in which the user can create tickets -% my $session = FS::TicketSystem->session(); -% my %queues = FS::TicketSystem->queues($session, 'CreateTicket'); +% my %queues = FS::TicketSystem->queues('', 'CreateTicket'); % if( $conf->exists('ticket_system-force_default_queueid') ) { <% $queues{$new_param{'Queue'}} %> @@ -46,7 +45,12 @@ function updateTicketLink() { <% mt('Status') |h %> <% mt('Queue') |h %> <% mt('Owner') |h %> + <% mt('Due') |h %> + <% mt('Estimated Time') |h %> <% mt('Priority') |h %> +% if ( $ss_priority ) { + <% mt('Customer Priority') |h %> +% } % foreach my $ticket ( @tickets ) { @@ -78,6 +82,14 @@ function updateTicketLink() { <% $ticket->{owner} %> + + + <% $date_formatter->($ticket->{due}) %> + + + + <% $ticket->{timeestimated} %> + <% $ticket->{content} @@ -85,7 +97,13 @@ function updateTicketLink() { : $ticket->{priority} %> - + +% if ( $ss_priority ) { + + <% $ticket->{"CF.{$ss_priority}"} %> + +% } + % } @@ -93,6 +111,8 @@ function updateTicketLink() { <%init> +use Date::Format 'time2str'; +use Date::Parse 'str2time'; my( $conf ) = new FS::Conf; my( $cust_main ) = @_; @@ -111,4 +131,33 @@ my( $new_base, %new_param ) = my $new_link = FS::TicketSystem->href_new_ticket( $cust_main ); +my $ss_priority = FS::TicketSystem->selfservice_priority; +if ( $ss_priority ) { + my $dir = $conf->exists('ticket_system-priority_reverse') ? -1 : 1; + use sort 'stable'; + # sort in the following way: + @tickets = sort { + # within a severity level... + ( $a->{'content'} eq $b->{'content'} ) ? ( + # no-priority tickets sort last + ( + ($a->{'_selfservice_priority'} eq '') <=> + ($b->{'_selfservice_priority'} eq '') + ) || + # otherwise obey ticket_system-priority_reverse + ( $dir * + ($b->{'_selfservice_priority'} <=> $a->{'_selfservice_priority'}) + ) + ) : 0; # but don't rearrange between severity levels + } @tickets; +} + +my $format = $conf->config('date_format') || '%Y-%m-%d'; + +my $date_formatter = sub { + my $time = str2time($_[0], 'GMT'); + # exclude times within 24 hours of zero + ($time > 86400) ? time2str($format, $time) : ''; +}; +