You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ofbiz.apache.org by ar...@apache.org on 2017/07/08 12:39:58 UTC

svn commit: r1801282 - in /ofbiz/ofbiz-plugins/trunk: pricat/template/pricat/ projectmgr/template/project/ projectmgr/template/project/summary/ webpos/template/catalog/

Author: arunpatidar
Date: Sat Jul  8 12:39:58 2017
New Revision: 1801282

URL: http://svn.apache.org/viewvc?rev=1801282&view=rev
Log:
Improved: Inconsistent String Comparisons (OFBIZ-9254)
Thanks Devanshu Vyas for your contribution

Modified:
    ofbiz/ofbiz-plugins/trunk/pricat/template/pricat/ExcelImportHistoryReport.ftl
    ofbiz/ofbiz-plugins/trunk/pricat/template/pricat/pricatreport.ftl
    ofbiz/ofbiz-plugins/trunk/pricat/template/pricat/report.ftl
    ofbiz/ofbiz-plugins/trunk/projectmgr/template/project/GanttChart.ftl
    ofbiz/ofbiz-plugins/trunk/projectmgr/template/project/summary/NoteInfo.ftl
    ofbiz/ofbiz-plugins/trunk/webpos/template/catalog/SideDeepCategory.ftl

Modified: ofbiz/ofbiz-plugins/trunk/pricat/template/pricat/ExcelImportHistoryReport.ftl
URL: http://svn.apache.org/viewvc/ofbiz/ofbiz-plugins/trunk/pricat/template/pricat/ExcelImportHistoryReport.ftl?rev=1801282&r1=1801281&r2=1801282&view=diff
==============================================================================
--- ofbiz/ofbiz-plugins/trunk/pricat/template/pricat/ExcelImportHistoryReport.ftl (original)
+++ ofbiz/ofbiz-plugins/trunk/pricat/template/pricat/ExcelImportHistoryReport.ftl Sat Jul  8 12:39:58 2017
@@ -60,7 +60,7 @@ under the License.
                     <td><#if historyEntry.fromDate?exists && historyEntry.fromDate?has_content>${historyEntry.fromDate?string("yyyy-MM-dd HH:mm:ss")}</#if></td>
                     <td><#if historyEntry.thruDate?exists && historyEntry.thruDate?has_content>${historyEntry.thruDate?string("yyyy-MM-dd HH:mm:ss")}</#if></td>
                     <td><#if historyEntry.statusId?exists && historyEntry.statusId?has_content>${uiLabelMap.get(historyEntry.statusId)}</#if></td>
-                    <td><#if historyEntry.statusId?exists && historyEntry.statusId == "EXCEL_IMPORTED" && historyEntry.thruReasonId?exists && historyEntry.thruReasonId?has_content>${uiLabelMap.get(historyEntry.thruReasonId)}</#if></td>
+                    <td><#if historyEntry.statusId?exists && "EXCEL_IMPORTED" == historyEntry.statusId && historyEntry.thruReasonId?exists && historyEntry.thruReasonId?has_content>${uiLabelMap.get(historyEntry.thruReasonId)}</#if></td>
                     <td>
                         <#assign buttons = 0 />
                         <#if historyEntry.logFileName?exists && historyEntry.logFileName?has_content>

Modified: ofbiz/ofbiz-plugins/trunk/pricat/template/pricat/pricatreport.ftl
URL: http://svn.apache.org/viewvc/ofbiz/ofbiz-plugins/trunk/pricat/template/pricat/pricatreport.ftl?rev=1801282&r1=1801281&r2=1801282&view=diff
==============================================================================
--- ofbiz/ofbiz-plugins/trunk/pricat/template/pricat/pricatreport.ftl (original)
+++ ofbiz/ofbiz-plugins/trunk/pricat/template/pricat/pricatreport.ftl Sat Jul  8 12:39:58 2017
@@ -20,7 +20,7 @@ under the License.
 <#assign resourceParam = "resource"
          borderStyle = "2px inset ThreeDHighlight"
          borderSimpleStyle = "2px solid ThreeDFace">
-<#if report.isMultiOperation(request)?string("true", "false") == "true">
+<#if "true" == report.isMultiOperation(request)?string("true", "false")>
     <#assign resourceParam = null>
 </#if>
 <#assign action = report.getParamAction(request)>
@@ -84,7 +84,7 @@ ${StringUtil.wrapString(report.getReport
         active = setTimeout("reload('reportupdate');", 2000);
   } else {
        var hasNext = "${report.getParamThreadHasNext(request)}";
-       if (hasNext == "true") {
+       if ("true" == hasNext) {
                if (!${report.hasError()?string("true", "false")} || parent.isContinueChecked()) {
                    // all actions ok or continue checked, continue automatically
                    continueReport();
@@ -411,7 +411,7 @@ function displayButtonRow(rowId, show) {
 }
 
 function enableButtons(rowId) {
-    if (rowId == "buttonrowcontinue") {
+    if ("buttonrowcontinue" == rowId) {
         toggleButton("contok", false);
         toggleButton("contcancel", false);
     } else {
@@ -420,7 +420,7 @@ function enableButtons(rowId) {
 }
 
 function disableButtons(rowId) {
-    if (rowId == "buttonrowcontinue") {
+    if ("buttonrowcontinue" == rowId) {
         toggleButton("contok", true);
         toggleButton("contcancel", true);
     } else {
@@ -436,7 +436,7 @@ function toggleButton(buttonId, disableB
 }
 
 function initButtons() {
-    if (document.main.threadhasnext && document.main.threadhasnext.value == "true"
+    if (document.main.threadhasnext && "true" == document.main.threadhasnext.value
             && document.main.reportcontinuekey && document.main.reportcontinuekey.value != "") {
         displayButtonRowContinue();
     } else {
@@ -448,7 +448,7 @@ function initButtons() {
 }
 
 function submitActionRefresh(para1, para2, para3) {
-<#if report.getParamRefreshWorkplace()?has_content && report.getParamRefreshWorkplace() == "true"> 
+<#if report.getParamRefreshWorkplace()?has_content && "true" == report.getParamRefreshWorkplace()>
     <#-- workplace must be refresehd (reloaded) -->
     top.location.href = "${StringUtil.wrapString(report.getDialogRealUri(request))}";
 <#else> 

Modified: ofbiz/ofbiz-plugins/trunk/pricat/template/pricat/report.ftl
URL: http://svn.apache.org/viewvc/ofbiz/ofbiz-plugins/trunk/pricat/template/pricat/report.ftl?rev=1801282&r1=1801281&r2=1801282&view=diff
==============================================================================
--- ofbiz/ofbiz-plugins/trunk/pricat/template/pricat/report.ftl (original)
+++ ofbiz/ofbiz-plugins/trunk/pricat/template/pricat/report.ftl Sat Jul  8 12:39:58 2017
@@ -20,7 +20,7 @@ under the License.
 <#assign resourceParam = "resource"
          borderStyle = "2px inset ThreeDHighlight"
          borderSimpleStyle = "2px solid ThreeDFace">
-<#if report.isMultiOperation(request)?string("true", "false") == "true">
+<#if "true" == report.isMultiOperation(request)?string("true", "false")>
     <#assign resourceParam = null>
 </#if>
 <#assign action = report.getParamAction(request)>
@@ -84,7 +84,7 @@ ${StringUtil.wrapString(report.getReport
         active = setTimeout("reload('reportupdate');", 2000);
   } else {
        var hasNext = "${report.getParamThreadHasNext(request)}";
-       if (hasNext == "true") {
+       if ("true" == hasNext) {
                if (!${report.hasError()?string("true", "false")} || parent.isContinueChecked()) {
                    // all actions ok or continue checked, continue automatically
                    continueReport();
@@ -411,7 +411,7 @@ function displayButtonRow(rowId, show) {
 }
 
 function enableButtons(rowId) {
-    if (rowId == "buttonrowcontinue") {
+    if ("buttonrowcontinue" == rowId) {
         toggleButton("contok", false);
         toggleButton("contcancel", false);
     } else {
@@ -420,7 +420,7 @@ function enableButtons(rowId) {
 }
 
 function disableButtons(rowId) {
-    if (rowId == "buttonrowcontinue") {
+    if ("buttonrowcontinue" == rowId) {
         toggleButton("contok", true);
         toggleButton("contcancel", true);
     } else {
@@ -436,7 +436,7 @@ function toggleButton(buttonId, disableB
 }
 
 function initButtons() {
-    if (document.main.threadhasnext && document.main.threadhasnext.value == "true"
+    if (document.main.threadhasnext && "true" == document.main.threadhasnext.value
             && document.main.reportcontinuekey && document.main.reportcontinuekey.value != "") {
         displayButtonRowContinue();
     } else {
@@ -448,7 +448,7 @@ function initButtons() {
 }
 
 function submitActionRefresh(para1, para2, para3) {
-<#if report.getParamRefreshWorkplace()?has_content && report.getParamRefreshWorkplace() == "true"> 
+<#if report.getParamRefreshWorkplace()?has_content && "true" == report.getParamRefreshWorkplace()>
     <#-- workplace must be refresehd (reloaded) -->
     top.location.href = "${StringUtil.wrapString(report.getDialogRealUri(request))}";
 <#else> 

Modified: ofbiz/ofbiz-plugins/trunk/projectmgr/template/project/GanttChart.ftl
URL: http://svn.apache.org/viewvc/ofbiz/ofbiz-plugins/trunk/projectmgr/template/project/GanttChart.ftl?rev=1801282&r1=1801281&r2=1801282&view=diff
==============================================================================
--- ofbiz/ofbiz-plugins/trunk/projectmgr/template/project/GanttChart.ftl (original)
+++ ofbiz/ofbiz-plugins/trunk/projectmgr/template/project/GanttChart.ftl Sat Jul  8 12:39:58 2017
@@ -29,13 +29,13 @@ g.setShowComp(1); // Show/Hide % Complet
 // Parameters             (pID, pName,                  pStart,      pEnd,        pColor,   pLink,          pMile, pRes,  pComp, pGroup, pParent, pOpen)
 
 <#list phaseTaskList as t>
-    <#if t.workEffortTypeId == "PHASE">
+    <#if "PHASE" == t.workEffortTypeId>
         g.AddTaskItem(new JSGantt.TaskItem("${t.phaseNr}", "${t.phaseSeqNum!}. ${t.phaseName}", "", "", "00ff00", "", 0, "", 0, 1, 0, 1));
     </#if>
-    <#if t.workEffortTypeId == "TASK">
+    <#if "TASK" == t.workEffortTypeId>
         g.AddTaskItem(new JSGantt.TaskItem("${t.taskNr}","${t.taskSeqNum!}. ${t.taskName}","${StringUtil.wrapString(t.estimatedStartDate)}", "${StringUtil.wrapString(t.estimatedCompletionDate)}","009900", "${t.url}", 0 , "${t.resource!}", ${t.completion!} , 0, ${t.phaseNr}, 1<#if t.preDecessor??>, "${t.preDecessor}"</#if>));
     </#if>
-    <#if t.workEffortTypeId == "MILESTONE">
+    <#if "MILESTONE" == t.workEffortTypeId>
         g.AddTaskItem(new JSGantt.TaskItem("${t.taskNr}","${t.taskName}","${StringUtil.wrapString(t.estimatedStartDate)}", "${StringUtil.wrapString(t.estimatedCompletionDate)}","00ff00", "", 1 , "${t.resource!}", ${t.completion!} , 0,${t.phaseNr}, "", "" ));
     </#if>
 </#list>

Modified: ofbiz/ofbiz-plugins/trunk/projectmgr/template/project/summary/NoteInfo.ftl
URL: http://svn.apache.org/viewvc/ofbiz/ofbiz-plugins/trunk/projectmgr/template/project/summary/NoteInfo.ftl?rev=1801282&r1=1801281&r2=1801282&view=diff
==============================================================================
--- ofbiz/ofbiz-plugins/trunk/projectmgr/template/project/summary/NoteInfo.ftl (original)
+++ ofbiz/ofbiz-plugins/trunk/projectmgr/template/project/summary/NoteInfo.ftl Sat Jul  8 12:39:58 2017
@@ -46,7 +46,7 @@ under the License.
                     <div>${note.noteInfo!}</div>
                   </td>
                   <td align="right" valign="top" width="15%">
-                    <#if note.internalNote! == "N">
+                    <#if "N" == note.internalNote!>
                         <div>${uiLabelMap.ProjectMgrPrintableNote}</div>
                           <#if project?has_content>
                             <form name="updateProjectNoteForPublicNote" method="post" action="<@o...@ofbizUrl>">
@@ -64,7 +64,7 @@ under the License.
                             </form>
                           </#if>
                     </#if>
-                    <#if note.internalNote! == "Y">
+                    <#if "Y" == note.internalNote!>
                         <div>${uiLabelMap.OrderNotPrintableNote}</div>
                            <#if project?has_content>
                              <form name="updateProjectNoteForPrivateNote" method="post" action="<@o...@ofbizUrl>">

Modified: ofbiz/ofbiz-plugins/trunk/webpos/template/catalog/SideDeepCategory.ftl
URL: http://svn.apache.org/viewvc/ofbiz/ofbiz-plugins/trunk/webpos/template/catalog/SideDeepCategory.ftl?rev=1801282&r1=1801281&r2=1801282&view=diff
==============================================================================
--- ofbiz/ofbiz-plugins/trunk/webpos/template/catalog/SideDeepCategory.ftl (original)
+++ ofbiz/ofbiz-plugins/trunk/webpos/template/catalog/SideDeepCategory.ftl Sat Jul  8 12:39:58 2017
@@ -37,7 +37,7 @@ under the License.
   <#else>
       <#assign browseCategoryButtonClass = "browsecategorybutton">
   </#if>
-  <#if wrapInBox == "Y">
+  <#if "Y" == wrapInBox>
   <div id="sidedeepcategory">
     <h3><#if categoryDescription?has_content>${categoryDescription}<#else>${categoryName?default("")}</#if></h3>
     <div>
@@ -62,7 +62,7 @@ under the License.
     </#if>
   </#if>
   </li>
-  <#if wrapInBox == "Y">
+  <#if "Y" == wrapInBox>
       </div>
     </div>
   </div>