X-Git-Url: http://git.freeside.biz/gitweb/?a=blobdiff_plain;f=FS%2FFS%2FUI%2FWeb.pm;h=cdd7826c1228be81ab5c0fbe584e8e5cc926f3be;hb=41eec783951d2378d7d6f5f6b6f4c6e3bf50647b;hp=6d6f7fbb6912f446de89f73d11e4365702e7a164;hpb=2c5bb9b8dfea90e8aac3937dfd28e3826e9c5f99;p=freeside.git
diff --git a/FS/FS/UI/Web.pm b/FS/FS/UI/Web.pm
index 6d6f7fbb6..cdd7826c1 100644
--- a/FS/FS/UI/Web.pm
+++ b/FS/FS/UI/Web.pm
@@ -410,7 +410,14 @@ sub cust_sort_fields {
cust_header(@_) if( @_ or !@cust_fields );
#inefficientish, but tiny lists and only run once per page
- map { $_ eq 'custnum' ? 'custnum' : '' } @cust_fields;
+ my @sort_fields;
+ foreach (@cust_fields) {
+ if ($_ eq "custnum") { push @sort_fields, 'custnum'; }
+ elsif ($_ eq "contact" || $_ eq "name") { push @sort_fields, '(last, first)'; }
+ elsif ($_ eq "company") { push @sort_fields, 'company'; }
+ else { push @sort_fields, ''; }
+ }
+ return @sort_fields;
}
@@ -469,9 +476,9 @@ sub cust_sql_fields {
=item join_cust_main [ TABLE[.CUSTNUM] ] [ LOCATION_TABLE[.LOCATIONNUM] ]
Returns an SQL join phrase for the FROM clause so that the fields listed
-in L will be available. Currently joins to cust_main
+in L will be available. Currently joins to cust_main
itself, as well as cust_location (under the aliases 'bill_location' and
-'ship_location') if address fields are needed. L should have
+'ship_location') if address fields are needed. L should have
been called already.
All of these will be left joins; if you want to exclude rows with no linked
@@ -739,7 +746,7 @@ use vars qw($DEBUG);
use Carp;
use Storable qw(nfreeze);
use MIME::Base64;
-use JSON::XS;
+use Cpanel::JSON::XS;
use FS::UID qw(getotaker);
use FS::Record qw(qsearchs);
use FS::queue;
@@ -893,4 +900,3 @@ sub job_status {
}
1;
-