You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ofbiz.apache.org by jl...@apache.org on 2008/03/12 11:02:37 UTC

svn commit: r636270 - in /ofbiz/trunk/applications/ecommerce/webapp/ecommerce: WEB-INF/controller.xml order/orderheader.ftl order/orderhistory.ftl

Author: jleroux
Date: Wed Mar 12 03:02:23 2008
New Revision: 636270

URL: http://svn.apache.org/viewvc?rev=636270&view=rev
Log:
>From an Ashish Vijaywargiya's patch "PDF feature on orders for final clients (e-commerce)" (https://issues.apache.org/jira/browse/OFBIZ-208) - OFBIZ-208 
I had to write and rewrite some code snippets tough

Modified:
    ofbiz/trunk/applications/ecommerce/webapp/ecommerce/WEB-INF/controller.xml
    ofbiz/trunk/applications/ecommerce/webapp/ecommerce/order/orderheader.ftl
    ofbiz/trunk/applications/ecommerce/webapp/ecommerce/order/orderhistory.ftl

Modified: ofbiz/trunk/applications/ecommerce/webapp/ecommerce/WEB-INF/controller.xml
URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/ecommerce/webapp/ecommerce/WEB-INF/controller.xml?rev=636270&r1=636269&r2=636270&view=diff
==============================================================================
--- ofbiz/trunk/applications/ecommerce/webapp/ecommerce/WEB-INF/controller.xml (original)
+++ ofbiz/trunk/applications/ecommerce/webapp/ecommerce/WEB-INF/controller.xml Wed Mar 12 03:02:23 2008
@@ -1549,6 +1549,10 @@
         <response name="error" type="request" value="editShoppingList"/>
     </request-map>
 
+    <!-- PDFs -->
+    <request-map uri="order.pdf"><security https="true" auth="true"/><response name="success" type="view" value="OrderPDF"/></request-map>
+    <request-map uri="invoice.pdf"><security https="true" auth="true"/><response name="success" type="view" value="InvoicePDF"/></request-map>
+    
     <!-- ================ SimpleContent Requests ================= -->
 
     <request-map uri="ViewSimpleContent">
@@ -1679,5 +1683,8 @@
     <view-map name="LatestResponses" type="screen" page="component://ecommerce/widget/blog/BlogScreens.xml#LatestResponses"/>
 
     <view-map name="ViewSimpleContent" page="" type="simplecontent"/>
+    <!-- PDFs  -->
+    <view-map name="OrderPDF" type="screenfop" page="component://order/widget/ordermgr/OrderPrintScreens.xml#OrderPDF" content-type="application/pdf" encoding="none"/>
+    <view-map name="InvoicePDF" type="screenfop" page="component://accounting/widget/AccountingPrintForms.xml#InvoicePDF" content-type="application/pdf" encoding="none"/>
     <!-- End of View Mappings -->
 </site-conf>

Modified: ofbiz/trunk/applications/ecommerce/webapp/ecommerce/order/orderheader.ftl
URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/ecommerce/webapp/ecommerce/order/orderheader.ftl?rev=636270&r1=636269&r2=636270&view=diff
==============================================================================
--- ofbiz/trunk/applications/ecommerce/webapp/ecommerce/order/orderheader.ftl (original)
+++ ofbiz/trunk/applications/ecommerce/webapp/ecommerce/order/orderheader.ftl Wed Mar 12 03:02:23 2008
@@ -20,6 +20,9 @@
 <#-- NOTE: this template is used for the orderstatus screen in ecommerce AND for order notification emails through the OrderNoticeEmail.ftl file -->
 <#-- the "urlPrefix" value will be prepended to URLs by the ofbizUrl transform if/when there is no "request" object in the context -->
 <#if baseEcommerceSecureUrl?exists><#assign urlPrefix = baseEcommerceSecureUrl/></#if>
+<#if (orderHeader.externalId)?exists && (orderHeader.externalId)?has_content >
+  <#assign externalOrder = "(" + orderHeader.externalId + ")"/>
+</#if>
 
 <table width="100%" border="0" cellpadding="0" cellspacing="0">
   <tr>
@@ -33,7 +36,16 @@
                     <a href="<@o...@ofbizUrl>" class="submenutextright">${uiLabelMap.OrderRequestReturn}</a>
                 </#if>
             </div>
-            <div class="boxhead">&nbsp;${uiLabelMap.OrderOrder}&nbsp;<#if orderHeader?has_content>${uiLabelMap.OrderNbr}<a href="<@o...@ofbizUrl>" class="lightbuttontext">${orderHeader.orderId}</a>&nbsp;</#if>${uiLabelMap.CommonInformation}</div>
+            <div class="boxhead">
+                &nbsp;${uiLabelMap.OrderOrder}&nbsp;
+                <#if orderHeader?has_content>
+                    ${uiLabelMap.OrderNbr}<a href="<@o...@ofbizUrl>" class="lightbuttontext">${orderHeader.orderId}</a>&nbsp;
+                </#if>
+                ${uiLabelMap.CommonInformation} 
+                <#if (orderHeader.orderId)?exists> 
+                    ${externalOrder?if_exists} [ <a href="<@o...@ofbizUrl>" class="lightbuttontext" target="_blank">PDF</a> ]
+                </#if>
+            </div>
         </div>
         <div class="screenlet-body">
             <table width="100%" border="0" cellpadding="1">

Modified: ofbiz/trunk/applications/ecommerce/webapp/ecommerce/order/orderhistory.ftl
URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/ecommerce/webapp/ecommerce/order/orderhistory.ftl?rev=636270&r1=636269&r2=636270&view=diff
==============================================================================
--- ofbiz/trunk/applications/ecommerce/webapp/ecommerce/order/orderhistory.ftl (original)
+++ ofbiz/trunk/applications/ecommerce/webapp/ecommerce/order/orderhistory.ftl Wed Mar 12 03:02:23 2008
@@ -45,7 +45,9 @@
               <div class="tabletext"><b>${uiLabelMap.CommonStatus}</b></div>
             </td>
             <td width="10">&nbsp;</td>
-            <td width="15%"><b></b></td>
+            <td width="15%">
+              <div class="tabletext"><b>${uiLabelMap.OrderInvoices}</b></div>
+            </td>
           </tr>
           <#list orderHeaderList as orderHeader>
             <#assign status = orderHeader.getRelatedOneCache("StatusItem")>
@@ -66,7 +68,18 @@
               <td>
                 <div class="tabletext">${status.get("description",locale)}</div>
               </td>
+              <#-- invoices -->
               <td width="10">&nbsp;</td>
+              <#assign invoices = delegator.findByAnd("OrderItemBilling", Static["org.ofbiz.base.util.UtilMisc"].toMap("orderId", "${orderHeader.orderId}"), Static["org.ofbiz.base.util.UtilMisc"].toList("invoiceId"))>
+              <#if invoices?has_content>
+                <td>
+                  <#list invoices as invoice>
+                     <a href="<@o...@ofbizUrl>" class="buttontext">(${invoice.invoiceId} PDF) </a>
+                 </#list>
+                </td>
+              <#else>
+                <td width="10">&nbsp;</td>
+              </#if>
               <td align="right">
                 <a href="<@o...@ofbizUrl>" class="buttontext">${uiLabelMap.CommonView}</a>
               </td>