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 2012/04/11 08:00:00 UTC

svn commit: r1324576 - in /ofbiz/branches/release11.04: ./ applications/product/webapp/facility/facility/EditContactMech.ftl applications/product/widget/facility/FacilityScreens.xml

Author: jleroux
Date: Wed Apr 11 05:59:59 2012
New Revision: 1324576

URL: http://svn.apache.org/viewvc?rev=1324576&view=rev
Log:
"Applied fix from trunk for revision: 1324573" 
------------------------------------------------------------------------
r1324573 | jleroux | 2012-04-11 07:57:23 +0200 (mer., 11 avr. 2012) | 3 lines

A patch from Tom Burns for "Facility Edit Contact Information use Dependent drop-downs" https://issues.apache.org/jira/browse/OFBIZ-4798

Now uses the dependent drop-down mechanism as it was recently done for Party Profile
------------------------------------------------------------------------


Modified:
    ofbiz/branches/release11.04/   (props changed)
    ofbiz/branches/release11.04/applications/product/webapp/facility/facility/EditContactMech.ftl
    ofbiz/branches/release11.04/applications/product/widget/facility/FacilityScreens.xml

Propchange: ofbiz/branches/release11.04/
------------------------------------------------------------------------------
  Merged /ofbiz/trunk:r1324573

Modified: ofbiz/branches/release11.04/applications/product/webapp/facility/facility/EditContactMech.ftl
URL: http://svn.apache.org/viewvc/ofbiz/branches/release11.04/applications/product/webapp/facility/facility/EditContactMech.ftl?rev=1324576&r1=1324575&r2=1324576&view=diff
==============================================================================
--- ofbiz/branches/release11.04/applications/product/webapp/facility/facility/EditContactMech.ftl (original)
+++ ofbiz/branches/release11.04/applications/product/webapp/facility/facility/EditContactMech.ftl Wed Apr 11 05:59:59 2012
@@ -57,7 +57,7 @@ under the License.
         <div><span class="label">(${uiLabelMap.PartyMsgContactHavePurpose}</span>"${contactMechPurposeType.get("description",locale)?if_exists}")</div>
       </#if>
       <table width="90%" class="basic-table" cellspacing="0">
-        <form method="post" action='<@o...@ofbizUrl>' name="editcontactmechform">
+        <form method="post" action='<@o...@ofbizUrl>' name="editcontactmechform" id="editcontactmechform">
         <input type='hidden' name='DONE_PAGE' value='${donePage}' />
         <input type='hidden' name='contactMechTypeId' value='${mechMap.contactMechTypeId}' />
         <input type='hidden' name='facilityId' value='${facilityId}' />
@@ -136,7 +136,7 @@ under the License.
           </td>
         </tr>
         </#if>
-        <form method="post" action='<@o...@ofbizUrl>' name="editcontactmechform">
+        <form method="post" action='<@o...@ofbizUrl>' name="editcontactmechform" id="editcontactmechform">
         <input type="hidden" name="contactMechId" value='${contactMechId}' />
         <input type="hidden" name="contactMechTypeId" value='${mechMap.contactMechTypeId}' />
         <input type="hidden" name='facilityId' value='${facilityId}' />
@@ -176,12 +176,9 @@ under the License.
     <tr>
       <td class="label">${uiLabelMap.PartyState}</td>
       <td>
-        <select name="stateProvinceGeoId" class="required">
-          <option>${(mechMap.postalAddress.stateProvinceGeoId)?if_exists}</option>
-          <option></option>
-           ${screens.render("component://common/widget/CommonScreens.xml#states")}
+        <select name="stateProvinceGeoId" id="editcontactmechform_stateProvinceGeoId">
         </select>
-      *</td>
+      </td>
     </tr>
     <tr>
       <td class="label">${uiLabelMap.PartyZipCode}</td>
@@ -189,15 +186,22 @@ under the License.
         <input type="text" class="required" size="12" maxlength="10" name="postalCode" value="${(mechMap.postalAddress.postalCode)?default(request.getParameter('postalCode')?if_exists)}" />
       *</td>
     </tr>
-    <tr>
-      <td class="label">${uiLabelMap.PartyCountry}</td>
-      <td>
-        <select name="countryGeoId" class="required">
-          <option>${(mechMap.postalAddress.countryGeoId)?if_exists}</option>
-          <option></option>
-          ${screens.render("component://common/widget/CommonScreens.xml#countries")}
+    <tr>   
+      <td class="label">${uiLabelMap.CommonCountry}</td>      
+      <td>     
+        <select name="countryGeoId" id="editcontactmechform_countryGeoId">
+          ${screens.render("component://common/widget/CommonScreens.xml#countries")}        
+          <#if (mechMap.postalAddress?exists) && (mechMap.postalAddress.countryGeoId?exists)>
+            <#assign defaultCountryGeoId = mechMap.postalAddress.countryGeoId>
+          <#else>
+           <#assign defaultCountryGeoId = Static["org.ofbiz.base.util.UtilProperties"].getPropertyValue("general.properties", "country.geo.id.default")>
+          </#if>
+          <option selected="selected" value="${defaultCountryGeoId}">
+            <#assign countryGeo = delegator.findByPrimaryKey("Geo",Static["org.ofbiz.base.util.UtilMisc"].toMap("geoId",defaultCountryGeoId))>
+            ${countryGeo.get("geoName",locale)}
+          </option>
         </select>
-      *</td>
+      </td>
     </tr>
   <#elseif "TELECOM_NUMBER" = mechMap.contactMechTypeId?if_exists>
     <tr>

Modified: ofbiz/branches/release11.04/applications/product/widget/facility/FacilityScreens.xml
URL: http://svn.apache.org/viewvc/ofbiz/branches/release11.04/applications/product/widget/facility/FacilityScreens.xml?rev=1324576&r1=1324575&r2=1324576&view=diff
==============================================================================
--- ofbiz/branches/release11.04/applications/product/widget/facility/FacilityScreens.xml (original)
+++ ofbiz/branches/release11.04/applications/product/widget/facility/FacilityScreens.xml Wed Apr 11 05:59:59 2012
@@ -828,6 +828,17 @@ under the License.
             <actions>
                 <set field="tabButtonItem" value="ViewContactMechs"/>
                 <script location="component://product/webapp/facility/WEB-INF/actions/facility/EditContactMech.groovy"/>
+                
+                <set field="dependentForm" value="editcontactmechform"/>
+                <set field="paramKey" value="countryGeoId"/>
+                <set field="mainId" value="countryGeoId"/>
+                <set field="dependentId" value="stateProvinceGeoId"/>
+                <set field="requestName" value="getAssociatedStateList"/>
+                <set field="responseName" value="stateList"/>
+                <set field="dependentKeyName" value="geoId"/>
+                <set field="descName" value="geoName"/>
+                <set field="selectedDependentOption" from-field="mechMap.postalAddress.stateProvinceGeoId" default-value="_none_"/> 
+                               
                 <set field="facilityId" from-field="parameters.facilityId"/>
                 <entity-one entity-name="Facility" value-field="facility"/>
                 <property-map resource="ProductUiLabels" map-name="uiLabelMap"/>
@@ -846,7 +857,10 @@ under the License.
                 <decorator-screen name="CommonFacilityDecorator" location="${parameters.commonFacilityDecoratorLocation}">
                     <decorator-section name="body">
                         <platform-specific>
-                            <html><html-template location="component://product/webapp/facility/facility/EditContactMech.ftl"/></html>
+                            <html>
+                                <html-template location="component://common/webcommon/includes/setDependentDropdownValuesJs.ftl"/>
+                                <html-template location="component://product/webapp/facility/facility/EditContactMech.ftl"/>
+                            </html>
                         </platform-specific>
                     </decorator-section>
                 </decorator-screen>