svn commit: r1858479 - in /ofbiz/ofbiz-plugins/trunk/ecommerce: groovyScripts/order/CustSettings.groovy template/customer/EditPerson.ftl template/customer/ViewProfile.ftl

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

svn commit: r1858479 - in /ofbiz/ofbiz-plugins/trunk/ecommerce: groovyScripts/order/CustSettings.groovy template/customer/EditPerson.ftl template/customer/ViewProfile.ftl

surajk
Author: surajk
Date: Wed May  1 12:18:50 2019
New Revision: 1858479

URL: http://svn.apache.org/viewvc?rev=1858479&view=rev
Log:
Improved: Updated code occurences of marital status in e-commerce as per recent changes done for it in trunk.
(OFBIZ-10921)

Modified:
    ofbiz/ofbiz-plugins/trunk/ecommerce/groovyScripts/order/CustSettings.groovy
    ofbiz/ofbiz-plugins/trunk/ecommerce/template/customer/EditPerson.ftl
    ofbiz/ofbiz-plugins/trunk/ecommerce/template/customer/ViewProfile.ftl

Modified: ofbiz/ofbiz-plugins/trunk/ecommerce/groovyScripts/order/CustSettings.groovy
URL: http://svn.apache.org/viewvc/ofbiz/ofbiz-plugins/trunk/ecommerce/groovyScripts/order/CustSettings.groovy?rev=1858479&r1=1858478&r2=1858479&view=diff
==============================================================================
--- ofbiz/ofbiz-plugins/trunk/ecommerce/groovyScripts/order/CustSettings.groovy (original)
+++ ofbiz/ofbiz-plugins/trunk/ecommerce/groovyScripts/order/CustSettings.groovy Wed May  1 12:18:50 2019
@@ -47,7 +47,7 @@ if (partyId) {
 
             //Parameters not in use, Do we really need these here or should be removed.
             parameters.residenceStatusEnumId = person.residenceStatusEnumId
-            parameters.maritalStatus = person.maritalStatus
+            parameters.maritalStatusEnumId = person.maritalStatusEnumId
             parameters.employmentStatusEnumId = person.employmentStatusEnumId
             parameters.occupation = person.occupation
             parameters.yearsWithEmployer = person.yearsWithEmployer

Modified: ofbiz/ofbiz-plugins/trunk/ecommerce/template/customer/EditPerson.ftl
URL: http://svn.apache.org/viewvc/ofbiz/ofbiz-plugins/trunk/ecommerce/template/customer/EditPerson.ftl?rev=1858479&r1=1858478&r2=1858479&view=diff
==============================================================================
--- ofbiz/ofbiz-plugins/trunk/ecommerce/template/customer/EditPerson.ftl (original)
+++ ofbiz/ofbiz-plugins/trunk/ecommerce/template/customer/EditPerson.ftl Wed May  1 12:18:50 2019
@@ -80,20 +80,11 @@ under the License.
           </div>
           <div class="col-sm-6">
             <label>${uiLabelMap.PartyMaritalStatus}</label>
-            <select name="maritalStatus" class="form-control custom-select">
-            <#if personData.maritalStatus?has_content>
-              <option value="${personData.maritalStatus}">
-                <#if "S" == personData.maritalStatus>${uiLabelMap.PartySingle}</#if>
-                 <#if "M" == personData.maritalStatus>${uiLabelMap.PartyMarried}</#if>
-                 <#if "D" == personData.maritalStatus>${uiLabelMap.PartyDivorced}</#if>
-              </option>
-              <option value="${personData.maritalStatus}"> --</option>
-            <#else>
-              <option></option>
-            </#if>
-              <option value="S">${uiLabelMap.PartySingle}</option>
-              <option value="M">${uiLabelMap.PartyMarried}</option>
-              <option value="D">${uiLabelMap.PartyDivorced}</option>
+            <#assign maritalStatusEnums = EntityQuery.use(delegator).from("Enumeration").where("enumTypeId", "MARITAL_STATUS").cache(true).orderBy("sequenceId").queryList()!>
+            <select name="maritalStatusEnumId" class="form-control custom-select">
+              <#list maritalStatusEnums as maritalStatus>
+                <option <#if maritalStatus.enumId == personData.maritalStatusEnumId!>selected="selected"</#if> value="${maritalStatus.enumId!}">${maritalStatus.description!}</option>
+              </#list>
             </select>
           </div>
         </div>

Modified: ofbiz/ofbiz-plugins/trunk/ecommerce/template/customer/ViewProfile.ftl
URL: http://svn.apache.org/viewvc/ofbiz/ofbiz-plugins/trunk/ecommerce/template/customer/ViewProfile.ftl?rev=1858479&r1=1858478&r2=1858479&view=diff
==============================================================================
--- ofbiz/ofbiz-plugins/trunk/ecommerce/template/customer/ViewProfile.ftl (original)
+++ ofbiz/ofbiz-plugins/trunk/ecommerce/template/customer/ViewProfile.ftl Wed May  1 12:18:50 2019
@@ -89,9 +89,10 @@ under the License.
         <dt class="col-lg-2">${uiLabelMap.PartyWeight}</dt>
         <dd class="col-lg-10">${person.weight}</dd>
       </#if>
-      <#if person.maritalStatus?has_content>
+      <#if person.maritalStatusEnumId?has_content>
+        <#assign maritalStatus = EntityQuery.use(delegator).from("Enumeration").where("enumId", person.maritalStatusEnumId!).cache(true).queryOne()!>
         <dt class="col-lg-2">${uiLabelMap.PartyMaritalStatus}</dt>
-        <dd class="col-lg-10">${person.maritalStatus}</dd>
+        <dd class="col-lg-10">${maritalStatus.description!person.maritalStatusEnumId}</dd>
       </#if>
     </dl>
     </div>