changeset 776:da14e0f3e599

merged
author Dustin Demuth <dustin@intevation.de>
date Tue, 12 May 2015 16:26:05 +0200
parents 311c39a64064 (diff) dd6925ef6028 (current diff)
children 5a153d36ed4e
files
diffstat 4 files changed, 33 insertions(+), 4 deletions(-) [+]
line wrap: on
line diff
--- a/app/controller/form/Messprogramm.js	Tue May 12 15:12:02 2015 +0200
+++ b/app/controller/form/Messprogramm.js	Tue May 12 16:26:05 2015 +0200
@@ -26,7 +26,10 @@
             'messprogrammform': {
                 dirtychange: this.dirtyForm
             },
-            'messprogrammform [xtype="numberfield"]': {
+            'messprogrammform gueltigPeriod datetime': {
+                blur: this.checkPeriod
+            },
+            'messprogrammform probenintervall numberfield': {
                 change: this.synchronizeSlider,
                 blur: this.checkPeriod
             },
@@ -181,7 +184,7 @@
      * The function validates if the start is smaller than end.
      */
     checkPeriod: function(field) {
-
+        alert();
         // This field might be a field within a Period.
         // Search for Partner field (period: end/start) and validate
         // End Before Start validation
--- a/app/model/Messprogramm.js	Tue May 12 15:12:02 2015 +0200
+++ b/app/model/Messprogramm.js	Tue May 12 16:26:05 2015 +0200
@@ -59,9 +59,23 @@
     }, {
         name: 'intervallOffset'
     }, {
-        name: 'gueltigVon'
+        name: 'gueltigVon',
+        type: 'date',
+        convert: function(v) {
+            if (!v) {
+                return v;
+            }
+            return new Date(v);
+        },
     }, {
-        name: 'gueltigBis'
+        name: 'gueltigBis',
+        type: 'date',
+        convert: function(v) {
+            if (!v) {
+                return v;
+            }
+            return new Date(v);
+        },
     }, {
         name: 'probeNehmerId'
     }, {
--- a/app/view/form/Messprogramm.js	Tue May 12 15:12:02 2015 +0200
+++ b/app/view/form/Messprogramm.js	Tue May 12 16:26:05 2015 +0200
@@ -256,6 +256,12 @@
                             name: 'gueltigBis',
                             format: 'd.m.Y H:i',
                             period: 'end'
+                        }, {
+                            xtype: 'numberfield',
+                            fieldLabel: i18n.getMsg('offset'),
+                            labelWidth: 90,
+                            anchor: '100%',
+                            name: 'intervallOffset',
                         }]
                     }, {
                         xtype: 'fset',
@@ -310,6 +316,7 @@
         // for instance H, M, J, ...
         // Initialize the probenintervallslider
         var s = this.down('probenintervallslider');
+        var i = this.getForm().findField('intervallOffset');
         var v = this.getForm().findField('teilintervallVon');
         var b = this.getForm().findField('teilintervallBis');
         var intervallstore = Ext.data.StoreManager.get('Probenintervall');
@@ -367,6 +374,10 @@
         v.setValue(svalLower);
         b.setValue(svalUpper);
 
+        //Set IntervallOffset
+        i.setMinValue(0);
+        i.setMaxValue(max-1);
+
         console.log('Populate End');
     },
 
--- a/resources/i18n/Lada_de-DE.properties	Tue May 12 15:12:02 2015 +0200
+++ b/resources/i18n/Lada_de-DE.properties	Tue May 12 16:26:05 2015 +0200
@@ -61,6 +61,7 @@
 nuklid:Nuklid
 from:Von
 to:Bis
+offset:Offset
 
 emptytext.probenintervall:Wählen Sie ein Probenintervall
 emptytext.datenbasis:Wahlen Sie eine Datenbasis

http://lada.wald.intevation.org