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 2008/07/24 21:02:27 UTC

svn commit: r679491 - in /ofbiz/trunk/applications/party: data/PartyTypeData.xml script/org/ofbiz/party/communication/CommunicationEventServices.xml webapp/partymgr/communication/CommForms.xml

Author: hansbak
Date: Thu Jul 24 12:02:26 2008
New Revision: 679491

URL: http://svn.apache.org/viewvc?rev=679491&view=rev
Log:
use the communicationRoles in addition to the party from/to on the communication event

Modified:
    ofbiz/trunk/applications/party/data/PartyTypeData.xml
    ofbiz/trunk/applications/party/script/org/ofbiz/party/communication/CommunicationEventServices.xml
    ofbiz/trunk/applications/party/webapp/partymgr/communication/CommForms.xml

Modified: ofbiz/trunk/applications/party/data/PartyTypeData.xml
URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/party/data/PartyTypeData.xml?rev=679491&r1=679490&r2=679491&view=diff
==============================================================================
--- ofbiz/trunk/applications/party/data/PartyTypeData.xml (original)
+++ ofbiz/trunk/applications/party/data/PartyTypeData.xml Thu Jul 24 12:02:26 2008
@@ -177,11 +177,11 @@
     <RoleType description="Workflow" hasTable="N" parentTypeId="" roleTypeId="WORKFLOW_ROLE"/>
 
     <!-- second level role types -->
-    <RoleType description="Email To" hasTable="N" parentTypeId="COMMEVENT_ROLE" roleTypeId="ADDRESSEE"/>
+    <RoleType description="Addressee" hasTable="N" parentTypeId="COMMEVENT_ROLE" roleTypeId="ADDRESSEE"/>
     <RoleType description="Association" hasTable="N" parentTypeId="ORGANIZATION_ROLE" roleTypeId="ASSOCIATION"/>
     <RoleType description="Bill-From Vendor" hasTable="N" parentTypeId="VENDOR" roleTypeId="BILL_FROM_VENDOR"/>
     <RoleType description="Bill-To Customer" hasTable="N" parentTypeId="CUSTOMER" roleTypeId="BILL_TO_CUSTOMER"/>
-    <RoleType description="Email BCC" hasTable="N" parentTypeId="COMMEVENT_ROLE" roleTypeId="BCC"/>
+    <RoleType description="Blind Copy" hasTable="N" parentTypeId="COMMEVENT_ROLE" roleTypeId="BCC"/>
     <RoleType description="Bulk Customer" hasTable="N" parentTypeId="CUSTOMER" roleTypeId="BULK_CUSTOMER"/>
     <RoleType description="Calendar Attendee" hasTable="N" parentTypeId="CALENDAR_ROLE" roleTypeId="CAL_ATTENDEE"/>
     <RoleType description="Calendar Delegate" hasTable="N" parentTypeId="CALENDAR_ROLE" roleTypeId="CAL_DELEGATE"/>
@@ -190,7 +190,8 @@
     <RoleType description="Calendar Owner" hasTable="N" parentTypeId="CALENDAR_ROLE" roleTypeId="CAL_OWNER"/>
     <RoleType description="Carrier" hasTable="N" parentTypeId="ORGANIZATION_ROLE" roleTypeId="CARRIER"/>
     <RoleType description="Competitor" hasTable="N" parentTypeId="ORGANIZATION_ROLE" roleTypeId="COMPETITOR"/>
-    <RoleType description="Email CC." hasTable="N" parentTypeId="COMMEVENT_ROLE" roleTypeId="CC"/>
+    <RoleType description="Carbon Copy" hasTable="N" parentTypeId="COMMEVENT_ROLE" roleTypeId="CC"/>
+    <RoleType description="Originator" hasTable="N" parentTypeId="COMMEVENT_ROLE" roleTypeId="ORIGINATOR"/>
     <RoleType description="Distributor" hasTable="N" parentTypeId="DISTRIBUTION_CHANNEL" roleTypeId="DISTRIBUTOR"/>
     <RoleType description="Employee" hasTable="N" parentTypeId="PERSON_ROLE" roleTypeId="EMPLOYEE"/>
     <RoleType description="End-User Customer" hasTable="N" parentTypeId="CUSTOMER" roleTypeId="END_USER_CUSTOMER"/>

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=679491&r1=679490&r2=679491&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 Jul 24 12:02:26 2008
@@ -21,8 +21,7 @@
 <simple-methods xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
        xsi:noNamespaceSchemaLocation="http://ofbiz.apache.org/dtds/simple-methods.xsd">
     <simple-method method-name="createCommunicationEvent" short-description="Create a CommunicationEvent">
-
-        <!-- change status of related comevent before creating new comevent so it shown in proper order on the list -->
+        <!-- change status of parent comevent before creating new comevent so it shown in proper order on the list -->
         <if-not-empty field="parameters.parentCommEventId">
             <set field="newStat.communicationEventId" from-field="parameters.parentCommEventId"/>
             <set field="newStat.statusId" value="COM_COMPLETE"/>
@@ -79,6 +78,48 @@
             <create-value value-name="eventRequest"/>
         </if-not-empty>
         
+        <!-- roles -->
+        <!-- partyIdTo -->
+		<if-not-empty field="newEntity.partyIdTo">
+			<entity-one entity-name="PartyRole" value-name="partyRole">
+                <field-map field-name="partyId" value="${newEntity.partyIdTo}" />
+				<field-map field-name="roleTypeId" value="ADDRESSEE" />
+			</entity-one>
+			<if-empty field="partyRole">
+				<make-value entity-name="PartyRole" value-name="pr" />
+				<set field="pr.partyId" value="${newEntity.partyIdTo}" />
+				<set field="pr.roleTypeId" value="ADDRESSEE" />
+				<create-value value-name="pr" />
+			</if-empty>
+			<make-value entity-name="CommunicationEventRole"
+				value-name="commRole" />
+			<set field="commRole.communicationEventId" from-field="newEntity.communicationEventId" />
+			<set field="commRole.partyId" from-field="newEntity.partyIdTo" />
+			<set field="commRole.roleTypeId" value="ADDRESSEE" />
+            <set field="contactMechId" value="${newEntity.contactMechIdTo}" />
+			<set field="commRole.statusId" value="COM_ROLE_CREATED" />
+			<create-value value-name="commRole" />
+		</if-not-empty>
+	
+        <!-- partyIdFrom -->
+		<if-not-empty field="commEvent.partyIdFrom">
+			<entity-one entity-name="PartyRole" value-name="partyRole">
+				<field-map field-name="partyId" value="${newEntity.partyIdFrom}" />
+				<field-map field-name="roleTypeId" value="ORIGINATOR" />
+			</entity-one>
+			<if-empty field="partyRole">
+				<make-value entity-name="PartyRole" value-name="pr" />
+				<set field="pr.partyId" value="${newEntity.partyIdFrom}" />
+				<set field="pr.roleTypeId" value="ORIGINATOR" />
+				<create-value value-name="pr" />
+			</if-empty>
+            <set field="commRole.communicationEventId" from-field="newEntity.communicationEventId" />
+			<set field="commRole.partyId" from-field="newEntity.partyIdFrom" />
+			<set field="commRole.roleTypeId" value="ORIGINATOR" />
+            <set field="contactMechId" value="${newEntity.contactMechIdFrom}" />
+			<set field="commRole.statusId" value="COM_ROLE_READ" />
+			<create-value value-name="commRole" />
+		</if-not-empty>
     </simple-method>
 
     <simple-method method-name="updateCommunicationEvent" short-description="Update a CommunicationEvent">

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=679491&r1=679490&r2=679491&view=diff
==============================================================================
--- ofbiz/trunk/applications/party/webapp/partymgr/communication/CommForms.xml (original)
+++ ofbiz/trunk/applications/party/webapp/partymgr/communication/CommForms.xml Thu Jul 24 12:02:26 2008
@@ -288,8 +288,8 @@
         <field name="roleTypeIdFrom"><display-entity description="${description}" entity-name="RoleType" key-field-name="roleTypeId"/></field>
         <field name="roleTypeIdTo"><display-entity description="${description}" entity-name="RoleType" key-field-name="roleTypeId"/></field>
         -->
-        <field name="createdStamp" title="${uiLabelMap.CommonCreated}"><display description="${bsh:createdStamp.toString().substring(0,16)}"/></field>
-        <field name="datetimeStarted" title="${uiLabelMap.CommonSend}"><display description="${bsh:datetimeStarted==null?&quot;&quot;:datetimeStarted.toString().substring(0,16);}"/></field>
+        <field name="createdStamp" title="${uiLabelMap.CommonCreated}"><display type="date"/></field>
+        <field name="datetimeStarted" title="${uiLabelMap.CommonSend}"><display type="date"/></field>
     </form>
 
     <form name="ListPartyCommEvents" type="list" extends="ListCommEvents"
@@ -428,7 +428,7 @@
         odd-row-style="alternate-row" default-table-style="basic-table hover-bar">
         <actions>
             <entity-and entity-name="CommunicationEventRole" use-cache="true">
-                <field-map field-name="communicationEventId"/>
+                <field-map field-name="communicationEventId" env-name="parameters.communicationEventId"/>
             </entity-and>
         </actions>
         <field name="partyId" title="${uiLabelMap.PartyPartyId}">
@@ -437,7 +437,7 @@
             </display-entity>
         </field>
         <field name="roleTypeId"><display-entity description="${description}" entity-name="RoleType"/></field>
-        <field name="statusId"><display-entity entity-name="statusItem" description="${description}"/></field>
+        <field name="statusId"><display-entity entity-name="StatusItem" description="${description}"/></field>
         <field name="removeLink" title="${uiLabelMap.CommonEmptyHeader}" widget-style="smallSubmit">
             <hyperlink also-hidden="false" description="${uiLabelMap.CommonDelete}" target="/RemoveCommunicationEventRole?partyId=${partyId}&amp;roleTypeId=${roleTypeId}&amp;communicationEventId=${communicationEventId}"/>
         </field>
@@ -461,7 +461,7 @@
         odd-row-style="alternate-row" default-table-style="basic-table hover-bar">
         <actions>
             <entity-and entity-name="CommEventContentDataResource" list-name="contentDataResourceList">
-                <field-map field-name="communicationEventId"/>
+                <field-map field-name="communicationEventId" env-name="parameters.communicationEventId"/>
             </entity-and>
         </actions>