X-Git-Url: http://git.freeside.biz/gitweb/?p=freeside.git;a=blobdiff_plain;f=httemplate%2Felements%2Ftr-select-cust_location.html;h=1e6cf5b7f9a2593745de7a72158c672bb3f80aa9;hp=abaaa5b42dbeb306ca2812a2f0db2d169eca1751;hb=569f676f4a06512a46120e12edc6a6410e93ff93;hpb=4b2a48f5247303f07a00b42eb3091145be1150e2 diff --git a/httemplate/elements/tr-select-cust_location.html b/httemplate/elements/tr-select-cust_location.html index abaaa5b42..1e6cf5b7f 100644 --- a/httemplate/elements/tr-select-cust_location.html +++ b/httemplate/elements/tr-select-cust_location.html @@ -2,24 +2,23 @@ Example: - include('/elements/tr-select-cust_location.html', - 'cgi' => $cgi, + <& /elements/tr-select-cust_location.html, + 'cgi' => $cgi, - 'cust_main' => $cust_main, - #or - 'prospect_main' => $prospect_main, + 'cust_main' => $cust_main, + #or + 'prospect_main' => $prospect_main, - #optional - 'empty_label' => '(default service address)', - ) + #optional + 'empty_label' => '(default service address)', + &> -<% include('/elements/xmlhttp.html', - 'url' => $p.'misc/location.cgi', - 'subs' => [ 'get_location' ], - ) -%> +<& /elements/xmlhttp.html, + 'url' => $p.'misc/location.cgi', + 'subs' => [ 'get_location' ], +&> + <%init> my $conf = new FS::Conf; @@ -287,8 +280,12 @@ if ( $locationnum && $locationnum > 0 ) { $cust_location->coord_auto('Y'); my $location_sort = sub { + #enabled w/label_prefix _location # $a->locationname cmp $b->locationname + # or $a->country cmp $b->country + or lc($a->state) cmp lc($b->state) or lc($a->city) cmp lc($b->city) + or lc($a->county) cmp lc($b->county) or lc($a->address1) cmp lc($b->address1) or lc($a->address2) cmp lc($b->address2) }; @@ -303,7 +300,7 @@ push @cust_location, $cust_location @cust_location = sort $location_sort grep !$_->disabled, @cust_location; $cust_location = $cust_location[0] - if ( $prospect_main ) + if $prospect_main && !$opt{'is_optional'} && @cust_location;