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 07:57:24 UTC
svn commit: r1324573 - in /ofbiz/trunk/applications/product:
webapp/facility/facility/EditContactMech.ftl
widget/facility/FacilityScreens.xml
Author: jleroux
Date: Wed Apr 11 05:57:23 2012
New Revision: 1324573
URL: http://svn.apache.org/viewvc?rev=1324573&view=rev
Log:
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/trunk/applications/product/webapp/facility/facility/EditContactMech.ftl
ofbiz/trunk/applications/product/widget/facility/FacilityScreens.xml
Modified: ofbiz/trunk/applications/product/webapp/facility/facility/EditContactMech.ftl
URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/product/webapp/facility/facility/EditContactMech.ftl?rev=1324573&r1=1324572&r2=1324573&view=diff
==============================================================================
--- ofbiz/trunk/applications/product/webapp/facility/facility/EditContactMech.ftl (original)
+++ ofbiz/trunk/applications/product/webapp/facility/facility/EditContactMech.ftl Wed Apr 11 05:57:23 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/trunk/applications/product/widget/facility/FacilityScreens.xml
URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/product/widget/facility/FacilityScreens.xml?rev=1324573&r1=1324572&r2=1324573&view=diff
==============================================================================
--- ofbiz/trunk/applications/product/widget/facility/FacilityScreens.xml (original)
+++ ofbiz/trunk/applications/product/widget/facility/FacilityScreens.xml Wed Apr 11 05:57:23 2012
@@ -834,6 +834,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"/>
@@ -852,7 +863,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>