[freeside-commits] freeside/FS/FS/ClientAPI MyAccount.pm, 1.133.2.2, 1.133.2.3
Mark Wells
mark at wavetail.420.am
Wed Aug 24 14:01:00 PDT 2011
Update of /home/cvs/cvsroot/freeside/FS/FS/ClientAPI
In directory wavetail.420.am:/tmp/cvs-serv1472/FS/FS/ClientAPI
Modified Files:
Tag: FREESIDE_2_3_BRANCH
MyAccount.pm
Log Message:
selfservice priority sort order, #14029
Index: MyAccount.pm
===================================================================
RCS file: /home/cvs/cvsroot/freeside/FS/FS/ClientAPI/MyAccount.pm,v
retrieving revision 1.133.2.2
retrieving revision 1.133.2.3
diff -u -w -d -r1.133.2.2 -r1.133.2.3
--- MyAccount.pm 2 Aug 2011 19:35:12 -0000 1.133.2.2
+++ MyAccount.pm 24 Aug 2011 21:00:58 -0000 1.133.2.3
@@ -339,7 +339,25 @@
$return{balance} = $cust_main->balance;
}
- $return{tickets} = [ ($cust_main->tickets) ];
+ my @tickets = $cust_main->tickets;
+ # unavoidable false laziness w/ httemplate/view/cust_main/tickets.html
+ if ( FS::TicketSystem->selfservice_priority ) {
+ my $dir = $conf->exists('ticket_system-priority_reverse') ? -1 : 1;
+ $return{tickets} = [
+ sort {
+ (
+ ($a->{'_selfservice_priority'} eq '') <=>
+ ($b->{'_selfservice_priority'} eq '')
+ ) ||
+ ( $dir *
+ ($b->{'_selfservice_priority'} <=> $a->{'_selfservice_priority'})
+ )
+ } @tickets
+ ];
+ }
+ else {
+ $return{tickets} = \@tickets;
+ }
unless ( $session->{'pkgnum'} ) {
my @open = map {
More information about the freeside-commits
mailing list