details:   https://code.openbravo.com/erp/devel/pi/rev/30ffca2dd8ad
changeset: 25002:30ffca2dd8ad
user:      Augusto Mauch <augusto.mauch <at> openbravo.com>
date:      Tue Sep 30 11:20:31 2014 +0200
summary:   Fixes bug 27709: Inactive Window/Tab/Field Access records are not 
considered

The problem was that even if a WIndow/Tab/Field access record was inactive, it 
was being taken into account by the WindowSettionsActionHandler class. Now this 
no longer happen.

This fix comes with a behavioural change in the way the Is Active field of 
these tabs is handled. Before this fix the flag was ignored, now is taken into 
account.

details:   https://code.openbravo.com/erp/devel/pi/rev/8792ae5475eb
changeset: 25003:8792ae5475eb
user:      Augusto Mauch <augusto.mauch <at> openbravo.com>
date:      Tue Sep 30 17:15:15 2014 +0200
summary:   Fixes issue 27710: Fixes problem defining Field Access for process 
buttons

The problem was that if several process buttons were defined as not editable in 
the Field Access tab, then in the subtabs of the tab that own the issue only 
one of them was being set as read only. This happened because when the button 
being set as read only was looked for in the subtabs, the property of the 
button in the main tab was not being compared with the property of the button 
in the subtab, so the first one disabled was picked.

diffstat:

 
modules/org.openbravo.client.application/src/org/openbravo/client/application/WindowSettingsActionHandler.java
 |  49 +++++----
 
modules/org.openbravo.client.application/web/org.openbravo.client.application/js/main/ob-standard-window.js
    |   2 +-
 2 files changed, 28 insertions(+), 23 deletions(-)

diffs (73 lines):

diff -r 04065681d156 -r 8792ae5475eb 
modules/org.openbravo.client.application/src/org/openbravo/client/application/WindowSettingsActionHandler.java
--- 
a/modules/org.openbravo.client.application/src/org/openbravo/client/application/WindowSettingsActionHandler.java
    Mon Oct 06 09:44:38 2014 +0200
+++ 
b/modules/org.openbravo.client.application/src/org/openbravo/client/application/WindowSettingsActionHandler.java
    Tue Sep 30 17:15:15 2014 +0200
@@ -100,30 +100,35 @@
       final JSONArray tabs = new JSONArray();
       json.put("tabs", tabs);
       for (WindowAccess winAccess : window.getADWindowAccessList()) {
-        if (winAccess.getRole().getId().equals(roleId)) {
+        if (winAccess.isActive() && 
winAccess.getRole().getId().equals(roleId)) {
           for (TabAccess tabAccess : winAccess.getADTabAccessList()) {
-            boolean tabEditable = tabAccess.isEditableField();
-            final Entity entity = 
ModelProvider.getInstance().getEntityByTableId(
-                tabAccess.getTab().getTable().getId());
-            final JSONObject jTab = new JSONObject();
-            tabs.put(jTab);
-            jTab.put("tabId", tabAccess.getTab().getId());
-            jTab.put("updatable", tabEditable);
-            final JSONObject jFields = new JSONObject();
-            jTab.put("fields", jFields);
-            final Set<String> fields = new TreeSet<String>();
-            for (Field field : tabAccess.getTab().getADFieldList()) {
-              if (!field.isReadOnly() && !field.isShownInStatusBar()) {
-                fields.add(KernelUtils.getProperty(entity, field).getName());
+            if (tabAccess.isActive()) {
+              boolean tabEditable = tabAccess.isEditableField();
+              final Entity entity = 
ModelProvider.getInstance().getEntityByTableId(
+                  tabAccess.getTab().getTable().getId());
+              final JSONObject jTab = new JSONObject();
+              tabs.put(jTab);
+              jTab.put("tabId", tabAccess.getTab().getId());
+              jTab.put("updatable", tabEditable);
+              final JSONObject jFields = new JSONObject();
+              jTab.put("fields", jFields);
+              final Set<String> fields = new TreeSet<String>();
+              for (Field field : tabAccess.getTab().getADFieldList()) {
+                if (!field.isReadOnly() && !field.isShownInStatusBar()) {
+                  fields.add(KernelUtils.getProperty(entity, field).getName());
+                }
               }
-            }
-            for (FieldAccess fieldAccess : tabAccess.getADFieldAccessList()) {
-              final String name = KernelUtils.getProperty(entity, 
fieldAccess.getField()).getName();
-              jFields.put(name, fieldAccess.isEditableField());
-              fields.remove(name);
-            }
-            for (String name : fields) {
-              jFields.put(name, tabEditable);
+              for (FieldAccess fieldAccess : tabAccess.getADFieldAccessList()) 
{
+                if (fieldAccess.isActive()) {
+                  final String name = KernelUtils.getProperty(entity, 
fieldAccess.getField())
+                      .getName();
+                  jFields.put(name, fieldAccess.isEditableField());
+                  fields.remove(name);
+                }
+              }
+              for (String name : fields) {
+                jFields.put(name, tabEditable);
+              }
             }
           }
         }
diff -r 04065681d156 -r 8792ae5475eb 
modules/org.openbravo.client.application/web/org.openbravo.client.application/js/main/ob-standard-window.js
--- 
a/modules/org.openbravo.client.application/web/org.openbravo.client.application/js/main/ob-standard-window.js
       Mon Oct 06 09:44:38 2014 +0200
+++ 
b/modules/org.openbravo.client.application/web/org.openbravo.client.application/js/main/ob-standard-window.js
       Tue Sep 30 17:15:15 2014 +0200
@@ -498,7 +498,7 @@
                 }
                 for (stBtns = 0; stBtns < stView.toolBar.rightMembers.length; 
stBtns++) {
                   stBtn = stView.toolBar.rightMembers[stBtns];
-                  if (stBtn.contextView === button.contextView && 
stBtn.property && !tab.fields[stBtn.property]) {
+                  if (stBtn.contextView === button.contextView && 
button.property === stBtn.property && !tab.fields[stBtn.property]) {
                     stBtn.readOnlyIf = alwaysReadOnly;
                     break;
                   }

------------------------------------------------------------------------------
Slashdot TV.  Videos for Nerds.  Stuff that Matters.
http://pubads.g.doubleclick.net/gampad/clk?id=160591471&iu=/4140/ostg.clktrk
_______________________________________________
Openbravo-commits mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/openbravo-commits

Reply via email to