X-Git-Url: http://git.freeside.biz/gitweb/?a=blobdiff_plain;f=httemplate%2Felements%2Ftr-select-cust_location.html;h=7ffbd6c14a53720f2b806616379d94a577593a91;hb=468c9e660eb0edb2033f0f8dbb4458f20280082c;hp=b882c3d461892b673aff43f5413503faf08e73b7;hpb=25b48e1acbf6ad7ebd3e85b479ee6cd3a8ccd098;p=freeside.git
diff --git a/httemplate/elements/tr-select-cust_location.html b/httemplate/elements/tr-select-cust_location.html
index b882c3d46..7ffbd6c14 100644
--- a/httemplate/elements/tr-select-cust_location.html
+++ b/httemplate/elements/tr-select-cust_location.html
@@ -11,7 +11,6 @@ Example:
#optional
'empty_label' => '(default service address)',
- 'disable_empty' => 0, #1 to disable
)
%doc>
@@ -52,11 +51,13 @@ Example:
var ftype = what.form.<%$_%>.tagName;
if( ftype != 'SELECT') what.form.<%$_%>.style.backgroundColor = '#ffffff';
% }
-
- if ( what.form.location_type.options[what.form.location_type.selectedIndex].value ) {
+% if ( $opt{'alt_format'} ) {
+ if ( what.form.location_type &&
+ what.form.location_type.options[what.form.location_type.selectedIndex].value ) {
what.form.location_number.disabled = false;
what.form.location_number.style.backgroundColor = '#ffffff';
- }
+ }
+% }
}
function locationnum_changed(what) {
@@ -101,25 +102,8 @@ Example:
return;
}
- if ( locationnum == 0 ) { //(default service address)
-% if ( $cust_main ) {
- what.form.address1.value = <% $cust_main->get($prefix.'address1') |js_string %>;
- what.form.address2.value = <% $cust_main->get($prefix.'address2') |js_string %>;
- what.form.city.value = <% $cust_main->get($prefix.'city') |js_string %>;
- what.form.zip.value = <% $cust_main->get($prefix.'zip') |js_string %>;
-
- changeSelect(what.form.country, <% $cust_main->get($prefix.'country') | js_string %> );
-
- country_changed( what.form.country,
- fix_state_factory( <% $cust_main->get($prefix.'state') | js_string %>,
- <% $cust_main->get($prefix.'county') | js_string %>
- )
- );
-% }
-
- } else {
- get_location( locationnum, update_location );
- }
+%# default service address is now just another location
+ get_location( locationnum, update_location );
% if ( $editable ) {
if ( locationnum == 0 ) {
@@ -197,17 +181,22 @@ Example:
- <<%$th%> ALIGN="right"><% $opt{'label'} || 'Service location' %><%$th%>>
+ <<%$th%> ALIGN="right"><% $opt{'label'} || emt('Service location') %><%$th%>>
- |