[Lada-commits] [PATCH 1 of 2] Remove wrong period check

Wald Commits scm-commit at wald.intevation.org
Fri Sep 23 16:51:29 CEST 2016


# HG changeset patch
# User Tom Gottfried <tom at intevation.de>
# Date 1474641150 -7200
# Node ID 3b6f40541ac6fde7d04c66ed4603f8057d9f3368
# Parent  112fd60f1fb427134030eafaf7c1b25b9bd044dc
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).

diff -r 112fd60f1fb4 -r 3b6f40541ac6 app/controller/form/Messprogramm.js
--- 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');


More information about the Lada-commits mailing list