details:   https://code.openbravo.com/erp/devel/pi/rev/06c4eb6200c1
changeset: 34908:06c4eb6200c1
user:      Augusto Mauch <augusto.mauch <at> openbravo.com>
date:      Mon Oct 29 17:39:15 2018 +0100
summary:   Fixes issue 39405: Tab display logic works when direct opening a 
header tab

Before this change, when a window was opened by clicking on a column title, the 
display logic of the
tabs of the window were not evaluated. This was done because if the tab opened 
was a subtab, that tab
should be visible, regardless of that tab's display logic.

But there is no need to enforce that logic when the tab opened is a header tab. 
This changeset evaluates
the display logics of the tabs if the tab opened directly is a header tab.

diffstat:

 
modules/org.openbravo.client.application/web/org.openbravo.client.application/js/main/ob-standard-view.js
 |  18 +++++++++-
 1 files changed, 17 insertions(+), 1 deletions(-)

diffs (39 lines):

diff -r 890acbd59e51 -r 06c4eb6200c1 
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
 Fri Oct 26 10:54:45 2018 +0530
+++ 
b/modules/org.openbravo.client.application/web/org.openbravo.client.application/js/main/ob-standard-view.js
 Mon Oct 29 17:39:15 2018 +0100
@@ -1750,7 +1750,7 @@
         // session attributes of the form
         contextInfo = this.getContextInfo(false, true, true);
         this.addPreferenceValues(contextInfo, tabViewPane);
-        if (!this.isOpenedByDirectLink() && tabViewPane.showTabIf && 
!(tabViewPane.showTabIf(contextInfo))) {
+        if (!this.isSubtabOpenedByDirectLink() && tabViewPane.showTabIf && 
!(tabViewPane.showTabIf(contextInfo))) {
           this.childTabSet.tabBar.members[i].hide();
           tabViewPane.hidden = true;
         } else {
@@ -1792,10 +1792,26 @@
     }
   },
 
+  isSubtabOpenedByDirectLink: function () {
+    return this.isOpenedByDirectLink() && 
this.isSubTab(this.standardWindow.targetTabId);
+  },
+
   isOpenedByDirectLink: function () {
     return this.standardWindow.directTabInfo;
   },
 
+  isSubTab: function (tabId) {
+    var view;
+    if (!tabId) {
+      return false;
+    }
+    view = this.standardWindow.getView(tabId);
+    if (!view) {
+      return false;
+    }
+    return view.parentTab !== null && view.parentTab !== undefined;
+  },
+
   //This function returns true if it is a new record and it is being edited
   isEditingNewRecord: function () {
     var form = this.isShowingForm ? this.viewForm : 
this.viewGrid.getEditForm();


_______________________________________________
Openbravo-commits mailing list
Openbravo-commits@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/openbravo-commits

Reply via email to