svn commit: r1837829 - in /ofbiz/ofbiz-framework/trunk/themes/common-theme/template: includes/ macro/

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

svn commit: r1837829 - in /ofbiz/ofbiz-framework/trunk/themes/common-theme/template: includes/ macro/

Deepak Dixit-5
Author: deepak
Date: Fri Aug 10 18:47:58 2018
New Revision: 1837829

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

Modified:
    ofbiz/ofbiz-framework/trunk/themes/common-theme/template/includes/HtmlTemplate.ftl
    ofbiz/ofbiz-framework/trunk/themes/common-theme/template/macro/FoFormMacroLibrary.ftl
    ofbiz/ofbiz-framework/trunk/themes/common-theme/template/macro/FoScreenMacroLibrary.ftl
    ofbiz/ofbiz-framework/trunk/themes/common-theme/template/macro/HtmlFormMacroLibrary.ftl
    ofbiz/ofbiz-framework/trunk/themes/common-theme/template/macro/HtmlScreenMacroLibrary.ftl
    ofbiz/ofbiz-framework/trunk/themes/common-theme/template/macro/XlsFormMacroLibrary.ftl

Modified: ofbiz/ofbiz-framework/trunk/themes/common-theme/template/includes/HtmlTemplate.ftl
URL: http://svn.apache.org/viewvc/ofbiz/ofbiz-framework/trunk/themes/common-theme/template/includes/HtmlTemplate.ftl?rev=1837829&r1=1837828&r2=1837829&view=diff
==============================================================================
--- ofbiz/ofbiz-framework/trunk/themes/common-theme/template/includes/HtmlTemplate.ftl (original)
+++ ofbiz/ofbiz-framework/trunk/themes/common-theme/template/includes/HtmlTemplate.ftl Fri Aug 10 18:47:58 2018
@@ -36,10 +36,10 @@ under the License.
 </#macro>
 
 <#macro nextPrev commonUrl="" ajaxEnabled=false javaScriptEnabled=false paginateStyle="nav-pager" paginateFirstStyle="nav-first" viewIndex=0 highIndex=0 listSize=0 viewSize=1 ajaxFirstUrl="" firstUrl="" paginateFirstLabel="" paginatePreviousStyle="nav-previous" ajaxPreviousUrl="" previousUrl="" paginatePreviousLabel="" pageLabel="" ajaxSelectUrl="" selectUrl="" ajaxSelectSizeUrl="" selectSizeUrl="" commonDisplaying="" paginateNextStyle="nav-next" ajaxNextUrl="" nextUrl="" paginateNextLabel="" paginateLastStyle="nav-last" ajaxLastUrl="" lastUrl="" paginateLastLabel="" paginateViewSizeLabel="" >
-  <#assign viewIndexFirst = 0/>
-  <#assign viewIndexPrevious = viewIndex - 1/>
-  <#assign viewIndexNext = viewIndex + 1/>
-  <#assign viewIndexLast = Static["org.apache.ofbiz.base.util.UtilMisc"].getViewLastIndex(listSize, viewSize) />
+  <#local viewIndexFirst = 0/>
+  <#local viewIndexPrevious = viewIndex - 1/>
+  <#local viewIndexNext = viewIndex + 1/>
+  <#local viewIndexLast = Static["org.apache.ofbiz.base.util.UtilMisc"].getViewLastIndex(listSize, viewSize) />
   <#local javaScriptEnabled = javaScriptEnabled />
   <#if (!javaScriptEnabled)>
     <#local javaScriptEnabled = Static["org.apache.ofbiz.base.util.UtilHttp"].isJavaScriptEnabled(request) />

Modified: ofbiz/ofbiz-framework/trunk/themes/common-theme/template/macro/FoFormMacroLibrary.ftl
URL: http://svn.apache.org/viewvc/ofbiz/ofbiz-framework/trunk/themes/common-theme/template/macro/FoFormMacroLibrary.ftl?rev=1837829&r1=1837828&r2=1837829&view=diff
==============================================================================
--- ofbiz/ofbiz-framework/trunk/themes/common-theme/template/macro/FoFormMacroLibrary.ftl (original)
+++ ofbiz/ofbiz-framework/trunk/themes/common-theme/template/macro/FoFormMacroLibrary.ftl Fri Aug 10 18:47:58 2018
@@ -17,7 +17,7 @@ specific language governing permissions
 under the License.
 -->
 <#macro getFoStyle style>
-    <#assign foStyles = {
+    <#local foStyles = {
         "listtitlestyle":"font-weight=\"bold\" text-align=\"center\" border=\"solid black\" padding=\"2pt\"",
         "tabletext":"border-left=\"solid black\" border-right=\"solid black\" padding-left=\"2pt\" padding-top=\"2pt\"",
         "tabletextright":"border-left=\"solid black\" border-right=\"solid black\" padding-left=\"2pt\" padding-top=\"2pt\" text-align=\"right\"",
@@ -35,7 +35,7 @@ under the License.
         "alternate-row" : "background-color=\"lightgray\"",
         "error":"color=\"red\""}/>
     <#list style?split(' ') as styleItem>
-        <#assign foStyle = foStyles[styleItem]?default("")/>
+        <#local foStyle = foStyles[styleItem]?default("")/>
         ${foStyle?default("")}
     </#list>
 </#macro>

Modified: ofbiz/ofbiz-framework/trunk/themes/common-theme/template/macro/FoScreenMacroLibrary.ftl
URL: http://svn.apache.org/viewvc/ofbiz/ofbiz-framework/trunk/themes/common-theme/template/macro/FoScreenMacroLibrary.ftl?rev=1837829&r1=1837828&r2=1837829&view=diff
==============================================================================
--- ofbiz/ofbiz-framework/trunk/themes/common-theme/template/macro/FoScreenMacroLibrary.ftl (original)
+++ ofbiz/ofbiz-framework/trunk/themes/common-theme/template/macro/FoScreenMacroLibrary.ftl Fri Aug 10 18:47:58 2018
@@ -17,7 +17,7 @@ specific language governing permissions
 under the License.
 -->
 <#macro getFoStyle style>
-    <#assign foStyles = {
+    <#local foStyles = {
         "tabletext":"border-left=\"solid black\" border-right=\"solid black\" padding-left=\"2pt\" padding-top=\"2pt\"",
         "tabletextright":"border-left=\"solid black\" border-right=\"solid black\" padding-left=\"2pt\" padding-top=\"2pt\" text-align=\"right\"",
         "tableheadverysmall":"column-width=\"0.3in\"",
@@ -32,7 +32,7 @@ under the License.
         "h3":"font-weight=\"bold\" font-style=\"italic\"",
         "error":"color=\"red\""}/>
     <#list style?split(' ') as styleItem>
-        <#assign foStyle = foStyles[styleItem]?default("")/>
+        <#local foStyle = foStyles[styleItem]?default("")/>
         ${foStyle?default("")}
     </#list>
 </#macro>

Modified: ofbiz/ofbiz-framework/trunk/themes/common-theme/template/macro/HtmlFormMacroLibrary.ftl
URL: http://svn.apache.org/viewvc/ofbiz/ofbiz-framework/trunk/themes/common-theme/template/macro/HtmlFormMacroLibrary.ftl?rev=1837829&r1=1837828&r2=1837829&view=diff
==============================================================================
--- ofbiz/ofbiz-framework/trunk/themes/common-theme/template/macro/HtmlFormMacroLibrary.ftl (original)
+++ ofbiz/ofbiz-framework/trunk/themes/common-theme/template/macro/HtmlFormMacroLibrary.ftl Fri Aug 10 18:47:58 2018
@@ -60,8 +60,8 @@ under the License.
     require
   /><#t/>
   <#if ajaxEnabled?has_content && ajaxEnabled>
-    <#assign defaultMinLength = modelTheme.getAutocompleterDefaultMinLength()>
-    <#assign defaultDelay = modelTheme.getAutocompleterDefaultDelay()>
+    <#local defaultMinLength = modelTheme.getAutocompleterDefaultMinLength()>
+    <#local defaultDelay = modelTheme.getAutocompleterDefaultDelay()>
     <script type="application/javascript">ajaxAutoCompleter('${ajaxUrl!}', false, ${defaultMinLength!2}, ${defaultDelay!300});</script><#lt/>
   </#if>
 </#macro>
@@ -178,18 +178,18 @@ under the License.
     <#if timeDropdown?has_content && timeDropdown=="time-dropdown">
       <select name="${timeHourName}" <#if classString?has_content>class="${classString}"</#if>><#rt/>
         <#if isTwelveHour>
-          <#assign x=11>
+          <#local x=11>
           <#list 0..x as i>
             <option value="${i}"<#if hour1?has_content><#if i=hour1> selected="selected"</#if></#if>>${i}</option><#rt/>
           </#list>
         <#else>
-          <#assign x=23>
+          <#local x=23>
           <#list 0..x as i>
             <option value="${i}"<#if hour2?has_content><#if i=hour2> selected="selected"</#if></#if>>${i}</option><#rt/>
           </#list>
         </#if>
         </select>:<select name="${timeMinutesName}" <#if classString?has_content>class="${classString}"</#if>><#rt/>
-          <#assign values = Static["org.apache.ofbiz.base.util.StringUtil"].toList(timeValues)>
+          <#local values = Static["org.apache.ofbiz.base.util.StringUtil"].toList(timeValues)>
           <#list values as i>
             <option value="${i}"<#if minutes?has_content><#if i?number== minutes ||((i?number==(60 -step?number)) && (minutes &gt; 60 - (step?number/2))) || ((minutes &gt; i?number )&& (minutes &lt; i?number+(step?number/2))) || ((minutes &lt; i?number )&& (minutes &gt; i?number-(step?number/2)))> selected="selected"</#if></#if>>${i}</option><#rt/>
           </#list>
@@ -649,19 +649,19 @@ Parameter: delegatorName, String, option
     <#if presentation?has_content && descriptionFieldName?has_content && "window" == presentation>
       data-lookup-field-formname="${fieldFormName}" data-lookup-form-name="${formName?html}" <#if descriptionFieldName?has_content>data-lookup-description-field="${descriptionFieldName}"</#if> <#rt>
       <#if targetParameterIter?has_content>
-        <#assign args = "${targetParameterIter?join(', ')}">
+        <#local args = "${targetParameterIter?join(', ')}">
       </#if>
       data-lookup-args="${args!}" <#rt>
     <#elseif presentation?has_content && "window" == presentation>
       data-lookup-field-formname="${fieldFormName}" <#rt>
       <#if targetParameterIter?has_content>
-        <#assign args = "${targetParameterIter?join(', ')}">
+        <#local args = "${targetParameterIter?join(', ')}">
       </#if>
       data-lookup-args="${args!}" <#rt>
     <#else>
       <#if ajaxEnabled?has_content && ajaxEnabled>
-        <#assign defaultMinLength = modelTheme.getAutocompleterDefaultMinLength()>
-        <#assign defaultDelay = modelTheme.getAutocompleterDefaultDelay()>
+        <#local defaultMinLength = modelTheme.getAutocompleterDefaultMinLength()>
+        <#local defaultDelay = modelTheme.getAutocompleterDefaultDelay()>
         <#if !ajaxUrl?contains("searchValueFieldName=")>
           <#if descriptionFieldName?has_content && "true" == showDescription>
             <#local ajaxUrl = ajaxUrl + "&amp;searchValueFieldName=" + descriptionFieldName />
@@ -678,7 +678,7 @@ Parameter: delegatorName, String, option
       data-lookup-default-minlength="${defaultMinLength!2}" <#rt>
       data-lookup-default-delay="${defaultDelay!300}" <#rt>
       <#if targetParameterIter?has_content>
-        <#assign args = "${targetParameterIter?join(', ')}">
+        <#local args = "${targetParameterIter?join(', ')}">
       </#if>
       data-lookup-args="${args!}"
     </#if>
@@ -701,7 +701,7 @@ Parameter: delegatorName, String, option
         <li class="${paginateFirstStyle}<#if viewIndex gt 0>"><a href="javascript:void(0)" onclick="<#if ajaxEnabled>ajaxUpdateAreas('${ajaxFirstUrl}')<#else>submitPagination(this, '${firstUrl}')</#if>">${paginateFirstLabel}</a><#else>-disabled"><span>${paginateFirstLabel}</span></#if></li>
         <li class="${paginatePreviousStyle}<#if viewIndex gt 0>"><a href="javascript:void(0)" onclick="<#if ajaxEnabled>ajaxUpdateAreas('${ajaxPreviousUrl}')<#else>submitPagination(this, '${previousUrl}')</#if>">${paginatePreviousLabel}</a><#else>-disabled"><span>${paginatePreviousLabel}</span></#if></li>
         <#if listSize gt 0 && javaScriptEnabled><li class="nav-page-select">${pageLabel} <select name="page" size="1" onchange="<#if ajaxEnabled>ajaxUpdateAreas('${ajaxSelectUrl}')<#else>submitPagination(this, '${selectUrl}'+this.value)</#if>"><#rt/>
-          <#assign x=(listSize/viewSize)?ceiling>
+          <#local x=(listSize/viewSize)?ceiling>
             <#list 1..x as i>
               <#if i == (viewIndex+1)><option selected="selected" value="<#else><option value="</#if>${i-1}">${i}</option>
             </#list>
@@ -710,7 +710,7 @@ Parameter: delegatorName, String, option
         <li class="${paginateNextStyle}<#if highIndex lt listSize>"><a href="javascript:void(0)" onclick="<#if ajaxEnabled>ajaxUpdateAreas('${ajaxNextUrl}')<#else>submitPagination(this, '${nextUrl}')</#if>">${paginateNextLabel}</a><#else>-disabled"><span>${paginateNextLabel}</span></#if></li>
         <li class="${paginateLastStyle}<#if highIndex lt listSize>"><a href="javascript:void(0)" onclick="<#if ajaxEnabled>ajaxUpdateAreas('${ajaxLastUrl}')<#else>submitPagination(this, '${lastUrl}')</#if>">${paginateLastLabel}</a><#else>-disabled"><span>${paginateLastLabel}</span></#if></li>
         <#if javaScriptEnabled><li class="nav-pagesize"><select name="pageSize" size="1" onchange="<#if ajaxEnabled>ajaxUpdateAreas('${ajaxSelectSizeUrl}')<#else>submitPagination(this, '${selectSizeUrl}')</#if>"><#rt/>
-            <#assign availPageSizes = [20, 30, 50, 100, 200]>
+            <#local availPageSizes = [20, 30, 50, 100, 200]>
           <#list availPageSizes as ps>
             <option <#if viewSize == ps> selected="selected" </#if> value="${ps}">${ps}</option>
           </#list>
@@ -805,8 +805,8 @@ Parameter: delegatorName, String, option
     <#if uniqueItemName?has_content>
         <#local params = "{\"presentation\": \"layer\"">
         <#if targetParameters?has_content>
-          <#assign parameterMap = targetParameters?eval>
-          <#assign parameterKeys = parameterMap?keys>
+          <#local parameterMap = targetParameters?eval>
+          <#local parameterKeys = parameterMap?keys>
           <#list parameterKeys as key>
             <#local params += ",\"${key}\": \"${parameterMap[key]}\"">
           </#list>

Modified: ofbiz/ofbiz-framework/trunk/themes/common-theme/template/macro/HtmlScreenMacroLibrary.ftl
URL: http://svn.apache.org/viewvc/ofbiz/ofbiz-framework/trunk/themes/common-theme/template/macro/HtmlScreenMacroLibrary.ftl?rev=1837829&r1=1837828&r2=1837829&view=diff
==============================================================================
--- ofbiz/ofbiz-framework/trunk/themes/common-theme/template/macro/HtmlScreenMacroLibrary.ftl (original)
+++ ofbiz/ofbiz-framework/trunk/themes/common-theme/template/macro/HtmlScreenMacroLibrary.ftl Fri Aug 10 18:47:58 2018
@@ -66,8 +66,8 @@ under the License.
   <#if text?has_content>
     <#-- If a label widget has one of the h1-h6 styles, then it is considered block level element.
          Otherwise it is considered an inline element. -->
-    <#assign idText = ""/>
-    <#if id?has_content><#assign idText = " id=\"${id}\""/></#if>
+    <#local idText = ""/>
+    <#if id?has_content><#local idText = " id=\"${id}\""/></#if>
     <#if style?has_content>
       <#if style=="h1">
         <h1${idText}>${text}</h1>
@@ -183,8 +183,8 @@ ${menuString}
 </#macro>
 
 <#macro renderPortalPageColumnBegin originalPortalPageId portalPageId columnSeqId confMode="false" width="auto" delColumnLabel="Delete column" delColumnHint="Delete this column" addPortletLabel="Add portlet" addPortletHint="Add a new portlet to this column" colWidthLabel="Col. width:" setColumnSizeHint="Set column size">
-  <#assign columnKey = portalPageId+columnSeqId>
-  <#assign columnKeyFields = '<input name="portalPageId" value="' + portalPageId + '" type="hidden"/><input name="columnSeqId" value="' + columnSeqId + '" type="hidden"/>'>
+  <#local columnKey = portalPageId+columnSeqId>
+  <#local columnKeyFields = '<input name="portalPageId" value="' + portalPageId + '" type="hidden"/><input name="columnSeqId" value="' + columnSeqId + '" type="hidden"/>'>
   <script type="application/javascript">
     if (typeof SORTABLE_COLUMN_LIST != "undefined") {
       if (SORTABLE_COLUMN_LIST == null) {
@@ -227,8 +227,8 @@ ${menuString}
 </#macro>
 
 <#macro renderPortalPagePortletBegin originalPortalPageId portalPageId portalPortletId portletSeqId prevPortletId="" prevPortletSeqId="" nextPortletId="" nextPortletSeqId="" columnSeqId="" prevColumnSeqId="" nextColumnSeqId="" confMode="false" delPortletHint="Remove this portlet" editAttribute="false" editAttributeHint="Edit portlet parameters">
-  <#assign portletKey = portalPageId+portalPortletId+portletSeqId>
-  <#assign portletKeyFields = '<input name="portalPageId" value="' + portalPageId + '" type="hidden"/><input name="portalPortletId" value="' + portalPortletId + '" type="hidden"/><input name="portletSeqId" value="' + portletSeqId  + '" type="hidden"/>'>
+  <#local portletKey = portalPageId+portalPortletId+portletSeqId>
+  <#local portletKeyFields = '<input name="portalPageId" value="' + portalPageId + '" type="hidden"/><input name="portalPortletId" value="' + portalPortletId + '" type="hidden"/><input name="portletSeqId" value="' + portletSeqId  + '" type="hidden"/>'>
   <div id="PP_${portletKey}" name="portalPortlet" class="noClass" portalPageId="${portalPageId}" portalPortletId="${portalPortletId}" columnSeqId="${columnSeqId}" portletSeqId="${portletSeqId}">
     <#if "true" == confMode>
       <div class="portlet-config" id="PPCFG_${portletKey}">

Modified: ofbiz/ofbiz-framework/trunk/themes/common-theme/template/macro/XlsFormMacroLibrary.ftl
URL: http://svn.apache.org/viewvc/ofbiz/ofbiz-framework/trunk/themes/common-theme/template/macro/XlsFormMacroLibrary.ftl?rev=1837829&r1=1837828&r2=1837829&view=diff
==============================================================================
--- ofbiz/ofbiz-framework/trunk/themes/common-theme/template/macro/XlsFormMacroLibrary.ftl (original)
+++ ofbiz/ofbiz-framework/trunk/themes/common-theme/template/macro/XlsFormMacroLibrary.ftl Fri Aug 10 18:47:58 2018
@@ -22,7 +22,7 @@ under the License.
 <#macro renderItemField value cellType cellStyle=""><td class="${cellType!}" <#if cellStyle?has_content>${cellStyle!}</#if>>${value!}</td></#macro>
 
 <#macro renderDisplayField type imageLocation idName description title class alert inPlaceEditorUrl="" inPlaceEditorParams="">
-<#if type=="currency"><#assign value = StringUtil.makeStringWrapper(description!)><@renderItemField value "cf" class/>
+<#if type=="currency"><#local value = StringUtil.makeStringWrapper(description!)><@renderItemField value "cf" class/>
 <#elseif type=="date"><@renderItemField description "dt" class/>
 <#elseif type=="date-time"><@renderItemField description "dtf" class/>
 <#elseif type=="accounting-number"><@renderItemField description "nf" class/>