[freeside-commits] freeside/httemplate/elements tr-select-cust_location.html, 1.14, 1.15 location.html, 1.15, 1.16

Ivan,,, ivan at wavetail.420.am
Sun Mar 13 11:56:05 PDT 2011


Update of /home/cvs/cvsroot/freeside/httemplate/elements
In directory wavetail.420.am:/tmp/cvs-serv3526/httemplate/elements

Modified Files:
	tr-select-cust_location.html location.html 
Log Message:
qualification address handling changes, RT#7111

Index: tr-select-cust_location.html
===================================================================
RCS file: /home/cvs/cvsroot/freeside/httemplate/elements/tr-select-cust_location.html,v
retrieving revision 1.14
retrieving revision 1.15
diff -u -w -d -r1.14 -r1.15
--- tr-select-cust_location.html	11 Mar 2011 00:45:53 -0000	1.14
+++ tr-select-cust_location.html	13 Mar 2011 18:56:02 -0000	1.15
@@ -23,28 +23,40 @@
 
 <SCRIPT TYPE="text/javascript">
 
-  function locationnum_changed(what) {
-    var locationnum = what.options[what.selectedIndex].value;
-    if ( locationnum == -2 ) {
+  function location_disable(what) {
 %         for (@location_fields, 'city_select') { 
             what.form.<%$_%>.disabled = true;
 	    var ftype = what.form.<%$_%>.tagName;
 	    if( ftype == 'SELECT') changeSelect(what.form.<%$_%>, '');
 	    else what.form.<%$_%>.value = '';
-            what.form.<%$_%>.style.backgroundColor = '#dddddd';
+      if( ftype != 'SELECT') what.form.<%$_%>.style.backgroundColor = '#dddddd';
 %         } 
-	return;
     }
     
-    if ( locationnum == -1 ) {
-
-%     for (@location_fields, 'city_select') { 
+  function location_enable(what) {
+%   for (grep { $_ ne 'location_number' } @location_fields, 'city_select') { 
         what.form.<%$_%>.disabled = false;
-        what.form.<%$_%>.style.backgroundColor = '#ffffff';
 	var ftype = what.form.<%$_%>.tagName;
+      if( ftype != 'SELECT') what.form.<%$_%>.style.backgroundColor = '#ffffff';
 	if( ftype == 'INPUT' ) what.form.<%$_%>.value = '';
 %     } 
 
+    if ( what.form.location_type.options[what.form.location_type.selectedIndex].value ) {
+      what.form.location_number.disabled = false;
+      what.form.location_number.style.backgroundColor = '#ffffff';
+    }
+    what.form.location_number.value = '';
+  }
+
+  function locationnum_changed(what) {
+    var locationnum = what.options[what.selectedIndex].value;
+    if ( locationnum == -2 ) {
+      location_disable(what);
+      return;
+    }
+    if ( locationnum == -1 ) {
+      location_enable(what);
+
       changeSelect(what.form.country, <% $countrydefault |js_string %>);
 
       country_changed( what.form.country,
@@ -52,8 +64,8 @@
                                           ''
                                         )
                      );
-
-    } else {
+      return;
+    }
 
       if ( locationnum == 0 ) {
 %       if ( $cust_main ) {
@@ -80,25 +92,18 @@
 %     }
 
 %#sleep/wait until dropdowns are updated?
-%         for (@location_fields, 'city_select') { 
-            what.form.<%$_%>.disabled = true;
-            what.form.<%$_%>.style.backgroundColor = '#dddddd';
-%         } 
+        location_disable(what);
 
 %     if ( $editable ) {
         } else {
 
 %#sleep/wait until dropdowns are updated?
-%         for (@location_fields, 'city_select') { 
-            what.form.<%$_%>.disabled = false;
-            what.form.<%$_%>.style.backgroundColor = '#ffffff';
-%         } 
+        location_enable(what);
 
         }
 %     }
 
     }
-  }
 
   function fix_state_factory (state, county) {
     function fix_state() {

Index: location.html
===================================================================
RCS file: /home/cvs/cvsroot/freeside/httemplate/elements/location.html,v
retrieving revision 1.15
retrieving revision 1.16
diff -u -w -d -r1.15 -r1.16
--- location.html	13 Mar 2011 04:04:17 -0000	1.15
+++ location.html	13 Mar 2011 18:56:02 -0000	1.16
@@ -20,7 +20,7 @@
 % if ( $opt{'alt_format'} ) {
 
 <TR>
-    <<%$th%> ALIGN="right">Location kind</<%$th%>>
+    <<%$th%> ALIGN="right">Location&nbsp;kind</<%$th%>>
     <TD>
     <% include('/elements/select.html',
                  'cgi'        => $cgi,
@@ -79,7 +79,7 @@
       >
 
 <TR>
-    <<%$th%> ALIGN="right">Unit type and #</<%$th%>>
+    <<%$th%> ALIGN="right">Unit&nbsp;type&nbsp;and&nbsp;#</<%$th%>>
     <TD COLSPAN=7>
 
 %     my $location_type = scalar($cgi->param('location_type'))
@@ -136,15 +136,9 @@
                <% $style %>
         >
 
-%   if ( $object->get($pre.'address2') ) {
-
-%     #XXX try to parse first
-%     if ( 0 ) {
-%     } else { #XXX i don't work so well when the dropdown is changed :/  i probably need to be triggered by "default service address"
-        Can't parse unit type and number from <B><% $object->get($pre.'address2') |h %></B>
-%    }
-
-% }
+%    #XXX i don't work so well when the dropdown is changed :/  i probably need to be triggered by "default service address"
+%    $alt_err =~ s/(ship_)?address2/'<B>'.encode_entities($object->get($1.'address2')).'<\/B>'/e;
+     <% $alt_err %>
 
     </TD>
 
@@ -219,6 +213,8 @@
   unless $object->get($pre.'state')
          || $object->get($pre.'country') ne $countrydefault;
 
+my $alt_err = ($opt{'alt_format'} && !$disabled) ? $object->alternize : '';
+
 my @style = ();
 push @style, 'background-color: #dddddd' if $disabled;
 



More information about the freeside-commits mailing list