diff --git a/applications/order/script/org/ofbiz/order/request/CustRequestServices.xml b/applications/order/script/org/ofbiz/order/request/CustRequestServices.xml index 5db841a018..4cc6763c49 100644 --- a/applications/order/script/org/ofbiz/order/request/CustRequestServices.xml +++ b/applications/order/script/org/ofbiz/order/request/CustRequestServices.xml @@ -62,9 +62,8 @@ under the License. - - - + + @@ -77,12 +76,10 @@ under the License. - - - + @@ -363,8 +360,9 @@ under the License. - + + @@ -381,7 +379,6 @@ under the License. - diff --git a/applications/order/servicedef/secas.xml b/applications/order/servicedef/secas.xml index ab938007bf..0f7921ed1b 100644 --- a/applications/order/servicedef/secas.xml +++ b/applications/order/servicedef/secas.xml @@ -326,14 +326,14 @@ under the License. - + - + diff --git a/applications/order/servicedef/services_request.xml b/applications/order/servicedef/services_request.xml index 98a7136e36..847b8137bc 100644 --- a/applications/order/servicedef/services_request.xml +++ b/applications/order/servicedef/services_request.xml @@ -154,10 +154,9 @@ under the License. Set the Customer Request Status - + - diff --git a/framework/common/script/org/ofbiz/common/email/EmailServices.xml b/framework/common/script/org/ofbiz/common/email/EmailServices.xml index ad11ee0434..29fd3e7ef6 100644 --- a/framework/common/script/org/ofbiz/common/email/EmailServices.xml +++ b/framework/common/script/org/ofbiz/common/email/EmailServices.xml @@ -22,9 +22,11 @@ under the License. xsi:noNamespaceSchemaLocation="http://ofbiz.apache.org/dtds/simple-methods.xsd"> - + + + diff --git a/framework/service/src/org/ofbiz/service/eca/ServiceEcaSetField.java b/framework/service/src/org/ofbiz/service/eca/ServiceEcaSetField.java index 433c963ab3..648211557a 100644 --- a/framework/service/src/org/ofbiz/service/eca/ServiceEcaSetField.java +++ b/framework/service/src/org/ofbiz/service/eca/ServiceEcaSetField.java @@ -26,6 +26,7 @@ import org.ofbiz.base.util.string.FlexibleStringExpander; import org.ofbiz.entity.model.ModelUtil; import java.util.Map; +import javolution.util.FastMap; /** * ServiceEcaSetField @@ -59,12 +60,35 @@ public class ServiceEcaSetField { Debug.log("Expanded String: " + s, module); } } + // TODO: rewrite using the ContextAccessor.java see hack below to be able to use maps for email notifications + // check if target is a map + String mapName = null; + Map map = null; + if (UtilValidate.isNotEmpty(fieldName) && fieldName.indexOf('.') != -1) { + mapName = fieldName.substring(0, fieldName.indexOf('.')); + fieldName = fieldName.substring(fieldName.indexOf('.') +1); + if (context.containsKey(mapName)) { + map = (Map) context.get(mapName); + } else { + map = FastMap.newInstance(); + } + } // process the context changes + String newValue = null; if (UtilValidate.isNotEmpty(value)) { - context.put(fieldName, this.format(value, context)); + newValue = (String) this.format(value, context); } else if (UtilValidate.isNotEmpty(envName) && context.get(envName) != null) { - context.put(fieldName, this.format((String) context.get(envName), context)); + newValue = (String) this.format((String) context.get(envName), context); + } + + if (newValue != null) { + if (map != null) { + map.put(fieldName, newValue); + context.put(mapName, map); + } else { + context.put(fieldName, newValue); + } } } }