[tree] Added tree popup to tabs with trees
authorAsier Lostalé <asier.lostale@openbravo.com>
Mon, 24 Jan 2011 10:31:01 +0100
changeset 10085 c1acc35fef75
parent 10084 7b0cca48bc9c
child 10086 b071c4b4756f
[tree] Added tree popup to tabs with trees
modules/org.openbravo.client.application/src/org/openbravo/client/application/window/OBViewTab.java
modules/org.openbravo.client.application/web/org.openbravo.client.application/js/ob-toolbar.js
--- a/modules/org.openbravo.client.application/src/org/openbravo/client/application/window/OBViewTab.java	Mon Jan 24 12:28:48 2011 +0100
+++ b/modules/org.openbravo.client.application/src/org/openbravo/client/application/window/OBViewTab.java	Mon Jan 24 10:31:01 2011 +0100
@@ -125,6 +125,17 @@
       iconButtons.add(auditBtn);
     }
 
+    // Tree button
+    if (tab.isTreeIncluded()) {
+      IconButton treeBtn = new IconButton();
+      // TODO: set correct type once the icon for the tree is available
+      treeBtn.type = "attach";
+      treeBtn.label = Utility.messageBD(new DalConnectionProvider(), "Tree", OBContext
+          .getOBContext().getLanguage().getLanguage());
+      treeBtn.action = "OB.ToolbarUtils.showTree(this.view);";
+      iconButtons.add(treeBtn);
+    }
+
     return iconButtons;
   }
 
--- a/modules/org.openbravo.client.application/web/org.openbravo.client.application/js/ob-toolbar.js	Mon Jan 24 12:28:48 2011 +0100
+++ b/modules/org.openbravo.client.application/web/org.openbravo.client.application/js/ob-toolbar.js	Mon Jan 24 10:31:01 2011 +0100
@@ -820,5 +820,14 @@
     popupParams += "&inpRecordId=" + view.viewGrid.getSelectedRecord().id;
   }
   
-  OB.Layout.ClassicOBCompatibility.Popup.open('print', 900, 600, OB.Application.contextUrl + '/businessUtility/AuditTrail.html?'+popupParams, '', window, false, false, true);
-};
\ No newline at end of file
+  OB.Layout.ClassicOBCompatibility.Popup.open('audit', 900, 600, OB.Application.contextUrl + '/businessUtility/AuditTrail.html?'+popupParams, '', window, false, false, true);
+};
+
+OB.ToolbarUtils.showTree = function(view){
+  // Open tree through menu to have hidden vertical menu which is needed to show old JS messages
+  var popupParams = 'url=/utility/WindowTree.html';
+  popupParams += 'Command=DEFAULT';
+  pupopParams += '&inpTabId=' + view.tabId;
+  popupParams += '&hideMenu=true&noprefs=true';
+  OB.Layout.ClassicOBCompatibility.Popup.open('tree', 750, 625, OB.Application.contextUrl + '/security/Menu.html?'+popupParams, '', window, false, false, true);
+};