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/28 22:36:46 UTC

svn commit: r680484 - in /ofbiz/trunk/applications/party: script/org/ofbiz/party/communication/ script/org/ofbiz/party/party/ servicedef/ webapp/partymgr/communication/ widget/partymgr/

Author: hansbak
Date: Mon Jul 28 13:36:45 2008
New Revision: 680484

URL: http://svn.apache.org/viewvc?rev=680484&view=rev
Log:
created a setCommunicationRoleStatus service with minor other changes

Modified:
    ofbiz/trunk/applications/party/script/org/ofbiz/party/communication/CommunicationEventServices.xml
    ofbiz/trunk/applications/party/script/org/ofbiz/party/party/PartyPermissionServices.xml
    ofbiz/trunk/applications/party/servicedef/services.xml
    ofbiz/trunk/applications/party/webapp/partymgr/communication/CommForms.xml
    ofbiz/trunk/applications/party/webapp/partymgr/communication/CommMenus.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=680484&r1=680483&r2=680484&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 Mon Jul 28 13:36:45 2008
@@ -25,7 +25,7 @@
         <if-not-empty field="parameters.parentCommEventId">
             <set field="newStat.communicationEventId" from-field="parameters.parentCommEventId"/>
             <set field="newStat.statusId" value="COM_COMPLETE"/>
-            <call-service service-name="setCommunicationEventStatus" in-map-name="newStat"/>
+            <call-service service-name="setCommunicationEventRoleStatus" in-map-name="newStat"/>
         </if-not-empty>
         
         <if-empty field="parameters.statusId">
@@ -330,7 +330,7 @@
         <set field="inComRole.communicationEventId" from-field="parameters.communicationEventId"/>
         <set field="inComRole.partyId" from-field="parameters.partyId"/>
         <set field="inComRole.roleTypeId" value="ORIGINATOR"/>
-        <set field="inComRole.statusId" value="COM_ROLE_CREATED"/>
+        <set field="inComRole.statusId" value="COM_ROLE_COMPLETED"/>
         <set field="inComRole.contactMechId" from-field="inCom.contactMechIdFrom" />
         <call-service service-name="createCommunicationEventRole" in-map-name="inComRole"/>
         
@@ -389,4 +389,23 @@
             </if-empty>
         </if-compare-field>
     </simple-method>
+    <simple-method method-name="setCommunicationEventRoleStatus" short-description="Set The Communication Event Status for a specific role">
+        <entity-one entity-name="CommunicationEventRole" value-name="communicationEventRole"/>
+        <field-to-result field-name="communicationEventRole.statusId" result-name="oldStatusId"/>
+        <if-compare-field field="communicationEventRole.statusId" to-field="parameters.statusId" operator="not-equals">
+            <entity-one entity-name="StatusValidChange" value-name="statusChange">
+                <field-map field-name="statusId" env-name="communicationEventRole.statusId"/>
+                <field-map field-name="statusIdTo" env-name="parameters.statusId"/>
+            </entity-one>
+            <if-empty field="statusChange">
+                <add-error><fail-message message="Status is not a valid change"/></add-error>
+                <log level="error" message="Cannot change from ${communicationEventRole.statusId} to ${parameters.statusId}"/>
+                <check-errors/>
+                <else>
+                    <set field="communicationEventRole.statusId" from-field="parameters.statusId"/>
+                    <store-value value-name="communicationEventRole"/>
+                </else>
+            </if-empty>
+        </if-compare-field>
+    </simple-method>
 </simple-methods>

Modified: ofbiz/trunk/applications/party/script/org/ofbiz/party/party/PartyPermissionServices.xml
URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/party/script/org/ofbiz/party/party/PartyPermissionServices.xml?rev=680484&r1=680483&r2=680484&view=diff
==============================================================================
--- ofbiz/trunk/applications/party/script/org/ofbiz/party/party/PartyPermissionServices.xml (original)
+++ ofbiz/trunk/applications/party/script/org/ofbiz/party/party/PartyPermissionServices.xml Mon Jul 28 13:36:45 2008
@@ -244,6 +244,7 @@
                 <and>
                     <if-compare-field field="parameters.partyIdFrom" to-field="userLogin.partyId" operator="not-equals"/>
                     <if-compare-field field="parameters.partyIdTo" to-field="userLogin.partyId" operator="not-equals"/>
+                    <if-compare-field field="parameters.partyId" to-field="userLogin.partyId" operator="not-equals"/><!-- update role -->
                 </and>
             </condition>
             <then>

Modified: ofbiz/trunk/applications/party/servicedef/services.xml
URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/party/servicedef/services.xml?rev=680484&r1=680483&r2=680484&view=diff
==============================================================================
--- ofbiz/trunk/applications/party/servicedef/services.xml (original)
+++ ofbiz/trunk/applications/party/servicedef/services.xml Mon Jul 28 13:36:45 2008
@@ -630,10 +630,19 @@
     </service>
 
     <!-- Communication Event Services -->
-    <service name="setCommunicationEventStatus" engine="simple"
+    <service name="setCommunicationEventStatus" engine="simple" default-entity-name="CommunicationEvent"
             location="org/ofbiz/party/communication/CommunicationEventServices.xml" invoke="setCommunicationEventStatus" auth="true">
-        <description>Set the Communication event  Status</description>
-        <attribute name="communicationEventId" type="String" mode="IN" optional="false"/>
+        <description>Set the Communication event Status</description>
+        <permission-service service-name="partyCommunicationEventPermissionCheck" main-action="UPDATE"/>
+        <auto-attributes mode="IN" include="pk" optional="false"/>
+        <attribute name="statusId" type="String" mode="IN" optional="false"/>
+        <attribute name="oldStatusId" type="String" mode="OUT" optional="true"/>
+    </service>
+    <service name="setCommunicationEventRoleStatus" engine="simple" default-entity-name="CommunicationEventRole"
+            location="org/ofbiz/party/communication/CommunicationEventServices.xml" invoke="setCommunicationEventRoleStatus" auth="true">
+        <description>Set the Communication event  Status for a specific role</description>
+        <permission-service service-name="partyCommunicationEventPermissionCheck" main-action="UPDATE"/>
+        <auto-attributes mode="IN" include="pk" optional="false"/>
         <attribute name="statusId" type="String" mode="IN" optional="false"/>
         <attribute name="oldStatusId" type="String" mode="OUT" optional="true"/>
     </service>

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=680484&r1=680483&r2=680484&view=diff
==============================================================================
--- ofbiz/trunk/applications/party/webapp/partymgr/communication/CommForms.xml (original)
+++ ofbiz/trunk/applications/party/webapp/partymgr/communication/CommForms.xml Mon Jul 28 13:36:45 2008
@@ -438,6 +438,7 @@
                 <sub-hyperlink target="viewprofile?partyId=${partyId}" link-style="smallSubmit" description="${partyId}"/>
             </display-entity>
         </field>
+        <field name="contactMechId"><display-entity description="${infoString}" entity-name="ContactMech"/></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="removeLink" title="${uiLabelMap.CommonEmptyHeader}" widget-style="smallSubmit">
@@ -445,6 +446,10 @@
         </field>
     </form>
 
+    <form name="ViewCommRoles" extends="ListCommRoles">
+        <field name="removeLink"><ignored/></field>
+    </form> 
+
     <form name="AddEventRole" type="single" target="createCommunicationEventRole"
         header-row-style="header-row" default-table-style="basic-table">
         <field name="communicationEventId"><hidden/></field>

Modified: ofbiz/trunk/applications/party/webapp/partymgr/communication/CommMenus.xml
URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/party/webapp/partymgr/communication/CommMenus.xml?rev=680484&r1=680483&r2=680484&view=diff
==============================================================================
--- ofbiz/trunk/applications/party/webapp/partymgr/communication/CommMenus.xml (original)
+++ ofbiz/trunk/applications/party/webapp/partymgr/communication/CommMenus.xml Mon Jul 28 13:36:45 2008
@@ -84,6 +84,7 @@
                 <and>
                     <not><if-empty field-name="parameters.communicationEventId"/></not>
                     <not><if-empty field-name="communicationEvent.partyIdFrom"/></not>
+                    <if-compare field-name="communicationEvent.partyIdFrom" operator="not-equals" value="${userLogin.partyId}"/>
                 </and>
             </condition>
             <link target="EditCommunicationEvent?parentCommEventId=${parameters.communicationEventId}"/>

Modified: ofbiz/trunk/applications/party/widget/partymgr/CommunicationScreens.xml
URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/party/widget/partymgr/CommunicationScreens.xml?rev=680484&r1=680483&r2=680484&view=diff
==============================================================================
--- ofbiz/trunk/applications/party/widget/partymgr/CommunicationScreens.xml (original)
+++ ofbiz/trunk/applications/party/widget/partymgr/CommunicationScreens.xml Mon Jul 28 13:36:45 2008
@@ -188,7 +188,7 @@
                             <section>
                                 <widgets>
                                     <screenlet title="${uiLabelMap.PartyCommEventRoles}">
-                                        <include-form name="ListCommRoles"
+                                        <include-form name="ViewCommRoles"
                                             location="component://party/webapp/partymgr/communication/CommForms.xml" />
                                     </screenlet>
                                 </widgets>