added some demo data, made use of the new setcommunicatonrolestatus service

git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@680486 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Hans Bakker
2008-07-28 20:38:31 +00:00
parent 5cb0d70227
commit dd848cfe77
6 changed files with 53 additions and 61 deletions
@@ -23,4 +23,16 @@ under the License.
<PartyRole partyId="admin" roleTypeId="EMAIL_ADMIN"/>
<PartyRelationship partyIdFrom="admin" roleTypeIdFrom="EMAIL_ADMIN" partyIdTo="Company" roleTypeIdTo="_NA_" fromDate="2000-01-01 00:00:00"/>
<!-- incoming customer request examples -->
<CustRequest custRequestId="9000" custRequestTypeId="RF_SUPPORT" statusId="CRQ_SUBMITTED" fromPartyId="DemoCustomer" priority="9" custRequestName="Customer Request Usage" description="Could you please advise us how to use the customer request facility within ofbiz?" productStoreId="9000" createdDate="2008-07-28 11:45:31.928" createdByUserLogin="admin" lastModifiedDate="2008-07-28 11:45:31.928" lastModifiedByUserLogin="admin" lastUpdatedStamp="2008-07-28 11:45:31.984" lastUpdatedTxStamp="2008-07-28 11:45:31.83" createdStamp="2008-07-28 11:45:31.984" createdTxStamp="2008-07-28 11:45:31.83"/>
<CustRequest custRequestId="9001" custRequestTypeId="RF_SUPPORT" statusId="CRQ_SUBMITTED" fromPartyId="DemoCustAgent" priority="9" custRequestName="Hardware?" description="Please provide us with the hardware requirements of OFBiz" productStoreId="9000" createdDate="2008-07-28 11:45:31.928" createdByUserLogin="admin" lastModifiedDate="2008-07-28 11:45:31.928" lastModifiedByUserLogin="admin" lastUpdatedStamp="2008-07-28 11:45:31.984" lastUpdatedTxStamp="2008-07-28 11:45:31.83" createdStamp="2008-07-28 11:45:31.984" createdTxStamp="2008-07-28 11:45:31.83"/>
<!-- responsible employees -->
<CustRequestType custRequestTypeId="RF_SUPPORT" partyId="Company"/>
<PartyRole partyId="admin" roleTypeId="REQ_TAKER"/>
<PartyRelationship partyIdFrom="Company" roleTypeIdFrom="_NA_" partyIdTo="admin" roleTypeIdTo="REQ_TAKER" fromDate="2000-01-01 00:00:00"/>
<!-- email from an unknown party -->
<CommunicationEvent communicationEventId="9000" communicationEventTypeId="AUTO_EMAIL_COMM" statusId="COM_UNKNOWN_PARTY" contactMechTypeId="EMAIL_ADDRESS" contactMechIdTo="admin" roleTypeIdFrom="_NA_" roleTypeIdTo="_NA_" partyIdTo="admin" entryDate="2008-07-28 13:55:55.827" datetimeStarted="2008-07-28 13:55:19.0" subject="Why i would use the OFBiz system" contentMimeTypeId="text/plain" content="Every time i think of you, only you...you are always on my mind......." note="Sent from: my@email.com; Sent Name from: Jo Easy User; Sent to: ofbiztest@yahoo.com; Delivered-To: ofbiztest@yahoo.com; " fromString="mailinglist@antwebsystems.com" toString="ofbiztest@yahoo.com"/>
<PartyRole partyId="admin" roleTypeId="ADDRESSEE"/>
<CommunicationEventRole communicationEventId="9000" partyId="admin" roleTypeId="ADDRESSEE" contactMechId="admin" statusId="COM_ROLE_CREATED"/>
</entity-engine-xml>
@@ -56,52 +56,32 @@ under the License.
<call-service service-name="setUserPreferenceGroup"
in-map-name="inMap" />
</simple-method>
<simple-method method-name="setCommEventToRead" short-description="">
<call-simple-method method-name="checkCommEventAccess"/>
<if-compare operator="equals" value="true" field="found">
<entity-one entity-name="CommunicationEventRole" value-name="communicationEventRole"/>
<if>
<condition>
<or>
<if-empty field="communicationEventRole.statusId"/>
<if-compare operator="equals" value="COM_ROLE_CREATED" field="communicationEventRole.statusId"/>
</or>
</condition>
<then>
<set-service-fields service-name="updateCommunicationEventRole" map-name="parameters" to-map-name="inMap"/>
<set field="inMap.statusId" value="COM_ROLE_READ" />
<call-service service-name="updateCommunicationEventRole" in-map-name="inMap"/>
</then>
</if>
<else>
<add-error><fail-property property="NoAccess" resource="MyPageUiLabels"/></add-error>
</else>
</if-compare>
</simple-method>
<simple-method method-name="setCommEventRoleToComplete" short-description="">
<call-simple-method method-name="checkCommEventAccess"/>
<if-compare operator="equals" value="true" field="found">
<entity-one entity-name="CommunicationEventRole" value-name="communicationEventRole"/>
<if>
<condition>
<or>
<if-empty field="communicationEventRole.statusId"/>
<if-compare operator="equals" value="COM_ROLE_READ" field="communicationEventRole.statusId"/>
</or>
</condition>
<then>
<set-service-fields service-name="updateCommunicationEventRole" map-name="parameters" to-map-name="inMap"/>
<set field="inMap.statusId" value="COM_ROLE_COMPLETED" />
<call-service service-name="updateCommunicationEventRole" in-map-name="inMap"/>
</then>
</if>
<else>
<add-error><fail-property property="NoAccess" resource="MyPageUiLabels"/></add-error>
</else>
</if-compare>
</simple-method>
<simple-method method-name="setCommEventToRead"
short-description="">
<entity-one entity-name="CommunicationEventRole"
value-name="eventRole" />
<if-compare operator="equals" value="COM_ROLE_CREATED"
field="eventRole.statusId">
<call-simple-method method-name="checkCommEventAccess" />
<if-compare operator="equals" value="true" field="found">
<entity-one entity-name="UserLogin" value-name="userLogin">
<field-map field-name="userLoginId" value="system" />
</entity-one>
<set-service-fields service-name="setCommunicationEventRoleStatus"
map-name="parameters" to-map-name="updStat" />
<set field="updStat.statusId" value="COM_ROLE_READ" />
<set field="updStat.userLogin" from-field="userLogin" />
<call-service service-name="setCommunicationEventRoleStatus"
in-map-name="updStat" include-user-login="false" />
<else>
<add-error>
<fail-property property="NoAccess" resource="MyPageUiLabels" />
</add-error>
</else>
</if-compare>
</if-compare>
</simple-method>
<simple-method method-name="checkCommEventAccess" short-description="check if the user has access to the email of this party">
<set field="found" value="false"/>
@@ -142,9 +142,9 @@
<security https="true" auth="true"/>
<response name="success" type="view" value="otherCommunications"/>
</request-map>
<request-map uri="setCommEventRoleToComplete">
<request-map uri="setCommunicationEventRoleStatus">
<security https="true" auth="true"/>
<event type="simple" path="org/ofbiz/mypage/Events.xml" invoke="setCommEventRoleToComplete"/>
<event type="service" invoke="setCommunicationEventRoleStatus"/>
<response name="success" type="request" value="getToNextDonePage"/>
<response name="error" type="view" value="main"/>
</request-map>
@@ -152,7 +152,7 @@
<security https="true" auth="true"/>
<event type="simple" invoke="setCommEventToRead" path="org/ofbiz/mypage/Events.xml"/>
<response name="success" type="view" value="ViewCommunicationEvent"/>
<response name="error" type="view" value="main"/>
<response name="error" type="request" value="getToNextDonePage"/>
</request-map>
<request-map uri="deleteUnknownCommunicationEvent">
@@ -143,7 +143,7 @@ under the License.
<section>
<actions>
<set field="headerItem" value="main" />
<set field="donePage" value="main"/>
<set field="parameters.donePage" value="main"/>
<!-- refresh every 3 minutes -->
<!--
set field="layoutSettings.extraHead" value="&lt;META
@@ -157,8 +157,8 @@ under the License.
<entity-condition list-name="custRequests" entity-name="CustReqAndTypeAndPartyRel">
<condition-list combine="and">
<condition-expr field-name="statusId" operator="equals" value="CRQ_SUBMITTED"/>
<condition-list combine="or">
<condition-expr field-name="partyIdFrom" operator="equals" env-name="userLogin.partyId"/>
<condition-list combine="and">
<condition-expr field-name="roleTypeIdTo" operator="equals" value="REQ_TAKER"/>
<condition-expr field-name="partyIdTo" operator="equals" env-name="userLogin.partyId"/>
</condition-list>
</condition-list>
+5 -5
View File
@@ -91,19 +91,19 @@ under the License.
<form name="ListPartyCommEvents" extends="ListCommEvents" extends-resource="component://party/webapp/partymgr/communication/CommForms.xml" type="list">
<row-actions>
<set field="toComplete" value="${bsh:&quot;COM_ROLE_COMPLETED&quot;.equals(roleStatusId)?&quot;&quot;:&quot;->Complete&quot;}"/>
<set field="toComplete" value="${bsh:&quot;COM_ROLE_READ&quot;.equals(roleStatusId)?&quot;->Complete&quot;:&quot;&quot;}"/>
</row-actions>
<field name="donePage"><hidden/></field>
<field name="roleTypeId"><display-entity entity-name="RoleType" description="${description}"/></field>
<field name="removeLink" title="${uiLabelMap.CommonEmptyHeader}" widget-style="smallSubmit">
<hyperlink also-hidden="false" description="${uiLabelMap.CommonDelete}" target="RemoveCommunicationEventRole?partyId=${partyId}&amp;communicationEventId=${communicationEventId}&amp;roleTypeId=${roleTypeId}&amp;deleteCommEventIfLast=Y&amp;delContentDataResource=Y&amp;donePage=${donePage}"/>
<hyperlink also-hidden="false" description="${uiLabelMap.CommonDelete}" target="RemoveCommunicationEventRole?partyId=${partyId}&amp;communicationEventId=${communicationEventId}&amp;roleTypeId=${roleTypeId}&amp;deleteCommEventIfLast=Y&amp;delContentDataResource=Y&amp;donePage=${parameters.donePage}"/>
</field>
<field name="subject" widget-style="buttontext" widget-area-style="fieldWidth300">
<hyperlink description="${subject} " target="ViewCommunicationEvent?communicationEventId=${communicationEventId}&amp;partyId=${partyId}&amp;roleTypeId=${roleTypeId}&amp;donePage=${donePage}"/>
<hyperlink description="${subject} " target="ViewCommunicationEvent?communicationEventId=${communicationEventId}&amp;partyId=${partyId}&amp;roleTypeId=${roleTypeId}&amp;donePage=${parameters.donePage}"/>
</field>
<field name="statusId" entry-name="roleStatusId" widget-style="buttontext" widget-area-style="fieldWidth300">
<display-entity entity-name="StatusItem" description="${description}">
<sub-hyperlink description="${uiLabelMap.${toComplete}}" target="setCommEventRoleToComplete?communicationEventId=${communicationEventId}&amp;partyId=${partyId}&amp;roleTypeId=${roleTypeId}&amp;donePage=${donePage}"/>
<sub-hyperlink description="${uiLabelMap.${toComplete}}" target="setCommunicationEventRoleStatus?communicationEventId=${communicationEventId}&amp;partyId=${partyId}&amp;roleTypeId=${roleTypeId}&amp;statusId=COM_ROLE_COMPLETED&amp;donePage=${parameters.donePage}&amp;VIEW_SIZE=${parameters.VIEWSIZE}&amp;VIEW_INDEX=${parameters.VIEW_INDEX}"/>
</display-entity>
</field>
<field name="statusId" entry-name="roleStatusId"/>
@@ -113,7 +113,7 @@ under the License.
extends="ListMyUnknownPartyEmails" extends-resource="component://party/webapp/partymgr/communication/CommForms.xml" use-row-submit="true">
<field name="donePage"><hidden/></field>
<field name="subject" widget-style="buttontext" widget-area-style="fieldWidth300">
<hyperlink description="${subject}" target="ViewCommunicationEvent?communicationEventId=${communicationEventId}&amp;donePage=${donePage}"/>
<hyperlink description="${subject}" target="ViewCommunicationEvent?communicationEventId=${communicationEventId}&amp;donePage=${parameters.donePage}"/>
</field>
<field name="_rowSubmit" title="S">
<check />
+5 -5
View File
@@ -100,24 +100,24 @@ under the License.
<menu name="MyCompanyCommsMenu">
<menu-item name="newEvent" title="${uiLabelMap.WorkEffortNewEvent}">
<link target="newEvent?donePage=${donePage}"/>
<link target="newEvent?donePage=${parameters.donePage}"/>
</menu-item>
</menu>
<menu name="communicationsMenu">
<menu-item name="newEmail" title="${uiLabelMap.PartyNewEmail}">
<link
target="EditCommunicationEvent?communicationEventTypeId=EMAIL_COMMUNICATION&amp;donePage=${donePage}" />
target="EditCommunicationEvent?communicationEventTypeId=EMAIL_COMMUNICATION&amp;donePage=${parameters.donePage}" />
</menu-item>
<menu-item name="newNote" title="${uiLabelMap.PartyNewInternalNote}">
<link
target="EditCommunicationEvent?communicationEventTypeId=COMMENT_NOTE&amp;donePage=${donePage}" />
target="EditCommunicationEvent?communicationEventTypeId=COMMENT_NOTE&amp;donePage=${parameters.donePage}" />
</menu-item>
<menu-item name="openEvents" title="${uiLabelMap.OpenEvents}">
<condition>
<if-compare field-name="parameters.status" operator="equals"
value="all" />
</condition>
<link target="${donePage}?status=open" />
<link target="${parameters.donePage}?donePage=${parameters.donePage}&amp;status=open" />
</menu-item>
<menu-item name="allOtherEvents" title="${uiLabelMap.AllEvents}">
<condition>
@@ -127,7 +127,7 @@ under the License.
<if-empty field-name="parameters.status"/>
</or>
</condition>
<link target="${donePage}?status=all" />
<link target="${parameters.donePage}?donePage=${parameters.donePage}&amp;status=all" />
</menu-item>
</menu>