You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ofbiz.apache.org by de...@apache.org on 2018/08/10 18:49:03 UTC

svn commit: r1837830 - in /ofbiz/ofbiz-framework/trunk: applications/content/template/cms/ applications/order/template/entry/cart/ applications/order/template/entry/catalog/ applications/order/template/order/ applications/order/template/return/ applica...

Author: deepak
Date: Fri Aug 10 18:49:03 2018
New Revision: 1837830

URL: http://svn.apache.org/viewvc?rev=1837830&view=rev
Log:
Improved: Replace #assign with #local in all the ftl macros
(OFBIZ-10516)

Modified:
    ofbiz/ofbiz-framework/trunk/applications/content/template/cms/CMSContentEdit.ftl
    ofbiz/ofbiz-framework/trunk/applications/order/template/entry/cart/ShowCartItems.ftl
    ofbiz/ofbiz-framework/trunk/applications/order/template/entry/catalog/CategoryDetail.ftl
    ofbiz/ofbiz-framework/trunk/applications/order/template/entry/catalog/ConfigProductDetail.ftl
    ofbiz/ofbiz-framework/trunk/applications/order/template/entry/catalog/ProductDetail.ftl
    ofbiz/ofbiz-framework/trunk/applications/order/template/order/OrderPaymentInfo.ftl
    ofbiz/ofbiz-framework/trunk/applications/order/template/return/ReturnItems.ftl
    ofbiz/ofbiz-framework/trunk/applications/order/template/return/ReturnReportBody.fo.ftl
    ofbiz/ofbiz-framework/trunk/applications/party/template/party/profileblocks/PaymentMethods.ftl
    ofbiz/ofbiz-framework/trunk/framework/webtools/template/datafile/ViewDataFile.ftl

Modified: ofbiz/ofbiz-framework/trunk/applications/content/template/cms/CMSContentEdit.ftl
URL: http://svn.apache.org/viewvc/ofbiz/ofbiz-framework/trunk/applications/content/template/cms/CMSContentEdit.ftl?rev=1837830&r1=1837829&r2=1837830&view=diff
==============================================================================
--- ofbiz/ofbiz-framework/trunk/applications/content/template/cms/CMSContentEdit.ftl (original)
+++ ofbiz/ofbiz-framework/trunk/applications/content/template/cms/CMSContentEdit.ftl Fri Aug 10 18:49:03 2018
@@ -151,7 +151,7 @@ under the License.
 </table>
 
 <#macro renderTextData content textData >
-    <#assign contentId=content.contentId!/>
+    <#local contentId=content.contentId!/>
 <table border="0" width='100%' cellspacing='0' cellpadding='0' class='boxoutside'>
   <tr>
     <td width='100%'>

Modified: ofbiz/ofbiz-framework/trunk/applications/order/template/entry/cart/ShowCartItems.ftl
URL: http://svn.apache.org/viewvc/ofbiz/ofbiz-framework/trunk/applications/order/template/entry/cart/ShowCartItems.ftl?rev=1837830&r1=1837829&r2=1837830&view=diff
==============================================================================
--- ofbiz/ofbiz-framework/trunk/applications/order/template/entry/cart/ShowCartItems.ftl (original)
+++ ofbiz/ofbiz-framework/trunk/applications/order/template/entry/cart/ShowCartItems.ftl Fri Aug 10 18:49:03 2018
@@ -19,8 +19,8 @@ under the License.
 
 <#-- Continuation of showcart.ftl:  List of order items and forms to modify them. -->
 <#macro showAssoc productAssoc>
-  <#assign productAssocType = (delegator.findOne("ProductAssocType", {"productAssocTypeId" : productAssoc.productAssocTypeId}, false))/>
-  <#assign assocProduct = (delegator.findOne("Product", {"productId" : productAssoc.productIdTo}, false))/>
+  <#local productAssocType = (delegator.findOne("ProductAssocType", {"productAssocTypeId" : productAssoc.productAssocTypeId}, false))/>
+  <#local assocProduct = (delegator.findOne("Product", {"productId" : productAssoc.productIdTo}, false))/>
   <#if assocProduct?has_content>
     <td><a href="<@o...@ofbizUrl>"class="buttontext">${productAssoc.productIdTo}</a></td>
     <td>- ${(assocProduct.productName)!}<i>(${(productAssocType.description)?default("Unknown")})</i></td>

Modified: ofbiz/ofbiz-framework/trunk/applications/order/template/entry/catalog/CategoryDetail.ftl
URL: http://svn.apache.org/viewvc/ofbiz/ofbiz-framework/trunk/applications/order/template/entry/catalog/CategoryDetail.ftl?rev=1837830&r1=1837829&r2=1837830&view=diff
==============================================================================
--- ofbiz/ofbiz-framework/trunk/applications/order/template/entry/catalog/CategoryDetail.ftl (original)
+++ ofbiz/ofbiz-framework/trunk/applications/order/template/entry/catalog/CategoryDetail.ftl Fri Aug 10 18:49:03 2018
@@ -41,7 +41,7 @@ under the License.
 </script>
 
 <#macro paginationControls>
-    <#assign viewIndexMax = Static["java.lang.Math"].ceil((listSize)?double / viewSize?double)>
+    <#local viewIndexMax = Static["java.lang.Math"].ceil((listSize)?double / viewSize?double)>
       <#if (viewIndexMax?int > 0)>
         <div class="product-prevnext">
             <select name="pageSelect" onchange="callDocumentByPaginate(this[this.selectedIndex].value);">

Modified: ofbiz/ofbiz-framework/trunk/applications/order/template/entry/catalog/ConfigProductDetail.ftl
URL: http://svn.apache.org/viewvc/ofbiz/ofbiz-framework/trunk/applications/order/template/entry/catalog/ConfigProductDetail.ftl?rev=1837830&r1=1837829&r2=1837830&view=diff
==============================================================================
--- ofbiz/ofbiz-framework/trunk/applications/order/template/entry/catalog/ConfigProductDetail.ftl (original)
+++ ofbiz/ofbiz-framework/trunk/applications/order/template/entry/catalog/ConfigProductDetail.ftl Fri Aug 10 18:49:03 2018
@@ -622,9 +622,9 @@ function getConfigDetails() {
 
 <#-- Upgrades/Up-Sell/Cross-Sell -->
   <#macro associated assocProducts beforeName showName afterName formNamePrefix targetRequestName>
-  <#assign targetRequest = "product">
+  <#local targetRequest = "product">
   <#if targetRequestName?has_content>
-    <#assign targetRequest = targetRequestName>
+    <#local targetRequest = targetRequestName>
   </#if>
   <#if assocProducts?has_content>
     <tr><td>&nbsp;</td></tr>

Modified: ofbiz/ofbiz-framework/trunk/applications/order/template/entry/catalog/ProductDetail.ftl
URL: http://svn.apache.org/viewvc/ofbiz/ofbiz-framework/trunk/applications/order/template/entry/catalog/ProductDetail.ftl?rev=1837830&r1=1837829&r2=1837830&view=diff
==============================================================================
--- ofbiz/ofbiz-framework/trunk/applications/order/template/entry/catalog/ProductDetail.ftl (original)
+++ ofbiz/ofbiz-framework/trunk/applications/order/template/entry/catalog/ProductDetail.ftl Fri Aug 10 18:49:03 2018
@@ -646,9 +646,9 @@ ${virtualJavaScript!}
 
   <#-- Upgrades/Up-Sell/Cross-Sell -->
   <#macro associated assocProducts beforeName showName afterName formNamePrefix targetRequestName>
-  <#assign targetRequest = "product">
+  <#local targetRequest = "product">
   <#if targetRequestName?has_content>
-    <#assign targetRequest = targetRequestName>
+    <#local targetRequest = targetRequestName>
   </#if>
   <#if assocProducts?has_content>
     <h2>${beforeName!}<#if "Y" == showName>${productContentWrapper.get("PRODUCT_NAME", "html")!}</#if>${afterName!}</h2>

Modified: ofbiz/ofbiz-framework/trunk/applications/order/template/order/OrderPaymentInfo.ftl
URL: http://svn.apache.org/viewvc/ofbiz/ofbiz-framework/trunk/applications/order/template/order/OrderPaymentInfo.ftl?rev=1837830&r1=1837829&r2=1837830&view=diff
==============================================================================
--- ofbiz/ofbiz-framework/trunk/applications/order/template/order/OrderPaymentInfo.ftl (original)
+++ ofbiz/ofbiz-framework/trunk/applications/order/template/order/OrderPaymentInfo.ftl Fri Aug 10 18:49:03 2018
@@ -17,17 +17,17 @@ specific language governing permissions
 under the License.
 -->
 <#macro maskSensitiveNumber cardNumber>
-  <#assign cardNumberDisplay = "">
+  <#local cardNumberDisplay = "">
   <#if cardNumber?has_content>
-    <#assign size = cardNumber?length - 4>
+    <#local size = cardNumber?length - 4>
     <#if (size > 0)>
       <#list 0 .. size-1 as foo>
-        <#assign cardNumberDisplay = cardNumberDisplay + "*">
+        <#local cardNumberDisplay = cardNumberDisplay + "*">
       </#list>
-      <#assign cardNumberDisplay = cardNumberDisplay + cardNumber[size .. size + 3]>
+      <#local cardNumberDisplay = cardNumberDisplay + cardNumber[size .. size + 3]>
     <#else>
       <#-- but if the card number has less than four digits (ie, it was entered incorrectly), display it in full -->
-      <#assign cardNumberDisplay = cardNumber>
+      <#local cardNumberDisplay = cardNumber>
     </#if>
   </#if>
   ${cardNumberDisplay!}

Modified: ofbiz/ofbiz-framework/trunk/applications/order/template/return/ReturnItems.ftl
URL: http://svn.apache.org/viewvc/ofbiz/ofbiz-framework/trunk/applications/order/template/return/ReturnItems.ftl?rev=1837830&r1=1837829&r2=1837830&view=diff
==============================================================================
--- ofbiz/ofbiz-framework/trunk/applications/order/template/return/ReturnItems.ftl (original)
+++ ofbiz/ofbiz-framework/trunk/applications/order/template/return/ReturnItems.ftl Fri Aug 10 18:49:03 2018
@@ -18,8 +18,8 @@ under the License.
 -->
 
 <#macro displayReturnAdjustment returnAdjustment adjEditable>
-    <#assign returnHeader = returnAdjustment.getRelatedOne("ReturnHeader", false)>
-    <#assign adjReturnType = returnAdjustment.getRelatedOne("ReturnType", false)!>
+    <#local returnHeader = returnAdjustment.getRelatedOne("ReturnHeader", false)>
+    <#local adjReturnType = returnAdjustment.getRelatedOne("ReturnType", false)!>
     <#if (adjEditable)>
         <input type="hidden" name="_rowSubmit_o_${rowCount}" value="Y" />
         <input type="hidden" name="returnAdjustmentId_o_${rowCount}" value="${returnAdjustment.returnAdjustmentId}" />
@@ -61,10 +61,10 @@ under the License.
        <td>&nbsp;</td>
        </#if>
         <#if (adjEditable)>
-          <#assign rowCount = rowCount + 1>
-          <#assign rowCountForAdjRemove = rowCountForAdjRemove + 1>
+          <#local rowCount = rowCount + 1>
+          <#local rowCountForAdjRemove = rowCountForAdjRemove + 1>
        </#if>
-       <#assign returnTotal = returnTotal + returnAdjustment.amount?default(0)>
+       <#local returnTotal = returnTotal + returnAdjustment.amount?default(0)>
     </tr>
 </#macro>
 

Modified: ofbiz/ofbiz-framework/trunk/applications/order/template/return/ReturnReportBody.fo.ftl
URL: http://svn.apache.org/viewvc/ofbiz/ofbiz-framework/trunk/applications/order/template/return/ReturnReportBody.fo.ftl?rev=1837830&r1=1837829&r2=1837830&view=diff
==============================================================================
--- ofbiz/ofbiz-framework/trunk/applications/order/template/return/ReturnReportBody.fo.ftl (original)
+++ ofbiz/ofbiz-framework/trunk/applications/order/template/return/ReturnReportBody.fo.ftl Fri Aug 10 18:49:03 2018
@@ -18,8 +18,8 @@ under the License.
 -->
 <#escape x as x?xml>
 <#macro displayReturnAdjustment returnAdjustment>
-    <#assign returnHeader = returnAdjustment.getRelatedOne("ReturnHeader", false)>
-    <#assign adjReturnType = returnAdjustment.getRelatedOne("ReturnType", false)!>
+    <#local returnHeader = returnAdjustment.getRelatedOne("ReturnHeader", false)>
+    <#local adjReturnType = returnAdjustment.getRelatedOne("ReturnType", false)!>
     <fo:table-row>
     <fo:table-cell><fo:block></fo:block></fo:table-cell>
     <fo:table-cell><fo:block></fo:block></fo:table-cell>
@@ -32,7 +32,7 @@ under the License.
     <fo:table-cell padding="1mm" text-align="right"><fo:block><@ofbizCurrency amount=returnAdjustment.amount isoCode=returnHeader.currencyUomId/></fo:block></fo:table-cell>
     </fo:table-row>
     <#if returnAdjustment.amount?has_content>
-         <#assign total = total + returnAdjustment.get("amount")>
+         <#local total = total + returnAdjustment.get("amount")>
     </#if>
 </#macro>
 

Modified: ofbiz/ofbiz-framework/trunk/applications/party/template/party/profileblocks/PaymentMethods.ftl
URL: http://svn.apache.org/viewvc/ofbiz/ofbiz-framework/trunk/applications/party/template/party/profileblocks/PaymentMethods.ftl?rev=1837830&r1=1837829&r2=1837830&view=diff
==============================================================================
--- ofbiz/ofbiz-framework/trunk/applications/party/template/party/profileblocks/PaymentMethods.ftl (original)
+++ ofbiz/ofbiz-framework/trunk/applications/party/template/party/profileblocks/PaymentMethods.ftl Fri Aug 10 18:49:03 2018
@@ -18,17 +18,17 @@ under the License.
 -->
 
 <#macro maskSensitiveNumber cardNumber>
-  <#assign cardNumberDisplay = "">
+  <#local cardNumberDisplay = "">
   <#if cardNumber?has_content>
-    <#assign size = cardNumber?length - 4>
+    <#local size = cardNumber?length - 4>
     <#if (size > 0)>
       <#list 0 .. size-1 as foo>
-        <#assign cardNumberDisplay = cardNumberDisplay + "*">
+        <#local cardNumberDisplay = cardNumberDisplay + "*">
       </#list>
-      <#assign cardNumberDisplay = cardNumberDisplay + cardNumber[size .. size + 3]>
+      <#local cardNumberDisplay = cardNumberDisplay + cardNumber[size .. size + 3]>
     <#else>
       <#-- but if the card number has less than four digits (ie, it was entered incorrectly), display it in full -->
-      <#assign cardNumberDisplay = cardNumber>
+      <#local cardNumberDisplay = cardNumber>
     </#if>
   </#if>
   ${cardNumberDisplay!}

Modified: ofbiz/ofbiz-framework/trunk/framework/webtools/template/datafile/ViewDataFile.ftl
URL: http://svn.apache.org/viewvc/ofbiz/ofbiz-framework/trunk/framework/webtools/template/datafile/ViewDataFile.ftl?rev=1837830&r1=1837829&r2=1837830&view=diff
==============================================================================
--- ofbiz/ofbiz-framework/trunk/framework/webtools/template/datafile/ViewDataFile.ftl (original)
+++ ofbiz/ofbiz-framework/trunk/framework/webtools/template/datafile/ViewDataFile.ftl Fri Aug 10 18:49:03 2018
@@ -73,9 +73,9 @@ under the License.
       </#if>
 
     <#macro displayrecords records>
-        <#assign lastRecordName = null>
+        <#local lastRecordName = null>
         <#list records as record>
-          <#assign modelRecord = record.getModelRecord()>
+          <#local modelRecord = record.getModelRecord()>
           <#-- if record is different than the last displayed, make a new table and header row -->
           <#if !(modelRecord.name == lastRecordName)>
             <#if lastRecordName??>
@@ -101,7 +101,7 @@ under the License.
 
           <tr>
             <#list modelRecord.fields as modelField>
-              <#assign value = record.get(modelField.name)>
+              <#local value = record.get(modelField.name)>
               <#if value?has_content>
                 <td>${value}</td>
               <#else>