diff app/controller/form/Messprogramm.js @ 1198:3b6f40541ac6

Remove wrong period check. The validity period can be e.g. from November till February, thus spanning over turn of the year and allowing a from value greater than to value (in terms of day of year).
author Tom Gottfried <tom@intevation.de>
date Fri, 23 Sep 2016 16:32:30 +0200
parents 112fd60f1fb4
children a24de34d6423
line wrap: on
line diff
--- a/app/controller/form/Messprogramm.js	Tue Sep 20 18:16:41 2016 +0200
+++ b/app/controller/form/Messprogramm.js	Fri Sep 23 16:32:30 2016 +0200
@@ -39,9 +39,6 @@
             'messprogrammform location combobox': {
                 select: this.syncOrtWindow
             },
-            'messprogrammform datetime textfield': {
-                change: this.checkDatePeriod
-            },
             'messprogrammform numfield numberfield': {
                 change: this.checkPeriod
             },
@@ -100,6 +97,7 @@
         var record = form.getRecord();
         form.populateIntervall(record, field.getValue());
     },
+
     /**
      * The function will open a new Window to edit the Ort of a Messprogramm
      */
@@ -292,34 +290,6 @@
         }
     },
 
-    /**
-     * checkDatePeriod() is called when a fields defining an intervall
-     * were modified
-     * The function validates if the start is smaller than end.
-     * Same as checkPeriod but requires DATETIME fields
-     */
-    checkDatePeriod: function(field) {
-        // This field might be a field within a Period.
-        // Search for Partner field (period: end/start) and validate
-        // End Before Start validation
-        if (field.period) {
-            var partners = new Array();
-                partners[0] = field.up('fieldset')
-                    .down('datetime[period=start]')
-                    .down('textfield')
-                    .getValue()
-                partners[1] = field.up('fieldset')
-                    .down('datetime[period=end]')
-                    .down('textfield')
-                    .getValue()
-            if (partners[0] && partners[1] && partners[0] > partners [1]) {
-                var msg = Lada.getApplication().bundle.getMsg('662');
-                field.up('fieldset').showWarningOrError(false, '', true, msg);
-            } else {
-                field.up('fieldset').clearMessages();
-            }
-        }
-    },
 
     deskriptorSelect: function(field, records) {
         var desk = field.up('deskriptor');

http://lada.wald.intevation.org