Mercurial > lada > lada-client
annotate app/controller/form/Messprogramm.js @ 1359:49efc1cc0eac
Remove trailing whitespace.
author | Tom Gottfried <tom@intevation.de> |
---|---|
date | Tue, 07 Feb 2017 18:50:32 +0100 |
parents | 2e462c5334f1 |
children | b58868c47f02 |
rev | line source |
---|---|
757
b8502964f5c3
Added missing files. Added MmtMockup
Dustin Demuth <dustin@intevation.de>
parents:
diff
changeset
|
1 /* Copyright (C) 2013 by Bundesamt fuer Strahlenschutz |
b8502964f5c3
Added missing files. Added MmtMockup
Dustin Demuth <dustin@intevation.de>
parents:
diff
changeset
|
2 * Software engineering by Intevation GmbH |
b8502964f5c3
Added missing files. Added MmtMockup
Dustin Demuth <dustin@intevation.de>
parents:
diff
changeset
|
3 * |
b8502964f5c3
Added missing files. Added MmtMockup
Dustin Demuth <dustin@intevation.de>
parents:
diff
changeset
|
4 * This file is Free Software under the GNU GPL (v>=3) |
b8502964f5c3
Added missing files. Added MmtMockup
Dustin Demuth <dustin@intevation.de>
parents:
diff
changeset
|
5 * and comes with ABSOLUTELY NO WARRANTY! Check out |
b8502964f5c3
Added missing files. Added MmtMockup
Dustin Demuth <dustin@intevation.de>
parents:
diff
changeset
|
6 * the documentation coming with IMIS-Labordaten-Application for details. |
b8502964f5c3
Added missing files. Added MmtMockup
Dustin Demuth <dustin@intevation.de>
parents:
diff
changeset
|
7 */ |
b8502964f5c3
Added missing files. Added MmtMockup
Dustin Demuth <dustin@intevation.de>
parents:
diff
changeset
|
8 |
b8502964f5c3
Added missing files. Added MmtMockup
Dustin Demuth <dustin@intevation.de>
parents:
diff
changeset
|
9 /** |
1086
61cc583c3649
Messprogramm form redesign
Michael Stanko <mstanko@bfs.de>
parents:
1070
diff
changeset
|
10 * A Controller for a Messprogramm form |
757
b8502964f5c3
Added missing files. Added MmtMockup
Dustin Demuth <dustin@intevation.de>
parents:
diff
changeset
|
11 */ |
b8502964f5c3
Added missing files. Added MmtMockup
Dustin Demuth <dustin@intevation.de>
parents:
diff
changeset
|
12 Ext.define('Lada.controller.form.Messprogramm', { |
b8502964f5c3
Added missing files. Added MmtMockup
Dustin Demuth <dustin@intevation.de>
parents:
diff
changeset
|
13 extend: 'Ext.app.Controller', |
b8502964f5c3
Added missing files. Added MmtMockup
Dustin Demuth <dustin@intevation.de>
parents:
diff
changeset
|
14 |
797
b8fd43021c29
Added a Window to alter Orte of a Messprogramm
Dustin Demuth <dustin@intevation.de>
parents:
784
diff
changeset
|
15 |
757
b8502964f5c3
Added missing files. Added MmtMockup
Dustin Demuth <dustin@intevation.de>
parents:
diff
changeset
|
16 /** |
b8502964f5c3
Added missing files. Added MmtMockup
Dustin Demuth <dustin@intevation.de>
parents:
diff
changeset
|
17 * Initialize the Controller |
b8502964f5c3
Added missing files. Added MmtMockup
Dustin Demuth <dustin@intevation.de>
parents:
diff
changeset
|
18 */ |
b8502964f5c3
Added missing files. Added MmtMockup
Dustin Demuth <dustin@intevation.de>
parents:
diff
changeset
|
19 init: function() { |
b8502964f5c3
Added missing files. Added MmtMockup
Dustin Demuth <dustin@intevation.de>
parents:
diff
changeset
|
20 this.control({ |
b8502964f5c3
Added missing files. Added MmtMockup
Dustin Demuth <dustin@intevation.de>
parents:
diff
changeset
|
21 'messprogrammform button[action=save]': { |
b8502964f5c3
Added missing files. Added MmtMockup
Dustin Demuth <dustin@intevation.de>
parents:
diff
changeset
|
22 click: this.save |
b8502964f5c3
Added missing files. Added MmtMockup
Dustin Demuth <dustin@intevation.de>
parents:
diff
changeset
|
23 }, |
b8502964f5c3
Added missing files. Added MmtMockup
Dustin Demuth <dustin@intevation.de>
parents:
diff
changeset
|
24 'messprogrammform button[action=discard]': { |
b8502964f5c3
Added missing files. Added MmtMockup
Dustin Demuth <dustin@intevation.de>
parents:
diff
changeset
|
25 click: this.discard |
b8502964f5c3
Added missing files. Added MmtMockup
Dustin Demuth <dustin@intevation.de>
parents:
diff
changeset
|
26 }, |
b8502964f5c3
Added missing files. Added MmtMockup
Dustin Demuth <dustin@intevation.de>
parents:
diff
changeset
|
27 'messprogrammform': { |
b8502964f5c3
Added missing files. Added MmtMockup
Dustin Demuth <dustin@intevation.de>
parents:
diff
changeset
|
28 dirtychange: this.dirtyForm |
b8502964f5c3
Added missing files. Added MmtMockup
Dustin Demuth <dustin@intevation.de>
parents:
diff
changeset
|
29 }, |
1070
33927274f013
Fixed mst/labor_mst field and selection to automatically set the netzbetreiber.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
972
diff
changeset
|
30 'messprogrammform messstellelabor combobox': { |
842
beef4e8eeafc
Added logic to autofill the Netzbetreiber when the Messstelle was selected.
Dustin Demuth <dustin@intevation.de>
parents:
818
diff
changeset
|
31 select: this.setNetzbetreiber |
798
ff4330d4aba1
Filter Messtellen in Probeform and Messprogramm
Dustin Demuth <dustin@intevation.de>
parents:
797
diff
changeset
|
32 }, |
1197
112fd60f1fb4
It is an error to specify invalid intervals.
Tom Gottfried <tom@intevation.de>
parents:
1194
diff
changeset
|
33 'messprogrammform numfield numberfield': { |
112fd60f1fb4
It is an error to specify invalid intervals.
Tom Gottfried <tom@intevation.de>
parents:
1194
diff
changeset
|
34 change: this.checkPeriod |
774 | 35 }, |
777 | 36 'messprogrammform [name="teilintervallVon"]': { |
1280
3b4dcc83a21b
fix sencha compile warnings
Michael Stanko <mstanko@bfs.de>
parents:
1276
diff
changeset
|
37 change: this.synchronizeSlider |
757
b8502964f5c3
Added missing files. Added MmtMockup
Dustin Demuth <dustin@intevation.de>
parents:
diff
changeset
|
38 }, |
777 | 39 'messprogrammform [name="teilintervallBis"]': { |
1280
3b4dcc83a21b
fix sencha compile warnings
Michael Stanko <mstanko@bfs.de>
parents:
1276
diff
changeset
|
40 change: this.synchronizeSlider |
777 | 41 }, |
818
097d4edc2f00
Genprobenwindow can only be created once, also fixed messprogrammortewindow 'close with x and can not reopen' bug
Dustin Demuth <dustin@intevation.de>
parents:
808
diff
changeset
|
42 'messprogrammform probenintervall combobox': { |
757
b8502964f5c3
Added missing files. Added MmtMockup
Dustin Demuth <dustin@intevation.de>
parents:
diff
changeset
|
43 select: this.updateIntervalls |
784
f0b26df02157
Handle deskriptoren in messprogramm like in probe.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
777
diff
changeset
|
44 }, |
1210
a24de34d6423
Align subintervall with validity for yearly samples.
Tom Gottfried <tom@intevation.de>
parents:
1198
diff
changeset
|
45 'messprogrammform dayofyear [hidden]': { |
a24de34d6423
Align subintervall with validity for yearly samples.
Tom Gottfried <tom@intevation.de>
parents:
1198
diff
changeset
|
46 change: this.alignSubIntervall |
a24de34d6423
Align subintervall with validity for yearly samples.
Tom Gottfried <tom@intevation.de>
parents:
1198
diff
changeset
|
47 }, |
784
f0b26df02157
Handle deskriptoren in messprogramm like in probe.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
777
diff
changeset
|
48 'messprogrammform panel[xtype="deskriptor] combobox': { |
f0b26df02157
Handle deskriptoren in messprogramm like in probe.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
777
diff
changeset
|
49 select: this.deskriptorSelect |
757
b8502964f5c3
Added missing files. Added MmtMockup
Dustin Demuth <dustin@intevation.de>
parents:
diff
changeset
|
50 } |
b8502964f5c3
Added missing files. Added MmtMockup
Dustin Demuth <dustin@intevation.de>
parents:
diff
changeset
|
51 }); |
b8502964f5c3
Added missing files. Added MmtMockup
Dustin Demuth <dustin@intevation.de>
parents:
diff
changeset
|
52 }, |
798
ff4330d4aba1
Filter Messtellen in Probeform and Messprogramm
Dustin Demuth <dustin@intevation.de>
parents:
797
diff
changeset
|
53 |
ff4330d4aba1
Filter Messtellen in Probeform and Messprogramm
Dustin Demuth <dustin@intevation.de>
parents:
797
diff
changeset
|
54 /** |
ff4330d4aba1
Filter Messtellen in Probeform and Messprogramm
Dustin Demuth <dustin@intevation.de>
parents:
797
diff
changeset
|
55 * The Messtellen Store contains ALL Messtellen. |
ff4330d4aba1
Filter Messtellen in Probeform and Messprogramm
Dustin Demuth <dustin@intevation.de>
parents:
797
diff
changeset
|
56 * Filter the store in this combobox to reduce the choices |
ff4330d4aba1
Filter Messtellen in Probeform and Messprogramm
Dustin Demuth <dustin@intevation.de>
parents:
797
diff
changeset
|
57 * to the subset which the user is allowed to use. |
ff4330d4aba1
Filter Messtellen in Probeform and Messprogramm
Dustin Demuth <dustin@intevation.de>
parents:
797
diff
changeset
|
58 */ |
ff4330d4aba1
Filter Messtellen in Probeform and Messprogramm
Dustin Demuth <dustin@intevation.de>
parents:
797
diff
changeset
|
59 filter: function(field) { |
ff4330d4aba1
Filter Messtellen in Probeform and Messprogramm
Dustin Demuth <dustin@intevation.de>
parents:
797
diff
changeset
|
60 var fil = Ext.create('Ext.util.Filter', { |
ff4330d4aba1
Filter Messtellen in Probeform and Messprogramm
Dustin Demuth <dustin@intevation.de>
parents:
797
diff
changeset
|
61 filterFn: function(item) { |
ff4330d4aba1
Filter Messtellen in Probeform and Messprogramm
Dustin Demuth <dustin@intevation.de>
parents:
797
diff
changeset
|
62 if (Ext.Array.contains(Lada.mst, item.get('id'))) { |
ff4330d4aba1
Filter Messtellen in Probeform and Messprogramm
Dustin Demuth <dustin@intevation.de>
parents:
797
diff
changeset
|
63 return true; |
ff4330d4aba1
Filter Messtellen in Probeform and Messprogramm
Dustin Demuth <dustin@intevation.de>
parents:
797
diff
changeset
|
64 } |
ff4330d4aba1
Filter Messtellen in Probeform and Messprogramm
Dustin Demuth <dustin@intevation.de>
parents:
797
diff
changeset
|
65 return false; |
ff4330d4aba1
Filter Messtellen in Probeform and Messprogramm
Dustin Demuth <dustin@intevation.de>
parents:
797
diff
changeset
|
66 } |
ff4330d4aba1
Filter Messtellen in Probeform and Messprogramm
Dustin Demuth <dustin@intevation.de>
parents:
797
diff
changeset
|
67 }); |
ff4330d4aba1
Filter Messtellen in Probeform and Messprogramm
Dustin Demuth <dustin@intevation.de>
parents:
797
diff
changeset
|
68 field.getStore().filter(fil); |
ff4330d4aba1
Filter Messtellen in Probeform and Messprogramm
Dustin Demuth <dustin@intevation.de>
parents:
797
diff
changeset
|
69 }, |
ff4330d4aba1
Filter Messtellen in Probeform and Messprogramm
Dustin Demuth <dustin@intevation.de>
parents:
797
diff
changeset
|
70 |
757
b8502964f5c3
Added missing files. Added MmtMockup
Dustin Demuth <dustin@intevation.de>
parents:
diff
changeset
|
71 /** |
842
beef4e8eeafc
Added logic to autofill the Netzbetreiber when the Messstelle was selected.
Dustin Demuth <dustin@intevation.de>
parents:
818
diff
changeset
|
72 * When a Messtelle is selected, modify the Netzbetreiber |
beef4e8eeafc
Added logic to autofill the Netzbetreiber when the Messstelle was selected.
Dustin Demuth <dustin@intevation.de>
parents:
818
diff
changeset
|
73 * according to the Messstelle |
beef4e8eeafc
Added logic to autofill the Netzbetreiber when the Messstelle was selected.
Dustin Demuth <dustin@intevation.de>
parents:
818
diff
changeset
|
74 */ |
beef4e8eeafc
Added logic to autofill the Netzbetreiber when the Messstelle was selected.
Dustin Demuth <dustin@intevation.de>
parents:
818
diff
changeset
|
75 setNetzbetreiber: function(combo, records){ |
beef4e8eeafc
Added logic to autofill the Netzbetreiber when the Messstelle was selected.
Dustin Demuth <dustin@intevation.de>
parents:
818
diff
changeset
|
76 var netzbetreiber = combo.up().up('form') |
beef4e8eeafc
Added logic to autofill the Netzbetreiber when the Messstelle was selected.
Dustin Demuth <dustin@intevation.de>
parents:
818
diff
changeset
|
77 .down('netzbetreiber').down('combobox'); |
beef4e8eeafc
Added logic to autofill the Netzbetreiber when the Messstelle was selected.
Dustin Demuth <dustin@intevation.de>
parents:
818
diff
changeset
|
78 var nbId = records[0].get('netzbetreiberId'); |
846
af9d506b0700
always modify the netzbetreiber when the Messstelle was changed
Dustin Demuth <dustin@intevation.de>
parents:
843
diff
changeset
|
79 if (nbId != null) { |
842
beef4e8eeafc
Added logic to autofill the Netzbetreiber when the Messstelle was selected.
Dustin Demuth <dustin@intevation.de>
parents:
818
diff
changeset
|
80 //select the NB in the NB-Combobox |
beef4e8eeafc
Added logic to autofill the Netzbetreiber when the Messstelle was selected.
Dustin Demuth <dustin@intevation.de>
parents:
818
diff
changeset
|
81 netzbetreiber.select(nbId); |
beef4e8eeafc
Added logic to autofill the Netzbetreiber when the Messstelle was selected.
Dustin Demuth <dustin@intevation.de>
parents:
818
diff
changeset
|
82 } |
beef4e8eeafc
Added logic to autofill the Netzbetreiber when the Messstelle was selected.
Dustin Demuth <dustin@intevation.de>
parents:
818
diff
changeset
|
83 }, |
beef4e8eeafc
Added logic to autofill the Netzbetreiber when the Messstelle was selected.
Dustin Demuth <dustin@intevation.de>
parents:
818
diff
changeset
|
84 |
beef4e8eeafc
Added logic to autofill the Netzbetreiber when the Messstelle was selected.
Dustin Demuth <dustin@intevation.de>
parents:
818
diff
changeset
|
85 /** |
757
b8502964f5c3
Added missing files. Added MmtMockup
Dustin Demuth <dustin@intevation.de>
parents:
diff
changeset
|
86 * When the Probenintervall was changed, update the Sliders |
1210
a24de34d6423
Align subintervall with validity for yearly samples.
Tom Gottfried <tom@intevation.de>
parents:
1198
diff
changeset
|
87 * and the numberfield. |
757
b8502964f5c3
Added missing files. Added MmtMockup
Dustin Demuth <dustin@intevation.de>
parents:
diff
changeset
|
88 */ |
1210
a24de34d6423
Align subintervall with validity for yearly samples.
Tom Gottfried <tom@intevation.de>
parents:
1198
diff
changeset
|
89 updateIntervalls: function(field) { |
757
b8502964f5c3
Added missing files. Added MmtMockup
Dustin Demuth <dustin@intevation.de>
parents:
diff
changeset
|
90 var form = field.up('messprogrammform'); |
b8502964f5c3
Added missing files. Added MmtMockup
Dustin Demuth <dustin@intevation.de>
parents:
diff
changeset
|
91 var record = form.getRecord(); |
b8502964f5c3
Added missing files. Added MmtMockup
Dustin Demuth <dustin@intevation.de>
parents:
diff
changeset
|
92 form.populateIntervall(record, field.getValue()); |
b8502964f5c3
Added missing files. Added MmtMockup
Dustin Demuth <dustin@intevation.de>
parents:
diff
changeset
|
93 }, |
1198
3b6f40541ac6
Remove wrong period check.
Tom Gottfried <tom@intevation.de>
parents:
1197
diff
changeset
|
94 |
797
b8fd43021c29
Added a Window to alter Orte of a Messprogramm
Dustin Demuth <dustin@intevation.de>
parents:
784
diff
changeset
|
95 /** |
1210
a24de34d6423
Align subintervall with validity for yearly samples.
Tom Gottfried <tom@intevation.de>
parents:
1198
diff
changeset
|
96 * When the validity period was changed, align the subintervall |
a24de34d6423
Align subintervall with validity for yearly samples.
Tom Gottfried <tom@intevation.de>
parents:
1198
diff
changeset
|
97 * in case of yearly intervall. |
a24de34d6423
Align subintervall with validity for yearly samples.
Tom Gottfried <tom@intevation.de>
parents:
1198
diff
changeset
|
98 */ |
a24de34d6423
Align subintervall with validity for yearly samples.
Tom Gottfried <tom@intevation.de>
parents:
1198
diff
changeset
|
99 alignSubIntervall: function(field) { |
a24de34d6423
Align subintervall with validity for yearly samples.
Tom Gottfried <tom@intevation.de>
parents:
1198
diff
changeset
|
100 var form = field.up('messprogrammform'); |
a24de34d6423
Align subintervall with validity for yearly samples.
Tom Gottfried <tom@intevation.de>
parents:
1198
diff
changeset
|
101 var intervall = form.down('probenintervall').down('combobox') |
a24de34d6423
Align subintervall with validity for yearly samples.
Tom Gottfried <tom@intevation.de>
parents:
1198
diff
changeset
|
102 .getValue(); |
a24de34d6423
Align subintervall with validity for yearly samples.
Tom Gottfried <tom@intevation.de>
parents:
1198
diff
changeset
|
103 if (intervall == 'J') { |
a24de34d6423
Align subintervall with validity for yearly samples.
Tom Gottfried <tom@intevation.de>
parents:
1198
diff
changeset
|
104 if (field.getName() == 'gueltigVon') { |
a24de34d6423
Align subintervall with validity for yearly samples.
Tom Gottfried <tom@intevation.de>
parents:
1198
diff
changeset
|
105 form.down('[name=teilintervallVon]') |
a24de34d6423
Align subintervall with validity for yearly samples.
Tom Gottfried <tom@intevation.de>
parents:
1198
diff
changeset
|
106 .setValue(field.getValue()); |
a24de34d6423
Align subintervall with validity for yearly samples.
Tom Gottfried <tom@intevation.de>
parents:
1198
diff
changeset
|
107 } else { |
a24de34d6423
Align subintervall with validity for yearly samples.
Tom Gottfried <tom@intevation.de>
parents:
1198
diff
changeset
|
108 form.down('[name=teilintervallBis]') |
a24de34d6423
Align subintervall with validity for yearly samples.
Tom Gottfried <tom@intevation.de>
parents:
1198
diff
changeset
|
109 .setValue(field.getValue()); |
a24de34d6423
Align subintervall with validity for yearly samples.
Tom Gottfried <tom@intevation.de>
parents:
1198
diff
changeset
|
110 } |
a24de34d6423
Align subintervall with validity for yearly samples.
Tom Gottfried <tom@intevation.de>
parents:
1198
diff
changeset
|
111 } |
a24de34d6423
Align subintervall with validity for yearly samples.
Tom Gottfried <tom@intevation.de>
parents:
1198
diff
changeset
|
112 }, |
a24de34d6423
Align subintervall with validity for yearly samples.
Tom Gottfried <tom@intevation.de>
parents:
1198
diff
changeset
|
113 |
a24de34d6423
Align subintervall with validity for yearly samples.
Tom Gottfried <tom@intevation.de>
parents:
1198
diff
changeset
|
114 /** |
757
b8502964f5c3
Added missing files. Added MmtMockup
Dustin Demuth <dustin@intevation.de>
parents:
diff
changeset
|
115 * When the Slider was used, |
b8502964f5c3
Added missing files. Added MmtMockup
Dustin Demuth <dustin@intevation.de>
parents:
diff
changeset
|
116 * update the Value of the Teilintervallfields |
b8502964f5c3
Added missing files. Added MmtMockup
Dustin Demuth <dustin@intevation.de>
parents:
diff
changeset
|
117 */ |
b8502964f5c3
Added missing files. Added MmtMockup
Dustin Demuth <dustin@intevation.de>
parents:
diff
changeset
|
118 synchronizeFields: function(slider, newValue, thumb) { |
b8502964f5c3
Added missing files. Added MmtMockup
Dustin Demuth <dustin@intevation.de>
parents:
diff
changeset
|
119 var formPanel = slider.up('form'); |
b8502964f5c3
Added missing files. Added MmtMockup
Dustin Demuth <dustin@intevation.de>
parents:
diff
changeset
|
120 if (thumb.index == 0) { |
b8502964f5c3
Added missing files. Added MmtMockup
Dustin Demuth <dustin@intevation.de>
parents:
diff
changeset
|
121 formPanel.getForm() |
b8502964f5c3
Added missing files. Added MmtMockup
Dustin Demuth <dustin@intevation.de>
parents:
diff
changeset
|
122 .findField('teilintervallVon') |
b8502964f5c3
Added missing files. Added MmtMockup
Dustin Demuth <dustin@intevation.de>
parents:
diff
changeset
|
123 .setValue(newValue); |
b8502964f5c3
Added missing files. Added MmtMockup
Dustin Demuth <dustin@intevation.de>
parents:
diff
changeset
|
124 } |
b8502964f5c3
Added missing files. Added MmtMockup
Dustin Demuth <dustin@intevation.de>
parents:
diff
changeset
|
125 else if (thumb.index == 1) { |
b8502964f5c3
Added missing files. Added MmtMockup
Dustin Demuth <dustin@intevation.de>
parents:
diff
changeset
|
126 formPanel.getForm() |
b8502964f5c3
Added missing files. Added MmtMockup
Dustin Demuth <dustin@intevation.de>
parents:
diff
changeset
|
127 .findField('teilintervallBis') |
b8502964f5c3
Added missing files. Added MmtMockup
Dustin Demuth <dustin@intevation.de>
parents:
diff
changeset
|
128 .setValue(newValue); |
b8502964f5c3
Added missing files. Added MmtMockup
Dustin Demuth <dustin@intevation.de>
parents:
diff
changeset
|
129 } |
b8502964f5c3
Added missing files. Added MmtMockup
Dustin Demuth <dustin@intevation.de>
parents:
diff
changeset
|
130 |
b8502964f5c3
Added missing files. Added MmtMockup
Dustin Demuth <dustin@intevation.de>
parents:
diff
changeset
|
131 }, |
b8502964f5c3
Added missing files. Added MmtMockup
Dustin Demuth <dustin@intevation.de>
parents:
diff
changeset
|
132 |
b8502964f5c3
Added missing files. Added MmtMockup
Dustin Demuth <dustin@intevation.de>
parents:
diff
changeset
|
133 /** |
b8502964f5c3
Added missing files. Added MmtMockup
Dustin Demuth <dustin@intevation.de>
parents:
diff
changeset
|
134 * When the IntervallFields were used, |
b8502964f5c3
Added missing files. Added MmtMockup
Dustin Demuth <dustin@intevation.de>
parents:
diff
changeset
|
135 * update the Slider |
b8502964f5c3
Added missing files. Added MmtMockup
Dustin Demuth <dustin@intevation.de>
parents:
diff
changeset
|
136 */ |
b8502964f5c3
Added missing files. Added MmtMockup
Dustin Demuth <dustin@intevation.de>
parents:
diff
changeset
|
137 synchronizeSlider: function(field, newValue, oldValue) { |
b8502964f5c3
Added missing files. Added MmtMockup
Dustin Demuth <dustin@intevation.de>
parents:
diff
changeset
|
138 var formPanel = field.up('form'); |
b8502964f5c3
Added missing files. Added MmtMockup
Dustin Demuth <dustin@intevation.de>
parents:
diff
changeset
|
139 if (field.name == 'teilintervallVon') { |
b8502964f5c3
Added missing files. Added MmtMockup
Dustin Demuth <dustin@intevation.de>
parents:
diff
changeset
|
140 formPanel.down('probenintervallslider') |
b8502964f5c3
Added missing files. Added MmtMockup
Dustin Demuth <dustin@intevation.de>
parents:
diff
changeset
|
141 .setValue(0, newValue, false); |
b8502964f5c3
Added missing files. Added MmtMockup
Dustin Demuth <dustin@intevation.de>
parents:
diff
changeset
|
142 } |
b8502964f5c3
Added missing files. Added MmtMockup
Dustin Demuth <dustin@intevation.de>
parents:
diff
changeset
|
143 else if (field.name == 'teilintervallBis') { |
b8502964f5c3
Added missing files. Added MmtMockup
Dustin Demuth <dustin@intevation.de>
parents:
diff
changeset
|
144 formPanel.down('probenintervallslider') |
b8502964f5c3
Added missing files. Added MmtMockup
Dustin Demuth <dustin@intevation.de>
parents:
diff
changeset
|
145 .setValue(1, newValue, false); |
b8502964f5c3
Added missing files. Added MmtMockup
Dustin Demuth <dustin@intevation.de>
parents:
diff
changeset
|
146 } |
b8502964f5c3
Added missing files. Added MmtMockup
Dustin Demuth <dustin@intevation.de>
parents:
diff
changeset
|
147 |
b8502964f5c3
Added missing files. Added MmtMockup
Dustin Demuth <dustin@intevation.de>
parents:
diff
changeset
|
148 }, |
b8502964f5c3
Added missing files. Added MmtMockup
Dustin Demuth <dustin@intevation.de>
parents:
diff
changeset
|
149 /** |
972
24b5684d74d7
Set letzteAenderung in a Bunch of controllers.
Dustin Demuth <dustin@intevation.de>
parents:
857
diff
changeset
|
150 * The save function saves the content of the Messprogramm form. |
757
b8502964f5c3
Added missing files. Added MmtMockup
Dustin Demuth <dustin@intevation.de>
parents:
diff
changeset
|
151 * On success it will reload the Store, |
b8502964f5c3
Added missing files. Added MmtMockup
Dustin Demuth <dustin@intevation.de>
parents:
diff
changeset
|
152 * on failure, it will display an Errormessage |
b8502964f5c3
Added missing files. Added MmtMockup
Dustin Demuth <dustin@intevation.de>
parents:
diff
changeset
|
153 */ |
b8502964f5c3
Added missing files. Added MmtMockup
Dustin Demuth <dustin@intevation.de>
parents:
diff
changeset
|
154 save: function(button) { |
b8502964f5c3
Added missing files. Added MmtMockup
Dustin Demuth <dustin@intevation.de>
parents:
diff
changeset
|
155 var formPanel = button.up('form'); |
1231
e8dd06450f2c
Two lines later we rely on having a specific field, dirty or not.
Tom Gottfried <tom@intevation.de>
parents:
1217
diff
changeset
|
156 var data = formPanel.getForm().getFieldValues(); |
1217
4270da0f7d3b
Merged branch schema-update into default.
Tom Gottfried <tom@intevation.de>
parents:
1210
diff
changeset
|
157 var orte = Ext.data.StoreManager.get('orte'); |
757
b8502964f5c3
Added missing files. Added MmtMockup
Dustin Demuth <dustin@intevation.de>
parents:
diff
changeset
|
158 for (var key in data) { |
b8502964f5c3
Added missing files. Added MmtMockup
Dustin Demuth <dustin@intevation.de>
parents:
diff
changeset
|
159 formPanel.getForm().getRecord().set(key, data[key]); |
b8502964f5c3
Added missing files. Added MmtMockup
Dustin Demuth <dustin@intevation.de>
parents:
diff
changeset
|
160 } |
972
24b5684d74d7
Set letzteAenderung in a Bunch of controllers.
Dustin Demuth <dustin@intevation.de>
parents:
857
diff
changeset
|
161 if (!formPanel.getForm().getRecord().get('letzteAenderung')) { |
24b5684d74d7
Set letzteAenderung in a Bunch of controllers.
Dustin Demuth <dustin@intevation.de>
parents:
857
diff
changeset
|
162 formPanel.getForm().getRecord().data.letzteAenderung = new Date(); |
24b5684d74d7
Set letzteAenderung in a Bunch of controllers.
Dustin Demuth <dustin@intevation.de>
parents:
857
diff
changeset
|
163 } |
757
b8502964f5c3
Added missing files. Added MmtMockup
Dustin Demuth <dustin@intevation.de>
parents:
diff
changeset
|
164 formPanel.getForm().getRecord().save({ |
b8502964f5c3
Added missing files. Added MmtMockup
Dustin Demuth <dustin@intevation.de>
parents:
diff
changeset
|
165 success: function(record, response) { |
b8502964f5c3
Added missing files. Added MmtMockup
Dustin Demuth <dustin@intevation.de>
parents:
diff
changeset
|
166 var json = Ext.decode(response.response.responseText); |
b8502964f5c3
Added missing files. Added MmtMockup
Dustin Demuth <dustin@intevation.de>
parents:
diff
changeset
|
167 if (json) { |
b8502964f5c3
Added missing files. Added MmtMockup
Dustin Demuth <dustin@intevation.de>
parents:
diff
changeset
|
168 button.setDisabled(true); |
b8502964f5c3
Added missing files. Added MmtMockup
Dustin Demuth <dustin@intevation.de>
parents:
diff
changeset
|
169 button.up('toolbar').down('button[action=discard]') |
b8502964f5c3
Added missing files. Added MmtMockup
Dustin Demuth <dustin@intevation.de>
parents:
diff
changeset
|
170 .setDisabled(true); |
b8502964f5c3
Added missing files. Added MmtMockup
Dustin Demuth <dustin@intevation.de>
parents:
diff
changeset
|
171 formPanel.clearMessages(); |
b8502964f5c3
Added missing files. Added MmtMockup
Dustin Demuth <dustin@intevation.de>
parents:
diff
changeset
|
172 formPanel.setRecord(record); |
b8502964f5c3
Added missing files. Added MmtMockup
Dustin Demuth <dustin@intevation.de>
parents:
diff
changeset
|
173 formPanel.setMessages(json.errors, json.warnings); |
b8502964f5c3
Added missing files. Added MmtMockup
Dustin Demuth <dustin@intevation.de>
parents:
diff
changeset
|
174 if (response.action === 'create' && json.success) { |
b8502964f5c3
Added missing files. Added MmtMockup
Dustin Demuth <dustin@intevation.de>
parents:
diff
changeset
|
175 button.up('window').close(); |
759
b7484c7da2d4
Unified the Messprogramm windows. Unfortunately the Roweditor of Messmethodengrid is broken in this commit. This is due to the fact that the Mmt store is noit autoloaded anymore
Dustin Demuth <dustin@intevation.de>
parents:
757
diff
changeset
|
176 var win = Ext.create('Lada.view.window.Messprogramm', { |
757
b8502964f5c3
Added missing files. Added MmtMockup
Dustin Demuth <dustin@intevation.de>
parents:
diff
changeset
|
177 record: record |
b8502964f5c3
Added missing files. Added MmtMockup
Dustin Demuth <dustin@intevation.de>
parents:
diff
changeset
|
178 }); |
b8502964f5c3
Added missing files. Added MmtMockup
Dustin Demuth <dustin@intevation.de>
parents:
diff
changeset
|
179 win.show(); |
b8502964f5c3
Added missing files. Added MmtMockup
Dustin Demuth <dustin@intevation.de>
parents:
diff
changeset
|
180 win.initData(); |
b8502964f5c3
Added missing files. Added MmtMockup
Dustin Demuth <dustin@intevation.de>
parents:
diff
changeset
|
181 } |
b8502964f5c3
Added missing files. Added MmtMockup
Dustin Demuth <dustin@intevation.de>
parents:
diff
changeset
|
182 } |
b8502964f5c3
Added missing files. Added MmtMockup
Dustin Demuth <dustin@intevation.de>
parents:
diff
changeset
|
183 }, |
b8502964f5c3
Added missing files. Added MmtMockup
Dustin Demuth <dustin@intevation.de>
parents:
diff
changeset
|
184 failure: function(record, response) { |
b8502964f5c3
Added missing files. Added MmtMockup
Dustin Demuth <dustin@intevation.de>
parents:
diff
changeset
|
185 button.setDisabled(true); |
b8502964f5c3
Added missing files. Added MmtMockup
Dustin Demuth <dustin@intevation.de>
parents:
diff
changeset
|
186 button.up('toolbar').down('button[action=discard]') |
b8502964f5c3
Added missing files. Added MmtMockup
Dustin Demuth <dustin@intevation.de>
parents:
diff
changeset
|
187 .setDisabled(true); |
b8502964f5c3
Added missing files. Added MmtMockup
Dustin Demuth <dustin@intevation.de>
parents:
diff
changeset
|
188 var rec = formPanel.getForm().getRecord(); |
b8502964f5c3
Added missing files. Added MmtMockup
Dustin Demuth <dustin@intevation.de>
parents:
diff
changeset
|
189 rec.dirty = false; |
b8502964f5c3
Added missing files. Added MmtMockup
Dustin Demuth <dustin@intevation.de>
parents:
diff
changeset
|
190 formPanel.getForm().loadRecord(record); |
b8502964f5c3
Added missing files. Added MmtMockup
Dustin Demuth <dustin@intevation.de>
parents:
diff
changeset
|
191 var json = response.request.scope.reader.jsonData; |
b8502964f5c3
Added missing files. Added MmtMockup
Dustin Demuth <dustin@intevation.de>
parents:
diff
changeset
|
192 if (json) { |
b8502964f5c3
Added missing files. Added MmtMockup
Dustin Demuth <dustin@intevation.de>
parents:
diff
changeset
|
193 if(json.message){ |
b8502964f5c3
Added missing files. Added MmtMockup
Dustin Demuth <dustin@intevation.de>
parents:
diff
changeset
|
194 Ext.Msg.alert(Lada.getApplication().bundle.getMsg('err.msg.save.title') |
b8502964f5c3
Added missing files. Added MmtMockup
Dustin Demuth <dustin@intevation.de>
parents:
diff
changeset
|
195 +' #'+json.message, |
b8502964f5c3
Added missing files. Added MmtMockup
Dustin Demuth <dustin@intevation.de>
parents:
diff
changeset
|
196 Lada.getApplication().bundle.getMsg(json.message)); |
b8502964f5c3
Added missing files. Added MmtMockup
Dustin Demuth <dustin@intevation.de>
parents:
diff
changeset
|
197 } else { |
b8502964f5c3
Added missing files. Added MmtMockup
Dustin Demuth <dustin@intevation.de>
parents:
diff
changeset
|
198 Ext.Msg.alert(Lada.getApplication().bundle.getMsg('err.msg.save.title'), |
b8502964f5c3
Added missing files. Added MmtMockup
Dustin Demuth <dustin@intevation.de>
parents:
diff
changeset
|
199 Lada.getApplication().bundle.getMsg('err.msg.generic.body')); |
b8502964f5c3
Added missing files. Added MmtMockup
Dustin Demuth <dustin@intevation.de>
parents:
diff
changeset
|
200 } |
b8502964f5c3
Added missing files. Added MmtMockup
Dustin Demuth <dustin@intevation.de>
parents:
diff
changeset
|
201 formPanel.clearMessages(); |
b8502964f5c3
Added missing files. Added MmtMockup
Dustin Demuth <dustin@intevation.de>
parents:
diff
changeset
|
202 formPanel.setMessages(json.errors, json.warnings); |
b8502964f5c3
Added missing files. Added MmtMockup
Dustin Demuth <dustin@intevation.de>
parents:
diff
changeset
|
203 } else { |
b8502964f5c3
Added missing files. Added MmtMockup
Dustin Demuth <dustin@intevation.de>
parents:
diff
changeset
|
204 Ext.Msg.alert(Lada.getApplication().bundle.getMsg('err.msg.save.title'), |
b8502964f5c3
Added missing files. Added MmtMockup
Dustin Demuth <dustin@intevation.de>
parents:
diff
changeset
|
205 Lada.getApplication().bundle.getMsg('err.msg.response.body')); |
b8502964f5c3
Added missing files. Added MmtMockup
Dustin Demuth <dustin@intevation.de>
parents:
diff
changeset
|
206 } |
b8502964f5c3
Added missing files. Added MmtMockup
Dustin Demuth <dustin@intevation.de>
parents:
diff
changeset
|
207 |
b8502964f5c3
Added missing files. Added MmtMockup
Dustin Demuth <dustin@intevation.de>
parents:
diff
changeset
|
208 } |
b8502964f5c3
Added missing files. Added MmtMockup
Dustin Demuth <dustin@intevation.de>
parents:
diff
changeset
|
209 }); |
b8502964f5c3
Added missing files. Added MmtMockup
Dustin Demuth <dustin@intevation.de>
parents:
diff
changeset
|
210 }, |
b8502964f5c3
Added missing files. Added MmtMockup
Dustin Demuth <dustin@intevation.de>
parents:
diff
changeset
|
211 |
b8502964f5c3
Added missing files. Added MmtMockup
Dustin Demuth <dustin@intevation.de>
parents:
diff
changeset
|
212 /** |
1210
a24de34d6423
Align subintervall with validity for yearly samples.
Tom Gottfried <tom@intevation.de>
parents:
1198
diff
changeset
|
213 * The discard function resets the form |
757
b8502964f5c3
Added missing files. Added MmtMockup
Dustin Demuth <dustin@intevation.de>
parents:
diff
changeset
|
214 * to its original state. |
b8502964f5c3
Added missing files. Added MmtMockup
Dustin Demuth <dustin@intevation.de>
parents:
diff
changeset
|
215 */ |
b8502964f5c3
Added missing files. Added MmtMockup
Dustin Demuth <dustin@intevation.de>
parents:
diff
changeset
|
216 discard: function(button) { |
b8502964f5c3
Added missing files. Added MmtMockup
Dustin Demuth <dustin@intevation.de>
parents:
diff
changeset
|
217 var formPanel = button.up('form'); |
b8502964f5c3
Added missing files. Added MmtMockup
Dustin Demuth <dustin@intevation.de>
parents:
diff
changeset
|
218 formPanel.getForm().loadRecord(formPanel.getForm().getRecord()); |
b8502964f5c3
Added missing files. Added MmtMockup
Dustin Demuth <dustin@intevation.de>
parents:
diff
changeset
|
219 formPanel.getForm().owner.populateIntervall( |
b8502964f5c3
Added missing files. Added MmtMockup
Dustin Demuth <dustin@intevation.de>
parents:
diff
changeset
|
220 formPanel.getForm().getRecord()); |
b8502964f5c3
Added missing files. Added MmtMockup
Dustin Demuth <dustin@intevation.de>
parents:
diff
changeset
|
221 }, |
b8502964f5c3
Added missing files. Added MmtMockup
Dustin Demuth <dustin@intevation.de>
parents:
diff
changeset
|
222 |
b8502964f5c3
Added missing files. Added MmtMockup
Dustin Demuth <dustin@intevation.de>
parents:
diff
changeset
|
223 /** |
b8502964f5c3
Added missing files. Added MmtMockup
Dustin Demuth <dustin@intevation.de>
parents:
diff
changeset
|
224 * The dirtyForm function enables or disables the save and discard |
b8502964f5c3
Added missing files. Added MmtMockup
Dustin Demuth <dustin@intevation.de>
parents:
diff
changeset
|
225 * button which are present in the toolbar of the form. |
b8502964f5c3
Added missing files. Added MmtMockup
Dustin Demuth <dustin@intevation.de>
parents:
diff
changeset
|
226 * The Buttons are only active if the content of the form was altered |
b8502964f5c3
Added missing files. Added MmtMockup
Dustin Demuth <dustin@intevation.de>
parents:
diff
changeset
|
227 * (the form is dirty). |
b8502964f5c3
Added missing files. Added MmtMockup
Dustin Demuth <dustin@intevation.de>
parents:
diff
changeset
|
228 */ |
b8502964f5c3
Added missing files. Added MmtMockup
Dustin Demuth <dustin@intevation.de>
parents:
diff
changeset
|
229 dirtyForm: function(form, dirty) { |
b8502964f5c3
Added missing files. Added MmtMockup
Dustin Demuth <dustin@intevation.de>
parents:
diff
changeset
|
230 if (dirty) { |
b8502964f5c3
Added missing files. Added MmtMockup
Dustin Demuth <dustin@intevation.de>
parents:
diff
changeset
|
231 form.owner.down('button[action=save]').setDisabled(false); |
b8502964f5c3
Added missing files. Added MmtMockup
Dustin Demuth <dustin@intevation.de>
parents:
diff
changeset
|
232 form.owner.down('button[action=discard]').setDisabled(false); |
b8502964f5c3
Added missing files. Added MmtMockup
Dustin Demuth <dustin@intevation.de>
parents:
diff
changeset
|
233 } |
b8502964f5c3
Added missing files. Added MmtMockup
Dustin Demuth <dustin@intevation.de>
parents:
diff
changeset
|
234 else { |
b8502964f5c3
Added missing files. Added MmtMockup
Dustin Demuth <dustin@intevation.de>
parents:
diff
changeset
|
235 form.owner.down('button[action=save]').setDisabled(true); |
b8502964f5c3
Added missing files. Added MmtMockup
Dustin Demuth <dustin@intevation.de>
parents:
diff
changeset
|
236 form.owner.down('button[action=discard]').setDisabled(true); |
b8502964f5c3
Added missing files. Added MmtMockup
Dustin Demuth <dustin@intevation.de>
parents:
diff
changeset
|
237 } |
b8502964f5c3
Added missing files. Added MmtMockup
Dustin Demuth <dustin@intevation.de>
parents:
diff
changeset
|
238 }, |
b8502964f5c3
Added missing files. Added MmtMockup
Dustin Demuth <dustin@intevation.de>
parents:
diff
changeset
|
239 |
b8502964f5c3
Added missing files. Added MmtMockup
Dustin Demuth <dustin@intevation.de>
parents:
diff
changeset
|
240 /** |
b8502964f5c3
Added missing files. Added MmtMockup
Dustin Demuth <dustin@intevation.de>
parents:
diff
changeset
|
241 * checkPeriod() is called when a fields defining an intervall |
b8502964f5c3
Added missing files. Added MmtMockup
Dustin Demuth <dustin@intevation.de>
parents:
diff
changeset
|
242 * were modified |
b8502964f5c3
Added missing files. Added MmtMockup
Dustin Demuth <dustin@intevation.de>
parents:
diff
changeset
|
243 * The function validates if the start is smaller than end. |
b8502964f5c3
Added missing files. Added MmtMockup
Dustin Demuth <dustin@intevation.de>
parents:
diff
changeset
|
244 */ |
b8502964f5c3
Added missing files. Added MmtMockup
Dustin Demuth <dustin@intevation.de>
parents:
diff
changeset
|
245 checkPeriod: function(field) { |
b8502964f5c3
Added missing files. Added MmtMockup
Dustin Demuth <dustin@intevation.de>
parents:
diff
changeset
|
246 // This field might be a field within a Period. |
b8502964f5c3
Added missing files. Added MmtMockup
Dustin Demuth <dustin@intevation.de>
parents:
diff
changeset
|
247 // Search for Partner field (period: end/start) and validate |
b8502964f5c3
Added missing files. Added MmtMockup
Dustin Demuth <dustin@intevation.de>
parents:
diff
changeset
|
248 // End Before Start validation |
b8502964f5c3
Added missing files. Added MmtMockup
Dustin Demuth <dustin@intevation.de>
parents:
diff
changeset
|
249 if (field.period) { |
b8502964f5c3
Added missing files. Added MmtMockup
Dustin Demuth <dustin@intevation.de>
parents:
diff
changeset
|
250 var partners = new Array(); |
1194
c63acd44f8ca
Fix regression of 40a07eb873bf to display errors and warnings again.
Tom Gottfried <tom@intevation.de>
parents:
1108
diff
changeset
|
251 partners[0] = field.up('fieldset') |
c63acd44f8ca
Fix regression of 40a07eb873bf to display errors and warnings again.
Tom Gottfried <tom@intevation.de>
parents:
1108
diff
changeset
|
252 .down('numberfield[period=start]').getValue(); |
c63acd44f8ca
Fix regression of 40a07eb873bf to display errors and warnings again.
Tom Gottfried <tom@intevation.de>
parents:
1108
diff
changeset
|
253 partners[1] = field.up('fieldset') |
c63acd44f8ca
Fix regression of 40a07eb873bf to display errors and warnings again.
Tom Gottfried <tom@intevation.de>
parents:
1108
diff
changeset
|
254 .down('numberfield[period=end]').getValue(); |
757
b8502964f5c3
Added missing files. Added MmtMockup
Dustin Demuth <dustin@intevation.de>
parents:
diff
changeset
|
255 if (partners[0] && partners[1] && partners[0] > partners [1]) { |
b8502964f5c3
Added missing files. Added MmtMockup
Dustin Demuth <dustin@intevation.de>
parents:
diff
changeset
|
256 var msg = Lada.getApplication().bundle.getMsg('662'); |
1197
112fd60f1fb4
It is an error to specify invalid intervals.
Tom Gottfried <tom@intevation.de>
parents:
1194
diff
changeset
|
257 field.up('fieldset').showWarningOrError(false, '', true, msg); |
757
b8502964f5c3
Added missing files. Added MmtMockup
Dustin Demuth <dustin@intevation.de>
parents:
diff
changeset
|
258 } else { |
b8502964f5c3
Added missing files. Added MmtMockup
Dustin Demuth <dustin@intevation.de>
parents:
diff
changeset
|
259 field.up('fieldset').clearMessages(); |
b8502964f5c3
Added missing files. Added MmtMockup
Dustin Demuth <dustin@intevation.de>
parents:
diff
changeset
|
260 } |
b8502964f5c3
Added missing files. Added MmtMockup
Dustin Demuth <dustin@intevation.de>
parents:
diff
changeset
|
261 } |
777 | 262 }, |
263 | |
784
f0b26df02157
Handle deskriptoren in messprogramm like in probe.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
777
diff
changeset
|
264 deskriptorSelect: function(field, records) { |
f0b26df02157
Handle deskriptoren in messprogramm like in probe.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
777
diff
changeset
|
265 var desk = field.up('deskriptor'); |
f0b26df02157
Handle deskriptoren in messprogramm like in probe.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
777
diff
changeset
|
266 var media = field.up('messprogrammform').down('textfield[name="mediaDesk"]'); |
f0b26df02157
Handle deskriptoren in messprogramm like in probe.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
777
diff
changeset
|
267 var current = media.getValue().split(' '); |
1088
60af12dd4a13
Decreased descriptor string parts in Messprogramm.
Michael Stanko <mstanko@bfs.de>
parents:
1086
diff
changeset
|
268 if (current.length < 12) { |
1108 | 269 var value; |
784
f0b26df02157
Handle deskriptoren in messprogramm like in probe.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
777
diff
changeset
|
270 for (var i = 0; i <= 12; i++) { |
f0b26df02157
Handle deskriptoren in messprogramm like in probe.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
777
diff
changeset
|
271 if (i === 0) { |
f0b26df02157
Handle deskriptoren in messprogramm like in probe.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
777
diff
changeset
|
272 current.push('D:'); |
f0b26df02157
Handle deskriptoren in messprogramm like in probe.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
777
diff
changeset
|
273 } |
f0b26df02157
Handle deskriptoren in messprogramm like in probe.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
777
diff
changeset
|
274 else if (i === desk.layer + 1) { |
f0b26df02157
Handle deskriptoren in messprogramm like in probe.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
777
diff
changeset
|
275 var value; |
f0b26df02157
Handle deskriptoren in messprogramm like in probe.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
777
diff
changeset
|
276 if (records[0].get('sn') < 10) { |
f0b26df02157
Handle deskriptoren in messprogramm like in probe.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
777
diff
changeset
|
277 value = '0' + records[0].get('sn'); |
f0b26df02157
Handle deskriptoren in messprogramm like in probe.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
777
diff
changeset
|
278 } |
f0b26df02157
Handle deskriptoren in messprogramm like in probe.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
777
diff
changeset
|
279 else { |
f0b26df02157
Handle deskriptoren in messprogramm like in probe.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
777
diff
changeset
|
280 value = records[0].get('sn'); |
f0b26df02157
Handle deskriptoren in messprogramm like in probe.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
777
diff
changeset
|
281 } |
f0b26df02157
Handle deskriptoren in messprogramm like in probe.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
777
diff
changeset
|
282 current.push(value); |
f0b26df02157
Handle deskriptoren in messprogramm like in probe.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
777
diff
changeset
|
283 } |
f0b26df02157
Handle deskriptoren in messprogramm like in probe.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
777
diff
changeset
|
284 else { |
f0b26df02157
Handle deskriptoren in messprogramm like in probe.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
777
diff
changeset
|
285 current.push('00'); |
f0b26df02157
Handle deskriptoren in messprogramm like in probe.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
777
diff
changeset
|
286 } |
f0b26df02157
Handle deskriptoren in messprogramm like in probe.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
777
diff
changeset
|
287 } |
f0b26df02157
Handle deskriptoren in messprogramm like in probe.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
777
diff
changeset
|
288 } |
f0b26df02157
Handle deskriptoren in messprogramm like in probe.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
777
diff
changeset
|
289 else { |
f0b26df02157
Handle deskriptoren in messprogramm like in probe.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
777
diff
changeset
|
290 var value; |
f0b26df02157
Handle deskriptoren in messprogramm like in probe.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
777
diff
changeset
|
291 if (records[0].get('sn') < 10) { |
f0b26df02157
Handle deskriptoren in messprogramm like in probe.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
777
diff
changeset
|
292 value = '0' + records[0].get('sn'); |
f0b26df02157
Handle deskriptoren in messprogramm like in probe.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
777
diff
changeset
|
293 } |
f0b26df02157
Handle deskriptoren in messprogramm like in probe.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
777
diff
changeset
|
294 else { |
f0b26df02157
Handle deskriptoren in messprogramm like in probe.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
777
diff
changeset
|
295 value = records[0].get('sn'); |
f0b26df02157
Handle deskriptoren in messprogramm like in probe.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
777
diff
changeset
|
296 } |
f0b26df02157
Handle deskriptoren in messprogramm like in probe.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
777
diff
changeset
|
297 current[desk.layer + 1] = value; |
1086
61cc583c3649
Messprogramm form redesign
Michael Stanko <mstanko@bfs.de>
parents:
1070
diff
changeset
|
298 if (desk.layer < 2) { |
1088
60af12dd4a13
Decreased descriptor string parts in Messprogramm.
Michael Stanko <mstanko@bfs.de>
parents:
1086
diff
changeset
|
299 for (var i = desk.layer + 2; i < 12; i++) { |
1086
61cc583c3649
Messprogramm form redesign
Michael Stanko <mstanko@bfs.de>
parents:
1070
diff
changeset
|
300 current[i] = '00'; |
61cc583c3649
Messprogramm form redesign
Michael Stanko <mstanko@bfs.de>
parents:
1070
diff
changeset
|
301 } |
61cc583c3649
Messprogramm form redesign
Michael Stanko <mstanko@bfs.de>
parents:
1070
diff
changeset
|
302 this.clearChildDesk(desk); |
61cc583c3649
Messprogramm form redesign
Michael Stanko <mstanko@bfs.de>
parents:
1070
diff
changeset
|
303 } |
61cc583c3649
Messprogramm form redesign
Michael Stanko <mstanko@bfs.de>
parents:
1070
diff
changeset
|
304 else if (desk.layer === 2 && current[1] === '01') { |
61cc583c3649
Messprogramm form redesign
Michael Stanko <mstanko@bfs.de>
parents:
1070
diff
changeset
|
305 current[4] = '00'; |
61cc583c3649
Messprogramm form redesign
Michael Stanko <mstanko@bfs.de>
parents:
1070
diff
changeset
|
306 desk.up('fieldset').down('deskriptor[layer=3]').clearValue(); |
61cc583c3649
Messprogramm form redesign
Michael Stanko <mstanko@bfs.de>
parents:
1070
diff
changeset
|
307 } |
784
f0b26df02157
Handle deskriptoren in messprogramm like in probe.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
777
diff
changeset
|
308 } |
f0b26df02157
Handle deskriptoren in messprogramm like in probe.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
777
diff
changeset
|
309 media.setValue(current.join(' ').trim()); |
1108 | 310 |
1276
8f37f8832c4a
fix mediadescription in probe form
Michael Stanko <mstanko@bfs.de>
parents:
1250
diff
changeset
|
311 if (current[0].length == 0) { |
8f37f8832c4a
fix mediadescription in probe form
Michael Stanko <mstanko@bfs.de>
parents:
1250
diff
changeset
|
312 current.splice(0,1); |
8f37f8832c4a
fix mediadescription in probe form
Michael Stanko <mstanko@bfs.de>
parents:
1250
diff
changeset
|
313 } |
8f37f8832c4a
fix mediadescription in probe form
Michael Stanko <mstanko@bfs.de>
parents:
1250
diff
changeset
|
314 var mediatext = field.up('messprogrammform').down('textfield[name="media"]'); |
8f37f8832c4a
fix mediadescription in probe form
Michael Stanko <mstanko@bfs.de>
parents:
1250
diff
changeset
|
315 |
8f37f8832c4a
fix mediadescription in probe form
Michael Stanko <mstanko@bfs.de>
parents:
1250
diff
changeset
|
316 if ( (desk.layer === 0 ) && (records[0].get('sn') === 0) ){ |
8f37f8832c4a
fix mediadescription in probe form
Michael Stanko <mstanko@bfs.de>
parents:
1250
diff
changeset
|
317 mediatext.setValue(''); |
8f37f8832c4a
fix mediadescription in probe form
Michael Stanko <mstanko@bfs.de>
parents:
1250
diff
changeset
|
318 } else { |
1359
49efc1cc0eac
Remove trailing whitespace.
Tom Gottfried <tom@intevation.de>
parents:
1358
diff
changeset
|
319 if ( current[1] === '01') { |
1276
8f37f8832c4a
fix mediadescription in probe form
Michael Stanko <mstanko@bfs.de>
parents:
1250
diff
changeset
|
320 if ( (current[4] !== '00') && (desk.layer === 3) ) { |
8f37f8832c4a
fix mediadescription in probe form
Michael Stanko <mstanko@bfs.de>
parents:
1250
diff
changeset
|
321 mediatext.setValue(records[0].data.beschreibung); |
8f37f8832c4a
fix mediadescription in probe form
Michael Stanko <mstanko@bfs.de>
parents:
1250
diff
changeset
|
322 } else if ( (current[3] !== '00') && (desk.layer === 2) ) { |
8f37f8832c4a
fix mediadescription in probe form
Michael Stanko <mstanko@bfs.de>
parents:
1250
diff
changeset
|
323 mediatext.setValue(records[0].data.beschreibung); |
8f37f8832c4a
fix mediadescription in probe form
Michael Stanko <mstanko@bfs.de>
parents:
1250
diff
changeset
|
324 } else if ( (current[2] !== '00') && (desk.layer === 1) ) { |
8f37f8832c4a
fix mediadescription in probe form
Michael Stanko <mstanko@bfs.de>
parents:
1250
diff
changeset
|
325 mediatext.setValue(records[0].data.beschreibung); |
8f37f8832c4a
fix mediadescription in probe form
Michael Stanko <mstanko@bfs.de>
parents:
1250
diff
changeset
|
326 } else if ( (current[1] !== '00') && (desk.layer === 0 )) { |
8f37f8832c4a
fix mediadescription in probe form
Michael Stanko <mstanko@bfs.de>
parents:
1250
diff
changeset
|
327 mediatext.setValue(records[0].data.beschreibung); |
1359
49efc1cc0eac
Remove trailing whitespace.
Tom Gottfried <tom@intevation.de>
parents:
1358
diff
changeset
|
328 } |
1108 | 329 } |
1276
8f37f8832c4a
fix mediadescription in probe form
Michael Stanko <mstanko@bfs.de>
parents:
1250
diff
changeset
|
330 |
1359
49efc1cc0eac
Remove trailing whitespace.
Tom Gottfried <tom@intevation.de>
parents:
1358
diff
changeset
|
331 if ( current[1] !== '01') { |
1276
8f37f8832c4a
fix mediadescription in probe form
Michael Stanko <mstanko@bfs.de>
parents:
1250
diff
changeset
|
332 if ((current[2] !== '00') && (desk.layer === 1 )) { |
8f37f8832c4a
fix mediadescription in probe form
Michael Stanko <mstanko@bfs.de>
parents:
1250
diff
changeset
|
333 mediatext.setValue(records[0].data.beschreibung); |
8f37f8832c4a
fix mediadescription in probe form
Michael Stanko <mstanko@bfs.de>
parents:
1250
diff
changeset
|
334 } else if ((current[1] !== '00') && (desk.layer === 0 )) { |
8f37f8832c4a
fix mediadescription in probe form
Michael Stanko <mstanko@bfs.de>
parents:
1250
diff
changeset
|
335 mediatext.setValue(records[0].data.beschreibung); |
1359
49efc1cc0eac
Remove trailing whitespace.
Tom Gottfried <tom@intevation.de>
parents:
1358
diff
changeset
|
336 } |
1276
8f37f8832c4a
fix mediadescription in probe form
Michael Stanko <mstanko@bfs.de>
parents:
1250
diff
changeset
|
337 } |
8f37f8832c4a
fix mediadescription in probe form
Michael Stanko <mstanko@bfs.de>
parents:
1250
diff
changeset
|
338 } |
784
f0b26df02157
Handle deskriptoren in messprogramm like in probe.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
777
diff
changeset
|
339 }, |
f0b26df02157
Handle deskriptoren in messprogramm like in probe.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
777
diff
changeset
|
340 |
1086
61cc583c3649
Messprogramm form redesign
Michael Stanko <mstanko@bfs.de>
parents:
1070
diff
changeset
|
341 clearChildDesk: function(field) { |
784
f0b26df02157
Handle deskriptoren in messprogramm like in probe.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
777
diff
changeset
|
342 var allS = field.up('fieldset').items.items; |
f0b26df02157
Handle deskriptoren in messprogramm like in probe.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
777
diff
changeset
|
343 for (var i = field.layer + 1; i < 12; i++) { |
f0b26df02157
Handle deskriptoren in messprogramm like in probe.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
777
diff
changeset
|
344 allS[i].clearValue(); |
f0b26df02157
Handle deskriptoren in messprogramm like in probe.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
777
diff
changeset
|
345 } |
f0b26df02157
Handle deskriptoren in messprogramm like in probe.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
777
diff
changeset
|
346 } |
1086
61cc583c3649
Messprogramm form redesign
Michael Stanko <mstanko@bfs.de>
parents:
1070
diff
changeset
|
347 |
784
f0b26df02157
Handle deskriptoren in messprogramm like in probe.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
777
diff
changeset
|
348 }); |