You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ofbiz.apache.org by ha...@apache.org on 2009/06/03 05:49:13 UTC
svn commit: r781253 - in /ofbiz/trunk/applications/party:
script/org/ofbiz/party/communication/CommunicationEventServices.xml
webapp/partymgr/WEB-INF/controller.xml
webapp/partymgr/communication/CommForms.xml
widget/partymgr/CommunicationScreens.xml
Author: hansbak
Date: Wed Jun 3 03:49:13 2009
New Revision: 781253
URL: http://svn.apache.org/viewvc?rev=781253&view=rev
Log:
improve the commevent roles maintenance on a new commevent
Modified:
ofbiz/trunk/applications/party/script/org/ofbiz/party/communication/CommunicationEventServices.xml
ofbiz/trunk/applications/party/webapp/partymgr/WEB-INF/controller.xml
ofbiz/trunk/applications/party/webapp/partymgr/communication/CommForms.xml
ofbiz/trunk/applications/party/widget/partymgr/CommunicationScreens.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=781253&r1=781252&r2=781253&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 Wed Jun 3 03:49:13 2009
@@ -372,6 +372,22 @@
<if-empty field="newEntity.statusId">
<set field="newEntity.statusId" value="COM_ROLE_CREATED"/>
</if-empty>
+
+ <!-- if not provided get the latest contact mech id -->
+ <if-empty field="newEntity.contactMechId">
+ <entity-one entity-name="CommunicationEvent" value-field="communicationEvent"/>
+ <get-related-one value-field="communicationEvent" relation-name="CommunicationEventType" to-value-field="communicationEventType"/>
+ <if-not-empty field="communicationEventType.contactMechTypeId">
+ <entity-and entity-name="PartyAndContactMech" list="contactMechs" filter-by-date="true">
+ <field-map field-name="partyId" from-field="newEntity.partyId"/>
+ <field-map field-name="contactMechTypeId" from-field="communicationEventType.contactMechTypeId"/>
+ <order-by field-name="-fromDate"/>
+ </entity-and>
+ <first-from-list entry="contactMech" list="contactMechs"/>
+ <set field="newEntity.contactMechId" from-field="contactMech.contactMechId"/>
+ </if-not-empty>
+ </if-empty>
+
<create-value value-field="newEntity"/>
</if-empty>
</simple-method>
Modified: ofbiz/trunk/applications/party/webapp/partymgr/WEB-INF/controller.xml
URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/party/webapp/partymgr/WEB-INF/controller.xml?rev=781253&r1=781252&r2=781253&view=diff
==============================================================================
--- ofbiz/trunk/applications/party/webapp/partymgr/WEB-INF/controller.xml (original)
+++ ofbiz/trunk/applications/party/webapp/partymgr/WEB-INF/controller.xml Wed Jun 3 03:49:13 2009
@@ -765,7 +765,7 @@
<request-map uri="updateCommunicationEvent">
<security https="true" auth="true"/>
<event type="service" invoke="updateCommunicationEvent"/>
- <response name="success" type="view-home" value="EditCommunicationEvent"/>
+ <response name="success" type="view" value="EditCommunicationEvent"/>
<response name="error" type="view" value="EditCommunicationEvent"/>
</request-map>
<request-map uri="deleteCommunicationEvent">
@@ -843,7 +843,10 @@
<response name="error" type="view" value="UpdateCommPurposes"/>
</request-map>
- <request-map uri="UpdateCommRoles"><security https="true" auth="true"/><response name="success" type="view" value="UpdateCommRoles"/></request-map>
+ <request-map uri="UpdateCommRoles">
+ <security https="true" auth="true"/>
+ <response name="success" type="view" value="UpdateCommRoles" save-current-view="true"/>
+ </request-map>
<request-map uri="createCommunicationEventRole">
<security https="true" auth="true"/>
<event type="service" invoke="createCommunicationEventRole"/>
@@ -853,8 +856,8 @@
<request-map uri="RemoveCommunicationEventRole">
<security https="true" auth="true"/>
<event type="service" invoke="removeCommunicationEventRole"/>
- <response name="success" type="view-home"/>
- <response name="error" type="view-home"/>
+ <response name="success" type="view-last"/>
+ <response name="error" type="view-last"/>
</request-map>
<request-map uri="ListPartyCommEvents"><security https="true" auth="true"/><response name="success" type="view" value="ListPartyCommEvents"/></request-map>
Modified: ofbiz/trunk/applications/party/webapp/partymgr/communication/CommForms.xml
URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/party/webapp/partymgr/communication/CommForms.xml?rev=781253&r1=781252&r2=781253&view=diff
==============================================================================
--- ofbiz/trunk/applications/party/webapp/partymgr/communication/CommForms.xml (original)
+++ ofbiz/trunk/applications/party/webapp/partymgr/communication/CommForms.xml Wed Jun 3 03:49:13 2009
@@ -62,14 +62,14 @@
</field>
<!-- this is an example of how to display different types of contact mech to the user -->
- <field name="contactMechIdFrom" title="${uiLabelMap.PartyFromContactMech}">
+ <field name="contactMechIdFrom" title="${uiLabelMap.PartyFromContactMech}" position="1">
<lookup target-form-name="LookupPreferredContactMech" target-parameter="partyIdFrom"/>
</field>
<field name="contactMechIdTo" title="${uiLabelMap.PartyToContactMech}" position="2">
<lookup target-form-name="LookupPreferredContactMech" target-parameter="partyIdTo"/>
</field>
- <field name="roleTypeIdFrom">
+ <field name="roleTypeIdFrom" position="1">
<drop-down no-current-selected-key="_NA_">
<entity-options description="${description}" entity-name="RoleType" key-field-name="roleTypeId">
<entity-order-by field-name="description"/>
Modified: ofbiz/trunk/applications/party/widget/partymgr/CommunicationScreens.xml
URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/party/widget/partymgr/CommunicationScreens.xml?rev=781253&r1=781252&r2=781253&view=diff
==============================================================================
--- ofbiz/trunk/applications/party/widget/partymgr/CommunicationScreens.xml (original)
+++ ofbiz/trunk/applications/party/widget/partymgr/CommunicationScreens.xml Wed Jun 3 03:49:13 2009
@@ -384,7 +384,6 @@
<set field="my" from-field="parameters.my" default-value=""/>
<entity-one entity-name="CommunicationEvent" value-field="communicationEvent"/>
<set field="partyIdFrom" from-field="communicationEvent.partyIdFrom" default-value="${userLogin.partyId}"/>
- <set field="parameters.communicationEventTypeId" from-field="parameters.communicationEventTypeId" default-value="${communicationEvent.communicationEventTypeId}"/>
</actions>
<widgets>
<decorator-screen name="Common${my}CommunicationEventDecorator" location="${parameters.mainDecoratorLocation}">
@@ -392,7 +391,10 @@
<section><!-- Email -->
<condition>
<and>
- <if-compare field="parameters.communicationEventTypeId" operator="equals" value="EMAIL_COMMUNICATION"/>
+ <or>
+ <if-compare field="communicationEvent.communicationEventTypeId" operator="equals" value="EMAIL_COMMUNICATION"/>
+ <if-compare field="communicationEvent.communicationEventTypeId" operator="equals" value="AUTO_EMAIL_COMM"/>
+ </or>
<if-compare field="my" operator="equals" value="My"/>
</and>
</condition>
@@ -414,10 +416,8 @@
</container>
<container style="righthalf">
<screenlet title="${uiLabelMap.PartyCommEventRoles}">
- <include-form name="ViewCommRoles" location="component://party/webapp/partymgr/communication/CommForms.xml"/>
- </screenlet>
- <screenlet title="${uiLabelMap.PartyCommEventRoles}">
- <include-form location="component://party/webapp/partymgr/communication/CommForms.xml" name="AddEventRole"/>
+ <include-form name="ListCommRoles" location="component://party/webapp/partymgr/communication/CommForms.xml"/>
+ <include-form name="AddEventRole" location="component://party/webapp/partymgr/communication/CommForms.xml"/>
</screenlet>
<include-screen name="AttachFileList"/>
<include-screen name="addAttachmentEmail"/>
@@ -430,7 +430,7 @@
<section>
<condition><!-- internal note -->
<and>
- <if-compare field="parameters.communicationEventTypeId" operator="equals" value="COMMENT_NOTE"/>
+ <if-compare field="communicationEvent.communicationEventTypeId" operator="equals" value="COMMENT_NOTE"/>
<if-compare field="my" operator="equals" value="My"/>
</and>
</condition>
@@ -453,9 +453,7 @@
<container style="righthalf">
<screenlet title="${uiLabelMap.PartyCommEventRoles}">
<include-form name="ListCommRoles" location="component://party/webapp/partymgr/communication/CommForms.xml"/>
- </screenlet>
- <screenlet title="${uiLabelMap.PartyCommEventRoles}">
- <include-form location="component://party/webapp/partymgr/communication/CommForms.xml" name="AddEventRole"/>
+ <include-form name="AddEventRole" location="component://party/webapp/partymgr/communication/CommForms.xml"/>
</screenlet>
<include-screen name="AttachFileList"/>
<include-screen name="addAttachmentEmail"/>
@@ -469,9 +467,9 @@
<or>
<if-empty field="my"/>
<and>
- <if-compare field="parameters.communicationEventTypeId" operator="not-equals" value="COMMENT_NOTE"/>
- <if-compare field="parameters.communicationEventTypeId" operator="not-equals" value="EMAIL_COMMUNICATION"/>
- <if-compare field="parameters.communicationEventTypeId" operator="not-equals" value="AUTO_EMAIL_COMM"/>
+ <if-compare field="communicationEvent.communicationEventTypeId" operator="not-equals" value="COMMENT_NOTE"/>
+ <if-compare field="communicationEvent.communicationEventTypeId" operator="not-equals" value="EMAIL_COMMUNICATION"/>
+ <if-compare field="communicationEvent.communicationEventTypeId" operator="not-equals" value="AUTO_EMAIL_COMM"/>
</and>
</or>
</condition>