[freeside-commits] freeside/httemplate/view/cust_main tickets.html, 1.20.2.1, 1.20.2.2
Mark Wells
mark at wavetail.420.am
Wed Aug 24 14:01:01 PDT 2011
Update of /home/cvs/cvsroot/freeside/httemplate/view/cust_main
In directory wavetail.420.am:/tmp/cvs-serv1472/httemplate/view/cust_main
Modified Files:
Tag: FREESIDE_2_3_BRANCH
tickets.html
Log Message:
selfservice priority sort order, #14029
Index: tickets.html
===================================================================
RCS file: /home/cvs/cvsroot/freeside/httemplate/view/cust_main/tickets.html,v
retrieving revision 1.20.2.1
retrieving revision 1.20.2.2
diff -u -w -d -r1.20.2.1 -r1.20.2.2
--- tickets.html 21 Jul 2011 23:29:44 -0000 1.20.2.1
+++ tickets.html 24 Aug 2011 21:00:59 -0000 1.20.2.2
@@ -133,11 +133,22 @@
my $ss_priority = FS::TicketSystem->selfservice_priority;
if ( $ss_priority ) {
+ my $dir = $conf->exists('ticket_system-priority_reverse') ? -1 : 1;
use sort 'stable';
- no warnings 'uninitialized';
+ # sort in the following way:
@tickets = sort {
- ($b->{'content'} eq $a->{'content'}) &&
- $b->{'_selfservice_priority'} <=> $a->{'_selfservice_priority'}
+ # 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;
}
More information about the freeside-commits
mailing list