svn commit: r779477 - in /ofbiz/trunk/applications/party: script/org/ofbiz/party/communication/CommunicationEventServices.xml script/org/ofbiz/party/party/PartyServices.xml webapp/partymgr/communication/CommForms.xml

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

svn commit: r779477 - in /ofbiz/trunk/applications/party: script/org/ofbiz/party/communication/CommunicationEventServices.xml script/org/ofbiz/party/party/PartyServices.xml webapp/partymgr/communication/CommForms.xml

hansbak-2
Author: hansbak
Date: Thu May 28 08:33:05 2009
New Revision: 779477

URL: http://svn.apache.org/viewvc?rev=779477&view=rev
Log:
some corrections on email sending via the reply button

Modified:
    ofbiz/trunk/applications/party/script/org/ofbiz/party/communication/CommunicationEventServices.xml
    ofbiz/trunk/applications/party/script/org/ofbiz/party/party/PartyServices.xml
    ofbiz/trunk/applications/party/webapp/partymgr/communication/CommForms.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=779477&r1=779476&r2=779477&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 May 28 08:33:05 2009
@@ -60,7 +60,7 @@
         <field-to-result field="newEntity.communicationEventId" result-name="communicationEventId"/>
 
         <!-- check for reply -->
-        <if-compare field="parameters.userLogin.userLoginId" value="system" operator="not-equals">
+        <if-compare field="parameters.communicationEventId" value="AUTO_EMAIL_COMM" operator="not-equals"><!--not an incoming email from a mailserver -->
             <if-not-empty field="parameters.parentCommEventId">
                 <entity-one entity-name="CommunicationEvent" value-field="parentCommEvent">
                     <field-map field-name="communicationEventId" from-field="parameters.parentCommEventId"/>
@@ -68,7 +68,10 @@
                 <entity-one entity-name="PartyNameView" value-field="partyNameView">
                     <field-map field-name="partyId" from-field="parentCommEvent.partyIdFrom"/>
                 </entity-one>
-                
+                <set field="newEntity.communicationEventTypeId" from-field="parentComEvent.communicationEventTypeId"/>
+                <if-compare field="newEntity.communicationEventTypeId" value="AUTO_EMAIL_COMM" operator="equals">
+                    <set field="newEntity.communicationEventTypeId" value="EMAIL_COMMUNICATION"/>
+                </if-compare>
                 <set field="newEntity.partyIdFrom" from-field="parameters.partyIdFrom" default-value="parameters.userLogin.partyId"/>
                 <set field="newEntity.partyIdTo" from-field="parentCommEvent.partyIdFrom"/>
                 
@@ -108,32 +111,56 @@
             </if-not-empty>
         </if-compare>
         
-        <if-empty field="parameters.statusId">
-            <set value="COM_ENTERED" field="parameters.statusId"/>
+        <if-empty field="newEntity.statusId">
+            <set value="COM_ENTERED" field="newEntity.statusId"/>
         </if-empty>
 
-        <!-- if only contactMechId and no partyIdTo is provided for creation email address find the related party -->
-        <if-empty field="parameters.partyIdTo">
-            <if-not-empty field="parameters.contactMechIdTo">
-                <entity-and entity-name="PartyAndContactMech" list="partyContactMechs" filter-by-date="true">
-                    <field-map field-name="contactMechId" from-field="parameters.contactMechIdTo"/>
-                    <field-map field-name="contactMechTypeId" value="EMAIL_ADDRESS"/>
-                </entity-and>
-                <first-from-list entry="partyContactMech" list="partyContactMechs"/>
-                <set field="newEntity.partyIdTo" from-field="partyContactMech.partyId"/>
+        <if-compare field="newEntity.communicationEventTypeId" value="EMAIL_COMMUNICATION" operator="equals">
+            <!-- if only contactMechIdFrom and no partyIdFrom is provided for creation email address find the related party -->
+            <if-empty field="newEntity.partyIdFrom">
+                <if-not-empty field="newEntity.contactMechIdFrom">
+                    <entity-and entity-name="PartyAndContactMech" list="partyContactMechs" filter-by-date="true">
+                        <field-map field-name="contactMechId" from-field="newEntity.contactMechIdFrom"/>
+                        <field-map field-name="contactMechTypeId" value="EMAIL_ADDRESS"/>
+                    </entity-and>
+                    <first-from-list entry="partyContactMech" list="partyContactMechs"/>
+                    <set field="newEntity.partyIdFrom" from-field="partyContactMech.partyId"/>
+                </if-not-empty>
+            </if-empty>
+            
+            <!-- if partyIdFrom provided but no contactMechIdFrom get emailAddress -->
+            <if-not-empty field="newEntity.partyIdFrom">
+                <if-empty field="newEntity.contactMechIdFrom">
+                    <set field="getEmail.partyId" from-field="newEntity.partyIdFrom"/>
+                    <call-service service-name="getPartyEmail" in-map-name="getEmail">
+                        <result-to-field result-name="contactMechId" field="newEntity.contactMechIdFrom"/>
+                    </call-service>
+                </if-empty>
             </if-not-empty>
-        </if-empty>
-
-        <!-- if partyId provided but no contactMechIdTo get emailAddress -->
-        <if-not-empty field="parameters.partyIdTo">
-            <if-empty field="parameters.contactMechIdTo">
-                <set field="getEmail.partyId" from-field="parameters.partyIdTo"/>
-                <call-service service-name="getPartyEmail" in-map-name="getEmail">
-                    <result-to-field result-name="contacMechId" field="newEntity.contactMechIdTo"/>
-                </call-service>
+            
+            <!-- if only contactMechIdTo and no partyIdTo is provided for creation email address find the related party -->
+            <if-empty field="newEntity.partyIdTo">
+                <if-not-empty field="newEntity.contactMechIdTo">
+                    <entity-and entity-name="PartyAndContactMech" list="partyContactMechs" filter-by-date="true">
+                        <field-map field-name="contactMechId" from-field="newEntity.contactMechIdTo"/>
+                        <field-map field-name="contactMechTypeId" value="EMAIL_ADDRESS"/>
+                    </entity-and>
+                    <first-from-list entry="partyContactMech" list="partyContactMechs"/>
+                    <set field="newEntity.partyIdTo" from-field="partyContactMech.partyId"/>
+                </if-not-empty>
             </if-empty>
-        </if-not-empty>
-
+            
+            <!-- if partyId provided but no contactMechIdTo get emailAddress -->
+            <if-not-empty field="newEntity.partyIdTo">
+                <if-empty field="newEntity.contactMechIdTo">
+                    <set field="getEmail.partyId" from-field="newEntity.partyIdTo"/>
+                    <call-service service-name="getPartyEmail" in-map-name="getEmail">
+                        <result-to-field result-name="contactMechId" field="newEntity.contactMechIdTo"/>
+                    </call-service>
+                </if-empty>
+            </if-not-empty>
+        </if-compare>
+        
         <now-timestamp field="newEntity.entryDate"/>
         <create-value value-field="newEntity"/>
 
@@ -162,13 +189,7 @@
             <set field="commRole.partyId" from-field="newEntity.partyIdTo"/>
             <set field="commRole.roleTypeId" value="ADDRESSEE"/>
             <set field="commRole.contactMechId" from-field="newEntity.contactMechIdTo"/>
-            <set field="commRole.statusId" value="COM_ROLE_CREATED"/>
-            <if-compare field="parameters.permission" value="true" operator="equals">
-                <call-service service-name="createCommunicationEventRole" in-map-name="commRole"/>
-                <else>
-                    <call-service service-name="createCommunicationEventRoleWithoutPermission" in-map-name="commRole"/>
-                </else>
-            </if-compare>
+            <call-service service-name="createCommunicationEventRoleWithoutPermission" in-map-name="commRole"/>
         </if-not-empty>
 
         <!-- partyIdFrom role-->
@@ -178,12 +199,7 @@
             <set field="commRole.roleTypeId" value="ORIGINATOR"/>
             <set field="commRole.contactMechId" from-field="newEntity.contactMechIdFrom"/>
             <set field="commRole.statusId" value="COM_ROLE_COMPLETED"/>
-            <if-compare field="parameters.permission" value="true" operator="equals">
-                <call-service service-name="createCommunicationEventRole" in-map-name="commRole"/>
-                <else>
-                    <call-service service-name="createCommunicationEventRoleWithoutPermission" in-map-name="commRole"/>
-                </else>
-            </if-compare>
+            <call-service service-name="createCommunicationEventRoleWithoutPermission" in-map-name="commRole"/>
         </if-not-empty>
     </simple-method>
 
@@ -445,7 +461,7 @@
         </entity-condition>
         <iterate entry="communicationEvent" list="communicationEvents">
             <set-service-fields service-name="sendCommEventAsEmail" map="communicationEvent" to-map="inMap"/>
-            <call-service service-name="sendCommEventAsEmail" in-map-name="inMap" require-new-transaction="true"/>
+            <call-service service-name="sendCommEventAsEmail" in-map-name="inMap" require-new-transaction="true" break-on-error="false"/>
         </iterate>
     </simple-method>
 

Modified: ofbiz/trunk/applications/party/script/org/ofbiz/party/party/PartyServices.xml
URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/party/script/org/ofbiz/party/party/PartyServices.xml?rev=779477&r1=779476&r2=779477&view=diff
==============================================================================
--- ofbiz/trunk/applications/party/script/org/ofbiz/party/party/PartyServices.xml (original)
+++ ofbiz/trunk/applications/party/script/org/ofbiz/party/party/PartyServices.xml Thu May 28 08:33:05 2009
@@ -661,7 +661,7 @@
         <!-- first try to find primary email Address when not found get other email -->
         <entity-and entity-name="PartyContactWithPurpose" list="emailAddressesPurposes">
             <field-map field-name="partyId" from-field="parameters.partyId"/>
-            <field-map field-name="contactMechPurposeTypeId" from-field="PRIMARY_EMAIL"/>
+            <field-map field-name="contactMechPurposeTypeId" value="PRIMARY_EMAIL"/>
         </entity-and>
         <filter-list-by-date list="emailAddressesPurposes" to-list="emailAddressesPurposes1" from-field-name="purposeFromDate" thru-field-name="purposeThruDate"/>
         <filter-list-by-date list="emailAddressesPurposes1" to-list="emailAddresses" from-field-name="contactFromDate" thru-field-name="contactThruDate"/>

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=779477&r1=779476&r2=779477&view=diff
==============================================================================
--- ofbiz/trunk/applications/party/webapp/partymgr/communication/CommForms.xml (original)
+++ ofbiz/trunk/applications/party/webapp/partymgr/communication/CommForms.xml Thu May 28 08:33:05 2009
@@ -144,7 +144,7 @@
         </actions>
         <alt-target use-when="communicationEvent!=null" target="updateCommunicationEvent"/>
         <field name="communicationEventId"><hidden/></field>
-        <field name="communicationEventTypeId"><hidden value="AUTO_EMAIL_COMM"/></field>
+        <field name="communicationEventTypeId"><hidden value="EMAIL_COMMUNICATION"/></field>
         <field name="statusId"><hidden value="COM_IN_PROGRESS"/></field>
         <field name="parentCommEventId" use-when="parentCommEventId != null"><hidden value="${parameters.parentCommEventId}"/></field>
         <field name="parentCommEventId" use-when="originalCommEventId != null"><hidden value="${parameters.originalCommEventId}"/></field>
@@ -154,8 +154,8 @@
                 <list-options list-name="emailAddresses" description="${infoString}" key-name="contactMechId"/>
             </drop-down>
         </field>
-        <field name="contactMechIdTo" title="${uiLabelMap.PartyEmailTo}">
-            <lookup target-form-name="LookupPartyEmail" default-value="${parameters.contactMechIdTo}"/>
+        <field name="partyIdTo">
+            <lookup target-form-name="LookupPartyName" default-value="${partyIdTo}"/>
         </field>
         <field name="datetimeStarted" title="${uiLabelMap.CommonSendDate}"><date-time/></field>
         <field name="subject"><text size="60" default-value="${parameters.subject}"/></field>
@@ -217,9 +217,8 @@
             </hyperlink>
         </field>
         <field name="communicationEventTypeId"><display-entity entity-name="CommunicationEventType" description="${description}"/></field>
-        <field name="contactListId"><display/></field>
-        <field name="messageId"><display/></field>
-        <field name="partyIdFrom" use-when="partyIdFrom!=void">
+        <field name="contactListId" use-when="communicationEvent.get(&quot;contactListId&quot;)!=null"><display/></field>
+        <field name="partyIdFrom" use-when="communicationEvent.get(&quot;partyIdFrom&quot;)!=null">
             <display-entity entity-name="PartyNameView" key-field-name="partyId" description="${firstName} ${middleName} ${lastName} ${groupName} (${contactMechFrom.infoString})">
                 <sub-hyperlink description=" [${communicationEvent.partyIdFrom}]" target="/partymgr/control/viewprofile" target-type="inter-app">
                     <parameter param-name="partyIdFrom"/>
@@ -376,7 +375,7 @@
         </row-actions>
         <field name="communicationEventId"><hidden/></field>
         <field name="subject">
-            <hyperlink description="${subject}" target="ViewCommunicationEvent">
+            <hyperlink description="${subject}[${communicationEventId}]" target="ViewCommunicationEvent">
                 <parameter param-name="communicationEventId"/>
                 <parameter param-name="partyId"/>
                 <parameter param-name="roleTypeId"/>