Author: ashish
Date: Tue Dec 28 06:55:06 2010
New Revision: 1053271

URL: http://svn.apache.org/viewvc?rev=1053271&view=rev
Log:
Applied patch from jira issue - OFBIZ-4078 - Provide the option on orderview 
screen so that CSR could change customer phone and email address.

Thanks Amit for the contribution. 

Modified:
    
ofbiz/trunk/applications/order/webapp/ordermgr/WEB-INF/actions/order/OrderView.groovy
    ofbiz/trunk/applications/order/webapp/ordermgr/order/ordercontactinfo.ftl

Modified: 
ofbiz/trunk/applications/order/webapp/ordermgr/WEB-INF/actions/order/OrderView.groovy
URL: 
http://svn.apache.org/viewvc/ofbiz/trunk/applications/order/webapp/ordermgr/WEB-INF/actions/order/OrderView.groovy?rev=1053271&r1=1053270&r2=1053271&view=diff
==============================================================================
--- 
ofbiz/trunk/applications/order/webapp/ordermgr/WEB-INF/actions/order/OrderView.groovy
 (original)
+++ 
ofbiz/trunk/applications/order/webapp/ordermgr/WEB-INF/actions/order/OrderView.groovy
 Tue Dec 28 06:55:06 2010
@@ -430,6 +430,14 @@ if (orderHeader) {
    orderParty = delegator.findByPrimaryKey("Party", [partyId : partyId]);
    postalContactMechList = 
ContactHelper.getContactMechByType(orderParty,"POSTAL_ADDRESS", false);
    context.postalContactMechList = postalContactMechList;
+
+   // list to find all the TELECOM_NUMBER for the party.
+   telecomContactMechList = 
ContactHelper.getContactMechByType(orderParty,"TELECOM_NUMBER", false);
+   context.telecomContactMechList = telecomContactMechList;
+
+   // list to find all the EMAIL_ADDRESS for the party.
+   emailContactMechList = 
ContactHelper.getContactMechByType(orderParty,"EMAIL_ADDRESS", false);
+   context.emailContactMechList = emailContactMechList;
 }
 
 if (orderItems) {

Modified: 
ofbiz/trunk/applications/order/webapp/ordermgr/order/ordercontactinfo.ftl
URL: 
http://svn.apache.org/viewvc/ofbiz/trunk/applications/order/webapp/ordermgr/order/ordercontactinfo.ftl?rev=1053271&r1=1053270&r2=1053271&view=diff
==============================================================================
--- ofbiz/trunk/applications/order/webapp/ordermgr/order/ordercontactinfo.ftl 
(original)
+++ ofbiz/trunk/applications/order/webapp/ordermgr/order/ordercontactinfo.ftl 
Tue Dec 28 06:55:06 2010
@@ -17,20 +17,53 @@ specific language governing permissions 
 under the License.
 -->
 
-<#macro partyPostalAddress postalContactMechList contactMechPurposeTypeId 
contactPostalAddress>
-   <select name="contactMechId">
-      <option 
value="${contactPostalAddress.contactMechId}">${(contactPostalAddress.address1)?default("")}
 - ${contactPostalAddress.city?default("")}</option>
-      <option value="${contactPostalAddress.contactMechId}"></option>
-      <#list postalContactMechList as postalContactMech>
-         <#assign postalAddress = 
postalContactMech.getRelatedOne("PostalAddress")?if_exists>
-         <#assign partyContactPurposes = 
postalAddress.getRelated("PartyContactMechPurpose")?if_exists>
-         <#list partyContactPurposes as partyContactPurpose>
-         <#if postalContactMech.contactMechId?has_content && 
partyContactPurpose.contactMechPurposeTypeId == contactMechPurposeTypeId>
-            <option 
value="${postalContactMech.contactMechId?if_exists}">${(postalAddress.address1)?default("")}
 - ${postalAddress.city?default("")}</option>
-         </#if>
-         </#list>
-      </#list>
-   </select>
+<#macro updateOrderContactMech orderHeader contactMechTypeId contactMechList 
contactMechPurposeTypeId contactMechAddress>
+  <#if (!orderHeader.statusId.equals("ORDER_COMPLETED")) && 
!(orderHeader.statusId.equals("ORDER_REJECTED")) && 
!(orderHeader.statusId.equals("ORDER_CANCELLED"))>
+    <form name="updateOrderContactMech" method="post" 
action="<@ofbizUrl>updateOrderContactMech</@ofbizUrl>">
+      <input type="hidden" name="orderId" value="${orderId?if_exists}" />
+      <input type="hidden" name="contactMechPurposeTypeId" 
value="${contactMechPurpose.contactMechPurposeTypeId?if_exists}" />
+      <input type="hidden" name="oldContactMechId" 
value="${contactMech.contactMechId?if_exists}" />
+      <select name="contactMechId">
+        <#if contactMech.contactMechTypeId == "POSTAL_ADDRESS">
+          <option 
value="${contactMechAddress.contactMechId}">${(contactMechAddress.address1)?default("")}
 - ${contactMechAddress.city?default("")}</option>
+          <option value="${contactMechAddress.contactMechId}"></option>
+          <#list contactMechList as contactMech>
+            <#assign postalAddress = 
contactMech.getRelatedOne("PostalAddress")?if_exists />
+            <#assign partyContactPurposes = 
postalAddress.getRelated("PartyContactMechPurpose")?if_exists />
+            <#list partyContactPurposes as partyContactPurpose>
+              <#if contactMech.contactMechId?has_content && 
partyContactPurpose.contactMechPurposeTypeId == contactMechPurposeTypeId>
+                <option 
value="${contactMech.contactMechId?if_exists}">${(postalAddress.address1)?default("")}
 - ${postalAddress.city?default("")}</option>
+              </#if>
+            </#list>
+          </#list>
+        <#elseif contactMech.contactMechTypeId == "TELECOM_NUMBER">
+          <option 
value="${contactMechAddress.contactMechId}">${contactMechAddress.countryCode?if_exists}
 <#if 
contactMechAddress.areaCode?exists>${contactMechAddress.areaCode}-</#if>${contactMechAddress.contactNumber}</option>
+          <option value="${contactMechAddress.contactMechId}"></option>
+          <#list contactMechList as contactMech>
+             <#assign telecomNumber = 
contactMech.getRelatedOne("TelecomNumber")?if_exists />
+             <#assign partyContactPurposes = 
telecomNumber.getRelated("PartyContactMechPurpose")?if_exists />
+             <#list partyContactPurposes as partyContactPurpose>
+               <#if contactMech.contactMechId?has_content && 
partyContactPurpose.contactMechPurposeTypeId == contactMechPurposeTypeId>
+                  <option 
value="${contactMech.contactMechId?if_exists}">${telecomNumber.countryCode?if_exists}
 <#if 
telecomNumber.areaCode?exists>${telecomNumber.areaCode}-</#if>${telecomNumber.contactNumber}</option>
+               </#if>
+             </#list>
+          </#list>
+        <#elseif contactMech.contactMechTypeId == "EMAIL_ADDRESS">
+          <option 
value="${contactMechAddress.contactMechId}">${(contactMechAddress.infoString)?default("")}</option>
+          <option value="${contactMechAddress.contactMechId}"></option>
+          <#list contactMechList as contactMech>
+             <#assign partyContactPurposes = 
contactMech.getRelated("PartyContactMechPurpose")?if_exists />
+             <#list partyContactPurposes as partyContactPurpose>
+               <#if contactMech.contactMechId?has_content && 
partyContactPurpose.contactMechPurposeTypeId == contactMechPurposeTypeId>
+                  <option 
value="${contactMech.contactMechId?if_exists}">${contactMech.infoString?if_exists}</option>
+               </#if>
+             </#list>
+          </#list>
+        </#if>
+      </select>
+      <input type="submit" value="${uiLabelMap.CommonUpdate}" 
class="smallSubmit" />
+    </form>
+  </#if>
 </#macro>
 
 <#if displayParty?has_content || orderContactMechValueMaps?has_content>
@@ -101,15 +134,7 @@ under the License.
                       </#if>
                     </#if>
                   </div>
-                  <#if (!orderHeader.statusId.equals("ORDER_COMPLETED")) && 
!(orderHeader.statusId.equals("ORDER_REJECTED")) && 
!(orderHeader.statusId.equals("ORDER_CANCELLED"))>
-                  <form name="updateOrderContactMech" method="post" 
action="<@ofbizUrl>updateOrderContactMech</@ofbizUrl>">
-                     <input type="hidden" name="orderId" 
value="${orderId?if_exists}"/>
-                     <input type="hidden" name="contactMechPurposeTypeId" 
value="${contactMechPurpose.contactMechPurposeTypeId?if_exists}"/>
-                     <input type="hidden" name="oldContactMechId" 
value="${contactMech.contactMechId?if_exists}"/>
-                     <hr />
-                     <div><@partyPostalAddress postalContactMechList = 
postalContactMechList?if_exists contactMechPurposeTypeId = 
contactMechPurpose.contactMechPurposeTypeId?if_exists 
contactPostalAddress=postalAddress?if_exists/><input type="submit" 
value="${uiLabelMap.CommonUpdate}" class="smallSubmit"/></div>
-                  </form>
-                  </#if>
+                  <@updateOrderContactMech orderHeader=orderHeader?if_exists 
contactMechTypeId=contactMech.contactMechTypeId 
contactMechList=postalContactMechList?if_exists 
contactMechPurposeTypeId=contactMechPurpose.contactMechPurposeTypeId?if_exists 
contactMechAddress=postalAddress?if_exists />
                 </#if>
               <#elseif contactMech.contactMechTypeId == "TELECOM_NUMBER">
                 <#assign telecomNumber = 
orderContactMechValueMap.telecomNumber>
@@ -122,6 +147,7 @@ under the License.
                    <a target="_blank" 
href="${uiLabelMap.CommonLookupWhitepagesTelNumberLink}" 
class="buttontext">${uiLabelMap.CommonLookupWhitepages}</a>
                   </#if>
                 </div>
+                <@updateOrderContactMech orderHeader=orderHeader?if_exists 
contactMechTypeId=contactMech.contactMechTypeId 
contactMechList=telecomContactMechList?if_exists 
contactMechPurposeTypeId=contactMechPurpose.contactMechPurposeTypeId?if_exists 
contactMechAddress=telecomNumber?if_exists />
               <#elseif contactMech.contactMechTypeId == "EMAIL_ADDRESS">
                 <div>
                   ${contactMech.infoString}
@@ -131,6 +157,7 @@ under the License.
                      <a href="mailto:${contactMech.infoString}"; 
class="buttontext">(${uiLabelMap.OrderSendEmail})</a>
                   </#if>
                 </div>
+                <@updateOrderContactMech orderHeader=orderHeader?if_exists 
contactMechTypeId=contactMech.contactMechTypeId 
contactMechList=emailContactMechList?if_exists 
contactMechPurposeTypeId=contactMechPurpose.contactMechPurposeTypeId?if_exists 
contactMechAddress=contactMech?if_exists />
               <#elseif contactMech.contactMechTypeId == "WEB_ADDRESS">
                 <div>
                   ${contactMech.infoString}


Reply via email to