Author: hansbak
Date: Fri Jun 26 06:35:54 2009
New Revision: 788606

URL: http://svn.apache.org/viewvc?rev=788606&view=rev
Log:
several adjustments on customer request notifications and added a notification 
when a note is added to the customer request

Added:
    
ofbiz/trunk/applications/order/webapp/ordermgr/request/AddedNoteCustRequestNotification.ftl
   (with props)
Modified:
    ofbiz/trunk/applications/order/config/OrderUiLabels.xml
    ofbiz/trunk/applications/order/data/OrderDemoData.xml
    
ofbiz/trunk/applications/order/script/org/ofbiz/order/request/CustRequestServices.xml
    ofbiz/trunk/applications/order/servicedef/secas.xml
    ofbiz/trunk/applications/order/servicedef/services_request.xml
    
ofbiz/trunk/applications/order/webapp/ordermgr/request/CompletedCustRequestNotification.ftl
    
ofbiz/trunk/applications/order/webapp/ordermgr/request/CreateCustRequestNotification.ftl

Modified: ofbiz/trunk/applications/order/config/OrderUiLabels.xml
URL: 
http://svn.apache.org/viewvc/ofbiz/trunk/applications/order/config/OrderUiLabels.xml?rev=788606&r1=788605&r2=788606&view=diff
==============================================================================
--- ofbiz/trunk/applications/order/config/OrderUiLabels.xml (original)
+++ ofbiz/trunk/applications/order/config/OrderUiLabels.xml Fri Jun 26 06:35:54 
2009
@@ -2380,6 +2380,9 @@
         <value xml:lang="en">Customer Request Completed Notification 
Mai</value>
         <value xml:lang="it">Notifica mail per richiesta cliente 
completata</value>
     </property>
+    <property key="OrderCustRequestNotificationMailNoteAdded">
+        <value xml:lang="en">Customer Request Note added Notification</value>
+    </property>
     <property key="OrderCustRequestNotificationMailCreation">
         <value xml:lang="en">Customer Request Creation Notification 
Mail</value>
         <value xml:lang="it">Notifica mail per richiesta cliente creata</value>

Modified: ofbiz/trunk/applications/order/data/OrderDemoData.xml
URL: 
http://svn.apache.org/viewvc/ofbiz/trunk/applications/order/data/OrderDemoData.xml?rev=788606&r1=788605&r2=788606&view=diff
==============================================================================
--- ofbiz/trunk/applications/order/data/OrderDemoData.xml (original)
+++ ofbiz/trunk/applications/order/data/OrderDemoData.xml Fri Jun 26 06:35:54 
2009
@@ -23,13 +23,17 @@
     <EmailTemplateSetting
         emailTemplateSettingId="CUST_REQ_ACCEPTED"
         
bodyScreenLocation="component://order/widget/ordermgr/RequestScreens.xml#CreateCustRequestNotification"
-        subject="OFBiz - Your Request Is Created[${custRequestId}]"
+        subject="OFBiz - Your Request is received: '${custRequestName}' 
#CR${custRequestId}"
         fromAddress="[email protected]"/>
     <EmailTemplateSetting emailTemplateSettingId="CUST_REQ_COMPLETED"
         
bodyScreenLocation="component://order/widget/ordermgr/RequestScreens.xml#CompletedCustRequestNotification"
-        subject="OFBiz - Your Request Is Complete[${custRequestId}]"
+        subject="OFBiz - Your Request is complete: '${custRequestName}' 
#CR${custRequestId}"
         fromAddress="[email protected]"/>
-
+    <EmailTemplateSetting emailTemplateSettingId="CUST_REQ_NOTE_ADDED"
+        
bodyScreenLocation="component://order/widget/ordermgr/RequestScreens.xml#AddNoteCustRequestNotification"
+        subject="OFBiz - A Note has been added to your request: 
'${custRequestName}' #CR${custRequestId}"
+        fromAddress="[email protected]"/>
+    
     <!-- incoming customer request examples -->
     <Party partyId="DemoCustomer"/>
     <Party partyId="DemoCustAgent"/>

Modified: 
ofbiz/trunk/applications/order/script/org/ofbiz/order/request/CustRequestServices.xml
URL: 
http://svn.apache.org/viewvc/ofbiz/trunk/applications/order/script/org/ofbiz/order/request/CustRequestServices.xml?rev=788606&r1=788605&r2=788606&view=diff
==============================================================================
--- 
ofbiz/trunk/applications/order/script/org/ofbiz/order/request/CustRequestServices.xml
 (original)
+++ 
ofbiz/trunk/applications/order/script/org/ofbiz/order/request/CustRequestServices.xml
 Fri Jun 26 06:35:54 2009
@@ -49,6 +49,7 @@
     </simple-method>
 
     <simple-method method-name="createCustRequest" short-description="Create 
Customer Request">
+        <log level="always" message="======start create with story: 
${parameters.story}"/>
         <make-value value-field="newEntity" entity-name="CustRequest"/>
         <set-nonpk-fields map="parameters" value-field="newEntity"/>
 
@@ -80,7 +81,7 @@
         <set-service-fields service-name="setCustRequestStatus" 
map="parameters" to-map="setStat"/>
         <call-service service-name="setCustRequestStatus" 
in-map-name="setStat"/>
         
-
+<log level="always" message="========================== story: 
${parameters.story}"></log>
         <!-- create also the item if key fields are provided -->
         <if>
             <condition>
@@ -216,6 +217,9 @@
         </call-service>
         <create-value value-field="newEntity"/>
         <field-to-result field="newEntity.noteId" result-name="noteId"/>
+        <entity-one entity-name="CustRequest" value-field="custRequest"/>
+        <field-to-result field="custRequest.fromPartyId" 
result-name="fromPartyId"/><!-- for notification services -->
+        <field-to-result field="custRequest.custRequestName" 
result-name="custRequestName"/><!-- for notification services -->
     </simple-method>
     <simple-method method-name="updateCustRequestNote" 
short-description="Update CustRequest Note">
         <entity-one entity-name="CustRequestNote" value-field="lookedUpValue"/>
@@ -235,6 +239,9 @@
         </call-service>
         <create-value value-field="newEntity"/>
         <field-to-result field="newEntity.noteId" result-name="noteId"/>
+        <entity-one entity-name="CustRequest" value-field="custRequest"/>
+        <field-to-result field="custRequest.fromPartyId" 
result-name="fromPartyId"/><!-- for notification services -->
+        <field-to-result field="custRequest.custRequestName" 
result-name="custRequestName"/><!-- for notification services -->
     </simple-method>
 
     <simple-method method-name="getCustRequestsByRole" 
short-description="Create Customer RequestItem Note">
@@ -364,6 +371,7 @@
             <field-to-result field="custRequest.statusId" 
result-name="oldStatusId"/>
             <field-to-result field="custRequest.custRequestId"  
result-name="custRequestId"/>
             <field-to-result field="custRequest.fromPartyId" 
result-name="fromPartyId"/><!-- for notification -->
+            <field-to-result field="custRequest.custRequestName" 
result-name="custRequestName"/><!-- for notification -->
             <if-compare-field field="custRequest.statusId" 
to-field="parameters.statusId" operator="not-equals">
                 <entity-one entity-name="StatusValidChange" 
value-field="statusChange">
                     <field-map field-name="statusId" 
from-field="custRequest.statusId"/>

Modified: ofbiz/trunk/applications/order/servicedef/secas.xml
URL: 
http://svn.apache.org/viewvc/ofbiz/trunk/applications/order/servicedef/secas.xml?rev=788606&r1=788605&r2=788606&view=diff
==============================================================================
--- ofbiz/trunk/applications/order/servicedef/secas.xml (original)
+++ ofbiz/trunk/applications/order/servicedef/secas.xml Fri Jun 26 06:35:54 2009
@@ -294,7 +294,7 @@
         <condition field-name="custRequestId" operator="is-not-empty"/>
         <action service="updateCommunicationEvent" mode="sync"/>
     </eca>
-
+    
     <eca service="updateCustRequest" event="commit">
         <condition field-name="communicationEventId" operator="is-not-empty"/>
         <condition field-name="custRequestId" operator="is-not-empty"/>
@@ -343,14 +343,17 @@
     </eca>
 
     <!-- customer request notifications -->
+    <!-- notification of a customer request received and accepted -->
     <eca service="setCustRequestStatus" event="commit">
         <condition field-name="oldStatusId" operator="not-equals" 
value="CRQ_ACCEPTED"/>
         <condition field-name="statusId" operator="equals" 
value="CRQ_ACCEPTED"/>
         <set field-name="bodyParameters.custRequestId" 
env-name="custRequestId"/>
+        <set field-name="bodyParameters.custRequestName" 
env-name="custRequestName"/>
         <set field-name="partyIdTo" env-name="fromPartyId"/>
         <set field-name="emailTemplateSettingId" value="CUST_REQ_ACCEPTED"/>
         <action service="sendMailFromTemplateSetting" mode="sync" />
     </eca>
+    <!-- notification of a customer request completed -->
     <eca service="setCustRequestStatus" event="commit">
         <condition field-name="oldStatusId" operator="not-equals" 
value="CRQ_COMPLETED"/>
         <condition field-name="statusId" operator="equals" 
value="CRQ_COMPLETED"/>
@@ -359,6 +362,15 @@
         <set field-name="emailTemplateSettingId" value="CUST_REQ_COMPLETED"/>
         <action service="sendMailFromTemplateSetting" mode="sync"/>
     </eca>
+    <!-- notification a item note was added to the customer request -->
+    <eca service="createCustRequestItemNote" event="commit">
+        <set field-name="bodyParameters.custRequestId" 
env-name="custRequestId"/>
+        <set field-name="bodyParameters.custRequestItemSeqId" 
env-name="custRequestItemSeqId"/>
+        <set field-name="bodyParameters.noteId" env-name="noteId"/>
+        <set field-name="partyIdTo" env-name="fromPartyId"/>
+        <set field-name="emailTemplateSettingId" value="CUST_REQ_NOTE_ADDED"/>
+        <action service="sendMailFromTemplateSetting" mode="sync"/>
+    </eca>
     <eca service="createSalesOpportunity" event="commit">
         <condition field-name="accountPartyId" operator="is-not-empty"/>
         <action service="createSalesOpportunityAccountRole" mode="sync"/>

Modified: ofbiz/trunk/applications/order/servicedef/services_request.xml
URL: 
http://svn.apache.org/viewvc/ofbiz/trunk/applications/order/servicedef/services_request.xml?rev=788606&r1=788605&r2=788606&view=diff
==============================================================================
--- ofbiz/trunk/applications/order/servicedef/services_request.xml (original)
+++ ofbiz/trunk/applications/order/servicedef/services_request.xml Fri Jun 26 
06:35:54 2009
@@ -118,6 +118,8 @@
         <attribute name="custRequestId" type="String" mode="IN" 
optional="false"/>
         <attribute name="noteInfo" type="String" mode="IN" optional="false"/>
         <attribute name="noteId" type="String" mode="OUT" optional="false"/>
+        <attribute name="fromPartyId" type="String" mode="OUT" 
optional="true"/><!-- party to be notified -->
+        <attribute name="custRequestName" type="String" mode="OUT" 
optional="true"/><!-- for notification services -->
     </service>
     <service name="updateCustRequestNote" engine="simple"
             
location="component://order/script/org/ofbiz/order/request/CustRequestServices.xml"
 invoke="updateCustRequestNote" auth="true">
@@ -133,6 +135,8 @@
         <attribute name="custRequestItemSeqId" type="String" mode="IN" 
optional="false"/>
         <attribute name="note" type="String" mode="IN" optional="false"/>
         <attribute name="noteId" type="String" mode="OUT" optional="false"/>
+        <attribute name="fromPartyId" type="String" mode="OUT" 
optional="true"/><!-- party to be notified -->
+        <attribute name="custRequestName" type="String" mode="OUT" 
optional="true"/><!-- for notification services -->
     </service>
     <service name="createCustRequestFromCart" engine="simple" auth="true"
             
location="component://order/script/org/ofbiz/order/request/CustRequestServices.xml"
 invoke="createCustRequestFromCart">
@@ -162,6 +166,7 @@
         <attribute name="statusId" type="String" mode="IN" optional="false"/>
         <attribute name="oldStatusId" type="String" mode="OUT" 
optional="true"/>
         <attribute name="fromPartyId" type="String" mode="OUT" 
optional="true"/><!-- for notification services -->
+        <attribute name="custRequestName" type="String" mode="OUT" 
optional="true"/><!-- for notification services -->
     </service>
     <service name="createCustRequestFromCommEvent" engine="simple" 
default-entity-name="CommunicationEvent"
             
location="component://order/script/org/ofbiz/order/request/CustRequestServices.xml"
 invoke="createCustRequestFromCommEvent" auth="true">

Added: 
ofbiz/trunk/applications/order/webapp/ordermgr/request/AddedNoteCustRequestNotification.ftl
URL: 
http://svn.apache.org/viewvc/ofbiz/trunk/applications/order/webapp/ordermgr/request/AddedNoteCustRequestNotification.ftl?rev=788606&view=auto
==============================================================================
--- 
ofbiz/trunk/applications/order/webapp/ordermgr/request/AddedNoteCustRequestNotification.ftl
 (added)
+++ 
ofbiz/trunk/applications/order/webapp/ordermgr/request/AddedNoteCustRequestNotification.ftl
 Fri Jun 26 06:35:54 2009
@@ -0,0 +1,38 @@
+<#--
+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.
+-->
+<html xmlns="http://www.w3.org/1999/xhtml";>
+    <head>
+        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
+        <title>${title}</title>
+        <link rel="stylesheet" href="${baseUrl?if_exists}/images/maincss.css" 
type="text/css"/>
+    </head>
+    <body>
+        <h2>${title}</h2>
+        <p>Hello ${person.firstName?if_exists} 
${person.lastName?if_exists},</p>
+        <p>Your Customer Request ${custRequest.custRequestName?if_exists} 
[${custRequest.custRequestId}] has a note added to it:<br/>
+        ${noteData.noteInfo?if_exists}
+        <br/><br/>
+        Please reply by email.<br/><br/>
+        The status and used hours can always be checked <br/>
+        <a 
href="${StringUtil.wrapString(baseUrl?if_exists)}/myportal/control/showPortletDecorator?portalPortletId=ViewCustRequest&custRequestId=${custRequest.custRequestId}">here.....</a>
+        <br/><br/>
+        Regards.<br/><br/>
+        Thank you for your business.
+    </body>
+</html>

Propchange: 
ofbiz/trunk/applications/order/webapp/ordermgr/request/AddedNoteCustRequestNotification.ftl
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: 
ofbiz/trunk/applications/order/webapp/ordermgr/request/AddedNoteCustRequestNotification.ftl
------------------------------------------------------------------------------
    svn:keywords = "Date Rev Author URL Id"

Propchange: 
ofbiz/trunk/applications/order/webapp/ordermgr/request/AddedNoteCustRequestNotification.ftl
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Modified: 
ofbiz/trunk/applications/order/webapp/ordermgr/request/CompletedCustRequestNotification.ftl
URL: 
http://svn.apache.org/viewvc/ofbiz/trunk/applications/order/webapp/ordermgr/request/CompletedCustRequestNotification.ftl?rev=788606&r1=788605&r2=788606&view=diff
==============================================================================
--- 
ofbiz/trunk/applications/order/webapp/ordermgr/request/CompletedCustRequestNotification.ftl
 (original)
+++ 
ofbiz/trunk/applications/order/webapp/ordermgr/request/CompletedCustRequestNotification.ftl
 Fri Jun 26 06:35:54 2009
@@ -20,7 +20,7 @@
     <head>
         <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
         <title>${title}</title>
-        <link rel="stylesheet" href="${baseUrl?if_exists}/images/maincss.css" 
type="text/css"/>
+        <link rel="stylesheet" 
href="${StringUtil.wrapString(baseUrl?if_exists)}/images/maincss.css" 
type="text/css"/>
     </head>
     <body>
         <h1>${title}</h1>
@@ -28,7 +28,7 @@
         <p>Your Customer Request ${custRequest.custRequestName?if_exists} 
[${custRequest.custRequestId}] has been completed.
         <br/><br/>
         The status and used hours can always be checked at the url: <br/>
-        <a 
href="${baseUrl?if_exists}/myportal/control/ViewRequest?custRequestId=${custRequest.custRequestId}">${baseUrl?if_exists}/myportal/control/ViewRequest?custRequestId=${custRequest.custRequestId}</a>
+        <a 
href="${StringUtil.wrapString(baseUrl?if_exists)}/myportal/control/showPortletDecorator?portalPortletId=ViewCustRequest&custRequestId=${custRequest.custRequestId}">${baseUrl?if_exists}/myportal/control/ViewRequest?custRequestId=${custRequest.custRequestId}</a>
         <br/><br/>
         Regards.<br/><br/>
         Thank you for your business.

Modified: 
ofbiz/trunk/applications/order/webapp/ordermgr/request/CreateCustRequestNotification.ftl
URL: 
http://svn.apache.org/viewvc/ofbiz/trunk/applications/order/webapp/ordermgr/request/CreateCustRequestNotification.ftl?rev=788606&r1=788605&r2=788606&view=diff
==============================================================================
--- 
ofbiz/trunk/applications/order/webapp/ordermgr/request/CreateCustRequestNotification.ftl
 (original)
+++ 
ofbiz/trunk/applications/order/webapp/ordermgr/request/CreateCustRequestNotification.ftl
 Fri Jun 26 06:35:54 2009
@@ -20,17 +20,17 @@
     <head>
         <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
         <title>${title}</title>
-        <link rel="stylesheet" href="${baseUrl?if_exists}/images/maincss.css" 
type="text/css"/>
+        <link rel="stylesheet" 
href="${StringUtil.wrapString(baseUrl?if_exists)}/images/maincss.css" 
type="text/css"/>
     </head>
     <body>
         <h1>${title}</h1>
-        <p>Hello ${person.firstName?if_exists} 
${person.lastName?if_exists},</p>
+        <p>Hello ${person.firstName?if_exists} ${person.middleName?if_exists} 
${person.lastName?if_exists},</p>
         <p>Your Customer Request ${custRequest.custRequestName?if_exists} 
[${custRequest.custRequestId}] has been created successfully.
         <br/><br/>
         We will solve/implement the request as soon as possible
         <br/><br/>
-        The status and used hours can always be checked at the url: <br/>
-        <a 
href="${baseUrl?if_exists}/myportal/control/ViewRequest?custRequestId=${custRequest.custRequestId}">${baseUrl?if_exists}/myportal/control/ViewRequest?custRequestId=${custRequest.custRequestId}</a>
+        The status and used hours can always be checked <br/>
+        <a 
href="${StringUtil.wrapString(baseUrl?if_exists)}/myportal/control/showPortletDecorator?portalPortletId=ViewCustRequest&custRequestId=${custRequest.custRequestId}">here....</a>
         <br/><br/>
         Regards.
         <br/><br/>


Reply via email to