changeset 962:9b6800458a9e

Altered permissions to open a Messung from the Messung-grid. Opening a Messung is only possible, when: a) StatusEdit=True or b) StatusWert > 0
author Dustin Demuth <dustin@intevation.de>
date Thu, 12 Nov 2015 09:50:48 +0100
parents 6f1cc3316e2d
children 6a6f2c6fe8ee
files app/controller/grid/Messung.js
diffstat 1 files changed, 18 insertions(+), 8 deletions(-) [+]
line wrap: on
line diff
--- 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();
+        }
     },
 
     /**

http://lada.wald.intevation.org