svn commit: r677051 - in /ofbiz/trunk/applications/party: config/ script/org/ofbiz/party/communication/ servicedef/ webapp/partymgr/WEB-INF/ webapp/partymgr/WEB-INF/actions/communication/ webapp/partymgr/communication/ widget/partymgr/

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

svn commit: r677051 - in /ofbiz/trunk/applications/party: config/ script/org/ofbiz/party/communication/ servicedef/ webapp/partymgr/WEB-INF/ webapp/partymgr/WEB-INF/actions/communication/ webapp/partymgr/communication/ widget/partymgr/

hansbak-2
Author: hansbak
Date: Tue Jul 15 14:33:06 2008
New Revision: 677051

URL: http://svn.apache.org/viewvc?rev=677051&view=rev
Log:
create a customer request from (email) communicationEvent to be able to import email assignements via requests into the projectmanager

Added:
    ofbiz/trunk/applications/party/webapp/partymgr/WEB-INF/actions/communication/copyCommEventToRequest.groovy   (with props)
Modified:
    ofbiz/trunk/applications/party/config/PartyUiLabels.xml
    ofbiz/trunk/applications/party/script/org/ofbiz/party/communication/CommunicationEventServices.xml
    ofbiz/trunk/applications/party/servicedef/services.xml
    ofbiz/trunk/applications/party/webapp/partymgr/WEB-INF/controller.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/CommonScreens.xml
    ofbiz/trunk/applications/party/widget/partymgr/CommunicationScreens.xml

Modified: ofbiz/trunk/applications/party/config/PartyUiLabels.xml
URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/party/config/PartyUiLabels.xml?rev=677051&r1=677050&r2=677051&view=diff
==============================================================================
--- ofbiz/trunk/applications/party/config/PartyUiLabels.xml (original)
+++ ofbiz/trunk/applications/party/config/PartyUiLabels.xml Tue Jul 15 14:33:06 2008
@@ -3071,6 +3071,9 @@
         <value xml:lang="th">Security Error: ผิดพลาด ! ในการสร้างรหัสไปรษณีย์ตามที่อยู่ คุณต้องได้รับความยินยอมจาก PARTYMGR_CREATE หรือ PARTYMGR_ADMIN ก่อน</value>
         <value xml:lang="zh">安全错误: 要运行 createPostalAddressBoundary,你必须具有 PARTYMGR_CREATE 或 PARTYMGR_ADMIN 权限</value>
     </property>
+    <property key="PartyCreateRequestFromCommEvent">
+        <value xml:lang="en">Create CustReq from CommEvent</value>
+    </property>
     <property key="PartyCreateUserLogin">
         <value xml:lang="en">Create UserLogin</value>
         <value xml:lang="es">Crear usuario</value>

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=677051&r1=677050&r2=677051&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 Tue Jul 15 14:33:06 2008
@@ -261,5 +261,30 @@
         <call-service service-name="updateCommunicationEvent" in-map-name="inCom"/>
         
         <field-to-request field-name="parameters.communicationEventId" request-name="communicationEventId"/>
-    </simple-method>  
+    </simple-method>
+    <simple-method method-name="createRequestFromCommEvent" short-description="Create a Customer request from a commEvent(email)">
+        <entity-one entity-name="CommunicationEvent" value-name="communicationEvent"/>
+        <if-empty field="communicationEvent">
+            <add-error><fail-message message="Event Id: ${parameters.communicationEventId} not found"/></add-error>
+            <return response-code="errors"/>
+        </if-empty>    
+        
+        <set field="custRequest.custRequestName" from-field="communicationEvent.subject"/>
+        <set field="custRequest.description" from-field="communicationEvent.content"/>
+        <set field="custRequest.fromPartyId" from-field="communicationEvent.partyIdFrom"/>
+        <set field="custRequest.custRequestTypeId" value="RF_SUPPORT"/>
+        
+        <set-service-fields service-name="createCustRequest" map-name="parameters" to-map-name="custRequest"/>
+        <call-service service-name="createCustRequest" in-map-name="custRequest">
+            <result-to-field result-name="custRequestId" field-name="parameters.custRequestId"/>
+        </call-service>
+        <set-service-fields service-name="createCustRequestCommEvent" map-name="parameters" to-map-name="custRequestCommEvent"/>
+        <call-service service-name="createCustRequestCommEvent" in-map-name="custRequestCommEvent"/>
+        <field-to-result field-name="parameters.custRequestId" result-name="custRequestId"/>
+    </simple-method>
+    <simple-method method-name="createCustRequestCommEvent" short-description="Create CustRequestCommEvent" >
+        <make-value value-name="newEntity" entity-name="CustRequestCommEvent"/>
+        <set-pk-fields map-name="parameters" value-name="newEntity"/>
+        <create-value value-name="newEntity"/>    
+    </simple-method>
 </simple-methods>

Modified: ofbiz/trunk/applications/party/servicedef/services.xml
URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/party/servicedef/services.xml?rev=677051&r1=677050&r2=677051&view=diff
==============================================================================
--- ofbiz/trunk/applications/party/servicedef/services.xml (original)
+++ ofbiz/trunk/applications/party/servicedef/services.xml Tue Jul 15 14:33:06 2008
@@ -668,6 +668,12 @@
         <auto-attributes entity-name="CommunicationEventPurpose" include="pk" mode="IN" optional="false"/>
         <auto-attributes entity-name="CommunicationEventPurpose" include="nonpk" mode="IN" optional="true"/>
     </service>
+    <service name="createCustRequestCommEvent" engine="simple"
+            location="org/ofbiz/party/communication/CommunicationEventServices.xml" invoke="createCustRequestCommEvent" auth="true">
+        <description>Create a CustRequestCommEvent</description>
+        <permission-service service-name="partyCommunicationEventPermissionCheck" main-action="CREATE"/>
+        <auto-attributes entity-name="CustRequestCommEvent" include="pk" mode="IN" optional="false"/>
+    </service>
     <service name="removeCommunicationEventPurpose" engine="simple"
             location="org/ofbiz/party/communication/CommunicationEventServices.xml" invoke="removeCommunicationEventPurpose" auth="true">
         <description>Remove a Communication Event Purpose</description>
@@ -694,6 +700,16 @@
         <auto-attributes include="pk" mode="INOUT" optional="true" entity-name="CommunicationEventWorkEff"/>
         <auto-attributes include="nonpk" mode="IN" optional="true" entity-name="CommunicationEventWorkEff"/>
     </service>
+    <service name="createRequestFromCommEvent" engine="simple"
+            location="org/ofbiz/party/communication/CommunicationEventServices.xml" invoke="createRequestFromCommEvent" auth="true">
+        <description>Create a Customer request from a commEvent(email)</description>
+        <attribute name="communicationEventId" mode="IN" type="String" optional="false"/>
+        <attribute name="custRequestTypeId" mode="IN" type="String" optional="true"/>
+        <attribute name="custRequestName" mode="IN" type="String" optional="true"/>
+        <attribute name="description" mode="IN" type="String" optional="true"/>
+        <attribute name="custRequestId" mode="OUT" type="String" optional="false"/>
+    </service>
+    
     <service name="markCommEventRead" engine="simple"
             location="org/ofbiz/party/communication/CommunicationEventServices.xml" invoke="markEventRead" auth="true">
         <description>Marks a communication event as read if in the entered/pending status</description>

Added: ofbiz/trunk/applications/party/webapp/partymgr/WEB-INF/actions/communication/copyCommEventToRequest.groovy
URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/party/webapp/partymgr/WEB-INF/actions/communication/copyCommEventToRequest.groovy?rev=677051&view=auto
==============================================================================
--- ofbiz/trunk/applications/party/webapp/partymgr/WEB-INF/actions/communication/copyCommEventToRequest.groovy (added)
+++ ofbiz/trunk/applications/party/webapp/partymgr/WEB-INF/actions/communication/copyCommEventToRequest.groovy Tue Jul 15 14:33:06 2008
@@ -0,0 +1,31 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+import org.ofbiz.base.util.*;
+import org.ofbiz.entity.util.EntityUtil;
+
+if (parameters.communicationEventId) {
+ communicationEvent = delegator.findByPrimaryKey("CommunicationEvent", ["communicationEventId" : parameters.communicationEventId]);
+ if (communicationEvent) {
+ parameters.fromPartyId = communicationEvent.partyIdFrom;
+ parameters.custRequestName = communicationEvent.subject;
+ parameters.description =  communicationEvent.content != null && communicationEvent.content.length() > 255? communicationEvent.content.substring(255) : communicationEvent.content;
+ parameters.custRequestTypeId = "RF_SUPPORT";
+ }
+}

Propchange: ofbiz/trunk/applications/party/webapp/partymgr/WEB-INF/actions/communication/copyCommEventToRequest.groovy
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: ofbiz/trunk/applications/party/webapp/partymgr/WEB-INF/actions/communication/copyCommEventToRequest.groovy
------------------------------------------------------------------------------
    svn:keywords = Date Rev Author URL Id

Propchange: ofbiz/trunk/applications/party/webapp/partymgr/WEB-INF/actions/communication/copyCommEventToRequest.groovy
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Modified: ofbiz/trunk/applications/party/webapp/partymgr/WEB-INF/controller.xml
URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/party/webapp/partymgr/WEB-INF/controller.xml?rev=677051&r1=677050&r2=677051&view=diff
==============================================================================
--- ofbiz/trunk/applications/party/webapp/partymgr/WEB-INF/controller.xml (original)
+++ ofbiz/trunk/applications/party/webapp/partymgr/WEB-INF/controller.xml Tue Jul 15 14:33:06 2008
@@ -704,7 +704,16 @@
         <security https="true" auth="true" />
         <response name="success" type="view" value="ListUnknownPartyComms" />
  </request-map>
-        
+    <request-map uri="editRequestFromCommEvent">
+        <security https="true" auth="true" />
+        <response name="success" type="view" value="EditRequestFromCommEvent" />
+    </request-map>
+    <request-map uri="createRequestFromCommEvent">
+        <security https="true" auth="true"/>
+        <event type="service" invoke="createRequestFromCommEvent"/>
+        <response name="success" type="view" value="ViewRequest"/>
+        <response name="error" type="view" value="EditRequestFromCommEvent"/>
+    </request-map>
 
     <request-map uri="deletePartyCommunicationEvent">
         <security https="true" auth="true"/>
@@ -1113,6 +1122,8 @@
     <view-map name="EditCommEventWorkEffort" type="screen" page="component://party/widget/partymgr/CommunicationScreens.xml#EditCommEventWorkEffort"/>
     <view-map name="AddCommContent" type="screen" page="component://party/widget/partymgr/CommunicationScreens.xml#AddCommContent"/>
     <view-map name="EditCommContent" type="screen" page="component://party/widget/partymgr/CommunicationScreens.xml#EditCommContent"/>
+    <view-map name="EditRequestFromCommEvent" type="screen" page="component://party/widget/partymgr/CommunicationScreens.xml#EditRequestFromCommEvent"/>
+    <view-map name="ViewRequest" type="screen" page="component://order/widget/ordermgr/RequestScreens.xml#ViewRequest"/>
     
     <view-map name="CreateNewParty" type="screen" page="component://party/widget/partymgr/PartyScreens.xml#CreateNewParty"/>
     <view-map name="NewCustomer" type="screen" page="component://party/widget/partymgr/PartyScreens.xml#NewCustomer"/>

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=677051&r1=677050&r2=677051&view=diff
==============================================================================
--- ofbiz/trunk/applications/party/webapp/partymgr/communication/CommForms.xml (original)
+++ ofbiz/trunk/applications/party/webapp/partymgr/communication/CommForms.xml Tue Jul 15 14:33:06 2008
@@ -636,5 +636,18 @@
         <field name="lastName" position="3"><text/></field>
         <field name="submit" title="${uiLabelMap.CommonCreate}" widget-style="smallSubmit"><submit button-type="button"/></field>
     </form>
-    
+    <form name="EditRequestFromCommEvent" type="single" target="createRequestFromCommEvent" default-map-name="parameters">
+        <field name="communicationEventId"><hidden value="${parameters.communicationEventId}"/></field>
+        <field name="fromPartyId"><display-entity entity-name="PartyNameView" key-field-name="partyId" description="${firstName} ${middleName} ${lastName} ${groupName}"/></field>
+        <field name="custRequestTypeId" >
+            <drop-down>
+                <entity-options entity-name="CustRequestType" description="${description}">
+                    <entity-order-by field-name="description"/>
+                </entity-options>
+            </drop-down>
+        </field>
+        <field name="custRequestName"><text/></field>
+        <field name="description"><textarea/></field>
+        <field name="submit" title="${uiLabelMap.CommonCreate}" widget-style="smallSubmit"><submit button-type="button"/></field>
+    </form>
 </forms>

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=677051&r1=677050&r2=677051&view=diff
==============================================================================
--- ofbiz/trunk/applications/party/webapp/partymgr/communication/CommMenus.xml (original)
+++ ofbiz/trunk/applications/party/webapp/partymgr/communication/CommMenus.xml Tue Jul 15 14:33:06 2008
@@ -85,5 +85,11 @@
             </condition>
             <link target="EditCommunicationEvent?parentCommEventId=${parameters.communicationEventId}"/>
         </menu-item>
+        <menu-item name="createRequestFromCommEvent" title="${uiLabelMap.PartyCreateRequestFromCommEvent}">
+            <condition>
+                <not><if-empty field-name="parameters.communicationEventId"/></not>
+            </condition>
+            <link target="editRequestFromCommEvent?communicationEventId=${parameters.communicationEventId}"/>
+        </menu-item>
     </menu>
 </menus>

Modified: ofbiz/trunk/applications/party/widget/partymgr/CommonScreens.xml
URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/party/widget/partymgr/CommonScreens.xml?rev=677051&r1=677050&r2=677051&view=diff
==============================================================================
--- ofbiz/trunk/applications/party/widget/partymgr/CommonScreens.xml (original)
+++ ofbiz/trunk/applications/party/widget/partymgr/CommonScreens.xml Tue Jul 15 14:33:06 2008
@@ -191,6 +191,18 @@
             </widgets>
         </section>
     </screen>
+    <screen name="CommonRequestDecorator">
+        <section>
+            <actions/>
+            <widgets>
+                <decorator-screen name="main-decorator" location="${parameters.mainDecoratorLocation}">
+                    <decorator-section name="body">
+                      <decorator-section-include name="body"/>
+                    </decorator-section>
+                </decorator-screen>
+            </widgets>
+        </section>
+    </screen>
 </screens>
 
 

Modified: ofbiz/trunk/applications/party/widget/partymgr/CommunicationScreens.xml
URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/party/widget/partymgr/CommunicationScreens.xml?rev=677051&r1=677050&r2=677051&view=diff
==============================================================================
--- ofbiz/trunk/applications/party/widget/partymgr/CommunicationScreens.xml (original)
+++ ofbiz/trunk/applications/party/widget/partymgr/CommunicationScreens.xml Tue Jul 15 14:33:06 2008
@@ -290,6 +290,27 @@
             </widgets>
         </section>
     </screen>
+    <screen name="EditRequestFromCommEvent">
+        <section>
+            <actions>
+                <set field="titleProperty" value="PageTitleEditCommunication" />
+                <set field="tabButtonItem" value="CommunicationEvent" />
+                <script location="component://party/webapp/partymgr/WEB-INF/actions/communication/copyCommEventToRequest.groovy"/>
+            </actions>
+            <widgets>
+                <decorator-screen name="CommonCommunicationEventDecorator"
+                    location="${parameters.mainDecoratorLocation}">
+                    <decorator-section name="body">
+                        <screenlet  title="${uiLabelMap.PartyEditCustomerRequest}">
+                            <include-form
+                                location="component://party/webapp/partymgr/communication/CommForms.xml"
+                                name="EditRequestFromCommEvent" />
+                        </screenlet>
+                    </decorator-section>
+                </decorator-screen>
+            </widgets>
+        </section>
+    </screen>
     
     <screen name="UpdateCommRoles">
         <section>