diff app/view/window/MessungEdit.js @ 996:bf7bb9583a40

Statusworkflow: More work on the reset Button
author Dustin Demuth <dustin@intevation.de>
date Fri, 08 Jan 2016 14:34:27 +0100
parents a2c2039bb5d9
children c943340176d4
line wrap: on
line diff
--- a/app/view/window/MessungEdit.js	Thu Jan 07 16:20:48 2016 +0100
+++ b/app/view/window/MessungEdit.js	Fri Jan 08 14:34:27 2016 +0100
@@ -178,6 +178,14 @@
                 else {
                     this.disableStatusEdit();
                 }
+                //Check if it is allowed to reset Status
+                // TODO additional requirements?
+                if (this.record.get('statusEdit') === true) {
+                    this.enableStatusReset();
+                }
+                else {
+                    this.disableStatusReset();
+                }
             },
             scope: this
         });
@@ -210,6 +218,7 @@
             this.down('fset[name=messungskommentare]').down('mkommentargrid').setReadOnly(true);
             this.down('fset[name=messungskommentare]').down('mkommentargrid').readOnly = true;
             this.disableStatusEdit();
+            this.disableStatusReset();
     },
 
     /**
@@ -221,12 +230,26 @@
             this.down('fset[name=messungskommentare]').down('mkommentargrid').setReadOnly(false);
             this.down('fset[name=messungskommentare]').down('mkommentargrid').readOnly = false;
             this.enableStatusEdit();
+            this.enableStatusReset();
     },
 
     /**
+     * Enable to reset the statusgrid
+     */
+     enableStatusReset: function() {
+            this.down('fset[name=messungstatus]').down('statusgrid').setResetable(true);
+     },
+
+    /**
+     * Disable to reset the statusgrid
+     */
+     disableStatusReset: function() {
+            this.down('fset[name=messungstatus]').down('statusgrid').setResetable(false);
+     },
+    /**
      * Enable to edit the statusgrid
      */
-     enableStatusEdit: function () {
+     enableStatusEdit: function() {
             this.down('fset[name=messungstatus]').down('statusgrid').setReadOnly(false);
             this.down('fset[name=messungstatus]').down('statusgrid').readOnly = false;
      },
@@ -234,7 +257,7 @@
     /**
      * Disable to edit the statusgrid
      */
-     disableStatusEdit: function () {
+     disableStatusEdit: function() {
             this.down('fset[name=messungstatus]').down('statusgrid').setReadOnly(true);
             this.down('fset[name=messungstatus]').down('statusgrid').readOnly = true;
      },

http://lada.wald.intevation.org