first version of issue OFBIZ-1886: add statusId field to communicationrole, more testing and additions will follow
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@678605 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
@@ -995,7 +995,10 @@ public class EmailServices {
|
||||
if (partyRole == null) {
|
||||
dispatcher.runSync("createPartyRole", UtilMisc.<String, Object>toMap("partyId", partyId, "roleTypeId", roleTypeId, "userLogin", userLogin));
|
||||
}
|
||||
Map input = UtilMisc.toMap("communicationEventId", communicationEventId, "partyId", partyId, "roleTypeId", roleTypeId, "userLogin", userLogin, "contactMechId", (String) result.get("contactMechId"));
|
||||
Map input = UtilMisc.toMap("communicationEventId", communicationEventId,
|
||||
"partyId", partyId, "roleTypeId", roleTypeId, "userLogin", userLogin,
|
||||
"contactMechId", (String) result.get("contactMechId"),
|
||||
"statusId", "COM_ROLE_CREATED");
|
||||
dispatcher.runSync("createCommunicationEventRole", input);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -326,6 +326,14 @@ under the License.
|
||||
<StatusValidChange condition="" statusId="COM_RESOLVED" statusIdTo="COM_CANCELLED" transitionName="Cancel"/>
|
||||
<StatusValidChange condition="" statusId="COM_REFERRED" statusIdTo="COM_CANCELLED" transitionName="Cancel"/>
|
||||
<StatusValidChange condition="" statusId="COM_UNKNOWN_PARTY" statusIdTo="COM_CANCELLED" transitionName="Cancel"/>
|
||||
|
||||
<StatusType description="Communication Event Role" hasTable="N" parentTypeId="COM_EVENT_STATUS" statusTypeId="COM_EVENT_ROLE_STATUS"/>
|
||||
<StatusItem description="Created" sequenceId="01" statusCode="ENTERED" statusId="COM_ROLE_CREATED" statusTypeId="COM_EVENT_ROLE_STATUS"/>
|
||||
<StatusItem description="Read" sequenceId="02" statusCode="PENDING" statusId="COM_ROLE_READ" statusTypeId="COM_EVENT_ROLE_STATUS"/>
|
||||
<StatusItem description="Completed" sequenceId="03" statusCode="READ" statusId="COM_ROLE_COMPLETED" statusTypeId="COM_EVENT_ROLE_STATUS"/>
|
||||
<StatusValidChange condition="" statusId="COM_ROLE_CREATED" statusIdTo="COM_ROLE_READ" transitionName="Read"/>
|
||||
<StatusValidChange condition="" statusId="COM_ROLE_CREATED" statusIdTo="COM_ROLE_COMPLETED" transitionName="Completed"/>
|
||||
<StatusValidChange condition="" statusId="COM_ROLE_READ" statusIdTo="COM_ROLE_COMPLETED" transitionName="Completed"/>
|
||||
|
||||
<StatusType description="Party Relationship" hasTable="N" parentTypeId="" statusTypeId="PARTY_REL_STATUS"/>
|
||||
|
||||
|
||||
@@ -703,8 +703,9 @@ under the License.
|
||||
<view-entity entity-name="CommunicationEventAndRole" package-name="org.ofbiz.party.communication" title="Communication Event And Role View Entity">
|
||||
<member-entity entity-alias="CR" entity-name="CommunicationEventRole"/>
|
||||
<member-entity entity-alias="CE" entity-name="CommunicationEvent"/>
|
||||
<alias-all entity-alias="CR"/>
|
||||
<alias-all entity-alias="CE"/>
|
||||
<alias entity-alias="CR" name="statusId" field="statusId" col-alias="roleStatusId" />
|
||||
<alias entity-alias="CR" name="contactMechId"/>
|
||||
<view-link entity-alias="CR" rel-entity-alias="CE">
|
||||
<key-map field-name="communicationEventId"/>
|
||||
</view-link>
|
||||
@@ -807,6 +808,7 @@ under the License.
|
||||
<field name="partyId" type="id-ne"></field>
|
||||
<field name="roleTypeId" type="id-ne"></field>
|
||||
<field name="contactMechId" type="id"><description>For additional communication event participants this represents the contactMechId of the ContactMech used.</description></field>
|
||||
<field name="statusId" type="id"></field>
|
||||
<prim-key field="communicationEventId"/>
|
||||
<prim-key field="partyId"/>
|
||||
<prim-key field="roleTypeId"/>
|
||||
@@ -826,6 +828,9 @@ under the License.
|
||||
<relation type="one" fk-name="COM_EVRL_CMCH" rel-entity-name="ContactMech">
|
||||
<key-map field-name="contactMechId"/>
|
||||
</relation>
|
||||
<relation type="one" fk-name="COM_EVRL_STTS" rel-entity-name="StatusItem">
|
||||
<key-map field-name="statusId"/>
|
||||
</relation>
|
||||
</entity>
|
||||
<entity entity-name="CommunicationEventType"
|
||||
package-name="org.ofbiz.party.communication"
|
||||
|
||||
+21
-8
@@ -90,8 +90,8 @@ under the License.
|
||||
</if-compare-field>
|
||||
<store-value value-name="event"/>
|
||||
</simple-method>
|
||||
|
||||
<simple-method method-name="deleteCommunicationEvent" short-description="Delete a CommunicationEvent">
|
||||
|
||||
<entity-one entity-name="CommunicationEvent" value-name="event"/>
|
||||
<!-- remove related links to content -->
|
||||
<get-related value-name="event" relation-name="CommEventContentAssoc" list-name="contentAssocs"/>
|
||||
@@ -160,16 +160,29 @@ under the License.
|
||||
<create-value value-name="newEntity"/>
|
||||
</simple-method>
|
||||
<simple-method method-name="removeCommunicationEventPurpose" short-description="Remove a CommunicationEventPurpose">
|
||||
|
||||
<entity-one entity-name="CommunicationEventPurpose" value-name="eventPurpose"/>
|
||||
<remove-value value-name="eventPurpose"/>
|
||||
</simple-method>
|
||||
<simple-method method-name="createCommunicationEventRole" short-description="Create a CommunicationEventRole">
|
||||
|
||||
<make-value value-name="newEntity" entity-name="CommunicationEventRole"/>
|
||||
<set-pk-fields map-name="parameters" value-name="newEntity"/>
|
||||
<set-nonpk-fields map-name="parameters" value-name="newEntity"/>
|
||||
<create-value value-name="newEntity"/>
|
||||
<simple-method method-name="createCommunicationEventRole"
|
||||
short-description="Create a CommunicationEventRole">
|
||||
<!-- check if role already exist, then ignore -->
|
||||
<entity-one entity-name="CommunicationEventRole" value-name="communicationEventRole" />
|
||||
<if-empty field="communicationEventRole">
|
||||
<make-value value-name="newEntity" entity-name="CommunicationEventRole" />
|
||||
<set-pk-fields map-name="parameters" value-name="newEntity" />
|
||||
<set-nonpk-fields map-name="parameters" value-name="newEntity" />
|
||||
<if-empty field="newEntity.statusId">
|
||||
<set field="newEntity.statusId" value="COM_ROLE_CREATED" />
|
||||
</if-empty>
|
||||
<create-value value-name="newEntity" />
|
||||
</if-empty>
|
||||
</simple-method>
|
||||
<simple-method method-name="updateCommunicationEventRole" short-description="Create a CommunicationEventRole">
|
||||
<entity-one value-name="eventRole" entity-name="CommunicationEventRole" />
|
||||
<if-not-empty field="eventRole">
|
||||
<set-nonpk-fields map-name="parameters" value-name="eventRole" />
|
||||
<store-value value-name="eventRole" />
|
||||
</if-not-empty>
|
||||
</simple-method>
|
||||
<simple-method method-name="removeCommunicationEventRole" short-description="Remove a CommunicationEventRole">
|
||||
|
||||
|
||||
@@ -696,6 +696,13 @@ under the License.
|
||||
<auto-attributes entity-name="CommunicationEventRole" include="pk" mode="IN" optional="false"/>
|
||||
<auto-attributes entity-name="CommunicationEventRole" include="nonpk" mode="IN" optional="true"/>
|
||||
</service>
|
||||
<service name="updateCommunicationEventRole" engine="simple"
|
||||
location="org/ofbiz/party/communication/CommunicationEventServices.xml" invoke="updateCommunicationEventRole" auth="true">
|
||||
<description>Update a Communication Event Role</description>
|
||||
<permission-service service-name="partyCommunicationEventPermissionCheck" main-action="UPDATE"/>
|
||||
<auto-attributes entity-name="CommunicationEventRole" include="pk" mode="IN" optional="false"/>
|
||||
<auto-attributes entity-name="CommunicationEventRole" include="nonpk" mode="IN" optional="true"/>
|
||||
</service>
|
||||
<service name="removeCommunicationEventRole" engine="simple"
|
||||
location="org/ofbiz/party/communication/CommunicationEventServices.xml" invoke="removeCommunicationEventRole" auth="true">
|
||||
<description>Remove a Communication Event Role</description>
|
||||
|
||||
Reference in New Issue
Block a user