changeset 997:c943340176d4

Disable the statusresetbutton
author Dustin Demuth <dustin@intevation.de>
date Fri, 08 Jan 2016 14:43:41 +0100
parents bf7bb9583a40
children 4bbb3da88c14
files app/view/form/Messung.js app/view/window/MessungEdit.js
diffstat 2 files changed, 13 insertions(+), 8 deletions(-) [+]
line wrap: on
line diff
--- a/app/view/form/Messung.js	Fri Jan 08 14:34:27 2016 +0100
+++ b/app/view/form/Messung.js	Fri Jan 08 14:43:41 2016 +0100
@@ -170,6 +170,7 @@
         var i18n = Lada.getApplication().bundle;
         var msg = i18n.getMsg('load.statuswert');
         var textfield = this.down('[name=status]');
+        var messwin = this.up('window');
 
         if(textfield) {
             textfield.setRawValue(msg);
@@ -192,6 +193,17 @@
                 }
                 this.setStatusWert(sw);
                 this.setStatusStufe(ss);
+
+                // Enable / Disable the statusreset button of the statusgrid of the messungform
+                if (messwin.record.get('statusEdit') === true &&
+                        sw != 0 &&
+                        sw != 4) {
+                    messwin.enableStatusReset();
+                }
+                else {
+                    messwin.disableStatusReset();
+                }
+
             },
             scope: this
         });
--- a/app/view/window/MessungEdit.js	Fri Jan 08 14:34:27 2016 +0100
+++ b/app/view/window/MessungEdit.js	Fri Jan 08 14:43:41 2016 +0100
@@ -178,14 +178,7 @@
                 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();
-                }
+                //Check if it is allowed to reset Status: done in Messungform
             },
             scope: this
         });

http://lada.wald.intevation.org