fixed bug 25709: header buttons not correctly disabled focusing in child tab
authorAsier Lostalé <asier.lostale@openbravo.com>
Tue, 18 Feb 2014 07:58:51 +0100
changeset 22046 2d05b68d4f4f
parent 22045 c0bf1e287857
child 22047 b689f78c1ee2
fixed bug 25709: header buttons not correctly disabled focusing in child tab
modules/org.openbravo.client.application/src/org/openbravo/client/application/WindowSettingsActionHandler.java
modules/org.openbravo.client.application/web/org.openbravo.client.application/js/main/ob-standard-window.js
--- a/modules/org.openbravo.client.application/src/org/openbravo/client/application/WindowSettingsActionHandler.java	Mon Feb 17 15:17:49 2014 +0000
+++ b/modules/org.openbravo.client.application/src/org/openbravo/client/application/WindowSettingsActionHandler.java	Tue Feb 18 07:58:51 2014 +0100
@@ -11,7 +11,7 @@
  * under the License. 
  * The Original Code is Openbravo ERP. 
  * The Initial Developer of the Original Code is Openbravo SLU 
- * All portions are Copyright (C) 2011-2012 Openbravo SLU 
+ * All portions are Copyright (C) 2011-2014 Openbravo SLU 
  * All Rights Reserved. 
  * Contributor(s):  ______________________________________.
  ************************************************************************
@@ -144,7 +144,7 @@
             .getInstance()
             .createQuery(
                 Field.class,
-                " as f where  tab.window = :window "
+                " as f where  tab.window = :window and tab.active = true "
                     + "and ( (column.oBUIAPPProcess is not null"
                     + " and not exists (select 1 from "
                     + " OBUIAPP_Process_Access a"
--- a/modules/org.openbravo.client.application/web/org.openbravo.client.application/js/main/ob-standard-window.js	Mon Feb 17 15:17:49 2014 +0000
+++ b/modules/org.openbravo.client.application/web/org.openbravo.client.application/js/main/ob-standard-window.js	Tue Feb 18 07:58:51 2014 +0100
@@ -401,6 +401,9 @@
       for (t = 0; t < data.notAccessibleProcesses.length; t++) {
         notAccessibleProcesses = data.notAccessibleProcesses[t];
         view = this.getView(notAccessibleProcesses.tabId);
+        if (!view) {
+          continue;
+        }
         for (i = 0; i < view.toolBar.rightMembers.length; i++) {
           button = view.toolBar.rightMembers[i];
           if (notAccessibleProcesses.tabId === button.contextView.tabId && button.property && notAccessibleProcesses.processes.contains(button.property)) {
@@ -413,7 +416,7 @@
               }
               for (stBtns = 0; stBtns < stView.toolBar.rightMembers.length; stBtns++) {
                 stBtn = stView.toolBar.rightMembers[stBtns];
-                if (stBtn.contextView === button.contextView && stBtn.property && notAccessibleProcesses.processes.contains(stBtn.property)) {
+                if (stBtn.contextView === button.contextView && stBtn.property && stBtn.property === button.property && notAccessibleProcesses.processes.contains(stBtn.property)) {
                   stBtn.readOnlyIf = alwaysReadOnly;
                   break;
                 }