changeset 1017:d8e74bd89d6b

Fixed Activation of StatusReset Button
author Dustin Demuth <dustin@intevation.de>
date Thu, 04 Feb 2016 12:08:21 +0100
parents d6e259e76de6
children 418e25969a16
files app/view/form/Messung.js app/view/grid/Status.js app/view/window/MessungEdit.js
diffstat 3 files changed, 11 insertions(+), 7 deletions(-) [+]
line wrap: on
line diff
--- a/app/view/form/Messung.js	Tue Feb 02 15:26:43 2016 +0100
+++ b/app/view/form/Messung.js	Thu Feb 04 12:08:21 2016 +0100
@@ -182,7 +182,7 @@
                 messungsId: messungsId
             },
             callback: function(records, operation, success) {
-                var sw, ss;
+                var sw, ss, se;
                 var i18n = Lada.getApplication().bundle;
                 if (sStore.getTotalCount() === 0 || !statusId) {
                     sw = 0;
@@ -190,14 +190,17 @@
                 else {
                     sw = sStore.getById(statusId).get('statusWert');
                     ss = sStore.getById(statusId).get('statusStufe');
+                    se = sStore.getById(statusId).get('erzeuger');
                 }
                 this.setStatusWert(sw);
                 this.setStatusStufe(ss);
 
-                // Enable / Disable the statusreset button of the statusgrid of the messungform
+                // Enable / Disable the statusreset button of the statusgrid of the messungwindow
                 if (messwin.record.get('statusEdit') === true &&
                         sw != 0 &&
-                        sw != 4) {
+                        sw != 4 &&
+                        Ext.Array.contains(Lada.mst, se)) {
+
                     messwin.enableStatusReset();
                 }
                 else {
--- a/app/view/grid/Status.js	Tue Feb 02 15:26:43 2016 +0100
+++ b/app/view/grid/Status.js	Thu Feb 04 12:08:21 2016 +0100
@@ -177,6 +177,7 @@
                 }]
             });
         }
+
         this.store.load({
             params: {
                 messungsId: this.recordId,
--- a/app/view/window/MessungEdit.js	Tue Feb 02 15:26:43 2016 +0100
+++ b/app/view/window/MessungEdit.js	Thu Feb 04 12:08:21 2016 +0100
@@ -210,8 +210,8 @@
             this.down('fset[name=messwerte]').down('messwertgrid').readOnly = true;
             this.down('fset[name=messungskommentare]').down('mkommentargrid').setReadOnly(true);
             this.down('fset[name=messungskommentare]').down('mkommentargrid').readOnly = true;
-            this.disableStatusEdit();
-            this.disableStatusReset();
+            //this.disableStatusEdit();
+            //this.disableStatusReset();
     },
 
     /**
@@ -222,8 +222,8 @@
             this.down('fset[name=messwerte]').down('messwertgrid').readOnly = false;
             this.down('fset[name=messungskommentare]').down('mkommentargrid').setReadOnly(false);
             this.down('fset[name=messungskommentare]').down('mkommentargrid').readOnly = false;
-            this.enableStatusEdit();
-            this.enableStatusReset();
+            //this.enableStatusEdit();
+            //this.enableStatusReset();
     },
 
     /**

http://lada.wald.intevation.org