Author: hansbak
Date: Thu Jun 10 10:57:13 2010
New Revision: 953277
URL: http://svn.apache.org/viewvc?rev=953277&view=rev
Log:
make sure a send email does not show on the originators 'open' email list
Modified:
ofbiz/trunk/applications/party/script/org/ofbiz/party/communication/CommunicationEventServices.xml
Modified:
ofbiz/trunk/applications/party/script/org/ofbiz/party/communication/CommunicationEventServices.xml
URL:
http://svn.apache.org/viewvc/ofbiz/trunk/applications/party/script/org/ofbiz/party/communication/CommunicationEventServices.xml?rev=953277&r1=953276&r2=953277&view=diff
==============================================================================
---
ofbiz/trunk/applications/party/script/org/ofbiz/party/communication/CommunicationEventServices.xml
(original)
+++
ofbiz/trunk/applications/party/script/org/ofbiz/party/communication/CommunicationEventServices.xml
Thu Jun 10 10:57:13 2010
@@ -545,8 +545,8 @@ under the License.
<else>
<set field="communicationEvent.statusId"
from-field="parameters.statusId"/>
<store-value value-field="communicationEvent"/>
- <if-compare operator="equals" value="Y"
field="parameters.setRoleStatusToComplete">
- <if-compare operator="equals" value="COM_COMPLETE"
field="parameters.statusId">
+ <if-compare operator="equals" value="COM_COMPLETE"
field="parameters.statusId">
+ <if-compare operator="equals" value="Y"
field="parameters.setRoleStatusToComplete">
<!-- if the status of the communicationevent is
set to complete, all roles need to be set to complete,
which means the commevent was dealt with and
no further action is required by any of the other participants/addressees -->
<get-related
relation-name="CommunicationEventRole" list="roles"
value-field="communicationEvent"/>
@@ -556,6 +556,21 @@ under the License.
<store-value value-field="role"/>
</if-compare-field>
</iterate>
+ <else><!-- make sure at least the senders role is
set to complete -->
+ <entity-one
entity-name="CommunicationEventRole" value-field="communicationEventRole">
+ <field-map
field-name="communicationEventId"
from-field="communicationEvent.communicationEventId"/>
+ <field-map field-name="partyId"
from-field="communicationEvent.partyIdFrom"/>
+ <field-map field-name="roleTypeId"
value="ORIGINATOR"/>
+ </entity-one>
+ <if-not-empty field="communicationEventRole">
+ <if-compare operator="not-equals"
value="COM_ROLE_COMPLETED" field="comunnicationEventRole.statusId">
+ <set-service-fields
service-name="updateCommunicationEventRole" to-map="updateRole"
map="communicationEventRole"/>
+ <set field="updateRole.statusId"
value="COM_ROLE_COMPLETED"/>
+
+ <call-service
service-name="updateCommunicationEventRole" in-map-name="updateRole"/>
+ </if-compare>
+ </if-not-empty>
+ </else>
</if-compare>
</if-compare>
</else>