svn commit: r447585 - in /incubator/ofbiz/trunk/applications/order: config/OrderUiLabels.properties webapp/ordermgr/WEB-INF/actions/order/sendconfirmationemail.bsh webapp/ordermgr/WEB-INF/controller.xml webapp/ordermgr/order/sendconfirmationemail.ftl

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

svn commit: r447585 - in /incubator/ofbiz/trunk/applications/order: config/OrderUiLabels.properties webapp/ordermgr/WEB-INF/actions/order/sendconfirmationemail.bsh webapp/ordermgr/WEB-INF/controller.xml webapp/ordermgr/order/sendconfirmationemail.ftl

sichen
Author: sichen
Date: Mon Sep 18 15:00:26 2006
New Revision: 447585

URL: http://svn.apache.org/viewvc?view=rev&rev=447585
Log:
Enhance send confirmation email to preview generated email and edit it.

Modified:
    incubator/ofbiz/trunk/applications/order/config/OrderUiLabels.properties
    incubator/ofbiz/trunk/applications/order/webapp/ordermgr/WEB-INF/actions/order/sendconfirmationemail.bsh
    incubator/ofbiz/trunk/applications/order/webapp/ordermgr/WEB-INF/controller.xml
    incubator/ofbiz/trunk/applications/order/webapp/ordermgr/order/sendconfirmationemail.ftl

Modified: incubator/ofbiz/trunk/applications/order/config/OrderUiLabels.properties
URL: http://svn.apache.org/viewvc/incubator/ofbiz/trunk/applications/order/config/OrderUiLabels.properties?view=diff&rev=447585&r1=447584&r2=447585
==============================================================================
--- incubator/ofbiz/trunk/applications/order/config/OrderUiLabels.properties (original)
+++ incubator/ofbiz/trunk/applications/order/config/OrderUiLabels.properties Mon Sep 18 15:00:26 2006
@@ -573,6 +573,9 @@
 OrderSendConfirmationEmailCCTo=CC To
 OrderSendConfirmationEmailSubject=Subject
 OrderSendConfirmationEmailNote=Note
+OrderSendConfirmationEmailBCCTo=BCC To
+OrderSendConfirmationEmailBody=Body
+OrderSendConfirmationEmailContentType=Content-Type
 
 # ========================================
 # org.ofbiz.order.order messages

Modified: incubator/ofbiz/trunk/applications/order/webapp/ordermgr/WEB-INF/actions/order/sendconfirmationemail.bsh
URL: http://svn.apache.org/viewvc/incubator/ofbiz/trunk/applications/order/webapp/ordermgr/WEB-INF/actions/order/sendconfirmationemail.bsh?view=diff&rev=447585&r1=447584&r2=447585
==============================================================================
--- incubator/ofbiz/trunk/applications/order/webapp/ordermgr/WEB-INF/actions/order/sendconfirmationemail.bsh (original)
+++ incubator/ofbiz/trunk/applications/order/webapp/ordermgr/WEB-INF/actions/order/sendconfirmationemail.bsh Mon Sep 18 15:00:26 2006
@@ -18,6 +18,7 @@
 import org.ofbiz.entity.GenericDelegator;
 import org.ofbiz.entity.GenericValue;
 import org.ofbiz.order.order.OrderReadHelper;
+import org.ofbiz.content.email.NotificationServices;
 
 delegator = request.getAttribute("delegator");
 
@@ -35,3 +36,15 @@
 if (donePage == null || donePage.length() <= 0)
     donePage="orderview?orderId=" + orderId;
 context.put("donePage", donePage);
+
+// Provide the correct order confirmation ProductStoreEmailSetting, if one exists
+orderHeader = delegator.findByPrimaryKey("OrderHeader", UtilMisc.toMap("orderId", orderId));
+if (orderHeader.getString("productStoreId") != null) {
+    productStoreEmailSetting = delegator.findByPrimaryKeyCache("ProductStoreEmailSetting", UtilMisc.toMap("productStoreId", orderHeader.getString("productStoreId"), "emailType", "PRDS_ODR_CONFIRM"));    
+    if (productStoreEmailSetting != null) {
+        context.put("productStoreEmailSetting", productStoreEmailSetting);        
+    }
+}
+
+// set the baseUrl parameter, required by some email bodies
+NotificationServices.setBaseUrl(delegator, context.get("webSiteId"), context);

Modified: incubator/ofbiz/trunk/applications/order/webapp/ordermgr/WEB-INF/controller.xml
URL: http://svn.apache.org/viewvc/incubator/ofbiz/trunk/applications/order/webapp/ordermgr/WEB-INF/controller.xml?view=diff&rev=447585&r1=447584&r2=447585
==============================================================================
--- incubator/ofbiz/trunk/applications/order/webapp/ordermgr/WEB-INF/controller.xml (original)
+++ incubator/ofbiz/trunk/applications/order/webapp/ordermgr/WEB-INF/controller.xml Mon Sep 18 15:00:26 2006
@@ -127,7 +127,7 @@
     </request-map>
     <request-map uri="sendconfirmationmail">
         <security https="true" auth="true"/>
-        <event type="service" path="" invoke="sendOrderConfirmation"/>
+        <event type="service" path="" invoke="sendMail"/>
         <response name="success" type="view" value="orderview"/>
         <response name="error" type="view" value="SendConfirmationMail"/>
     </request-map>

Modified: incubator/ofbiz/trunk/applications/order/webapp/ordermgr/order/sendconfirmationemail.ftl
URL: http://svn.apache.org/viewvc/incubator/ofbiz/trunk/applications/order/webapp/ordermgr/order/sendconfirmationemail.ftl?view=diff&rev=447585&r1=447584&r2=447585
==============================================================================
--- incubator/ofbiz/trunk/applications/order/webapp/ordermgr/order/sendconfirmationemail.ftl (original)
+++ incubator/ofbiz/trunk/applications/order/webapp/ordermgr/order/sendconfirmationemail.ftl Mon Sep 18 15:00:26 2006
@@ -20,40 +20,81 @@
  <p class="head1">${uiLabelMap.OrderSendConfirmationEmail}</p>
 
   &nbsp;<a href="<@ofbizUrl>authview/${donePage}</@ofbizUrl>" class="buttontext">${uiLabelMap.CommonGoBack}</a>
-  &nbsp;<a href="javascript:document.sendConfirmationForm.submit()" class="buttontext">${uiLabelMap.CommonSave}</a>
+  &nbsp;<a href="javascript:document.sendConfirmationForm.submit()" class="buttontext">${uiLabelMap.CommonSend}</a>
 
   <form method="post" action="<@ofbizUrl>sendconfirmationmail/${donePage}</@ofbizUrl>" name="sendConfirmationForm">
+    <#if ! productStoreEmailSetting?exists>
+        <#assign productStoreEmailSetting = {} />
+    </#if>
     <input type="hidden" name="partyId" value="${partyId?if_exists}">
+    <input type="hidden" name="contentType" value="${productStoreEmailSetting.contentType?default("")}" />
     <table width="90%" border="0" cellpadding="2" cellspacing="0">
-     <tr>
-        <td width="26%" align="right">
-           <div class="tabletext">${uiLabelMap.OrderSendConfirmationEmailSendTo}</div>
-        </td>
-        <td width="54%">
-          <input type="text" name="sendTo" value="${sendTo}"/>
-        </td>
-      </tr>
-       <tr>
-        <td width="26%" align="right">
-            <div class="tabletext">${uiLabelMap.OrderSendConfirmationEmailCCTo}</div>
-        </td>
-        <td width="54%">
-          <input type="text" name="sendCc" value="" />
-        </td>
-      </tr>
-      <tr>
-        <td width="26%" align="right">
-             <div class="tabletext">${uiLabelMap.OrderSendConfirmationEmailNote}</div>
-        </td>
-        <td width="54%">
-          <textarea name="note" class="textAreaBox" rows="5" cols="70"></textarea>
-        </td>
-      </tr>
+        <tr>
+            <td width="26%" align="right">
+                <div class="tabletext">${uiLabelMap.OrderSendConfirmationEmailSubject}</div>
+            </td>
+            <td width="54%">
+                <input type="text" size="40" name="subject" value="${productStoreEmailSetting.subject?default(uiLabelMap.OrderConfirmation + " " + uiLabelMap.OrderNbr + orderId)?replace("\\$\\{orderId\\}",orderId,"r")}" />
+            </td>
+        </tr>
+        </tr>
+            <td width="26%" align="right">
+                <div class="tabletext">${uiLabelMap.OrderSendConfirmationEmailSendTo}</div>
+            </td>
+            <td width="54%">
+                <input type="text" size="40" name="sendTo" value="${sendTo}"/>
+            </td>
+        <tr>
+        </tr>
+        <tr>
+            <td width="26%" align="right">
+                <div class="tabletext">${uiLabelMap.OrderSendConfirmationEmailCCTo}</div>
+            </td>
+            <td width="54%">
+                <input type="text" size="40" name="sendCc" value="${productStoreEmailSetting.ccAddress?default("")}" />
+            </td>
+        </tr>
+        <tr>
+            <td width="26%" align="right">
+                <div class="tabletext">${uiLabelMap.OrderSendConfirmationEmailBCCTo}</div>
+            </td>
+            <td width="54%">
+                <input type="text" size="40" name="sendBcc" value="${productStoreEmailSetting.bccAddress?default("")}" />
+            </td>
+        </tr>
+        <tr>
+            <td width="26%" align="right">
+                <div class="tabletext">${uiLabelMap.CommonFrom}</div>
+            </td>
+            <td width="54%">
+                <#if productStoreEmailSetting.fromAddress?exists>
+                    <input type="hidden" name="sendFrom" value="${productStoreEmailSetting.fromAddress}" />
+                <#else>
+                    <input type="text" size="40" name="sendFrom" value="" />
+                </#if>
+            </td>
+        <tr>
+        <tr>
+            <td width="26%" align="right">
+                <div class="tabletext">${uiLabelMap.OrderSendConfirmationEmailContentType}</div>
+            </td>
+            <td width="54%">
+                <div class="tabletext">${productStoreEmailSetting.contentType?default("text/html")}</div>
+            </td>
+        </tr>
+        <tr>
+            <td width="26%" align="right">
+                <div class="tabletext">${uiLabelMap.OrderSendConfirmationEmailBody}</div>
+            </td>
+            <td width="54%">
+                <textarea name="body" class="textAreaBox" rows="30" cols="80">${screens.render(productStoreEmailSetting.bodyScreenLocation?default(""))}</textarea>
+            </td>
+        </tr>
     </table>
-  </form>
+</form>
 
   &nbsp;<a href="<@ofbizUrl>authview/${donePage}</@ofbizUrl>" class="buttontext">${uiLabelMap.CommonGoBack}</a>
-  &nbsp;<a href="javascript:document.sendConfirmationForm.submit()" class="buttontext">${uiLabelMap.CommonSave}</a>
+  &nbsp;<a href="javascript:document.sendConfirmationForm.submit()" class="buttontext">${uiLabelMap.CommonSend}</a>
   
 <#else>
   <h3>${uiLabelMap.OrderViewPermissionError}</h3>