svn commit: r685395 - in /ofbiz/trunk: applications/workeffort/script/org/ofbiz/workeffort/workeffort/WorkEffortSimpleServices.xml framework/common/config/CommonUiLabels.xml

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

svn commit: r685395 - in /ofbiz/trunk: applications/workeffort/script/org/ofbiz/workeffort/workeffort/WorkEffortSimpleServices.xml framework/common/config/CommonUiLabels.xml

hansbak-2
Author: hansbak
Date: Tue Aug 12 17:13:08 2008
New Revision: 685395

URL: http://svn.apache.org/viewvc?rev=685395&view=rev
Log:
improved error message on suggestion of other committers

Modified:
    ofbiz/trunk/applications/workeffort/script/org/ofbiz/workeffort/workeffort/WorkEffortSimpleServices.xml
    ofbiz/trunk/framework/common/config/CommonUiLabels.xml

Modified: ofbiz/trunk/applications/workeffort/script/org/ofbiz/workeffort/workeffort/WorkEffortSimpleServices.xml
URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/workeffort/script/org/ofbiz/workeffort/workeffort/WorkEffortSimpleServices.xml?rev=685395&r1=685394&r2=685395&view=diff
==============================================================================
--- ofbiz/trunk/applications/workeffort/script/org/ofbiz/workeffort/workeffort/WorkEffortSimpleServices.xml (original)
+++ ofbiz/trunk/applications/workeffort/script/org/ofbiz/workeffort/workeffort/WorkEffortSimpleServices.xml Tue Aug 12 17:13:08 2008
@@ -70,11 +70,15 @@
 
         <!-- attach to a customer request if passed and copy attached docs if customer request has communication events with attachments -->
         <if-not-empty field="parameters.custRequestId">
-            <!-- check status of customer request should be assigned -->
-            <entity-one entity-name="CustRequest" value-name="custRequest"/>
-            <if-compare operator="not-equals" value="CRQ_ACCEPTED" field="custRequest.statusId">
-                <add-error><fail-message message="Cannot create task from Customer Request: wrong status of customer request"/></add-error>
-            </if-compare>
+            <!-- check status of customer request if valid -->
+            <entity-one entity-name="CustRequest" value-name="lookedUpValue"/>
+            <set field="goodStatusId" value="CRQ_ACCEPTED"/>
+            <if-compare-field operator="not-equals" field="lookedUpValue.statusId" to-field="goodStatusId" >
+                <set field="entity" value="Customer request"/>
+                <add-error><fail-property resource="CommonUiLabels" property="CommonErrorStatusNotValid"/></add-error>
+                <check-errors/>
+            </if-compare-field>
+            <!-- create customer request / work effort relation -->
             <make-value value-name="custRequestWorkEffort" entity-name="CustRequestWorkEffort"/>
             <set field="custRequestWorkEffort.workEffortId" from-field="newEntity.workEffortId" />
             <set field="custRequestWorkEffort.custRequestId" from-field="parameters.custRequestId"/>

Modified: ofbiz/trunk/framework/common/config/CommonUiLabels.xml
URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/common/config/CommonUiLabels.xml?rev=685395&r1=685394&r2=685395&view=diff
==============================================================================
--- ofbiz/trunk/framework/common/config/CommonUiLabels.xml (original)
+++ ofbiz/trunk/framework/common/config/CommonUiLabels.xml Tue Aug 12 17:13:08 2008
@@ -1976,6 +1976,9 @@
         <value xml:lang="th">Error: ข้อผิดพลาด ! ไม่อนุญาติเปลี่ยนสถานะจาก [${lookedUpValue.statusId}] เป็น [${parameters.statusId}]</value>
         <value xml:lang="zh">错误: 不允许把状态从[${lookedUpValue.statusId}]变为[${parameters.statusId}]。</value>
     </property>
+    <property key="CommonErrorStatusNotValid">
+        <value xml:lang="en">Error: status  of ${entity} is not valid, it is: ${lookedUpValue.statusId} but should be: ${goodStatusId}.</value>
+    </property>
     <property key="CommonEventDate">
         <value xml:lang="ar">تاريخ الحدث</value>
         <value xml:lang="de">Ereignisdatum</value>