Attached Files | bug-37604.patch [^] (13,560 bytes) 2018-01-23 12:36 [Show Content] [Hide Content]# HG changeset patch
# User Javier Armendáriz <javier.armendariz@openbravo.com>
# Date 1516707258 -3600
# Tue Jan 23 12:34:18 2018 +0100
# Node ID 0d29550f89d999224e7f8e2d4eba742d81e65628
# Parent 21e9102f2f7d35c80b8c06aa5984cfb761005220
Fixed issue 37604: Remove unneeded parameters in ToolBar class.
Removed isTest parameter in some ToolBar methods that is no longer useful because it is used to call a private empty method.
diff --git a/modules/org.openbravo.advpaymentmngt/src/org/openbravo/advpaymentmngt/ad_forms/Transactions.java b/modules/org.openbravo.advpaymentmngt/src/org/openbravo/advpaymentmngt/ad_forms/Transactions.java
--- a/modules/org.openbravo.advpaymentmngt/src/org/openbravo/advpaymentmngt/ad_forms/Transactions.java
+++ b/modules/org.openbravo.advpaymentmngt/src/org/openbravo/advpaymentmngt/ad_forms/Transactions.java
@@ -280,7 +280,7 @@
"document.frmMain.inpfinFinancialAccountId", "", "", "".equals("Y"), "FinancialAccount",
strReplaceWith, true);
- toolbar.prepareRelationTemplateNoSearch(false, false, false, false, false);
+ toolbar.prepareRelationTemplateNoSearch(false, false, false, false);
toolbar.prepareSimpleToolBarTemplate();
xmlDocument.setParameter("toolbar", toolbar.toString());
diff --git a/src/org/openbravo/erpCommon/ad_forms/SQLExecutor.java b/src/org/openbravo/erpCommon/ad_forms/SQLExecutor.java
--- a/src/org/openbravo/erpCommon/ad_forms/SQLExecutor.java
+++ b/src/org/openbravo/erpCommon/ad_forms/SQLExecutor.java
@@ -223,9 +223,10 @@
ToolBar toolbar = new ToolBar(this, vars.getLanguage(), "SQLExecutor", false,
"document.frmMain.inpKey", "myGrid", null, false, "ad_forms", strReplaceWith, false, true);
+
toolbar.prepareQueryTemplate((initRecordNumber > 1),
- (data != null && data.length != 0 && data.length >= intRecordRange),
- vars.getSessionValue("#ShowTest", "N").equals("Y"));
+ (data != null && data.length != 0 && data.length >= intRecordRange));
+
xmlDocument.setParameter("toolbar", toolbar.toString());
try {
diff --git a/src/org/openbravo/erpCommon/utility/ToolBar.java b/src/org/openbravo/erpCommon/utility/ToolBar.java
--- a/src/org/openbravo/erpCommon/utility/ToolBar.java
+++ b/src/org/openbravo/erpCommon/utility/ToolBar.java
@@ -470,59 +470,6 @@
}
}
- public void prepareInfoTemplate(boolean hasPrevious, boolean hasNext, boolean isTest) {
- removeElement("NEW");
- removeElement("EDIT");
- removeElement("RELATION");
- removeElement("FIND");
- removeElement("SEPARATOR2");
- removeElement("SAVE_RELATION");
- removeElement("SAVE_NEW");
- removeElement("SAVE_EDIT");
- removeElement("SAVE_NEXT");
- removeElement("SEPARATOR3");
- removeElement("DELETE");
- removeElement("DELETE_RELATION");
- removeElement("SEPARATOR4");
- // removeElement("REFRESH");
- removeElement("UNDO");
- removeElement("TREE");
- removeElement("ATTACHMENT");
- removeElement("EXCEL");
- removeElement("GRIDEXCEL");
- removeElement("GRIDCSV");
- removeElement("GRIDPDF");
- removeElement("PRINT");
- removeElement("EMAIL");
- removeElement("SEARCH");
- removeElement("SEARCH_FILTERED");
- removeElement("SEPARATOR5");
- removeElement("FIRST");
- removeElement("FIRST_RELATION");
- removeElement("PREVIOUS");
- removeElement("NEXT");
- removeElement("LAST");
- removeElement("LAST_RELATION");
- removeElement("SEPARATOR6");
-
- removeElement("AUDIT_SHOW_EDITION_DISABLED");
- removeElement("AUDIT_SHOW_EDITION_ENABLED");
- removeElement("AUDIT_SHOW_RELATION_DISABLED");
- removeElement("AUDIT_SHOW_RELATION_ENABLED");
- removeElement("AUDIT_TRAIL");
-
- if (!hasPrevious)
- removeElement("PREVIOUS_RELATION");
- else
- removeElement("PREVIOUS_RELATION_DISABLED");
- if (!hasNext)
- removeElement("NEXT_RELATION");
- else
- removeElement("NEXT_RELATION_DISABLED");
- if (!isTest)
- removeAllTests();
- }
-
public void prepareEditionTemplate(boolean hasTree, boolean isFiltered, boolean isTest,
String uiPattern, boolean isAuditEnabled) {
removeElement("EDIT");
@@ -576,8 +523,6 @@
removeElement("SEARCH");
else
removeElement("SEARCH_FILTERED");
- if (!isTest)
- removeAllTests();
if (uiPattern.equals("RO")) // read-only
removeReadOnly();
if (uiPattern.equals("SR")) // single record
@@ -588,109 +533,6 @@
changeAuditTrailVisibility();
}
- public void prepareEditionTemplateNoSearch(boolean hasTree, boolean isFiltered, boolean isTest,
- String uiPattern, boolean isAuditEnabled) {
- removeElement("SEARCH");
- removeElement("SEARCH_FILTERED");
- prepareEditionTemplate(hasTree, isFiltered, isTest, uiPattern, isAuditEnabled);
- }
-
- /**
- * Deprecated 2.50 use instead
- * {@link ToolBar#prepareEditionTemplateNoSearch(boolean, boolean, boolean, String, boolean)}
- *
- * @param hasTree
- * @param isFiltered
- * @param isTest
- * @param isReadOnly
- * @param isAuditEnabled
- */
- @Deprecated
- public void prepareEditionTemplateNoSearch(boolean hasTree, boolean isFiltered, boolean isTest,
- boolean isReadOnly, boolean isAuditEnabled) {
- removeElement("SEARCH");
- removeElement("SEARCH_FILTERED");
- prepareEditionTemplate(hasTree, isFiltered, isTest, isReadOnly, isAuditEnabled);
- }
-
- /**
- * Deprecated 2.50 used instead
- * {@link ToolBar#prepareEditionTemplate(boolean hasTree, boolean isFiltered, boolean isTest, String uiPattern, boolean isAuditEnabled)}
- *
- * @param hasTree
- * @param isFiltered
- * @param isTest
- * @param isReadOnly
- * @param isAuditEnabled
- */
- @Deprecated
- public void prepareEditionTemplate(boolean hasTree, boolean isFiltered, boolean isTest,
- boolean isReadOnly, boolean isAuditEnabled) {
- prepareEditionTemplate(hasTree, isFiltered, isTest, (isReadOnly ? "RO" : "STD"), isAuditEnabled);
- }
-
- public void prepareRelationTemplateNoSearch(boolean hasTree, boolean isFiltered, boolean isTest,
- boolean isReadOnly, boolean isAuditEnabled) {
- removeElement("SEARCH");
- removeElement("SEARCH_FILTERED");
- prepareRelationTemplate(hasTree, isFiltered, isTest, isReadOnly, isAuditEnabled);
- }
-
- public void prepareRelationTemplate(boolean hasTree, boolean isFiltered, boolean isTest,
- boolean isReadOnly, boolean isAuditEnabled) {
- isRelation = true;
- removeElement("EDIT");
- removeElement("RELATION");
- removeElement("DELETE");
- removeElement("SAVE_RELATION");
- removeElement("SAVE_NEW");
- removeElement("SAVE_EDIT");
- removeElement("SAVE_NEXT");
- removeElement("UNDO");
- removeElement("FIRST");
- removeElement("LAST");
- removeElement("FIND");
- removeElement("EXCEL");
-
- removeElement("AUDIT_SHOW_EDITION_DISABLED");
- removeElement("AUDIT_SHOW_EDITION_ENABLED");
- if (isAuditEnabled)
- removeElement("AUDIT_SHOW_RELATION_DISABLED");
- else
- removeElement("AUDIT_SHOW_RELATION_ENABLED");
- removeElement("PREVIOUS_RELATION");
- removeElement("PREVIOUS_RELATION_DISABLED");
- removeElement("NEXT_RELATION");
- removeElement("NEXT_RELATION_DISABLED");
-
- if (!deleteable) {
- removeElement("DELETE_RELATION");
- }
-
- if (!hasTree)
- removeElement("TREE");
- if (isFiltered)
- removeElement("SEARCH");
- else
- removeElement("SEARCH_FILTERED");
- if (!isTest)
- removeAllTests();
- if (isReadOnly)
- removeReadOnly();
-
- if (pdf != null && !pdf.contains("orders") && !pdf.contains("invoices")
- && !pdf.contains("payments")) {
- removeElement("EMAIL");
- }
-
- changeAuditTrailVisibility();
- }
-
- // AL New toolbars
- public void prepareSimpleToolBarTemplateFrame() {
-
- }
-
public void prepareSimpleToolBarTemplate() {
removeElement("SEPARATOR1");
removeElement("NEW");
@@ -747,56 +589,6 @@
removeElement("AUDIT_TRAIL");
}
- // Simple toolbar with save button
- public void prepareSimpleSaveToolBarTemplate() {
- removeElement("RELATED_INFO");
- removeElement("SEPARATOR1");
- removeElement("NEW");
- removeElement("EDIT");
- removeElement("RELATION");
- removeElement("FIND");
- removeElement("SEPARATOR2");
- removeElement("SAVE_RELATION");
- removeElement("SAVE_NEW");
- removeElement("SAVE_NEXT");
- removeElement("DELETE");
- removeElement("DELETE_RELATION");
- removeElement("UNDO");
- removeElement("TREE");
- removeElement("ATTACHMENT");
- removeElement("EXCEL");
- removeElement("GRIDEXCEL");
- removeElement("GRIDCSV");
- removeElement("GRIDPDF");
- removeElement("SEARCH");
- removeElement("SEARCH_FILTERED");
- removeElement("ORDERBY");
- removeElement("ORDERBY_FILTERED");
- removeElement("FIRST");
- removeElement("FIRST_RELATION");
- removeElement("PREVIOUS");
- removeElement("NEXT");
- removeElement("LAST");
- removeElement("LAST_RELATION");
- removeElement("PREVIOUS_RELATION");
- removeElement("PREVIOUS_RELATION_DISABLED");
- removeElement("NEXT_RELATION");
- removeElement("NEXT_RELATION_DISABLED");
- if (pdf != null && !pdf.equals("") && !pdf.equals("..")) {
- buttons.put("PRINT",
- new ToolBar_Button(base_direction, "Print", Utility.messageBD(conn, "Print", language),
- pdf));
- buttons.put("EMAIL",
- new ToolBar_Button(base_direction, "Email", Utility.messageBD(conn, "Email", language),
- pdf));
- }
- removeElement("AUDIT_SHOW_EDITION_DISABLED");
- removeElement("AUDIT_SHOW_EDITION_ENABLED");
- removeElement("AUDIT_SHOW_RELATION_DISABLED");
- removeElement("AUDIT_SHOW_RELATION_ENABLED");
- removeElement("AUDIT_TRAIL");
- }
-
public void prepareRelationBarTemplate(boolean hasPrevious, boolean hasNext) {
prepareRelationBarTemplate(hasPrevious, hasNext, "");
}
@@ -910,91 +702,7 @@
}
- // GD Toolbar with Menu, Refresh and Excel buttons
- public void prepareExcelToolBarTemplate() {
- removeElement("NEW");
- removeElement("EDIT");
- removeElement("RELATION");
- removeElement("FIND");
- removeElement("SEPARATOR2");
- removeElement("SAVE_RELATION");
- removeElement("SAVE_NEW");
- removeElement("SAVE_EDIT");
- removeElement("SAVE_NEXT");
- removeElement("DELETE");
- removeElement("DELETE_RELATION");
- removeElement("UNDO");
- removeElement("TREE");
- removeElement("GRIDEXCEL");
- removeElement("GRIDCSV");
- removeElement("GRIDPDF");
- removeElement("ATTACHMENT");
- removeElement("SEARCH");
- removeElement("SEARCH_FILTERED");
- removeElement("ORDERBY");
- removeElement("ORDERBY_FILTERED");
- removeElement("FIRST");
- removeElement("FIRST_RELATION");
- removeElement("PREVIOUS");
- removeElement("NEXT");
- removeElement("LAST");
- removeElement("LAST_RELATION");
- removeElement("PREVIOUS_RELATION");
- removeElement("PREVIOUS_RELATION_DISABLED");
- removeElement("NEXT_RELATION");
- removeElement("NEXT_RELATION_DISABLED");
-
- removeElement("AUDIT_SHOW_EDITION_DISABLED");
- removeElement("AUDIT_SHOW_EDITION_ENABLED");
- removeElement("AUDIT_SHOW_RELATION_DISABLED");
- removeElement("AUDIT_SHOW_RELATION_ENABLED");
- removeElement("AUDIT_TRAIL");
- }
-
- // AL
- public void prepareSortableTemplate(boolean isTest) {
- removeElement("NEW");
- removeElement("EDIT");
- removeElement("RELATION");
- removeElement("SAVE_RELATION");
- removeElement("SAVE_NEW");
- removeElement("SAVE_NEXT");
- removeElement("DELETE");
- removeElement("DELETE_RELATION");
- removeElement("UNDO");
- removeElement("TREE");
- removeElement("ATTACHMENT");
- removeElement("EXCEL");
- removeElement("GRIDEXCEL");
- removeElement("GRIDCSV");
- removeElement("GRIDPDF");
- removeElement("SEARCH");
- removeElement("SEARCH_FILTERED");
- removeElement("ORDERBY");
- removeElement("ORDERBY_FILTERED");
- removeElement("FIRST");
- removeElement("FIRST_RELATION");
- removeElement("PREVIOUS");
- removeElement("NEXT");
- removeElement("LAST");
- removeElement("LAST_RELATION");
- removeElement("PREVIOUS_RELATION");
- removeElement("PREVIOUS_RELATION_DISABLED");
- removeElement("NEXT_RELATION");
- removeElement("NEXT_RELATION_DISABLED");
- removeElement("FIND");
- removeElement("RELATED_INFO");
- if (!isTest)
- removeAllTests();
-
- removeElement("AUDIT_SHOW_EDITION_DISABLED");
- removeElement("AUDIT_SHOW_EDITION_ENABLED");
- removeElement("AUDIT_SHOW_RELATION_DISABLED");
- removeElement("AUDIT_SHOW_RELATION_ENABLED");
- removeElement("AUDIT_TRAIL");
- }
-
- public void prepareQueryTemplate(boolean hasPrevious, boolean hasNext, boolean isTest) {
+ public void prepareQueryTemplate(boolean hasPrevious, boolean hasNext) {
removeElement("NEW");
removeElement("EDIT");
removeElement("RELATION");
@@ -1029,8 +737,6 @@
removeElement("NEXT_RELATION");
else
removeElement("NEXT_RELATION_DISABLED");
- if (!isTest)
- removeAllTests();
removeElement("AUDIT_SHOW_EDITION_DISABLED");
removeElement("AUDIT_SHOW_EDITION_ENABLED");
@@ -1040,10 +746,6 @@
removeElement("RELATED_INFO");
}
- private void removeAllTests() {
-
- }
-
private void removeReadOnly() {
removeSingleRecord();
removeElement("SAVE_EDIT");
|