Author: hansbak
Date: Tue Apr 28 07:56:32 2009 New Revision: 769277 URL: http://svn.apache.org/viewvc?rev=769277&view=rev Log: Applied fix from trunk for revision: 769274 Modified: ofbiz/branches/release09.04/applications/order/script/org/ofbiz/order/request/CustRequestServices.xml ofbiz/branches/release09.04/applications/order/servicedef/secas.xml ofbiz/branches/release09.04/applications/order/servicedef/services_request.xml ofbiz/branches/release09.04/applications/order/widget/ordermgr/RequestScreens.xml ofbiz/branches/release09.04/framework/common/script/org/ofbiz/common/email/EmailServices.xml ofbiz/branches/release09.04/framework/common/servicedef/services_email.xml ofbiz/branches/release09.04/framework/service/src/org/ofbiz/service/eca/ServiceEcaSetField.java Modified: ofbiz/branches/release09.04/applications/order/script/org/ofbiz/order/request/CustRequestServices.xml URL: http://svn.apache.org/viewvc/ofbiz/branches/release09.04/applications/order/script/org/ofbiz/order/request/CustRequestServices.xml?rev=769277&r1=769276&r2=769277&view=diff ============================================================================== --- ofbiz/branches/release09.04/applications/order/script/org/ofbiz/order/request/CustRequestServices.xml (original) +++ ofbiz/branches/release09.04/applications/order/script/org/ofbiz/order/request/CustRequestServices.xml Tue Apr 28 07:56:32 2009 @@ -363,6 +363,7 @@ <if-not-empty field="custRequest"> <field-to-result field="custRequest.statusId" result-name="oldStatusId"/> <field-to-result field="custRequest.custRequestId" result-name="custRequestId"/> + <field-to-result field="custRequest.fromPartyId" result-name="fromPartyId"/><!-- for notification --> <if-compare-field field="custRequest.statusId" to-field="parameters.statusId" operator="not-equals"> <entity-one entity-name="StatusValidChange" value-field="statusChange"> <field-map field-name="statusId" from-field="custRequest.statusId"/> Modified: ofbiz/branches/release09.04/applications/order/servicedef/secas.xml URL: http://svn.apache.org/viewvc/ofbiz/branches/release09.04/applications/order/servicedef/secas.xml?rev=769277&r1=769276&r2=769277&view=diff ============================================================================== --- ofbiz/branches/release09.04/applications/order/servicedef/secas.xml (original) +++ ofbiz/branches/release09.04/applications/order/servicedef/secas.xml Tue Apr 28 07:56:32 2009 @@ -327,13 +327,15 @@ <condition field-name="oldStatusId" operator="not-equals" value="CRQ_ACCEPTED"/> <condition field-name="statusId" operator="equals" value="CRQ_ACCEPTED"/> <set field-name="bodyParameters.custRequestId" env-name="custRequestId"/> + <set field-name="partyIdTo" env-name="fromPartyId"/> <set field-name="emailTemplateSettingId" value="CUST_REQ_ACCEPTED"/> - <action service="sendMailFromTemplateSetting" mode="sync"/> + <action service="sendMailFromTemplateSetting" mode="sync" /> </eca> <eca service="setCustRequestStatus" event="commit"> <condition field-name="oldStatusId" operator="not-equals" value="CRQ_COMPLETED"/> <condition field-name="statusId" operator="equals" value="CRQ_COMPLETED"/> <set field-name="bodyParameters.custRequestId" env-name="custRequestId"/> + <set field-name="partyIdTo" env-name="fromPartyId"/> <set field-name="emailTemplateSettingId" value="CUST_REQ_COMPLETED"/> <action service="sendMailFromTemplateSetting" mode="sync"/> </eca> Modified: ofbiz/branches/release09.04/applications/order/servicedef/services_request.xml URL: http://svn.apache.org/viewvc/ofbiz/branches/release09.04/applications/order/servicedef/services_request.xml?rev=769277&r1=769276&r2=769277&view=diff ============================================================================== --- ofbiz/branches/release09.04/applications/order/servicedef/services_request.xml (original) +++ ofbiz/branches/release09.04/applications/order/servicedef/services_request.xml Tue Apr 28 07:56:32 2009 @@ -157,6 +157,7 @@ <attribute name="custRequestId" type="String" mode="INOUT" optional="false"/> <attribute name="statusId" type="String" mode="IN" optional="false"/> <attribute name="oldStatusId" type="String" mode="OUT" optional="true"/> + <attribute name="fromPartyId" type="String" mode="OUT" optional="true"/><!-- for notification services --> </service> <service name="createCustRequestFromCommEvent" engine="simple" default-entity-name="CommunicationEvent" location="component://order/script/org/ofbiz/order/request/CustRequestServices.xml" invoke="createCustRequestFromCommEvent" auth="true"> Modified: ofbiz/branches/release09.04/applications/order/widget/ordermgr/RequestScreens.xml URL: http://svn.apache.org/viewvc/ofbiz/branches/release09.04/applications/order/widget/ordermgr/RequestScreens.xml?rev=769277&r1=769276&r2=769277&view=diff ============================================================================== --- ofbiz/branches/release09.04/applications/order/widget/ordermgr/RequestScreens.xml (original) +++ ofbiz/branches/release09.04/applications/order/widget/ordermgr/RequestScreens.xml Tue Apr 28 07:56:32 2009 @@ -660,6 +660,7 @@ </screen> <screen name="CreateCustRequestNotification"> <section> + <condition><not><if-empty field="custRequestId"/></not></condition> <actions> <entity-one entity-name="CustRequest" value-field="custRequest"/> <entity-one entity-name="PartyNameView" value-field="person"> @@ -670,10 +671,14 @@ <widgets> <platform-specific><html><html-template location="component://order/webapp/ordermgr/request/CreateCustRequestNotification.ftl"/></html></platform-specific> </widgets> + <fail-widgets> + <label text="Customer requestId is required: ${parameters.custRequestId} value: ${custRequestId}"></label> + </fail-widgets> </section> </screen> <screen name="CompletedCustRequestNotification"> <section> + <condition><not><if-empty field="custRequestId"/></not></condition> <actions> <entity-one entity-name="CustRequest" value-field="custRequest"/> <entity-one entity-name="PartyNameView" value-field="person"> @@ -684,6 +689,9 @@ <widgets> <platform-specific><html><html-template location="component://order/webapp/ordermgr/request/CompletedCustRequestNotification.ftl"/></html></platform-specific> </widgets> + <fail-widgets> + <label text="Customer requestId is required: ${parameters.custRequestId} value: ${custRequestId}"></label> + </fail-widgets> </section> </screen> Modified: ofbiz/branches/release09.04/framework/common/script/org/ofbiz/common/email/EmailServices.xml URL: http://svn.apache.org/viewvc/ofbiz/branches/release09.04/framework/common/script/org/ofbiz/common/email/EmailServices.xml?rev=769277&r1=769276&r2=769277&view=diff ============================================================================== --- ofbiz/branches/release09.04/framework/common/script/org/ofbiz/common/email/EmailServices.xml (original) +++ ofbiz/branches/release09.04/framework/common/script/org/ofbiz/common/email/EmailServices.xml Tue Apr 28 07:56:32 2009 @@ -21,18 +21,15 @@ <simple-methods xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="http://ofbiz.apache.org/dtds/simple-methods.xsd"> <simple-method method-name="sendMailFromTemplateSetting" short-description="Send Mail from Email Template Setting"> - <!-- if partyIdTo provided but no emailAddress, get it from the partyContactMech --> <if-not-empty field="parameters.partyIdTo"> <if-empty field="parameters.sendTo"> - <set-service-fields service-name="getPartyEmail" map="parameters" to-map="getEmail"/> - <set field="getMail.partyId" from-field="parameters.partyIdTo"/> + <set field="getEmail.partyId" from-field="parameters.partyIdTo"/> <call-service service-name="getPartyEmail" in-map-name="getEmail"> <result-to-field result-name="emailAddress" field="parameters.sendTo"/> </call-service> </if-empty> </if-not-empty> - <entity-one entity-name="EmailTemplateSetting" value-field="emailTemplateSetting"/> <if-not-empty field="emailTemplateSetting"> <set field="emailParams.bodyScreenUri" from-field="emailTemplateSetting.bodyScreenLocation"/> @@ -45,7 +42,6 @@ <!-- copy the incoming parameter fields AFTER setting the ones from EmailTemplateSetting so they can override things like subject, sendFrom, etc --> <set-service-fields service-name="sendMailFromScreen" map="parameters" to-map="emailParams"/> - <call-service service-name="sendMailFromScreen" in-map-name="emailParams"> <result-to-result result-name="body"/> </call-service> Modified: ofbiz/branches/release09.04/framework/common/servicedef/services_email.xml URL: http://svn.apache.org/viewvc/ofbiz/branches/release09.04/framework/common/servicedef/services_email.xml?rev=769277&r1=769276&r2=769277&view=diff ============================================================================== --- ofbiz/branches/release09.04/framework/common/servicedef/services_email.xml (original) +++ ofbiz/branches/release09.04/framework/common/servicedef/services_email.xml Tue Apr 28 07:56:32 2009 @@ -51,6 +51,7 @@ <override name="contentType" mode="INOUT"/> <override name="subject" mode="INOUT" optional="false"/> <override name="emailType" type="String" mode="INOUT" optional="true"/> + <override name="sendTo" optional="false"/><!-- service will give an NPE when not provided --> </service> <service name="sendMailMultiPart" engine="java" location="org.ofbiz.common.email.EmailServices" invoke="sendMail"> @@ -85,6 +86,7 @@ <description>Send Email From Email Template Setting Service</description> <implements service="sendMailInterface"/> <attribute name="emailTemplateSettingId" type="String" mode="IN" optional="false"/> + <attribute name="partyIdTo" type="String" mode="IN" optional="true"/> <attribute name="bodyText" type="String" mode="IN" optional="true" allow-html="any"/> <attribute name="attachmentName" type="String" mode="IN" optional="true"/> <attribute name="bodyParameters" type="Map" mode="IN" optional="true"/> Modified: ofbiz/branches/release09.04/framework/service/src/org/ofbiz/service/eca/ServiceEcaSetField.java URL: http://svn.apache.org/viewvc/ofbiz/branches/release09.04/framework/service/src/org/ofbiz/service/eca/ServiceEcaSetField.java?rev=769277&r1=769276&r2=769277&view=diff ============================================================================== --- ofbiz/branches/release09.04/framework/service/src/org/ofbiz/service/eca/ServiceEcaSetField.java (original) +++ ofbiz/branches/release09.04/framework/service/src/org/ofbiz/service/eca/ServiceEcaSetField.java Tue Apr 28 07:56:32 2009 @@ -50,9 +50,9 @@ public void eval(Map<String, Object> context) { if (fieldName != null) { // try to expand the envName - if (UtilValidate.isEmpty(value)) { - if (UtilValidate.isNotEmpty(envName) && envName.startsWith("${")) { - FlexibleStringExpander exp = FlexibleStringExpander.getInstance(envName); + if (UtilValidate.isEmpty(this.value)) { + if (UtilValidate.isNotEmpty(this.envName) && this.envName.startsWith("${")) { + FlexibleStringExpander exp = FlexibleStringExpander.getInstance(this.envName); String s = exp.expandString(context); if (UtilValidate.isNotEmpty(s)) { value = s; @@ -76,10 +76,10 @@ // process the context changes String newValue = null; - if (UtilValidate.isNotEmpty(value)) { - newValue = (String) this.format(value, context); - } else if (UtilValidate.isNotEmpty(envName) && context.get(envName) != null) { - newValue = (String) this.format((String) context.get(envName), context); + if (UtilValidate.isNotEmpty(this.value)) { + newValue = (String) this.format(this.value, context); + } else if (UtilValidate.isNotEmpty(this.envName) && context.get(this.envName) != null) { + newValue = (String) this.format((String) context.get(this.envName), context); } if (newValue != null) { |
Free forum by Nabble | Edit this page |