Fixes issue 25307: Tab display logic works with preferences
authorAugusto Mauch <augusto.mauch@openbravo.com>
Thu, 12 Dec 2013 12:50:26 +0100
changeset 21631 9adac4af4305
parent 21630 1bd8af6b5ac9
child 21632 75d9faa915ad
Fixes issue 25307: Tab display logic works with preferences

For computing the display logic of a tab, the context info of its parent tab is used. But if a preference is used, it is stored as a session attribute in the subtab, so it was not being included in the context.
modules/org.openbravo.client.application/web/org.openbravo.client.application/js/main/ob-standard-view.js
--- a/modules/org.openbravo.client.application/web/org.openbravo.client.application/js/main/ob-standard-view.js	Wed Dec 11 19:02:49 2013 +0100
+++ b/modules/org.openbravo.client.application/web/org.openbravo.client.application/js/main/ob-standard-view.js	Thu Dec 12 12:50:26 2013 +0100
@@ -1357,14 +1357,16 @@
   },
 
   updateSubtabVisibility: function () {
-    var i, length, tabViewPane, activeTab, activeTabNum, activeTabPane, indexFirstNotHiddenTab;
+    var i, length, tabViewPane, activeTab, activeTabNum, activeTabPane, indexFirstNotHiddenTab, contextInfo;
     if (this.childTabSet) {
       length = this.childTabSet.tabs.length;
       for (i = 0; i < length; i++) {
         tabViewPane = this.childTabSet.tabs[i].pane;
         // Calling getContextInfo with (false, true, true) in order to obtain also the value of the
         // session attributes of the form
-        if (tabViewPane.showTabIf && !(tabViewPane.showTabIf(this.getContextInfo(false, true, true)))) {
+        contextInfo = this.getContextInfo(false, true, true);
+        isc.addProperties(contextInfo, tabViewPane.sessionAttributes);
+        if (tabViewPane.showTabIf && !(tabViewPane.showTabIf(contextInfo))) {
           this.childTabSet.tabBar.members[i].hide();
           tabViewPane.hidden = true;
         } else {