diff options
author | C.J. Adams-Collier <cjac@colliertech.org> | 2014-09-09 17:42:19 -0700 |
---|---|---|
committer | C.J. Adams-Collier <cjac@colliertech.org> | 2014-09-16 17:19:38 -0700 |
commit | 4dcbb6b380dfd036cc06e4d7002cbda17d29f23a (patch) | |
tree | e77dde771298906f37205bc0659d2dc4546bea0e /FS | |
parent | 3f56918a17a6f534513cbb1643630bc5b61e6034 (diff) |
altered FS::UI::Web::cust_sort_fields() and cust_sql_fields() so that ->param('cust_fields') argument is no longer required
when the parameter is not passed, the initial value previously passed to cust_header() is used
if @cust_fields is empty, cust_header() is called with no arguments
Diffstat (limited to 'FS')
-rw-r--r-- | FS/FS/UI/Web.pm | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/FS/FS/UI/Web.pm b/FS/FS/UI/Web.pm index fba4a4598..0aeaa5bea 100644 --- a/FS/FS/UI/Web.pm +++ b/FS/FS/UI/Web.pm @@ -325,7 +325,7 @@ sub cust_header { } sub cust_sort_fields { - cust_header(@_); + cust_header(@_) if( @_ or !@cust_fields ); #inefficientish, but tiny lists and only run once per page map { $_ eq 'custnum' ? 'custnum' : '' } @cust_fields; @@ -347,7 +347,7 @@ sub cust_sql_fields { my @fields = qw( last first company ); # push @fields, map "ship_$_", @fields; - cust_header(@_); + cust_header(@_) if( @_ or !@cust_fields ); #inefficientish, but tiny lists and only run once per page my @location_fields; @@ -487,6 +487,7 @@ element. sub cust_fields_subs { my $unlinked_warn = 0; + return map { my $f = $_; if ( $unlinked_warn++ ) { |