svn commit: r450670 - /incubator/ofbiz/trunk/applications/workeffort/script/org/ofbiz/workeffort/workeffort/WorkEffortSimpleServices.xml

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

svn commit: r450670 - /incubator/ofbiz/trunk/applications/workeffort/script/org/ofbiz/workeffort/workeffort/WorkEffortSimpleServices.xml

hansbak-2
Author: hansbak
Date: Wed Sep 27 19:39:38 2006
New Revision: 450670

URL: http://svn.apache.org/viewvc?view=rev&rev=450670
Log:
added check when a workeffort status is changed against the  statusValidChange table

Modified:
    incubator/ofbiz/trunk/applications/workeffort/script/org/ofbiz/workeffort/workeffort/WorkEffortSimpleServices.xml

Modified: incubator/ofbiz/trunk/applications/workeffort/script/org/ofbiz/workeffort/workeffort/WorkEffortSimpleServices.xml
URL: http://svn.apache.org/viewvc/incubator/ofbiz/trunk/applications/workeffort/script/org/ofbiz/workeffort/workeffort/WorkEffortSimpleServices.xml?view=diff&rev=450670&r1=450669&r2=450670
==============================================================================
--- incubator/ofbiz/trunk/applications/workeffort/script/org/ofbiz/workeffort/workeffort/WorkEffortSimpleServices.xml (original)
+++ incubator/ofbiz/trunk/applications/workeffort/script/org/ofbiz/workeffort/workeffort/WorkEffortSimpleServices.xml Wed Sep 27 19:39:38 2006
@@ -77,6 +77,19 @@
         <!-- if necessary create new status entry, and set lastStatusUpdate date -->
         <if-not-empty field-name="parameters.currentStatusId">
             <if-compare-field field-name="parameters.currentStatusId" operator="not-equals" to-field-name="lookedUpValue.currentStatusId">
+                
+                <!-- check if the status change is a valid change -->
+                <entity-and entity-name="StatusValidChange" list-name="validChange">
+                    <field-map field-name="statusId" env-name="lookedUpValue.currentStatusId"/>
+                    <field-map field-name="statusIdTo" env-name="parameters.currentStatusId"/>
+                </entity-and>
+                
+                <if-empty field-name="validChange">
+                    <add-error><fail-message message="The status change from ${lookedUpValue.currentStatusId} to ${parameters.currentStatusId} is not a valid change"/></add-error>
+                    <log level="error" message="The status change from ${lookedUpValue.currentStatusId} to ${parameters.currentStatusId} is not a valid change"/>
+                    <check-errors/>
+                </if-empty>
+                
                 <set from-field="nowTimestamp" field="lookedUpValue.lastStatusUpdate"/>
                 <make-value value-name="newWorkEffortStatus" entity-name="WorkEffortStatus"/>
                 <set from-field="lookedUpValue.workEffortId" field="newWorkEffortStatus.workEffortId"/>