[Lada-commits] [PATCH 1 of 2] Messprogramm form redesign

Wald Commits scm-commit at wald.intevation.org
Fri Apr 29 11:01:24 CEST 2016


# HG changeset patch
# User Michael Stanko <mstanko at bfs.de>
# Date 1461918005 -7200
# Node ID 61cc583c3649ab09abe2f7c8a0ac4b0647a93fea
# Parent  cbe5a19449a413ca5ea41738d096b7a275293751
Messprogramm form redesign

diff -r cbe5a19449a4 -r 61cc583c3649 app/controller/form/Messprogramm.js
--- a/app/controller/form/Messprogramm.js	Wed Apr 13 20:11:06 2016 +0200
+++ b/app/controller/form/Messprogramm.js	Fri Apr 29 10:20:05 2016 +0200
@@ -7,7 +7,7 @@
  */
 
 /**
- * A Controller for a Probe form
+ * A Controller for a Messprogramm form
  */
 Ext.define('Lada.controller.form.Messprogramm', {
     extend: 'Ext.app.Controller',
@@ -323,6 +323,7 @@
         var desk = field.up('deskriptor');
         var media = field.up('messprogrammform').down('textfield[name="mediaDesk"]');
         var current = media.getValue().split(' ');
+
         if (current.length < 13) {
             for (var i = 0; i <= 12; i++) {
                 if (i === 0) {
@@ -352,15 +353,26 @@
                 value = records[0].get('sn');
             }
             current[desk.layer + 1] = value;
+            if (desk.layer < 2) {
+                for (var i = desk.layer + 2; i < 13; i++) {
+                    current[i] = '00';
+                }
+                this.clearChildDesk(desk);
+            }
+            else if (desk.layer === 2 && current[1] === '01') {
+                current[4] = '00';
+                desk.up('fieldset').down('deskriptor[layer=3]').clearValue();
+            }
         }
         media.setValue(current.join(' ').trim());
     },
 
-    clearChildDesk: function(field, media) {
+    clearChildDesk: function(field) {
         var allS = field.up('fieldset').items.items;
         for (var i = field.layer + 1; i < 12; i++) {
             allS[i].clearValue();
-            media[i + 1] = '00';
         }
     }
+
+    
 });
diff -r cbe5a19449a4 -r 61cc583c3649 app/model/Messprogramm.js
--- a/app/model/Messprogramm.js	Wed Apr 13 20:11:06 2016 +0200
+++ b/app/model/Messprogramm.js	Fri Apr 29 10:20:05 2016 +0200
@@ -128,6 +128,9 @@
             }
             return new Date(v);
         }
+    }, {
+        name: 'media',
+        persist: false
     }],
 
     idProperty: 'id',
diff -r cbe5a19449a4 -r 61cc583c3649 app/view/form/Messprogramm.js
--- a/app/view/form/Messprogramm.js	Wed Apr 13 20:11:06 2016 +0200
+++ b/app/view/form/Messprogramm.js	Fri Apr 29 10:20:05 2016 +0200
@@ -14,10 +14,10 @@
     alias: 'widget.messprogrammform',
     requires: [
         'Lada.view.widget.Datenbasis',
+        'Lada.view.widget.base.CheckBox',
         'Lada.view.widget.Messstelle',
         'Lada.view.widget.Netzbetreiber',
         'Lada.view.widget.Betriebsart',
-        'Lada.view.widget.Testdatensatz',
         'Lada.view.widget.Probenart',
         'Lada.view.widget.Umwelt',
         'Lada.view.widget.base.TextField',
@@ -74,11 +74,7 @@
                     }]
                 }],
                 items: [{
-                    layout: 'hbox',
-                    border: 0,
-                    items: [{
                         border: 0,
-                        width: '50%',
                         minWidth: 290,
                         layout: {
                             type: 'vbox',
@@ -86,97 +82,92 @@
                         },
                         margin: '0, 10, 0, 0',
                         items: [{
-                            xtype: 'messstellelabor',
-                            name: 'mstlabor',
-                            fieldLabel: 'Messstelle/Labor',
-                            margin: '0, 5, 5, 5',
-                            width: '35%',
-                            labelWidth: 95,
-                            allowBlank: false,
-                            editable: true,
-                            listeners: {
-                                select: {
-                                    fn: function(combo, newValue) {
-                                        var mst = newValue[0].get('messStelle');
-                                        var labor = newValue[0].get('laborMst');
-                                        combo.up('fieldset').down('messstelle[name=mstId]').setValue(mst);
-                                        combo.up('fieldset').down('messstelle[name=laborMstId]').setValue(labor);
+                            layout: {
+                                type: 'hbox',
+                                align: 'stretch'
+                            },
+                            border: 0,
+                            items: [{
+                                xtype: 'messstellelabor',
+                                name: 'mstlabor',
+                                fieldLabel: 'Messstelle/Labor',
+                                margin: '0, 5, 5, 5',
+                                width: '35%',
+                                labelWidth: 95,
+                                allowBlank: false,
+                                editable: true,
+                                listeners: {
+                                    select: {
+                                        fn: function(combo, newValue) {
+                                            var mst = newValue[0].get('messStelle');
+                                            var labor = newValue[0].get('laborMst');
+                                            combo.up('fieldset').down('messstelle[name=mstId]').setValue(mst);
+                                            combo.up('fieldset').down('messstelle[name=laborMstId]').setValue(labor);
+                                        }
                                     }
                                 }
-                            }
-                        }, {
-                            xtype: 'messstelle',
-                            name: 'mstId',
-                            fieldLabel: 'Messstelle/Labor',
-                            margin: '0, 5, 5, 5',
-                            width: '35%',
-                            labelWidth: 95,
-                            allowBlank: false,
-                            editable: true,
-                            hidden: true
-                        }, {
-                            xtype: 'messstelle',
-                            name: 'laborMstId',
-                            fieldLabel: 'Messstelle/Labor',
-                            margin: '0, 5, 5, 5',
-                            width: '35%',
-                            labelWidth: 95,
-                            allowBlank: false,
-                            editable: true,
-                            hidden: true
-                        }, {
-                            xtype: 'tfield',
-                            name: 'name',
-                            fieldLabel: i18n.getMsg('name'),
-                            labelWidth: 135,
-                            allowBlank: false,
-                            editable: true
-                        }, {
-                            xtype: 'textarea',
-                            name: 'probeKommentar',
-                            labelAlign: 'top',
-                            fieldLabel: i18n.getMsg('probeKommentar'),
-                            labelwidth: 135,
-                            anchor: '100%'
-                        }, {
-                            layout: 'column',
-                            border: 0,
-                            items: [{
-                                xtype: 'location',
-                                name: 'ortId',
-                                fieldLabel: i18n.getMsg('ortId'),
+                            }, {
+                                xtype: 'messstelle',
+                                name: 'mstId',
+                                fieldLabel: 'Messstelle/Labor',
+                                margin: '0, 5, 5, 5',
+                                width: '35%',
+                                labelWidth: 95,
+                                allowBlank: false,
+                                editable: true,
+                                hidden: true
+                            }, {
+                                xtype: 'messstelle',
+                                name: 'laborMstId',
+                                fieldLabel: 'Messstelle/Labor',
+                                margin: '0, 5, 5, 5',
+                                width: '35%',
+                                labelWidth: 95,
+                                allowBlank: false,
+                                editable: true,
+                                hidden: true
+                            }, {
+                                xtype: 'netzbetreiber',
+                                name: 'netzbetreiberId',
+                                editable: false,
+                                readOnly: true,
+                                fieldLabel: i18n.getMsg('netzbetreiberId'),
+                                margin : '0, 5, 5, 5',
+                                width : '35%',
                                 labelWidth: 80,
-                                allowBlank: true,
-                                forceSelection: true,
-                                editable: false,
-                                columnWidth: '0.75'
                             }, {
-                                xtype: 'button',
-                                name: 'ortIdButton',
-                                margin: '0 0 0 5',
-                                text: i18n.getMsg('messprogrammort.button.title'),
-                                action: 'ort',
-                                columnWidth: '0.25'
-                            }]
-                        }]
-                    }, {
-                        border: 0,
-                        width: '50%',
-                        minWidth: 300,
-                        margin: '0, 1, 0, 0',
-                        items: [{
-                            xtype: 'fset',
-                            title: i18n.getMsg('erwAngaben'),
-                            name: 'erwAngaben',
-                            collapsible: false,
-                            collapsed: false,
-                            items: [{
                                 xtype: 'datenbasis',
                                 editable: false,
                                 name: 'datenbasisId',
                                 fieldLabel: i18n.getMsg('datenbasisId'),
+                                margin : '0, 5, 5, 5',
+                                width : '20%',
+                                labelWidth: 65
+                            }, {
+                                xtype: 'chkbox',
+                                name: 'test',
+                                fieldLabel: i18n.getMsg('test'),
                                 anchor: '100%',
-                                labelWidth: 105
+                                margin : '0, 5, 5, 5',
+                                width : '10%',
+                                labelWidth: 30,
+                                allowBlank: false
+                            }]
+                        }, {
+                            layout: {
+                                type: 'hbox',
+                                align: 'stretch'
+                            },
+                            border: 0,
+                            items: [{
+                                xtype: 'tfield',
+                                name: 'name',
+                                fieldLabel: i18n.getMsg('mprId'),
+                                margin: '0, 5, 5, 5',
+                                width: '35%',
+                                labelWidth: 95,
+                                maxLength: 20,
+                                editable: true
                             }, {
                                 xtype: 'betriebsart',
                                 name: 'baId',
@@ -184,43 +175,112 @@
                                 anchor: '100%',
                                 labelWidth: 105
                             }, {
-                                xtype: 'testdatensatz',
-                                name: 'test',
-                                fieldLabel: i18n.getMsg('test'),
-                                anchor: '100%',
-                                labelWidth: 105,
-                                allowBlank: false
-                            }, {
                                 xtype: 'probenart',
                                 editable: false,
                                 name: 'probenartId',
                                 fieldLabel: i18n.getMsg('probenartId'),
-                                anchor: '100%',
-                                labelWidth: 105,
+                                margin: '0, 15, 5, 5',
+                                width: '20%',
+                                labelWidth: 65,
                                 allowBlank: false
-                            }, {
-                                xtype: 'numberfield',
-                                allowDecimals: false,
-                                name: 'probeNehmerId',
-                                fieldLabel: i18n.getMsg('probeNehmerId'),
-                                anchor: '100%',
-                                labelWidth: 105
-                            }, {
-                                xtype: 'netzbetreiber',
-                                name: 'netzbetreiberId',
-                                editable: false,
-                                readOnly: true,
-                                fieldLabel: i18n.getMsg('netzbetreiberId'),
-                                anchor: '100%',
-                                labelWidth: 105,
-                                allowBlank: false
-                           }]
+                            }]
+                        }]
+                }, {
+                    // Zeit
+                    xtype: 'fieldset',
+                    title: i18n.getMsg('probenintervall'),
+                    layout: {
+                        type: 'vbox',
+                        align: 'stretch'
+                    },
+                    items: [{
+                        xtype: 'fset',
+                        name: 'probenIntervallFieldset',
+                        layout: {
+                            type: 'hbox',
+                            align: 'stretch'
+                        },
+                        border: 0,
+                        margin: '0, 0, 0, 0',
+                        items: [{
+                            xtype: 'probenintervall',
+                            fieldLabel: i18n.getMsg('probenintervall'),
+                            margin: '0, 10, 5, 5',
+                            labelWidth: 50,
+//                            anchor: '100%',
+                            width: '40%',
+                            name: 'probenintervall'
+                        }, {
+                            xtype: 'numberfield',
+                            fieldLabel: i18n.getMsg('teilintervallVon'),
+                            margin: '0, 10, 5, 10',
+                            labelWidth: 90,
+ //                           anchor: '100%',
+                            width: '28%',
+                            name: 'teilintervallVon',
+                            period: 'start'
+                        }, {
+                            xtype: 'numberfield',
+                            fieldLabel: i18n.getMsg('teilintervallBis'),
+                            margin: '0, 15, 5, 5',
+                            labelWidth: 18,
+//                            anchor: '100%',
+                            width: '12%',
+                            name: 'teilintervallBis',
+                            period: 'end'
+                        }, {
+                            xtype: 'numberfield',
+                            margin: '0, 10, 5, 5',
+                            fieldLabel: i18n.getMsg('offset'),
+                            labelWidth: 45,
+//                            anchor: '100%',
+                            width: '18%',
+                            name: 'intervallOffset'
+                        }]
+                    }, {
+                        xtype: 'probenintervallslider',
+//                        fieldLabel: i18n.getMsg('intervall'),
+//                        labelWidth: 70,
+                        pack: 'center',
+                        width: '70%',
+                        margin: '0, 40, 10, 40',
+//                        anchor: '950%',
+                        values: [0, 0]
+                        //this will be overridden
+                        // by setRecord
+                    }, {
+                        xtype: 'fset',
+                        name: 'gueltigPeriodFieldset',
+                        layout: {
+                            type: 'hbox',
+                            align: 'stretch'
+                        },
+                        border: 0,
+                        items: [{
+                            xtype: 'datetime',
+                            fieldLabel: i18n.getMsg('gueltigVon'),
+                            margin: '0, 30, 5, 5',
+                            labelWidth: 90,
+//                            anchor: '100%',
+                            name: 'gueltigVon',
+                            format: 'd.m.Y',
+                            period: 'start'
+                        }, {
+                            xtype: 'datetime',
+                            fieldLabel: i18n.getMsg('gueltigBis'),
+                            margin: '0, 5, 5, 5',
+                            labelWidth: 40,
+//                            anchor: '100%',
+                            name: 'gueltigBis',
+                            format: 'd.m.Y',
+                            period: 'end'
                         }]
                     }]
                 }, {
                     // Medium
                     xtype: 'fieldset',
                     title: i18n.getMsg('medium'),
+                    width: '100%',
                     items: [{
                         border: 0,
                         layout: {
@@ -229,21 +289,6 @@
                         },
                         width: '100%',
                         items: [{
-                           xtype: 'textfield',
-                            maxLength: 38,
-                            enforceMaxLength: true,
-                            name: 'mediaDesk',
-                            labelWidth: 125,
-                            fieldLabel: i18n.getMsg('mediaDesk'),
-                            regex: new RegExp('(?:D: ){1}(?:[0-9]{2} ){11}[0-9]{2}'),
-                            regexText: i18n.getMsg('err.msg.deskriptorvalidation'),
-                            listeners: {
-                                dirtychange: {
-                                    fn: this.updateOnChange,
-                                    scope: me
-                                }
-                            }
-                        }, {
                             xtype: 'umwelt',
                             name: 'umwId',
                             fieldLabel: i18n.getMsg('umwId'),
@@ -257,14 +302,46 @@
                                 }
                             }
                         }, {
+                            border: 0,
+                            layout: {
+                                type: 'hbox',
+                                align: 'stretch'
+                            },
+                            width: '100%',
+                            items: [{
+                                xtype: 'textfield',
+                                maxLength: 38,
+                                enforceMaxLength: true,
+                                name: 'mediaDesk',
+                                width: '60%',
+                                labelWidth: 125,
+                                fieldLabel: i18n.getMsg('mediaDesk'),
+                                editable: false,
+                                readOnly: true,
+                                listeners: {
+                                    dirtychange: {
+                                        fn: this.updateOnChange,
+                                        scope: me
+                                    }
+                                }
+                            }, {
+                                xtype: 'textfield',
+                                name: 'media',
+                                margin: '0, 10, 5, 10',
+                                width: '40%',
+                                enforceMaxLength: true,
+                                editable: false,
+                                readOnly: true
+                            }]
+                        }, {
                             xtype: 'fieldset',
                             title: i18n.getMsg('deskDetails'),
                             collapsible: true,
                             collapsed: true,
                             defaultType: 'textfield',
                             layout: {
-                                type: 'table',
-                                columns: 3
+                                type: 'vbox',
+                                align: 'stretch'
                             },
                             items: this.buildDescriptors(),
                             listeners: {
@@ -276,89 +353,48 @@
                         }]
                     }]
                 }, {
-                    // Zeit
+                    // Ort
                     xtype: 'fieldset',
-                    title: i18n.getMsg('time'),
+                    title: 'Ort',
                     layout: {
                         type: 'hbox',
-                        pack: 'center',
+//                        pack: 'center',
                         align: 'stretch'
                     },
+                    width: '100%',
                     items: [{
-                        xtype: 'fset',
-                        title: i18n.getMsg('validity'),
-                        name: 'gueltigPeriodFieldset',
-                        anchor: '100%',
-                        width: '50%',
-                        margin: '0, 5, 5, 5',
-                        layout: {
-                            type: 'vbox',
-                            align: 'stretch'
-                        },
-                        items: [{
-                            xtype: 'datetime',
-                            fieldLabel: i18n.getMsg('gueltigVon'),
-                            labelWidth: 90,
-                            anchor: '100%',
-                            name: 'gueltigVon',
-                            format: 'd.m.Y',
-                            period: 'start'
-                        }, {
-                            xtype: 'datetime',
-                            fieldLabel: i18n.getMsg('gueltigBis'),
-                            labelWidth: 90,
-                            anchor: '100%',
-                            name: 'gueltigBis',
-                            format: 'd.m.Y',
-                            period: 'end'
-                        }, {
-                            xtype: 'numberfield',
-                            fieldLabel: i18n.getMsg('offset'),
-                            labelWidth: 90,
-                            anchor: '100%',
-                            name: 'intervallOffset'
-                        }]
+                        xtype: 'location',
+                        name: 'ortId',
+                        fieldLabel: i18n.getMsg('ortId'),
+                        labelWidth: 80,
+                        allowBlank: true,
+                        forceSelection: true,
+                        editable: false,
+                        columnWidth: '0.75'
                     }, {
-                        xtype: 'fset',
-                        title: i18n.getMsg('probenintervall'),
-                        name: 'probenIntervallFieldset',
-                        anchor: '100%',
-                        width: '50%',
-                        margin: '0, 5, 5, 5',
-                        layout: {
-                            type: 'vbox',
-                            align: 'stretch'
-                        },
-                        items: [{
-                            xtype: 'probenintervall',
-                            fieldLabel: i18n.getMsg('probenintervall'),
-                            labelWidth: 90,
-                            anchor: '100%',
-                            name: 'probenintervall'
-                        }, {
-                            xtype: 'numberfield',
-                            fieldLabel: i18n.getMsg('teilintervallVon'),
-                            labelWidth: 90,
-                            anchor: '100%',
-                            name: 'teilintervallVon',
-                            period: 'start'
-                        }, {
-                            xtype: 'numberfield',
-                            fieldLabel: i18n.getMsg('teilintervallBis'),
-                            labelWidth: 90,
-                            anchor: '100%',
-                            name: 'teilintervallBis',
-                            period: 'end'
-                        }, {
-                            xtype: 'probenintervallslider',
-                            fieldLabel: i18n.getMsg('intervall'),
-                            labelWidth: 90,
-                            anchor: '100%',
-                            values: [0, 0]
-                                //this will be overridden
-                                // by setRecord
-                        }]
+                        xtype: 'button',
+                        name: 'ortIdButton',
+                        margin: '0 0 0 5',
+                        text: i18n.getMsg('messprogrammort.button.title'),
+                        action: 'ort',
+                        columnWidth: '0.25'
                     }]
+                }, {
+                    xtype: 'numberfield',
+                    allowDecimals: false,
+                    name: 'probeNehmerId',
+                    fieldLabel: i18n.getMsg('probeNehmerId'),
+                    width: '100%',
+                    anchor: '100%',
+                    labelWidth: 105
+                }, {
+                    xtype: 'textarea',
+                    name: 'probeKommentar',
+                    labelAlign: 'top',
+                    fieldLabel: i18n.getMsg('probeKommentar'),
+                    width: '100%',
+                    labelwidth: 135,
+                    anchor: '100%'
                 }]
             }]
         }];
@@ -488,6 +524,8 @@
             });
             this.down('messstellelabor').setValue(items.getAt(0));
         }
+        // set media field
+//        this.down('media').setValue('XXXX');
     },
 
     setMediaDesk: function(record) {
@@ -566,10 +604,9 @@
         this.down('cbox[name=mstlabor]').clearWarningOrError();
         this.down('tfield[name=name]').clearWarningOrError();
         //no clearmsg for probeKommentar
-        this.down('fset[name=erwAngaben]').clearMessages();
         this.down('cbox[name=datenbasisId]').clearWarningOrError();
         this.down('cbox[name=baId]').clearWarningOrError();
-        this.down('cbox[name=test]').clearWarningOrError();
+        this.down('chkbox[name=test]').clearWarningOrError();
         this.down('cbox[name=probenartId]').clearWarningOrError();
         this.down('cbox[name=netzbetreiberId]').clearWarningOrError();
         //no clear for probeNehmerId
diff -r cbe5a19449a4 -r 61cc583c3649 resources/i18n/Lada_de-DE.properties
--- a/resources/i18n/Lada_de-DE.properties	Wed Apr 13 20:11:06 2016 +0200
+++ b/resources/i18n/Lada_de-DE.properties	Fri Apr 29 10:20:05 2016 +0200
@@ -34,7 +34,7 @@
 ##
 hauptprobenNr:Hauptproben Nr.
 entnahmeOrt:Entnahmeort
-test:Testdatensatz
+test:Test
 probenartId:Probenart
 probeentnahmeBeginn:Probeentnahme Beginn
 
@@ -50,21 +50,21 @@
 probe:Probe
 messung:Messung
 name:Name
+mprId:Mpr-Id
 mstId:Messstelle
 datenbasisId:Datenbasis
-test:Testdatensatz
-baId:Betriebsart
+baId:Messregime
 probeNehmerId:Probennehmer
 netzbetreiberId:Netzbetreiber
 mediaDesk:Deskriptoren
 umwId:Umweltbereich
 ortId:Ort
-probenintervall:Probenintervall
-teilintervallVon:Teilintervall Von
-teilintervallBis:Teilintervall Bis
+probenintervall:Intervall
+teilintervallVon:Teilintervall von
+teilintervallBis:bis
 inntervallOffset:Intervall Offset
-gueltigVon:Gültig Von
-gueltigBis:Gültig Bis
+gueltigVon:Gültig von
+gueltigBis:bis
 probeKommentar:Probe Kommentar
 messmethode:Messmethode
 nuklide:Nuklide


More information about the Lada-commits mailing list