You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ofbiz.apache.org by jl...@apache.org on 2007/04/22 18:43:12 UTC

svn commit: r531223 - /ofbiz/trunk/applications/ecommerce/webapp/ecommerce/customer/newcustomer.ftl

Author: jleroux
Date: Sun Apr 22 09:43:11 2007
New Revision: 531223

URL: http://svn.apache.org/viewvc?view=rev&rev=531223
Log:
A refactored patch from Nicolas Malin "Internationalisation of newcustomer screen (eCommerce)" (https://issues.apache.org/jira/browse/OFBIZ-905).
Minor code modifications : 
. Added UMI to act as USA
. Created a js function whith Nicolas's code refactored 

Modified:
    ofbiz/trunk/applications/ecommerce/webapp/ecommerce/customer/newcustomer.ftl

Modified: ofbiz/trunk/applications/ecommerce/webapp/ecommerce/customer/newcustomer.ftl
URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/ecommerce/webapp/ecommerce/customer/newcustomer.ftl?view=diff&rev=531223&r1=531222&r2=531223
==============================================================================
--- ofbiz/trunk/applications/ecommerce/webapp/ecommerce/customer/newcustomer.ftl (original)
+++ ofbiz/trunk/applications/ecommerce/webapp/ecommerce/customer/newcustomer.ftl Sun Apr 22 09:43:11 2007
@@ -48,6 +48,15 @@
              // document.forms["newuserform"].elements["USERNAME"].disabled=false;
          }
      }
+     alert(document.getElementById("customerCountry").value);
+        if ( document.getElementById("customerCountry").value == "USA" 
+             || document.getElementById("customerCountry").value == "UMI" ) {
+            document.getElementById("customerState").style.display = "block";
+        }
+        else {
+            document.getElementById("customerState").style.display = "none";
+        } 
+     }     
 </script>
 </#if>
 
@@ -87,7 +96,18 @@
             <div class="form-label">${uiLabelMap.CommonTitle}</div>
             <div class="form-field">
                 <@fieldErrors fieldName="USER_TITLE"/>
-                <input type="text" class='inputBox' name="USER_TITLE" value="${requestParameters.USER_TITLE?if_exists}" size="10" maxlength="30"/>
+                <select name="USER_TITLE" class="selectBox">
+                  <#if requestParameters.USER_TITLE?has_content >
+                      <option>${requestParameters.USER_TITLE}</option>
+                      <option value="${requestParameters.USER_TITLE}"> -- </option>
+                  <#else>
+                      <option value="">${uiLabelMap.CommonSelectOne}</option>
+                  </#if>
+                      <option>${uiLabelMap.CommonTitleMr}</option>
+                      <option>${uiLabelMap.CommonTitleMrs}</option>
+                      <option>${uiLabelMap.CommonTitleMs}</option>
+                      <option>${uiLabelMap.CommonTitleDr}</option>
+                </select>                
             </div>
         </div>
         <div class="form-row">
@@ -140,17 +160,6 @@
             </div>
         </div>
         <div class="form-row">
-            <div class="form-label">${uiLabelMap.PartyState}</div>
-            <div class="form-field">
-                <@fieldErrors fieldName="CUSTOMER_STATE"/>
-                <select name="CUSTOMER_STATE" class='selectBox'>
-                    <#if requestParameters.CUSTOMER_STATE?exists><option value='${requestParameters.CUSTOMER_STATE}'>${selectedStateName?default(requestParameters.CUSTOMER_STATE)}</option></#if>
-                    <option value="">${uiLabelMap.PartyNoState}</option>
-                    ${screens.render("component://common/widget/CommonScreens.xml#states")}
-                </select> *
-            </div>
-        </div>
-        <div class="form-row">
             <div class="form-label">${uiLabelMap.PartyZipCode}</div>
             <div class="form-field">
                 <@fieldErrors fieldName="CUSTOMER_POSTAL_CODE"/>
@@ -161,17 +170,28 @@
             <div class="form-label">${uiLabelMap.PartyCountry}</div>
             <div class="form-field">
                 <@fieldErrors fieldName="CUSTOMER_COUNTRY"/>
-                <select name="CUSTOMER_COUNTRY" class='selectBox'>
+                <select name="CUSTOMER_COUNTRY" class='selectBox' onClick="javascript:hideShowUsaStates()" id="customerCountry">
                     <#if requestParameters.CUSTOMER_COUNTRY?exists><option value='${requestParameters.CUSTOMER_COUNTRY}'>${selectedCountryName?default(requestParameters.CUSTOMER_COUNTRY)}</option></#if>
                     ${screens.render("component://common/widget/CommonScreens.xml#countries")}
                 </select> *
             </div>
         </div>
+        <div class="form-row" id="customerState">
+            <div class="form-label">${uiLabelMap.PartyState}</div>
+            <div class="form-field">
+                <@fieldErrors fieldName="CUSTOMER_STATE"/>
+                <select name="CUSTOMER_STATE" class='selectBox'>
+                    <#if requestParameters.CUSTOMER_STATE?exists><option value='${requestParameters.CUSTOMER_STATE}'>${selectedStateName?default(requestParameters.CUSTOMER_STATE)}</option></#if>
+                    <option value="">${uiLabelMap.PartyNoState}</option>
+                    ${screens.render("component://common/widget/CommonScreens.xml#states")}
+                </select> *
+            </div>
+        </div>
         <div class="form-row">
             <div class="form-label">${uiLabelMap.PartyAllowAddressSolicitation}</div>
             <div class="form-field">
                 <select name="CUSTOMER_ADDRESS_ALLOW_SOL" class='selectBox'>
-                    <option>${requestParameters.CUSTOMER_ADDRESS_ALLOW_SOL?default("Y")}</option>
+                    <option>${requestParameters.CUSTOMER_ADDRESS_ALLOW_SOL?default("${uiLabelMap.CommonY}")}</option>
                     <option></option><option>${uiLabelMap.CommonY}</option><option>${uiLabelMap.CommonN}</option>
                 </select>
             </div>
@@ -201,7 +221,7 @@
                 &nbsp;ext&nbsp;<input type="text" class='inputBox' name="CUSTOMER_HOME_EXT" value="${requestParameters.CUSTOMER_HOME_EXT?if_exists}" size="6" maxlength="10">
                 <br/>
                 <select name="CUSTOMER_HOME_ALLOW_SOL" class='selectBox'>
-                    <option>${requestParameters.CUSTOMER_HOME_ALLOW_SOL?default("Y")}</option>
+                    <option>${requestParameters.CUSTOMER_HOME_ALLOW_SOL?default("${uiLabelMap.CommonY}")}</option>
                     <option></option><option>${uiLabelMap.CommonY}</option><option>${uiLabelMap.CommonN}</option>
                 </select>
             </div>
@@ -216,7 +236,7 @@
                 &nbsp;ext&nbsp;<input type="text" class='inputBox' name="CUSTOMER_WORK_EXT" value="${requestParameters.CUSTOMER_WORK_EXT?if_exists}" size="6" maxlength="10">
                 <br/>
                 <select name="CUSTOMER_WORK_ALLOW_SOL" class='selectBox'>
-                    <option>${requestParameters.CUSTOMER_WORK_ALLOW_SOL?default("Y")}</option>
+                    <option>${requestParameters.CUSTOMER_WORK_ALLOW_SOL?default("${uiLabelMap.CommonY}")}</option>
                     <option></option><option>${uiLabelMap.CommonY}</option><option>${uiLabelMap.CommonN}</option>
                 </select>
             </div>
@@ -230,7 +250,7 @@
                 -&nbsp;<input type="text" class='inputBox' name="CUSTOMER_FAX_CONTACT" value="${requestParameters.CUSTOMER_FAX_CONTACT?if_exists}" size="15" maxlength="15">
                 <br/>
                 <select name="CUSTOMER_FAX_ALLOW_SOL" class='selectBox'>
-                    <option>${requestParameters.CUSTOMER_FAX_ALLOW_SOL?default("Y")}</option>
+                    <option>${requestParameters.CUSTOMER_FAX_ALLOW_SOL?default("${uiLabelMap.CommonY}")}</option>
                     <option></option><option>${uiLabelMap.CommonY}</option><option>${uiLabelMap.CommonN}</option>
                 </select>
             </div>
@@ -244,7 +264,7 @@
                 -&nbsp;<input type="text" class='inputBox' name="CUSTOMER_MOBILE_CONTACT" value="${requestParameters.CUSTOMER_MOBILE_CONTACT?if_exists}" size="15" maxlength="15">
                 <br/>
                 <select name="CUSTOMER_MOBILE_ALLOW_SOL" class='selectBox'>
-                    <option>${requestParameters.CUSTOMER_MOBILE_ALLOW_SOL?default("Y")}</option>
+                    <option>${requestParameters.CUSTOMER_MOBILE_ALLOW_SOL?default("${uiLabelMap.CommonY}")}</option>
                     <option></option><option>${uiLabelMap.CommonY}</option><option>${uiLabelMap.CommonN}</option>
                 </select>
             </div>
@@ -265,7 +285,7 @@
                 <div><input type="text" class='inputBox' name="CUSTOMER_EMAIL" value="${requestParameters.CUSTOMER_EMAIL?if_exists}" size="40" maxlength="255" onchange="changeEmail()" onkeyup="changeEmail()"> *</div>
                 <div>
                     <select name="CUSTOMER_EMAIL_ALLOW_SOL" class='selectBox'>
-                        <option>${requestParameters.CUSTOMER_EMAIL_ALLOW_SOL?default("Y")}</option>
+                        <option>${requestParameters.CUSTOMER_EMAIL_ALLOW_SOL?default("${uiLabelMap.CommonY}")}</option>
                         <option></option><option>${uiLabelMap.CommonY}</option><option>${uiLabelMap.CommonN}</option>
                     </select>
                 </div>
@@ -339,3 +359,7 @@
 </div>
 
 <br/>
+
+<script language="JavaScript" type="text/javascript">
+    hideShowUsaStates();
+</script>