From dfc7fae37dd52e7184d2f4857ff37d13a42d4e71 Mon Sep 17 00:00:00 2001 From: Si Chen Date: Thu, 19 Oct 2006 01:06:40 +0000 Subject: [PATCH] Ability to change the billing and order shipping address within orderview. Handy macro to generate the options. Thanks to Ashish Vijaywargiya. git-svn-id: https://svn.apache.org/repos/asf/incubator/ofbiz/trunk@465435 13f79535-47bb-0310-9956-ffa450edef68 --- .../config/OrderErrorUiLabels.properties | 1 + .../org/ofbiz/order/order/OrderServices.xml | 44 +++++++++++++++++++ applications/order/servicedef/services.xml | 7 +++ .../WEB-INF/actions/order/orderview.bsh | 9 +++- .../webapp/ordermgr/WEB-INF/controller.xml | 8 ++++ .../ordermgr/order/ordercontactinfo.ftl | 25 +++++++++++ 6 files changed, 93 insertions(+), 1 deletion(-) diff --git a/applications/order/config/OrderErrorUiLabels.properties b/applications/order/config/OrderErrorUiLabels.properties index 48799d1b85..c2b35ca6f1 100644 --- a/applications/order/config/OrderErrorUiLabels.properties +++ b/applications/order/config/OrderErrorUiLabels.properties @@ -238,6 +238,7 @@ OrderSecurityErrorToRunUpdateQuoteItem=Security Error : to run updateQuoteItem y OrderSecurityErrorToRunUpdateReturnHeader=Security Error : to run updateReturnHeader you must have the ORDERMGR_UPDATE or ORDERMGR_ADMIN permission OrderSecurityErrorToRunUpdateOrderItemShipGroup=Security Error: to run updateOrderItemShipGroup you must have the ORDERMGR_UPDATE or ORDERMGR_ADMIN permission OrderSecurityErrorToRunCreateOrderContactMech=Security Error: to run createOrderContactMech you must have the ORDERMGR_CREATE or ORDERMGR_ADMIN permission +OrderSecurityErrorToRunUpdateOrderContactMech = Security Error: to run updateOrderContactMech you must have the ORDERMGR_UPDATE or ORDERMGR_ADMIN permission OrderSecurityErrorToRunRemoveOrderContactMech=Security Error: to run removeOrderContactMech you must have the ORDERMGR_DELETE or ORDERMGR_ADMIN permission OrderSendMailServiceFailed=SendMail service failed : OrderServiceExceptionSeeLogs=Service exception; see logs diff --git a/applications/order/script/org/ofbiz/order/order/OrderServices.xml b/applications/order/script/org/ofbiz/order/order/OrderServices.xml index 69d5b26a3e..8562f8cdb2 100644 --- a/applications/order/script/org/ofbiz/order/order/OrderServices.xml +++ b/applications/order/script/org/ofbiz/order/order/OrderServices.xml @@ -525,6 +525,50 @@ under the License. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/applications/order/servicedef/services.xml b/applications/order/servicedef/services.xml index 02f1e4db79..9f5a0a2a75 100644 --- a/applications/order/servicedef/services.xml +++ b/applications/order/servicedef/services.xml @@ -533,6 +533,13 @@ under the License. + + Update Order Contact Mech + + + + Remove Order Contact Mech diff --git a/applications/order/webapp/ordermgr/WEB-INF/actions/order/orderview.bsh b/applications/order/webapp/ordermgr/WEB-INF/actions/order/orderview.bsh index 8208ac855c..92db4f9afd 100644 --- a/applications/order/webapp/ordermgr/WEB-INF/actions/order/orderview.bsh +++ b/applications/order/webapp/ordermgr/WEB-INF/actions/order/orderview.bsh @@ -361,4 +361,11 @@ if (orderHeader != null) { if (displayParty != null) { List paymentMethodValueMaps = PaymentWorker.getPartyPaymentMethodValueMaps(delegator, assignPartyId, false); context.put("paymentMethodValueMaps", paymentMethodValueMaps); -} \ No newline at end of file +} + +if (orderHeader != null) { + // list to find all the POSTAL_ADDRESS for the party. + orderParty = delegator.findByPrimaryKey("Party", UtilMisc.toMap("partyId", partyId)); + postalContactMechList = ContactHelper.getContactMechByType(orderParty,"POSTAL_ADDRESS", false); + context.put("postalContactMechList",postalContactMechList); +} diff --git a/applications/order/webapp/ordermgr/WEB-INF/controller.xml b/applications/order/webapp/ordermgr/WEB-INF/controller.xml index 043b9b43fa..df2428eabd 100644 --- a/applications/order/webapp/ordermgr/WEB-INF/controller.xml +++ b/applications/order/webapp/ordermgr/WEB-INF/controller.xml @@ -633,6 +633,14 @@ + + + + + + + + diff --git a/applications/order/webapp/ordermgr/order/ordercontactinfo.ftl b/applications/order/webapp/ordermgr/order/ordercontactinfo.ftl index 4bac4057b5..de281092db 100644 --- a/applications/order/webapp/ordermgr/order/ordercontactinfo.ftl +++ b/applications/order/webapp/ordermgr/order/ordercontactinfo.ftl @@ -15,6 +15,22 @@ License for the specific language governing permissions and limitations under the License. --> +<#macro partyPostalAddress postalContactMechList contactMechPurposeTypeId contactPostalAddress> + + + <#if displayParty?has_content || orderContactMechValueMaps?has_content>
@@ -74,6 +90,15 @@ under the License.
+ <#if (!orderHeader.statusId.equals("ORDER_COMPLETED")) && !(orderHeader.statusId.equals("ORDER_REJECTED")) && !(orderHeader.statusId.equals("ORDER_CANCELLED"))> +
+ + + +
+
<@partyPostalAddress postalContactMechList = postalContactMechList?if_exists contactMechPurposeTypeId = contactMechPurpose.contactMechPurposeTypeId?if_exists contactPostalAddress=postalAddress?if_exists/>
+
+ <#elseif contactMech.contactMechTypeId == "TELECOM_NUMBER"> <#assign telecomNumber = orderContactMechValueMap.telecomNumber>