# HG changeset patch # User Raimund Renkert # Date 1463497982 -7200 # Node ID 566976d72ce560c7003f51b11256ed0d1987e432 # Parent e76551a6da276977e785ebd142bece385634c4cb# Parent 7baaf2cd3f57a912fb4349e17678f28f27c134ad merged. diff -r e76551a6da27 -r 566976d72ce5 app.js --- a/app.js Tue May 17 17:12:33 2016 +0200 +++ b/app.js Tue May 17 17:13:02 2016 +0200 @@ -55,6 +55,9 @@ 'Lada.store.Verwaltungseinheiten', 'Lada.store.StatusWerte', 'Lada.store.StatusStufe', + 'Lada.store.Probenehmer', + 'Lada.store.DatensatzErzeuger', + 'Lada.store.MessprogrammKategorie', 'Lada.model.MessstelleLabor' ], bundle: { @@ -162,13 +165,19 @@ if (!itemLabor) { continue; } + if ( item.get('messStelle') === itemLabor.get('messStelle') ) { + displayCombi = item.get('messStelle'); + } else { + displayCombi = item.get('messStelle') + '/' + itemLabor.get('messStelle') + } mstLaborStore.add({ id: i, messStelle: mstLabor[i].messstelle, netzbetreiberId: item.get('netzbetreiberId'), laborMst: mstLabor[i].labor, - displayCombi: item.get('messStelle') + - '/' + itemLabor.get('messStelle') + displayCombi: displayCombi + /*displayCombi: item.get('messStelle') + + '/' + itemLabor.get('messStelle')*/ }); } } @@ -200,6 +209,16 @@ Ext.create('Lada.store.Verwaltungseinheiten', { storeId: 'verwaltungseinheiten' }); + Ext.create('Lada.store.Probenehmer', { + storeId: 'probenehmer', + autoLoad: true + }); + Ext.create('Lada.store.DatensatzErzeuger', { + storeId: 'datensatzerzeuger' + }); + Ext.create('Lada.store.MessprogrammKategorie', { + storeId: 'messprogrammkategorie' + }); Ext.create('Lada.store.StatusWerte', { storeId: 'statuswerte', autoLoad: true diff -r e76551a6da27 -r 566976d72ce5 app/controller/Filter.js --- a/app/controller/Filter.js Tue May 17 17:12:33 2016 +0200 +++ b/app/controller/Filter.js Tue May 17 17:13:02 2016 +0200 @@ -305,6 +305,17 @@ multiSelect: multi }); } + else if (type === 'liststatus') { + field = Ext.create('Lada.view.widget.Status', { + name: name, + labelWidth: 135, + fieldLabel: label, + forceSelection: false, + value: value, + filterId: filterId, + multiSelect: multi + }); + } if (field) { filterValues.add(field); filters.show(); diff -r e76551a6da27 -r 566976d72ce5 app/controller/form/Messprogramm.js --- a/app/controller/form/Messprogramm.js Tue May 17 17:12:33 2016 +0200 +++ b/app/controller/form/Messprogramm.js Tue May 17 17:13:02 2016 +0200 @@ -84,7 +84,6 @@ var netzbetreiber = combo.up().up('form') .down('netzbetreiber').down('combobox'); var nbId = records[0].get('netzbetreiberId'); - if (nbId != null) { //select the NB in the NB-Combobox netzbetreiber.select(nbId); @@ -323,8 +322,8 @@ var desk = field.up('deskriptor'); var media = field.up('messprogrammform').down('textfield[name="mediaDesk"]'); var current = media.getValue().split(' '); - if (current.length < 12) { + var value; for (var i = 0; i <= 12; i++) { if (i === 0) { current.push('D:'); @@ -365,6 +364,37 @@ } } media.setValue(current.join(' ').trim()); + + if (current[0].length == 0) { + current.splice(0,1); + } + var mediatext = field.up('messprogrammform').down('textfield[name="media"]'); + + if ( (desk.layer === 0 ) && (records[0].get('sn') === 0) ){ + mediatext.setValue(''); + } else { + if ( current[1] === '01') { + if ( (current[5] !== '00') && (desk.layer === 4 ) ){ + //mediatext.setValue(records[0].data.beschreibung); + } else if ( (current[4] !== '00') && (desk.layer === 3) ) { + mediatext.setValue(records[0].data.beschreibung); + } else if ( (current[3] !== '00') && (desk.layer === 2) ) { + mediatext.setValue(records[0].data.beschreibung); + } else if ( (current[2] !== '00') && (desk.layer === 1) ) { + mediatext.setValue(records[0].data.beschreibung); + } else if ( (current[1] !== '00') && (desk.layer === 0 )) { + mediatext.setValue(records[0].data.beschreibung); + } + } + + if ( current[1] !== '01') { + if ((current[2] !== '00') && (desk.layer === 1 )) { + mediatext.setValue(records[0].data.beschreibung); + } else if ((current[1] !== '00') && (desk.layer === 0 )) { + mediatext.setValue(records[0].data.beschreibung); + } + } + } }, clearChildDesk: function(field) { diff -r e76551a6da27 -r 566976d72ce5 app/view/FilterPanel.js --- a/app/view/FilterPanel.js Tue May 17 17:12:33 2016 +0200 +++ b/app/view/FilterPanel.js Tue May 17 17:13:02 2016 +0200 @@ -44,11 +44,21 @@ margin: '0 0 0 10' }] }, { - xtype: 'checkbox', - name: 'favorites', - boxLabel: 'nur Favoriten', - margin: '0, 0, 0, 5', - checked: true + layout: { + type: 'hbox', + }, + border: false, + items: [{ + xtype: 'checkbox', + name: 'favorites', + boxLabel: 'nur Favoriten', + checked: true + }, { + xtype: 'button', + action: 'manage', + text: 'Filterauswahl bearbeiten', + margin: '0 0 0 20' + }] }, { xtype: 'displayfield', name: 'description', @@ -58,6 +68,22 @@ }, { xtype: 'panel', border: false, + margin: '10 0 10 0', + items: [{ + xtype: 'button', + action: 'search', + text: 'Suchen', + margin: '0 10 0 0' + }, { + xtype: 'button', + action: 'reset', + text: 'Zurücksetzen', + margin: '0 10 0 0' + }], + hidden: false + }, { + xtype: 'panel', + border: false, name: 'filtervariables', hidden: true, margin: '10, 0, 10, 0', @@ -67,7 +93,6 @@ name: 'filtervalues', items: [] }, { - layout: { type: 'hbox', pack: 'end' @@ -84,26 +109,6 @@ text: 'Vorbelegung zurücksetzen' }] }] - }, { - xtype: 'panel', - border: false, - margin: '10 0 10 0', - items: [{ - xtype: 'button', - action: 'search', - text: 'Suchen', - margin: '0 10 0 0' - }, { - xtype: 'button', - action: 'reset', - text: 'Zurücksetzen', - margin: '0 10 0 0' - }, { - xtype: 'button', - action: 'manage', - text: 'Filterauswahl bearbeiten' - }], - hidden: false }]; this.callParent(arguments); var combo = me.down('combobox[name=filter]'); diff -r e76551a6da27 -r 566976d72ce5 app/view/form/Messprogramm.js --- a/app/view/form/Messprogramm.js Tue May 17 17:12:33 2016 +0200 +++ b/app/view/form/Messprogramm.js Tue May 17 17:13:02 2016 +0200 @@ -171,17 +171,19 @@ }, { xtype: 'betriebsart', name: 'baId', + margin: '0, 5, 5, 5', fieldLabel: i18n.getMsg('baId'), - anchor: '100%', - labelWidth: 105 + //anchor: '100%', + width: '35%', + labelWidth: 80 }, { xtype: 'probenart', editable: false, name: 'probenartId', fieldLabel: i18n.getMsg('probenartId'), - margin: '0, 15, 5, 5', + margin: '0, 5, 5, 5', width: '20%', - labelWidth: 65, + labelWidth: 70, allowBlank: false }] }] @@ -207,7 +209,6 @@ fieldLabel: i18n.getMsg('probenintervall'), margin: '0, 10, 5, 5', labelWidth: 50, -// anchor: '100%', width: '40%', name: 'probenintervall' }, { @@ -215,7 +216,6 @@ fieldLabel: i18n.getMsg('teilintervallVon'), margin: '0, 10, 5, 10', labelWidth: 90, - // anchor: '100%', width: '28%', name: 'teilintervallVon', period: 'start' @@ -224,8 +224,7 @@ fieldLabel: i18n.getMsg('teilintervallBis'), margin: '0, 15, 5, 5', labelWidth: 18, -// anchor: '100%', - width: '12%', + width: '15%', name: 'teilintervallBis', period: 'end' }, { @@ -233,8 +232,7 @@ margin: '0, 10, 5, 5', fieldLabel: i18n.getMsg('offset'), labelWidth: 45, -// anchor: '100%', - width: '18%', + width: '17%', name: 'intervallOffset' }] }, { @@ -244,7 +242,6 @@ pack: 'center', width: '70%', margin: '0, 40, 10, 40', -// anchor: '950%', values: [0, 0] //this will be overridden // by setRecord @@ -261,7 +258,6 @@ fieldLabel: i18n.getMsg('gueltigVon'), margin: '0, 30, 5, 5', labelWidth: 90, -// anchor: '100%', name: 'gueltigVon', format: 'd.m.Y', period: 'start' @@ -270,7 +266,6 @@ fieldLabel: i18n.getMsg('gueltigBis'), margin: '0, 5, 5, 5', labelWidth: 40, -// anchor: '100%', name: 'gueltigBis', format: 'd.m.Y', period: 'end' @@ -358,7 +353,6 @@ title: 'Ort', layout: { type: 'hbox', -// pack: 'center', align: 'stretch' }, width: '100%', @@ -471,7 +465,6 @@ setRecord: function(messRecord) { this.clearMessages(); - this.getForm().loadRecord(messRecord); //Set the intervall numberfields and the slider. this.down('probenintervallslider').setValue([ @@ -501,16 +494,20 @@ laborMstId = ''; } var id = this.down('messstellelabor').store.count() + 1; - var newStore = Ext.create('Ext.data.Store', { - model: 'Lada.model.MessstelleLabor', - data: [{ - id: id, - laborMst: messRecord.get('laborMstId'), - messStelle: messRecord.get('mstId'), - displayCombi: mstId.get('messStelle') + - '/' + laborMstId - }] - }); + if ( messRecord.get('mstId') === messRecord.get('laborMstId') ) { + displayCombi = mstId.get('messStelle'); + } else { + displayCombi = mstId.get('messStelle') + '/' + laborMstId + } + var newStore = Ext.create('Ext.data.Store', { + model: 'Lada.model.MessstelleLabor', + data: [{ + id: id, + laborMst: messRecord.get('laborMstId'), + messStelle: messRecord.get('mstId'), + displayCombi: displayCombi + }] + }); this.down('messstellelabor').down('combobox').store = newStore; this.down('messstellelabor').setValue(id); } @@ -524,8 +521,6 @@ }); this.down('messstellelabor').setValue(items.getAt(0)); } - // set media field -// this.down('media').setValue('XXXX'); }, setMediaDesk: function(record) { @@ -533,8 +528,11 @@ this.setMediaSN(0, media); }, - setMediaSN: function(ndx, media) { + setMediaSN: function(ndx, media, beschreibung) { + var mediabeschreibung = this.getForm().findField('media'); + if (ndx >= 12) { + mediabeschreibung.setValue(beschreibung); return; } var me = this; @@ -560,7 +558,15 @@ return; } cbox.select(cbox.store.findRecord('sn', parseInt(media[ndx + 1], 10))); - me.setMediaSN(++ndx, media); + var mediatext = cbox.store.findRecord('sn', parseInt(media[ndx + 1], 10)); + if (mediatext !== null) { + if ( (ndx <= 3) && (media[1] === '01') && (mediatext.data.beschreibung !== "leer") ) { + beschreibung = mediatext.data.beschreibung; + } else if ( (media[1] !== '01') && (mediatext.data.beschreibung !== "leer") && (ndx <= 1) ) { + beschreibung = mediatext.data.beschreibung; + } + } + me.setMediaSN(++ndx, media, beschreibung); }); }, diff -r e76551a6da27 -r 566976d72ce5 app/view/form/Probe.js --- a/app/view/form/Probe.js Tue May 17 17:12:33 2016 +0200 +++ b/app/view/form/Probe.js Tue May 17 17:13:02 2016 +0200 @@ -14,6 +14,9 @@ alias: 'widget.probeform', requires: [ 'Lada.view.widget.Datenbasis', + 'Lada.view.widget.DatensatzErzeuger', + 'Lada.view.widget.Probenehmer', + 'Lada.view.widget.MessprogrammLand', 'Lada.view.widget.base.CheckBox', 'Lada.view.widget.MessstelleLabor', 'Lada.view.widget.Netzbetreiber', @@ -185,7 +188,7 @@ border: 0, width: '100%', items: [{ - xtype: 'numberfield', + xtype: 'probenehmer', allowDecimals: false, name: 'probeNehmerId', fieldLabel: 'Probennehmer', @@ -195,14 +198,22 @@ anchor: '100%', labelWidth: 95 }, { - xtype: 'tfield', - name: 'x11', + xtype: 'datensatzerzeuger', + name: 'erzeugerId', fieldLabel: 'Datensatzerzeuger', margin: '0, 5, 5, 5', width: '50%', anchor: '100%', labelWidth: 110 }] + },{ + xtype: 'messprogrammland', + name: 'mplId', + fieldLabel: 'Messprogramm-Land', + margin: '0, 5, 5, 5', + width: '50%', + anchor: '100%', + labelWidth: 110 }] }, { // Zeit @@ -467,7 +478,7 @@ this.down('chkbox[name=test]').clearWarningOrError(); this.down('cbox[name=probenartId]').clearWarningOrError(); this.down('cbox[name=netzbetreiberId]').clearWarningOrError(); - this.down('tfield[name=x11]').clearWarningOrError(); + this.down('cbox[name=erzeugerId]').clearWarningOrError(); this.down('cbox[name=umwId]').clearWarningOrError(); this.down('datetime[name=probeentnahmeBeginn]').clearWarningOrError(); this.down('datetime[name=probeentnahmeEnde]').clearWarningOrError(); @@ -482,11 +493,11 @@ this.down('cbox[name=baId]').setReadOnly(value); this.down('chkbox[name=test]').setReadOnly(value); this.down('cbox[name=probenartId]').setReadOnly(value); - this.down('tfield[name=x11]').setReadOnly(value); + this.down('cbox[name=erzeugerId]').setReadOnly(value); this.down('cbox[name=umwId]').setReadOnly(value); this.down('datetime[name=probeentnahmeBeginn]').setReadOnly(value); this.down('datetime[name=probeentnahmeEnde]').setReadOnly(value); - this.down('numberfield[name=probeNehmerId]').setReadOnly(value); + this.down('cbox[name=probeNehmerId]').setReadOnly(value); //Deskriptoren for (var i = 0; i < 12; i++) { diff -r e76551a6da27 -r 566976d72ce5 app/view/grid/Probenehmer.js --- a/app/view/grid/Probenehmer.js Tue May 17 17:12:33 2016 +0200 +++ b/app/view/grid/Probenehmer.js Tue May 17 17:13:02 2016 +0200 @@ -149,7 +149,9 @@ header: i18n.getMsg('plz'), dataIndex: 'plz', editor: { - xtype: 'numberfield' + xtype: 'textfield', + maxLength: 5, + enforceMaxLength: true } }, { header: i18n.getMsg('strasse'), diff -r e76551a6da27 -r 566976d72ce5 app/view/widget/DatensatzErzeuger.js --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/app/view/widget/DatensatzErzeuger.js Tue May 17 17:13:02 2016 +0200 @@ -0,0 +1,43 @@ +/* Copyright (C) 2013 by Bundesamt fuer Strahlenschutz + * Software engineering by Intevation GmbH + * + * This file is Free Software under the GNU GPL (v>=3) + * and comes with ABSOLUTELY NO WARRANTY! Check out + * the documentation coming with IMIS-Labordaten-Application for details. + */ + +/** + * Combobox for Umweltbereich + */ +Ext.define('Lada.view.widget.DatensatzErzeuger' ,{ + extend: 'Lada.view.widget.base.ComboBox', + alias: 'widget.datensatzerzeuger', + store: 'datensatzerzeuger', + displayField: 'id', + valueField: 'id', + editable: this.editable || false, + forceSelection: true, + // Enable filtering of comboboxes + autoSelect: false, + queryMode: 'local', + triggerAction: 'all', + typeAhead: false, + minChars: 0, + tpl: Ext.create("Ext.XTemplate", + '
' + + '{id} - {datensatzErzeuger}
'), + displayTpl: Ext.create('Ext.XTemplate', + '{id} - {datensatzErzeuger}'), + + initComponent: function() { + var i18n = Lada.getApplication().bundle; + this.emptyText = i18n.getMsg('emptytext.datensatzerzeuger'); + + this.store = Ext.data.StoreManager.get('datensatz_erzeuger'); + if (!this.store) { + this.store = Ext.create('Lada.store.DatensatzErzeuger'); + } + this.store.sort(); + this.callParent(arguments); + } +}); diff -r e76551a6da27 -r 566976d72ce5 app/view/widget/MessprogrammLand.js --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/app/view/widget/MessprogrammLand.js Tue May 17 17:13:02 2016 +0200 @@ -0,0 +1,36 @@ +/* Copyright (C) 2013 by Bundesamt fuer Strahlenschutz + * Software engineering by Intevation GmbH + * + * This file is Free Software under the GNU GPL (v>=3) + * and comes with ABSOLUTELY NO WARRANTY! Check out + * the documentation coming with IMIS-Labordaten-Application for details. + */ + +/** + * Combobox for MessprogrammLand + */ +Ext.define('Lada.view.widget.MessprogrammLand', { + extend: 'Lada.view.widget.base.ComboBox', + alias: 'widget.messprogrammland', + store: 'messprogrammkategorie', + displayField: 'display', + valueField: 'id', + emptyText: 'Wählen Sie eine Landesmessprogramm', + // Enable filtering of comboboxes + queryMode: 'local', + triggerAction: 'all', + typeAhead: true, + minChars: 0, + layout: 'hbox', + + initComponent: function() { + this.store = Ext.data.StoreManager.get('messprogrammkategorie'); + if (!this.store) { + this.store = Ext.create('Lada.store.MessprogrammKategorie'); + } + else { + this.store.clearFilter(); + } + this.callParent(arguments); + } +}); diff -r e76551a6da27 -r 566976d72ce5 app/view/widget/Probenehmer.js --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/app/view/widget/Probenehmer.js Tue May 17 17:13:02 2016 +0200 @@ -0,0 +1,43 @@ +/* Copyright (C) 2013 by Bundesamt fuer Strahlenschutz + * Software engineering by Intevation GmbH + * + * This file is Free Software under the GNU GPL (v>=3) + * and comes with ABSOLUTELY NO WARRANTY! Check out + * the documentation coming with IMIS-Labordaten-Application for details. + */ + +/** + * Combobox for Umweltbereich + */ +Ext.define('Lada.view.widget.Probenehmer' ,{ + extend: 'Lada.view.widget.base.ComboBox', + alias: 'widget.probenehmer', + store: 'Probenehmer', + displayField: 'id', + valueField: 'id', + editable: this.editable || false, + forceSelection: true, + // Enable filtering of comboboxes + autoSelect: false, + queryMode: 'local', + triggerAction: 'all', + typeAhead: false, + minChars: 0, + tpl: Ext.create("Ext.XTemplate", + '
' + + '{id} - {probeNehmer}
'), + displayTpl: Ext.create('Ext.XTemplate', + '{id} - {probeNehmer}'), + + initComponent: function() { + var i18n = Lada.getApplication().bundle; + this.emptyText = i18n.getMsg('emptytext.probenehmer'); + + this.store = Ext.data.StoreManager.get('probenehmer'); + if (!this.store) { + this.store = Ext.create('Lada.store.Probenehmer'); + } + this.store.sort(); + this.callParent(arguments); + } +}); diff -r e76551a6da27 -r 566976d72ce5 app/view/widget/base/ComboBox.js --- a/app/view/widget/base/ComboBox.js Tue May 17 17:12:33 2016 +0200 +++ b/app/view/widget/base/ComboBox.js Tue May 17 17:13:02 2016 +0200 @@ -20,7 +20,6 @@ margin: '0, 0, 5, 0', initComponent: function() { - console.log(this.editable); if (this.editable === undefined) { this.editable = true; } diff -r e76551a6da27 -r 566976d72ce5 app/view/window/GenProbenFromMessprogramm.js --- a/app/view/window/GenProbenFromMessprogramm.js Tue May 17 17:12:33 2016 +0200 +++ b/app/view/window/GenProbenFromMessprogramm.js Tue May 17 17:13:02 2016 +0200 @@ -50,8 +50,8 @@ handler: function() { var jsondata = { id: me.record.id, - start: new Date(me.down('datetime [name=start]').getValue()).valueOf(), - end: new Date(me.down('datetime [name=end]').getValue()).valueOf() + start: new Date(me.down('datefield [name=start]').getValue()).valueOf(), + end: new Date(me.down('datefield [name=end]').getValue()).valueOf() }; @@ -153,22 +153,22 @@ layout: 'fit', html: '

' + i18n.getMsg('messprogtimeperiod') + '

' }, { - xtype: 'datetime', + xtype: 'datefield', fieldLabel: i18n.getMsg('from'), labelWidth: 90, margin: 5, - width: 300, + width: 200, name: 'start', - format: 'd.m.Y H:i', + format: 'd.m.Y', period: 'start' }, { - xtype: 'datetime', + xtype: 'datefield', fieldLabel: i18n.getMsg('to'), labelWidth: 90, margin: 5, - width: 300, + width: 200, name: 'end', - format: 'd.m.Y H:i', + format: 'd.m.Y', period: 'end' }] }]; diff -r e76551a6da27 -r 566976d72ce5 install-dependencies.sh --- a/install-dependencies.sh Tue May 17 17:12:33 2016 +0200 +++ b/install-dependencies.sh Tue May 17 17:13:02 2016 +0200 @@ -24,11 +24,11 @@ curl -L https://github.com/openlayers/openlayers/archive/release-2.13.1.zip \ -o OpenLayers-2-13-1.zip unzip -n OpenLayers-2-13-1.zip -ln -sf ol2-release-2.13.1/build OpenLayers -cd OpenLayers -python build.py +ln -sf ol2-release-2.13.1 OpenLayers +cd OpenLayers/build +python build.py full.cfg ../OpenLayers.js -cd ../ext +cd ../../ext curl -L https://github.com/elmasse/Ext.i18n.Bundle/archive/v0.3.3.zip \ -o Ext-i18n-Bundle-v0-3-3.zip unzip -n Ext-i18n-Bundle-v0-3-3.zip