[Lada-commits] [PATCH 1 of 2] Altered permissions to open a Messung from the Messung-grid. Opening a Messung is only possible, when: a) StatusEdit=True or b) StatusWert > 0

Wald Commits scm-commit at wald.intevation.org
Thu Nov 12 12:14:00 CET 2015


# HG changeset patch
# User Dustin Demuth <dustin at intevation.de>
# Date 1447318248 -3600
# Node ID 9b6800458a9ed359aca72007d67bf2679d3e503b
# Parent  6f1cc3316e2df422dd7712123393e29ac19b1c97
Altered permissions to open a Messung from the Messung-grid. Opening a Messung is only possible, when: a) StatusEdit=True or b) StatusWert > 0

diff -r 6f1cc3316e2d -r 9b6800458a9e app/controller/grid/Messung.js
--- a/app/controller/grid/Messung.js	Tue Nov 10 13:07:57 2015 +0100
+++ b/app/controller/grid/Messung.js	Thu Nov 12 09:50:48 2015 +0100
@@ -40,14 +40,24 @@
      */
     editItem: function(grid, record) {
         var probe = grid.up('window').record;
-        var win = Ext.create('Lada.view.window.MessungEdit', {
-            parentWindow: grid.up('window'),
-            probe: probe,
-            record: record,
-            grid: grid
-        });
-        win.show();
-        win.initData();
+        /* Only open a new Window when:
+           statusEdit = True
+           -or-
+            the value of status is not 0
+            the statusWert attribute is not present in the original data.
+            it is appended, when the value and name of the status were
+            determined.
+        */
+        if (record.get('statusEdit') || record.get('statusWert') > 0) {
+            var win = Ext.create('Lada.view.window.MessungEdit', {
+                parentWindow: grid.up('window'),
+                probe: probe,
+                record: record,
+                grid: grid
+            });
+            win.show();
+            win.initData();
+        }
     },
 
     /**


More information about the Lada-commits mailing list