Author: hansbak
Date: Thu Jul 30 07:29:05 2009
New Revision: 799192
URL: http://svn.apache.org/viewvc?rev=799192&view=rev
Log:
do not allow changes to the customer request when cancelled or completed
Modified:
ofbiz/trunk/applications/order/config/OrderErrorUiLabels.xml
ofbiz/trunk/applications/order/script/org/ofbiz/order/request/CustRequestServices.xml
ofbiz/trunk/applications/order/widget/ordermgr/CustRequestForms.xml
ofbiz/trunk/applications/order/widget/ordermgr/Menus.xml
Modified: ofbiz/trunk/applications/order/config/OrderErrorUiLabels.xml
URL:
http://svn.apache.org/viewvc/ofbiz/trunk/applications/order/config/OrderErrorUiLabels.xml?rev=799192&r1=799191&r2=799192&view=diff
==============================================================================
--- ofbiz/trunk/applications/order/config/OrderErrorUiLabels.xml (original)
+++ ofbiz/trunk/applications/order/config/OrderErrorUiLabels.xml Thu Jul 30
07:29:05 2009
@@ -3952,4 +3952,7 @@
<value
xml:lang="zh">è´ç©å表æ è¯æ¯ä¸ä¸ªå¿
é¡»çåæ°ã</value>
<value xml:lang="zh_CN">shoppingListId æ¯å¿
é¡»çåæ°</value>
</property>
+ <property key="CheckCustRequest">
+ <value xml:lang="en">Can't only update CustRequest, when status is
in-process...is now: ${custRequest.statusId}</value>
+ </property>
</resource>
Modified:
ofbiz/trunk/applications/order/script/org/ofbiz/order/request/CustRequestServices.xml
URL:
http://svn.apache.org/viewvc/ofbiz/trunk/applications/order/script/org/ofbiz/order/request/CustRequestServices.xml?rev=799192&r1=799191&r2=799192&view=diff
==============================================================================
---
ofbiz/trunk/applications/order/script/org/ofbiz/order/request/CustRequestServices.xml
(original)
+++
ofbiz/trunk/applications/order/script/org/ofbiz/order/request/CustRequestServices.xml
Thu Jul 30 07:29:05 2009
@@ -98,7 +98,7 @@
</if>
</simple-method>
<simple-method method-name="updateCustRequest" short-description="Update
Customer Request">
- <entity-one entity-name="CustRequest" value-field="custRequest"/>
+ <call-simple-method method-name="checkStatusCustRequest"/>
<field-to-result field="custRequest.statusId"
result-name="oldStatusId"/>
<if-compare-field field="custRequest.statusId"
to-field="parameters.statusId" operator="not-equals">
<if-compare field="parameters.statusId" value="CRQ_CANCELLED"
operator="equals">
@@ -141,6 +141,27 @@
<set-nonpk-fields map="parameters" value-field="custRequest"/>
<store-value value-field="custRequest"/>
</simple-method>
+ <simple-method method-name="checkStatusCustRequest"
short-description="Check StatusId CustRequest">
+ <entity-one entity-name="CustRequest"
value-field="custRequest"></entity-one>
+ <if-empty field="custRequest">
+ <add-error><fail-message message="CustRequest not found, statusId
Id: ${custRequest.statusId}"/></add-error>
+ <log level="info" message="CustRequest not found, statusId Id:
${custRequest.statusId}"/>
+ <check-errors/>
+ </if-empty>
+ <if>
+ <condition>
+ <or>
+ <if-compare field="custRequest.statusId"
value="CRQ_CANCELLED" operator="equals"/>
+ <if-compare field="custRequest.statusId"
value="CRQ_COMPLETED" operator="equals"/>
+ </or>
+ </condition>
+ <then>
+ <add-error><fail-property resource="OrderErrorUiLabels"
property="CheckCustRequest"/></add-error>
+ <log level="info" message="Can't only update CustRequest, when
status is in-process...is now: ${custRequest.statusId}"/>
+ <check-errors/>
+ </then>
+ </if>
+ </simple-method>
<simple-method method-name="createCustRequestAttribute"
short-description="Create Customer Request Attribute">
<make-value value-field="newEntity"
entity-name="CustRequestAttribute"/>
@@ -157,6 +178,7 @@
</simple-method>
<simple-method method-name="createCustRequestItem"
short-description="Create Customer Request Item">
+ <call-simple-method method-name="checkStatusCustRequest"/>
<make-value value-field="newEntity" entity-name="CustRequestItem"/>
<set-pk-fields map="parameters" value-field="newEntity"/>
<set-nonpk-fields map="parameters" value-field="newEntity"/>
@@ -171,6 +193,7 @@
<field-to-result field="newEntity.custRequestItemSeqId"
result-name="custRequestItemSeqId"/>
</simple-method>
<simple-method method-name="updateCustRequestItem"
short-description="Update Customer Request Item">
+ <call-simple-method method-name="checkStatusCustRequest"/>
<set from-field="parameters.custRequestId"
field="lookupPKMap.custRequestId"/>
<set from-field="parameters.custRequestItemSeqId"
field="lookupPKMap.custRequestItemSeqId"/>
<find-by-primary-key entity-name="CustRequestItem" map="lookupPKMap"
value-field="custRequestItem"/>
@@ -179,6 +202,7 @@
</simple-method>
<simple-method method-name="createCustRequestParty"
short-description="Create Customer RequestParty">
+ <call-simple-method method-name="checkStatusCustRequest"/>
<set from-field="parameters.partyId" field="lookupPKMap.partyId"/>
<set from-field="parameters.roleTypeId"
field="lookupPKMap.roleTypeId"/>
<find-by-primary-key entity-name="PartyRole" map="lookupPKMap"
value-field="partyRole"/>
@@ -196,11 +220,13 @@
<create-value value-field="newEntity"/>
</simple-method>
<simple-method method-name="updateCustRequestParty"
short-description="Update an existing CustRequestParty">
+ <call-simple-method method-name="checkStatusCustRequest"/>
<entity-one entity-name="CustRequestParty"
value-field="lookedUpValue"/>
<set-nonpk-fields map="parameters" value-field="lookedUpValue"/>
<store-value value-field="lookedUpValue"/>
</simple-method>
<simple-method method-name="deleteCustRequestParty"
short-description="Delete Customer CustRequestParty">
+ <call-simple-method method-name="checkStatusCustRequest"/>
<entity-one entity-name="CustRequestParty"
value-field="lookedUpValue"/>
<now-timestamp field="thruDate"/>
<set field="lookedUpValue.thruDate" from-field="thruDate"/>
@@ -228,6 +254,7 @@
<store-value value-field="lookedUpValueForNoteData"/>
</simple-method>
<simple-method method-name="createCustRequestItemNote"
short-description="Create Customer RequestItem Note">
+ <call-simple-method method-name="checkStatusCustRequest"/>
<make-value value-field="newEntity" entity-name="CustRequestItemNote"/>
<set from-field="parameters.custRequestId"
field="newEntity.custRequestId"/>
<set from-field="parameters.custRequestItemSeqId"
field="newEntity.custRequestItemSeqId"/>
@@ -434,6 +461,7 @@
<!-- Create/Delete CustRequest Content -->
<simple-method method-name="createCustRequestContent"
short-description="Create Work Effort Content">
+ <call-simple-method method-name="checkStatusCustRequest"/>
<make-value entity-name="CustRequestContent" value-field="newEntity"/>
<set-nonpk-fields map="parameters" value-field="newEntity"/>
<set-pk-fields map="parameters" value-field="newEntity"/>
@@ -446,6 +474,7 @@
<create-value value-field="newEntity"/>
</simple-method>
<simple-method method-name="deleteCustRequestContent"
short-description="Remove a Customer Request Content">
+ <call-simple-method method-name="checkStatusCustRequest"/>
<entity-one entity-name="CustRequestContent"
value-field="lookedUpValue"/>
<set-nonpk-fields map="parameters" value-field="lookedUpValue"/>
<if-empty field="lookedUpValue.thruDate">
Modified: ofbiz/trunk/applications/order/widget/ordermgr/CustRequestForms.xml
URL:
http://svn.apache.org/viewvc/ofbiz/trunk/applications/order/widget/ordermgr/CustRequestForms.xml?rev=799192&r1=799191&r2=799192&view=diff
==============================================================================
--- ofbiz/trunk/applications/order/widget/ordermgr/CustRequestForms.xml
(original)
+++ ofbiz/trunk/applications/order/widget/ordermgr/CustRequestForms.xml Thu Jul
30 07:29:05 2009
@@ -129,7 +129,7 @@
<field name="statusId">
<display-entity also-hidden="false" entity-name="StatusItem"/>
</field>
- <field name="addNote">
+ <field name="addNote"
use-when="!custRequest.get("statusId").equals("CRQ_CANCELLED")&&!custRequest.get("statusId").equals("CRQ_COMPLETED")">
<hyperlink description="${uiLabelMap.FormFieldTitle_addNote}"
target="requestitemnotes">
<parameter param-name="custRequestId"/>
<parameter param-name="custRequestItemSeqId"/>
Modified: ofbiz/trunk/applications/order/widget/ordermgr/Menus.xml
URL:
http://svn.apache.org/viewvc/ofbiz/trunk/applications/order/widget/ordermgr/Menus.xml?rev=799192&r1=799191&r2=799192&view=diff
==============================================================================
--- ofbiz/trunk/applications/order/widget/ordermgr/Menus.xml (original)
+++ ofbiz/trunk/applications/order/widget/ordermgr/Menus.xml Thu Jul 30
07:29:05 2009
@@ -208,16 +208,37 @@
</link>
</menu-item>
<menu-item name="editRequest" title="${uiLabelMap.OrderRequest}">
+ <condition>
+ <and>
+ <not><if-empty field="custRequest"/></not>
+ <if-compare field="custRequest.statusId"
operator="not-equals" value="CRQ_CANCELLED"/>
+ <if-compare field="custRequest.statusId"
operator="not-equals" value="CRQ_COMPLETED"/>
+ </and>
+ </condition>
<link target="request">
<parameter param-name="custRequestId"
from-field="custRequest.custRequestId"/>
</link>
</menu-item>
<menu-item name="requestroles" title="${uiLabelMap.OrderRequestRoles}">
+ <condition>
+ <and>
+ <not><if-empty field="custRequest"/></not>
+ <if-compare field="custRequest.statusId"
operator="not-equals" value="CRQ_CANCELLED"/>
+ <if-compare field="custRequest.statusId"
operator="not-equals" value="CRQ_COMPLETED"/>
+ </and>
+ </condition>
<link target="requestroles">
<parameter param-name="custRequestId"
from-field="custRequest.custRequestId"/>
</link>
</menu-item>
<menu-item name="requestitems" title="${uiLabelMap.OrderRequestItems}">
+ <condition>
+ <and>
+ <not><if-empty field="custRequest"/></not>
+ <if-compare field="custRequest.statusId"
operator="not-equals" value="CRQ_CANCELLED"/>
+ <if-compare field="custRequest.statusId"
operator="not-equals" value="CRQ_COMPLETED"/>
+ </and>
+ </condition>
<link target="/requestitems">
<parameter param-name="custRequestId"
from-field="custRequest.custRequestId"/>
</link>