svn commit: r794603 - in /ofbiz/trunk/applications/party: script/org/ofbiz/party/communication/CommunicationEventEvents.xml webapp/partymgr/WEB-INF/controller.xml webapp/partymgr/communication/CommForms.xml widget/partymgr/CommunicationScreens.xml

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

svn commit: r794603 - in /ofbiz/trunk/applications/party: script/org/ofbiz/party/communication/CommunicationEventEvents.xml webapp/partymgr/WEB-INF/controller.xml webapp/partymgr/communication/CommForms.xml widget/partymgr/CommunicationScreens.xml

hansbak-2
Author: hansbak
Date: Thu Jul 16 09:15:08 2009
New Revision: 794603

URL: http://svn.apache.org/viewvc?rev=794603&view=rev
Log:
add file in edit email screen does not clear subject or content, cleanup of unused programs, add role delete button, change appearance of the screen

Modified:
    ofbiz/trunk/applications/party/script/org/ofbiz/party/communication/CommunicationEventEvents.xml
    ofbiz/trunk/applications/party/webapp/partymgr/WEB-INF/controller.xml
    ofbiz/trunk/applications/party/webapp/partymgr/communication/CommForms.xml
    ofbiz/trunk/applications/party/widget/partymgr/CommunicationScreens.xml

Modified: ofbiz/trunk/applications/party/script/org/ofbiz/party/communication/CommunicationEventEvents.xml
URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/party/script/org/ofbiz/party/communication/CommunicationEventEvents.xml?rev=794603&r1=794602&r2=794603&view=diff
==============================================================================
--- ofbiz/trunk/applications/party/script/org/ofbiz/party/communication/CommunicationEventEvents.xml (original)
+++ ofbiz/trunk/applications/party/script/org/ofbiz/party/communication/CommunicationEventEvents.xml Thu Jul 16 09:15:08 2009
@@ -21,43 +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="addContentToCommEvent"
-        short-description="Add content to email communication">
-        <!-- Call layout to get field -->
-        <call-class-method class-name="org.ofbiz.content.layout.LayoutWorker"
-            method-name="uploadImageAndParameters" ret-field="formInput">
-            <field field="request" type="javax.servlet.http.HttpServletRequest"/>
-            <string value="partyId"/>
-        </call-class-method>
-
-        <!-- Create party content -->
-        <set-service-fields service-name="createPartyContent" map="formInput.formInput"
-            to-map="partycontent"/>
-        <set field="partycontent.contentId" from-field="formInput.formInput.contentId"/>
-        <set field="partycontent.partyContentTypeId"
-            from-field="formInput.formInput.partyContentTypeId"/>
-        <set field="partycontent.partyId" from-field="formInput.formInput.partyId"/>
-        <call-service service-name="createPartyContent" in-map-name="partycontent"/>
-
-        <!-- Create communication event and content association -->
-        <set-service-fields service-name="createCommEventContentAssoc"
-            map="formInput.formInput" to-map="contentAssoc"/>
-        <set field="contentAssoc.contentId" from-field="formInput.formInput.contentId"/>
-        <set field="contentAssoc.communicationEventId"
-            from-field="formInput.formInput.communicationEventId"/>
-        <call-service service-name="createCommEventContentAssoc" in-map-name="contentAssoc">
-            <result-to-field result-name="fromDate" field="fromDate"/>
-        </call-service>
-
-        <!-- Return to request -->
-        <set field="communicationEventTypeId"
-            from-field="formInput.formInput.communicationEventTypeId"/>
-        <set field="communicationEventId" from-field="formInput.formInput.communicationEventId"/>
-        <field-to-request field="communicationEventTypeId"
-            request-name="communicationEventTypeId"/>
-        <field-to-request field="communicationEventId" request-name="communicationEventId"/>
-    </simple-method>
-    <simple-method method-name="createCommunicationContent"
+    <simple-method method-name="createCommunicationEventContent"
         short-description="Upload Content and Create Communication Content Association">
         <!-- Call layout to get field -->
         <call-class-method class-name="org.ofbiz.content.layout.LayoutWorker"
@@ -65,6 +29,11 @@
             <field field="request" type="javax.servlet.http.HttpServletRequest"/>
             <string value="uploadedFile"/>
         </call-class-method>
+        <if-empty field="formInput.imageFileName">
+            <add-error><fail-message message="Upload file is missing..."/></add-error>
+        </if-empty>
+        <check-errors/>
+        
         <set field="parameters.imageFileName" from-field="formInput.imageFileName"/>
 
         <!-- Create Data Resource -->
@@ -74,7 +43,7 @@
         <set field="data.dataTemplateTypeId" value="NONE"/>
         <set field="data.dataCategoryId" from-field="formInput.formInput.dataCategoryId"/>
 
-        <set field="data.statusId" from-field="formInput.formInput.statusId"/>
+        <set field="data.statusId" from-field="formInput.formInput.resourceStatusId"/>
         <set field="data.dataResourceName" from-field="formInput.imageFileName"/>
         <set field="data.mimeTypeId" from-field="mimeType.mimeTypeId"/>
         <set field="data.uploadedFile" from-field="formInput.imageData"/>
@@ -125,6 +94,10 @@
             <result-to-field result-name="fromDate" field="fromDate"/>
         </call-service>
 
+        <!-- save header fields -->
+        <set-service-fields service-name="updateCommunicationEvent" map="formInput.formInput" to-map="updateMap"/>
+        <call-service service-name="updateCommunicationEvent" in-map-name="updateMap"/>
+
         <!-- Return to request -->
         <field-to-request field="formInput.formInput.communicationEventId" request-name="communicationEventId"/>
         <set field="my" value="My"/>

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=794603&r1=794602&r2=794603&view=diff
==============================================================================
--- ofbiz/trunk/applications/party/webapp/partymgr/WEB-INF/controller.xml (original)
+++ ofbiz/trunk/applications/party/webapp/partymgr/WEB-INF/controller.xml Thu Jul 16 09:15:08 2009
@@ -731,21 +731,15 @@
         <security https="true" auth="true"/>
         <response name="success" type="view" value="ViewCommunicationEvent"/>
     </request-map>
-    <request-map uri="addContentToCommEvent">
-        <security https="true" auth="true"/>
-        <event type="simple" invoke="addContentToCommEvent" path="component://party/script/org/ofbiz/party/communication/CommunicationEventEvents.xml"/>
-        <response name="success" type="request" value="EditCommunicationEvent"/>
-        <response name="error" type="view" value="EditCommunicationEvent"/>
-    </request-map>
     <request-map uri="uploadAttachFiletoEmail">
         <security https="true" auth="true"/>
-        <event type="simple" invoke="createCommunicationContent" path="component://party/script/org/ofbiz/party/communication/CommunicationEventEvents.xml"/>
+        <event type="simple" invoke="createCommunicationEventContent" path="component://party/script/org/ofbiz/party/communication/CommunicationEventEvents.xml"/>
         <response name="success" type="view" value="EditCommunicationEvent"/>
         <response name="error" type="view" value="EditCommunicationEvent"/>
     </request-map>
     <request-map uri="uploadAttachFile">
         <security https="true" auth="true"/>
-        <event type="simple" invoke="createCommunicationContent" path="component://party/script/org/ofbiz/party/communication/CommunicationEventEvents.xml"/>
+        <event type="simple" invoke="createCommunicationEventContent" path="component://party/script/org/ofbiz/party/communication/CommunicationEventEvents.xml"/>
         <response name="success" type="view" value="ListCommContent"/>
         <response name="error" type="view" value="ListCommContent"/>
     </request-map>

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=794603&r1=794602&r2=794603&view=diff
==============================================================================
--- ofbiz/trunk/applications/party/webapp/partymgr/communication/CommForms.xml (original)
+++ ofbiz/trunk/applications/party/webapp/partymgr/communication/CommForms.xml Thu Jul 16 09:15:08 2009
@@ -23,6 +23,7 @@
     <form name="EditCommEvent" type="single" target="updateCommunicationEvent" default-map-name="communicationEvent">
         <alt-target target="createCommunicationEvent" use-when="communicationEvent==null"/>
         <field name="communicationEventId" use-when="communicationEvent!=null"><display/></field>
+        <field name="my"><hidden value="${my}"/></field>
         <field name="parentCommEventId" position="2">
             <lookup target-form-name="LookupCommEvent">
                 <sub-hyperlink link-style="buttontext" target="EditCommunicationEvent" description="${uiLabelMap.PartyGoToParent}" use-when="communicationEvent!=null&amp;&amp;communicationEvent.get(&quot;parentCommEventId&quot;)!=null">
@@ -120,7 +121,7 @@
         <field name="messageId"><display/></field>
         <field name="submitButton" title="${uiLabelMap.CommonSave}"><submit button-type="button"/></field>
     </form>
-    <form name="EditEmail" type="single" target="createCommunicationEvent" default-map-name="communicationEvent">
+    <form name="EditEmail" type="single" target="createCommunicationEvent" default-map-name="communicationEvent" id="EditEmail">
         <actions>
             <set field="nowDate" value="${bsh:org.ofbiz.base.util.UtilDateTime.nowDateString(&quot;yyyy-MM-dd HH:mm:ss.S&quot;)}" type="String"/>
             <entity-condition entity-name="PartyContactWithPurpose" list="emailAddresses">
@@ -149,24 +150,24 @@
         <field name="parentCommEventId" use-when="parentCommEventId != null"><hidden value="${parameters.parentCommEventId}"/></field>
         <field name="parentCommEventId" use-when="originalCommEventId != null"><hidden value="${parameters.originalCommEventId}"/></field>
         <field name="partyIdFrom"><hidden/></field>
-        <field name="my"><hidden value="${parameters.my}"/></field>
+        <field name="my"><hidden value="${my}"/></field>
         <field name="fromEmailAddr" parameter-name="contactMechIdFrom">
             <drop-down>
                 <list-options list-name="emailAddresses" description="${infoString}" key-name="contactMechId"/>
             </drop-down>
         </field>
-        <field name="partyIdTo">
+        <field name="partyIdTo" position="1">
             <lookup target-form-name="LookupPartyName" default-value="${partyIdTo}"/>
         </field>
-        <field name="datetimeStarted" title="${uiLabelMap.CommonSendDate}"><date-time/></field>
-        <field name="subject"><text size="60" default-value="${parameters.subject}"/></field>
+        <field name="datetimeStarted" title="${uiLabelMap.CommonSendDate}" position="2"><date-time type="date"/></field>
+        <field name="subject"><text size="74" default-value="${parameters.subject}"/></field>
         <field name="contentMimeTypeId"><hidden value="text/plain"/></field>
         <field name="content" title="${uiLabelMap.CommonContent}" encode-output="false"><textarea cols="72" rows="15" default-value="${parameters.content}"/></field>
         <field name="send" title=" " position="1" use-when="communicationEvent!=null">
-            <hyperlink also-hidden="true" target-type="plain" description="${uiLabelMap.CommonSend}" target="javascript:(document.EditEmail.submit())"/>
+            <hyperlink also-hidden="false" target-type="plain" description="${uiLabelMap.CommonSend}" target="javascript:(document.EditEmail.submit())"/>
         </field>
         <field name="save" title=" " position="2" use-when="communicationEvent!=null">
-            <hyperlink also-hidden="true" target-type="plain" description="${uiLabelMap.CommonSave}" target="javascript:(document.EditEmail.statusId.value='COM_PENDING'),(document.EditEmail.submit())"/>
+            <hyperlink also-hidden="false" target-type="plain" description="${uiLabelMap.CommonSave}" target="javascript:(document.EditEmail.statusId.value='COM_PENDING'),(document.EditEmail.submit())"/>
         </field>
         <field name="createButton" use-when="communicationEvent==null"><submit/></field>
         <field name="dummy" position="320"><hidden/></field>
@@ -626,17 +627,21 @@
                 </entity-options>
             </drop-down>
         </field>
-        <field name="submitButton" title="${uiLabelMap.PartyAddRole}"><submit button-type="button"/></field>
+        <field name="submitButton" title="${uiLabelMap.PartyAddRole}"><submit button-type="text-link"/></field>
     </form>
 
-    <form name="listCommContent" type="list" list-name="contentDataResourceList" paginate-target="/ListCommContent"
+    <form name="listCommContent" type="list" list-name="contentDataResourceList" paginate-target="/ListCommContent" target="removeAttachFile"
         odd-row-style="alternate-row" default-table-style="basic-table hover-bar">
         <actions>
             <entity-and entity-name="CommEventContentDataResource" list="contentDataResourceList">
                 <field-map field-name="communicationEventId" from-field="parameters.communicationEventId"/>
             </entity-and>
         </actions>
-        <field name="contentName" widget-style="smallSubmit">
+        <field name="communicationEventId"><hidden/></field>
+        <field name="contentId"><hidden/></field>
+        <field name="fromDate"><hidden/></field>
+        <field name="my"><hidden/></field>
+        <field name="contentName">
             <hyperlink also-hidden="false" description="${contentName} [${contentId}]" target="ViewSimpleContent">
                 <parameter param-name="contentId"/>
                 <parameter param-name="dataResourceId"/>
@@ -644,14 +649,7 @@
                 <parameter param-name="fromDate"/>
             </hyperlink>
         </field>
-        <field name="contentTypeId"><display-entity entity-name="ContentType" description="${description}"/></field>
-        <field name="fromDate"><display/></field>
-        <!-- <field name="drDataResourceName" widget-style="smallSubmit">
-            <hyperlink also-hidden="false" description="${drDataResourceName} [${drDataResourceId}]" target="/content/control/EditDataResource" target-type="inter-app">
-                <parameter param-name="dataResourceId" from-field="drDataResourceId"/>
-            </hyperlink>
-        </field-->
-        <field name="drMimeTypeId"><display-entity entity-name="MimeType" description="${description}" key-field-name="mimeTypeId"/></field>
+        <field name="deleteButton"><submit button-type="text-link"/></field>
     </form>
 
     <form name="addCommContent" type="single" target="createCommContentDataResource"
@@ -774,16 +772,25 @@
     <form name="uploadContent" type="upload" target="uploadAttachFiletoEmail">
         <field name="dataCategoryId"><hidden value="PERSONAL"/></field>
         <field name="contentTypeId"><hidden value="DOCUMENT"/></field>
-        <field name="statusId"><hidden value="CTNT_PUBLISHED"/></field>
+        <field name="resourceStatusId"><hidden value="CTNT_PUBLISHED"/></field>
         <field name="partyId"><hidden value="${partyIdFrom}"/></field>
         <field name="partyContentTypeId" ><hidden value="USERDEF"/></field>
         <field name="roleTypeId"><hidden value="CONTENT"/></field>
-        <field name="communicationEventId"><hidden value="${parameters.communicationEventId}"/></field>
-        <field name="communicationEventTypeId"><hidden value="${communicationEventTypeId}"/></field>
-        <field name="parentCommEventId"><hidden value="${parameters.parentCommEventId}"/></field>
-        <field name="originalCommEventId"><hidden value="${parameters.originalCommEventId}"/></field>
+        <field name="communicationEventId"><hidden value="${communicationEvent.communicationEventId}"/></field>
+        <field name="communicationEventTypeId"><hidden value="${communicationEvent.communicationEventTypeId}"/></field>
+        <field name="parentCommEventId"><hidden value="${communicationEvent.parentCommEventId}"/></field>
+        <field name="originalCommEventId"><hidden value="${communicationEvent.originalCommEventId}"/></field>
+        <field name="subject"><hidden/></field>
+        <field name="content"><hidden/></field>
+        <field name="partyIdTo"><hidden/></field>
+        <field name="datetimeStarted"><hidden/></field>
+        <field name="my"><hidden value="${my}"/></field>
         <field name="uploadedFile"><file/></field>
-        <field name="upLoad" title="${uiLabelMap.CommonUpload}"><submit/></field>
+        <field name="send" title=" ">
+            <hyperlink also-hidden="true"
+                target-type="plain" description="${uiLabelMap.CommonUpload}"
+                target="javascript:(document.uploadContent.datetimeStarted.value=document.EditEmail.datetimeStarted.value),(document.uploadContent.partyIdTo.value=document.EditEmail.partyIdTo.value),(document.uploadContent.subject.value=document.EditEmail.subject.value),(document.uploadContent.content.value=document.EditEmail.content.value),(document.uploadContent.submit())"/>
+        </field>
     </form>
     <form name="uploadContent1" type="upload" extends="uploadContent" target="uploadAttachFile"/>    
 

Modified: ofbiz/trunk/applications/party/widget/partymgr/CommunicationScreens.xml
URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/party/widget/partymgr/CommunicationScreens.xml?rev=794603&r1=794602&r2=794603&view=diff
==============================================================================
--- ofbiz/trunk/applications/party/widget/partymgr/CommunicationScreens.xml (original)
+++ ofbiz/trunk/applications/party/widget/partymgr/CommunicationScreens.xml Thu Jul 16 09:15:08 2009
@@ -346,16 +346,16 @@
                                         </screenlet>
                                     </widgets>
                                     <fail-widgets>
+                                        <screenlet title="${uiLabelMap.CommonFrom}: ${communicationEvent.partyIdFrom}, CommunicationEventId: ${communicationEvent.communicationEventId}">
+                                            <include-form location="component://party/webapp/partymgr/communication/CommForms.xml" name="EditEmail"/>
+                                        </screenlet>
                                         <container style="lefthalf">
-                                            <screenlet title="${uiLabelMap.CommonFrom}: ${communicationEvent.partyIdFrom}, CommunicationEventId: ${communicationEvent.communicationEventId}">
-                                                <include-form location="component://party/webapp/partymgr/communication/CommForms.xml" name="EditEmail"/>
-                                            </screenlet>
-                                        </container>
-                                        <container style="righthalf">
                                             <screenlet title="${uiLabelMap.PartyCommEventRoles}">
                                                 <include-form name="ListCommRoles" location="component://party/webapp/partymgr/communication/CommForms.xml"/>
                                                 <include-form name="AddEventRole" location="component://party/webapp/partymgr/communication/CommForms.xml"/>
                                             </screenlet>
+                                        </container>
+                                        <container style="righthalf">
                                             <screenlet title="${uiLabelMap.PartyCommContent}">
                                                 <include-form name="listCommContent" location="component://party/webapp/partymgr/communication/CommForms.xml"/>
                                                 <include-form  name="uploadContent" location="component://party/webapp/partymgr/communication/CommForms.xml"/>