diff options
author | mark <mark> | 2011-07-21 22:52:38 +0000 |
---|---|---|
committer | mark <mark> | 2011-07-21 22:52:38 +0000 |
commit | 4987c433ba77d64a0ef73c445a3d4afde9d080d3 (patch) | |
tree | 178e9404e2442eab75ea4e7d46e80b41f9a49b0a | |
parent | 7ce72ac58f66c833588474d73b54882fa6142252 (diff) |
ticket display sort order, #13199
-rw-r--r-- | FS/FS/TicketSystem/RT_Internal.pm | 11 | ||||
-rw-r--r-- | fs_selfservice/FS-SelfService/cgi/ticket_summary.html | 6 | ||||
-rw-r--r-- | httemplate/view/cust_main/misc.html | 9 | ||||
-rw-r--r-- | httemplate/view/cust_main/tickets.html | 8 |
4 files changed, 26 insertions, 8 deletions
diff --git a/FS/FS/TicketSystem/RT_Internal.pm b/FS/FS/TicketSystem/RT_Internal.pm index 31a6715d0..d96e5f05f 100644 --- a/FS/FS/TicketSystem/RT_Internal.pm +++ b/FS/FS/TicketSystem/RT_Internal.pm @@ -150,17 +150,11 @@ sub customer_tickets { my $conf = FS::Conf->new; my $priority_order = $conf->exists('ticket_system-priority_reverse') ? 'ASC' : 'DESC'; - my $custom_priority = - $conf->config('ticket_system-custom_priority_field') || ''; - my @order_by; - my $ss_priority = selfservice_priority(); - push @order_by, { FIELD => "CF.{$ss_priority}", ORDER => $priority_order } - if $ss_priority; - push @order_by, + my @order_by = ( { FIELD => 'Priority', ORDER => $priority_order }, { FIELD => 'Id', ORDER => 'DESC' }, - ; + ); $Tickets->OrderByCols(@order_by); @@ -168,6 +162,7 @@ sub customer_tickets { while ( my $t = $Tickets->Next ) { push @tickets, _ticket_info($t); } + return \@tickets; } diff --git a/fs_selfservice/FS-SelfService/cgi/ticket_summary.html b/fs_selfservice/FS-SelfService/cgi/ticket_summary.html index fc50f872f..781b1e763 100644 --- a/fs_selfservice/FS-SelfService/cgi/ticket_summary.html +++ b/fs_selfservice/FS-SelfService/cgi/ticket_summary.html @@ -10,6 +10,12 @@ my $col = $col1; my $can_set_priority = grep { exists($_->{'_selfservice_priority'}) } @tickets; if ( $can_set_priority ) { + use sort 'stable'; + @tickets = sort { + ($b->{'_selfservice_priority'} || 0) <=> + ($a->{'_selfservice_priority'} || 0) + } @tickets; + $OUT .= qq!<FORM ACTION="$selfurl" METHOD="POST">! . qq!<INPUT TYPE="hidden" NAME="session" VALUE="$session_id">! . qq!<INPUT TYPE="hidden" NAME="action" VALUE="ticket_priority">!; diff --git a/httemplate/view/cust_main/misc.html b/httemplate/view/cust_main/misc.html index ed9b91a61..5987459a5 100644 --- a/httemplate/view/cust_main/misc.html +++ b/httemplate/view/cust_main/misc.html @@ -125,6 +125,15 @@ % } +% if ( $conf->exists('ticket_system-selfservice_edit_subject') ) { + + <TR> + <TD ALIGN="right"><% mt('Edit ticket subjects') %></TD> + <TD BGCOLOR="#ffffff"><% $cust_main->edit_subject ? 'yes' : 'no' %></TD> + </TR> + +% } + </TABLE></TD></TR></TABLE> <%init> diff --git a/httemplate/view/cust_main/tickets.html b/httemplate/view/cust_main/tickets.html index e0262b895..863c66be4 100644 --- a/httemplate/view/cust_main/tickets.html +++ b/httemplate/view/cust_main/tickets.html @@ -132,6 +132,14 @@ 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 ) { + use sort 'stable'; + no warnings 'uninitialized'; + @tickets = sort { + ($b->{'content'} eq $a->{'content'}) && + $b->{'_selfservice_priority'} <=> $a->{'_selfservice_priority'} + } @tickets; +} my $format = $conf->config('date_format') || '%Y-%m-%d'; |