X-Git-Url: http://git.freeside.biz/gitweb/?a=blobdiff_plain;f=httemplate%2Felements%2Ftr-select-cust_location.html;h=36ee7b6e5eb4025b067045c47ee0f070521fdbb7;hb=1b3abef9815111c52b1370ba5168a592ae9cfcb0;hp=4ed9cd48e781db3ac2a8d40f4dbd99d0d132272d;hpb=b286638fd4cb875178b0247a04b2706a44cadf6f;p=freeside.git diff --git a/httemplate/elements/tr-select-cust_location.html b/httemplate/elements/tr-select-cust_location.html index 4ed9cd48e..36ee7b6e5 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' ], +&> +<& /elements/location.html, + 'object' => $cust_location, + #'onchange' ? probably not + 'disabled' => $disabled, + 'no_asterisks' => 1, + 'no_bold' => $opt{'no_bold'}, + 'alt_format' => $opt{'alt_format'}, + 'enable_coords' => 1, + 'enable_censustract' => 1, +&> + +% unless ( $prospect_main ) { + +% } + <%init> my $conf = new FS::Conf; @@ -284,8 +270,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) }; @@ -300,7 +290,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;