Mercurial > lada > lada-client
annotate app/view/form/Ortserstellung.js @ 1291:e9f812528324
ortszuordnung form changes
removed discard button
cursor change if new position is to be selected on map
display of GemeindeId and Staat in ortzuordnung
author | Maximilian Krambach <mkrambach@intevation.de> |
---|---|
date | Wed, 01 Feb 2017 18:00:59 +0100 |
parents | bfdc00c24baf |
children | c1b7db04b39c |
rev | line source |
---|---|
1279
291df0037835
Ortszuordnung window: create, change and display (wip)
Maximilian Krambach <mkrambach@intevation.de>
parents:
diff
changeset
|
1 /* Copyright (C) 2013 by Bundesamt fuer Strahlenschutz |
291df0037835
Ortszuordnung window: create, change and display (wip)
Maximilian Krambach <mkrambach@intevation.de>
parents:
diff
changeset
|
2 * Software engineering by Intevation GmbH |
291df0037835
Ortszuordnung window: create, change and display (wip)
Maximilian Krambach <mkrambach@intevation.de>
parents:
diff
changeset
|
3 * |
291df0037835
Ortszuordnung window: create, change and display (wip)
Maximilian Krambach <mkrambach@intevation.de>
parents:
diff
changeset
|
4 * This file is Free Software under the GNU GPL (v>=3) |
291df0037835
Ortszuordnung window: create, change and display (wip)
Maximilian Krambach <mkrambach@intevation.de>
parents:
diff
changeset
|
5 * and comes with ABSOLUTELY NO WARRANTY! Check out |
291df0037835
Ortszuordnung window: create, change and display (wip)
Maximilian Krambach <mkrambach@intevation.de>
parents:
diff
changeset
|
6 * the documentation coming with IMIS-Labordaten-Application for details. |
291df0037835
Ortszuordnung window: create, change and display (wip)
Maximilian Krambach <mkrambach@intevation.de>
parents:
diff
changeset
|
7 */ |
291df0037835
Ortszuordnung window: create, change and display (wip)
Maximilian Krambach <mkrambach@intevation.de>
parents:
diff
changeset
|
8 |
291df0037835
Ortszuordnung window: create, change and display (wip)
Maximilian Krambach <mkrambach@intevation.de>
parents:
diff
changeset
|
9 /** |
291df0037835
Ortszuordnung window: create, change and display (wip)
Maximilian Krambach <mkrambach@intevation.de>
parents:
diff
changeset
|
10 * Form to create a new Messpunkt |
291df0037835
Ortszuordnung window: create, change and display (wip)
Maximilian Krambach <mkrambach@intevation.de>
parents:
diff
changeset
|
11 */ |
291df0037835
Ortszuordnung window: create, change and display (wip)
Maximilian Krambach <mkrambach@intevation.de>
parents:
diff
changeset
|
12 Ext.define('Lada.view.form.Ortserstellung', { |
291df0037835
Ortszuordnung window: create, change and display (wip)
Maximilian Krambach <mkrambach@intevation.de>
parents:
diff
changeset
|
13 extend: 'Ext.form.Panel', |
291df0037835
Ortszuordnung window: create, change and display (wip)
Maximilian Krambach <mkrambach@intevation.de>
parents:
diff
changeset
|
14 alias: 'widget.ortserstellungsform', |
291df0037835
Ortszuordnung window: create, change and display (wip)
Maximilian Krambach <mkrambach@intevation.de>
parents:
diff
changeset
|
15 requires: [ |
291df0037835
Ortszuordnung window: create, change and display (wip)
Maximilian Krambach <mkrambach@intevation.de>
parents:
diff
changeset
|
16 'Lada.view.widget.Verwaltungseinheit', |
291df0037835
Ortszuordnung window: create, change and display (wip)
Maximilian Krambach <mkrambach@intevation.de>
parents:
diff
changeset
|
17 'Lada.view.widget.Staat' |
291df0037835
Ortszuordnung window: create, change and display (wip)
Maximilian Krambach <mkrambach@intevation.de>
parents:
diff
changeset
|
18 ], |
1284
faecbb446a04
Ortserstellung: new Messpunkt from map, clone or form
Maximilian Krambach <mkrambach@intevation.de>
parents:
1279
diff
changeset
|
19 model: null, |
1279
291df0037835
Ortszuordnung window: create, change and display (wip)
Maximilian Krambach <mkrambach@intevation.de>
parents:
diff
changeset
|
20 |
1289
bfdc00c24baf
Ortszuordnung for messprogramm and probe using same form
Maximilian Krambach <mkrambach@intevation.de>
parents:
1288
diff
changeset
|
21 margin: 5, |
bfdc00c24baf
Ortszuordnung for messprogramm and probe using same form
Maximilian Krambach <mkrambach@intevation.de>
parents:
1288
diff
changeset
|
22 |
1284
faecbb446a04
Ortserstellung: new Messpunkt from map, clone or form
Maximilian Krambach <mkrambach@intevation.de>
parents:
1279
diff
changeset
|
23 record: null, |
1279
291df0037835
Ortszuordnung window: create, change and display (wip)
Maximilian Krambach <mkrambach@intevation.de>
parents:
diff
changeset
|
24 |
291df0037835
Ortszuordnung window: create, change and display (wip)
Maximilian Krambach <mkrambach@intevation.de>
parents:
diff
changeset
|
25 initComponent: function() { |
291df0037835
Ortszuordnung window: create, change and display (wip)
Maximilian Krambach <mkrambach@intevation.de>
parents:
diff
changeset
|
26 var i18n = Lada.getApplication().bundle; |
291df0037835
Ortszuordnung window: create, change and display (wip)
Maximilian Krambach <mkrambach@intevation.de>
parents:
diff
changeset
|
27 var me = this; |
1284
faecbb446a04
Ortserstellung: new Messpunkt from map, clone or form
Maximilian Krambach <mkrambach@intevation.de>
parents:
1279
diff
changeset
|
28 this.items = [{ |
faecbb446a04
Ortserstellung: new Messpunkt from map, clone or form
Maximilian Krambach <mkrambach@intevation.de>
parents:
1279
diff
changeset
|
29 xtype: 'netzbetreiber', |
faecbb446a04
Ortserstellung: new Messpunkt from map, clone or form
Maximilian Krambach <mkrambach@intevation.de>
parents:
1279
diff
changeset
|
30 editable: false, |
faecbb446a04
Ortserstellung: new Messpunkt from map, clone or form
Maximilian Krambach <mkrambach@intevation.de>
parents:
1279
diff
changeset
|
31 readOnly: true, |
faecbb446a04
Ortserstellung: new Messpunkt from map, clone or form
Maximilian Krambach <mkrambach@intevation.de>
parents:
1279
diff
changeset
|
32 submitValue: true, |
1289
bfdc00c24baf
Ortszuordnung for messprogramm and probe using same form
Maximilian Krambach <mkrambach@intevation.de>
parents:
1288
diff
changeset
|
33 border: 0, |
1284
faecbb446a04
Ortserstellung: new Messpunkt from map, clone or form
Maximilian Krambach <mkrambach@intevation.de>
parents:
1279
diff
changeset
|
34 fieldLabel: i18n.getMsg('netzbetreiberId'), |
1289
bfdc00c24baf
Ortszuordnung for messprogramm and probe using same form
Maximilian Krambach <mkrambach@intevation.de>
parents:
1288
diff
changeset
|
35 labelWidth: 125, |
1288
08085b7d1d0b
Ortszuordnung: Search, new orte, display and validity check
Maximilian Krambach <mkrambach@intevation.de>
parents:
1284
diff
changeset
|
36 value: Lada.netzbetreiber[0] |
1279
291df0037835
Ortszuordnung window: create, change and display (wip)
Maximilian Krambach <mkrambach@intevation.de>
parents:
diff
changeset
|
37 }, { |
1284
faecbb446a04
Ortserstellung: new Messpunkt from map, clone or form
Maximilian Krambach <mkrambach@intevation.de>
parents:
1279
diff
changeset
|
38 xtype: 'checkbox', |
faecbb446a04
Ortserstellung: new Messpunkt from map, clone or form
Maximilian Krambach <mkrambach@intevation.de>
parents:
1279
diff
changeset
|
39 name: 'aktiv', |
faecbb446a04
Ortserstellung: new Messpunkt from map, clone or form
Maximilian Krambach <mkrambach@intevation.de>
parents:
1279
diff
changeset
|
40 fieldLabel: 'aktiv:' |
faecbb446a04
Ortserstellung: new Messpunkt from map, clone or form
Maximilian Krambach <mkrambach@intevation.de>
parents:
1279
diff
changeset
|
41 },{ |
faecbb446a04
Ortserstellung: new Messpunkt from map, clone or form
Maximilian Krambach <mkrambach@intevation.de>
parents:
1279
diff
changeset
|
42 xtype: 'staat', |
faecbb446a04
Ortserstellung: new Messpunkt from map, clone or form
Maximilian Krambach <mkrambach@intevation.de>
parents:
1279
diff
changeset
|
43 labelWidth: 125, |
faecbb446a04
Ortserstellung: new Messpunkt from map, clone or form
Maximilian Krambach <mkrambach@intevation.de>
parents:
1279
diff
changeset
|
44 fieldLabel: i18n.getMsg('staat'), |
faecbb446a04
Ortserstellung: new Messpunkt from map, clone or form
Maximilian Krambach <mkrambach@intevation.de>
parents:
1279
diff
changeset
|
45 name: 'staatId', |
1289
bfdc00c24baf
Ortszuordnung for messprogramm and probe using same form
Maximilian Krambach <mkrambach@intevation.de>
parents:
1288
diff
changeset
|
46 forceSelection: true, |
1284
faecbb446a04
Ortserstellung: new Messpunkt from map, clone or form
Maximilian Krambach <mkrambach@intevation.de>
parents:
1279
diff
changeset
|
47 listeners: { |
faecbb446a04
Ortserstellung: new Messpunkt from map, clone or form
Maximilian Krambach <mkrambach@intevation.de>
parents:
1279
diff
changeset
|
48 change: { |
faecbb446a04
Ortserstellung: new Messpunkt from map, clone or form
Maximilian Krambach <mkrambach@intevation.de>
parents:
1279
diff
changeset
|
49 fn: function() { me.checkCommitEnabled() } |
1279
291df0037835
Ortszuordnung window: create, change and display (wip)
Maximilian Krambach <mkrambach@intevation.de>
parents:
diff
changeset
|
50 } |
1284
faecbb446a04
Ortserstellung: new Messpunkt from map, clone or form
Maximilian Krambach <mkrambach@intevation.de>
parents:
1279
diff
changeset
|
51 } |
faecbb446a04
Ortserstellung: new Messpunkt from map, clone or form
Maximilian Krambach <mkrambach@intevation.de>
parents:
1279
diff
changeset
|
52 }, { |
faecbb446a04
Ortserstellung: new Messpunkt from map, clone or form
Maximilian Krambach <mkrambach@intevation.de>
parents:
1279
diff
changeset
|
53 xtype: 'verwaltungseinheit', |
faecbb446a04
Ortserstellung: new Messpunkt from map, clone or form
Maximilian Krambach <mkrambach@intevation.de>
parents:
1279
diff
changeset
|
54 labelWidth: 125, |
faecbb446a04
Ortserstellung: new Messpunkt from map, clone or form
Maximilian Krambach <mkrambach@intevation.de>
parents:
1279
diff
changeset
|
55 fieldLabel: i18n.getMsg('orte.gemeinde'), |
1289
bfdc00c24baf
Ortszuordnung for messprogramm and probe using same form
Maximilian Krambach <mkrambach@intevation.de>
parents:
1288
diff
changeset
|
56 forceSelection: true, |
1284
faecbb446a04
Ortserstellung: new Messpunkt from map, clone or form
Maximilian Krambach <mkrambach@intevation.de>
parents:
1279
diff
changeset
|
57 name: 'gemId', |
faecbb446a04
Ortserstellung: new Messpunkt from map, clone or form
Maximilian Krambach <mkrambach@intevation.de>
parents:
1279
diff
changeset
|
58 listeners: { |
faecbb446a04
Ortserstellung: new Messpunkt from map, clone or form
Maximilian Krambach <mkrambach@intevation.de>
parents:
1279
diff
changeset
|
59 change: { |
faecbb446a04
Ortserstellung: new Messpunkt from map, clone or form
Maximilian Krambach <mkrambach@intevation.de>
parents:
1279
diff
changeset
|
60 fn: function() { me.checkCommitEnabled() } |
1279
291df0037835
Ortszuordnung window: create, change and display (wip)
Maximilian Krambach <mkrambach@intevation.de>
parents:
diff
changeset
|
61 } |
1284
faecbb446a04
Ortserstellung: new Messpunkt from map, clone or form
Maximilian Krambach <mkrambach@intevation.de>
parents:
1279
diff
changeset
|
62 } |
faecbb446a04
Ortserstellung: new Messpunkt from map, clone or form
Maximilian Krambach <mkrambach@intevation.de>
parents:
1279
diff
changeset
|
63 }, { |
faecbb446a04
Ortserstellung: new Messpunkt from map, clone or form
Maximilian Krambach <mkrambach@intevation.de>
parents:
1279
diff
changeset
|
64 xtype: 'numfield', |
faecbb446a04
Ortserstellung: new Messpunkt from map, clone or form
Maximilian Krambach <mkrambach@intevation.de>
parents:
1279
diff
changeset
|
65 labelWidth: 125, |
faecbb446a04
Ortserstellung: new Messpunkt from map, clone or form
Maximilian Krambach <mkrambach@intevation.de>
parents:
1279
diff
changeset
|
66 fieldLabel: i18n.getMsg('orte.kda'), |
faecbb446a04
Ortserstellung: new Messpunkt from map, clone or form
Maximilian Krambach <mkrambach@intevation.de>
parents:
1279
diff
changeset
|
67 allowDecimals: false, |
faecbb446a04
Ortserstellung: new Messpunkt from map, clone or form
Maximilian Krambach <mkrambach@intevation.de>
parents:
1279
diff
changeset
|
68 maxLength: 1, |
faecbb446a04
Ortserstellung: new Messpunkt from map, clone or form
Maximilian Krambach <mkrambach@intevation.de>
parents:
1279
diff
changeset
|
69 name: 'kdaId', |
faecbb446a04
Ortserstellung: new Messpunkt from map, clone or form
Maximilian Krambach <mkrambach@intevation.de>
parents:
1279
diff
changeset
|
70 listeners: { |
faecbb446a04
Ortserstellung: new Messpunkt from map, clone or form
Maximilian Krambach <mkrambach@intevation.de>
parents:
1279
diff
changeset
|
71 change: { |
faecbb446a04
Ortserstellung: new Messpunkt from map, clone or form
Maximilian Krambach <mkrambach@intevation.de>
parents:
1279
diff
changeset
|
72 fn: function() { me.checkCommitEnabled() } |
1279
291df0037835
Ortszuordnung window: create, change and display (wip)
Maximilian Krambach <mkrambach@intevation.de>
parents:
diff
changeset
|
73 } |
1284
faecbb446a04
Ortserstellung: new Messpunkt from map, clone or form
Maximilian Krambach <mkrambach@intevation.de>
parents:
1279
diff
changeset
|
74 } |
faecbb446a04
Ortserstellung: new Messpunkt from map, clone or form
Maximilian Krambach <mkrambach@intevation.de>
parents:
1279
diff
changeset
|
75 }, { |
faecbb446a04
Ortserstellung: new Messpunkt from map, clone or form
Maximilian Krambach <mkrambach@intevation.de>
parents:
1279
diff
changeset
|
76 xtype: 'numfield', |
faecbb446a04
Ortserstellung: new Messpunkt from map, clone or form
Maximilian Krambach <mkrambach@intevation.de>
parents:
1279
diff
changeset
|
77 labelWidth: 125, |
faecbb446a04
Ortserstellung: new Messpunkt from map, clone or form
Maximilian Krambach <mkrambach@intevation.de>
parents:
1279
diff
changeset
|
78 fieldLabel: i18n.getMsg('orte.koordx'), |
faecbb446a04
Ortserstellung: new Messpunkt from map, clone or form
Maximilian Krambach <mkrambach@intevation.de>
parents:
1279
diff
changeset
|
79 name: 'koordXExtern', |
faecbb446a04
Ortserstellung: new Messpunkt from map, clone or form
Maximilian Krambach <mkrambach@intevation.de>
parents:
1279
diff
changeset
|
80 allowDecimals: true, |
faecbb446a04
Ortserstellung: new Messpunkt from map, clone or form
Maximilian Krambach <mkrambach@intevation.de>
parents:
1279
diff
changeset
|
81 decimalPrecision: 5, |
faecbb446a04
Ortserstellung: new Messpunkt from map, clone or form
Maximilian Krambach <mkrambach@intevation.de>
parents:
1279
diff
changeset
|
82 maxLength: 10, |
faecbb446a04
Ortserstellung: new Messpunkt from map, clone or form
Maximilian Krambach <mkrambach@intevation.de>
parents:
1279
diff
changeset
|
83 listeners: { |
faecbb446a04
Ortserstellung: new Messpunkt from map, clone or form
Maximilian Krambach <mkrambach@intevation.de>
parents:
1279
diff
changeset
|
84 change: { |
faecbb446a04
Ortserstellung: new Messpunkt from map, clone or form
Maximilian Krambach <mkrambach@intevation.de>
parents:
1279
diff
changeset
|
85 fn: function() { me.checkCommitEnabled() } |
faecbb446a04
Ortserstellung: new Messpunkt from map, clone or form
Maximilian Krambach <mkrambach@intevation.de>
parents:
1279
diff
changeset
|
86 } |
faecbb446a04
Ortserstellung: new Messpunkt from map, clone or form
Maximilian Krambach <mkrambach@intevation.de>
parents:
1279
diff
changeset
|
87 } |
faecbb446a04
Ortserstellung: new Messpunkt from map, clone or form
Maximilian Krambach <mkrambach@intevation.de>
parents:
1279
diff
changeset
|
88 }, { |
faecbb446a04
Ortserstellung: new Messpunkt from map, clone or form
Maximilian Krambach <mkrambach@intevation.de>
parents:
1279
diff
changeset
|
89 xtype: 'numfield', |
faecbb446a04
Ortserstellung: new Messpunkt from map, clone or form
Maximilian Krambach <mkrambach@intevation.de>
parents:
1279
diff
changeset
|
90 labelWidth: 125, |
faecbb446a04
Ortserstellung: new Messpunkt from map, clone or form
Maximilian Krambach <mkrambach@intevation.de>
parents:
1279
diff
changeset
|
91 fieldLabel: i18n.getMsg('orte.koordy'), |
faecbb446a04
Ortserstellung: new Messpunkt from map, clone or form
Maximilian Krambach <mkrambach@intevation.de>
parents:
1279
diff
changeset
|
92 name: 'koordYExtern', |
faecbb446a04
Ortserstellung: new Messpunkt from map, clone or form
Maximilian Krambach <mkrambach@intevation.de>
parents:
1279
diff
changeset
|
93 allowDecimals: true, |
faecbb446a04
Ortserstellung: new Messpunkt from map, clone or form
Maximilian Krambach <mkrambach@intevation.de>
parents:
1279
diff
changeset
|
94 decimalPrecision: 5, |
faecbb446a04
Ortserstellung: new Messpunkt from map, clone or form
Maximilian Krambach <mkrambach@intevation.de>
parents:
1279
diff
changeset
|
95 maxLength: 10, |
faecbb446a04
Ortserstellung: new Messpunkt from map, clone or form
Maximilian Krambach <mkrambach@intevation.de>
parents:
1279
diff
changeset
|
96 listeners: { |
faecbb446a04
Ortserstellung: new Messpunkt from map, clone or form
Maximilian Krambach <mkrambach@intevation.de>
parents:
1279
diff
changeset
|
97 change: { |
faecbb446a04
Ortserstellung: new Messpunkt from map, clone or form
Maximilian Krambach <mkrambach@intevation.de>
parents:
1279
diff
changeset
|
98 fn: function() { me.checkCommitEnabled() } |
faecbb446a04
Ortserstellung: new Messpunkt from map, clone or form
Maximilian Krambach <mkrambach@intevation.de>
parents:
1279
diff
changeset
|
99 } |
faecbb446a04
Ortserstellung: new Messpunkt from map, clone or form
Maximilian Krambach <mkrambach@intevation.de>
parents:
1279
diff
changeset
|
100 } |
faecbb446a04
Ortserstellung: new Messpunkt from map, clone or form
Maximilian Krambach <mkrambach@intevation.de>
parents:
1279
diff
changeset
|
101 }, { |
faecbb446a04
Ortserstellung: new Messpunkt from map, clone or form
Maximilian Krambach <mkrambach@intevation.de>
parents:
1279
diff
changeset
|
102 xtype: 'numfield', |
faecbb446a04
Ortserstellung: new Messpunkt from map, clone or form
Maximilian Krambach <mkrambach@intevation.de>
parents:
1279
diff
changeset
|
103 labelWidth: 125, |
1289
bfdc00c24baf
Ortszuordnung for messprogramm and probe using same form
Maximilian Krambach <mkrambach@intevation.de>
parents:
1288
diff
changeset
|
104 fieldLabel: i18n.getMsg('orte.hoeheLand'), |
1284
faecbb446a04
Ortserstellung: new Messpunkt from map, clone or form
Maximilian Krambach <mkrambach@intevation.de>
parents:
1279
diff
changeset
|
105 name: 'hoeheLand', |
faecbb446a04
Ortserstellung: new Messpunkt from map, clone or form
Maximilian Krambach <mkrambach@intevation.de>
parents:
1279
diff
changeset
|
106 maxLength: 10, |
faecbb446a04
Ortserstellung: new Messpunkt from map, clone or form
Maximilian Krambach <mkrambach@intevation.de>
parents:
1279
diff
changeset
|
107 allowDecimals: true |
faecbb446a04
Ortserstellung: new Messpunkt from map, clone or form
Maximilian Krambach <mkrambach@intevation.de>
parents:
1279
diff
changeset
|
108 }, { |
faecbb446a04
Ortserstellung: new Messpunkt from map, clone or form
Maximilian Krambach <mkrambach@intevation.de>
parents:
1279
diff
changeset
|
109 xtype: 'tfield', |
faecbb446a04
Ortserstellung: new Messpunkt from map, clone or form
Maximilian Krambach <mkrambach@intevation.de>
parents:
1279
diff
changeset
|
110 labelWidth: 125, |
faecbb446a04
Ortserstellung: new Messpunkt from map, clone or form
Maximilian Krambach <mkrambach@intevation.de>
parents:
1279
diff
changeset
|
111 maxLength: 100, |
faecbb446a04
Ortserstellung: new Messpunkt from map, clone or form
Maximilian Krambach <mkrambach@intevation.de>
parents:
1279
diff
changeset
|
112 name: 'kurztext', |
1289
bfdc00c24baf
Ortszuordnung for messprogramm and probe using same form
Maximilian Krambach <mkrambach@intevation.de>
parents:
1288
diff
changeset
|
113 fieldLabel: i18n.getMsg('orte.kurztext') |
1284
faecbb446a04
Ortserstellung: new Messpunkt from map, clone or form
Maximilian Krambach <mkrambach@intevation.de>
parents:
1279
diff
changeset
|
114 },{ |
faecbb446a04
Ortserstellung: new Messpunkt from map, clone or form
Maximilian Krambach <mkrambach@intevation.de>
parents:
1279
diff
changeset
|
115 xtype: 'tfield', |
faecbb446a04
Ortserstellung: new Messpunkt from map, clone or form
Maximilian Krambach <mkrambach@intevation.de>
parents:
1279
diff
changeset
|
116 labelWidth: 125, |
faecbb446a04
Ortserstellung: new Messpunkt from map, clone or form
Maximilian Krambach <mkrambach@intevation.de>
parents:
1279
diff
changeset
|
117 fieldLabel: i18n.getMsg('orte.langtext'), |
faecbb446a04
Ortserstellung: new Messpunkt from map, clone or form
Maximilian Krambach <mkrambach@intevation.de>
parents:
1279
diff
changeset
|
118 name: 'langtext' |
faecbb446a04
Ortserstellung: new Messpunkt from map, clone or form
Maximilian Krambach <mkrambach@intevation.de>
parents:
1279
diff
changeset
|
119 },{ |
faecbb446a04
Ortserstellung: new Messpunkt from map, clone or form
Maximilian Krambach <mkrambach@intevation.de>
parents:
1279
diff
changeset
|
120 xtype: 'tfield', |
faecbb446a04
Ortserstellung: new Messpunkt from map, clone or form
Maximilian Krambach <mkrambach@intevation.de>
parents:
1279
diff
changeset
|
121 labelWidth: 125, |
1289
bfdc00c24baf
Ortszuordnung for messprogramm and probe using same form
Maximilian Krambach <mkrambach@intevation.de>
parents:
1288
diff
changeset
|
122 fieldLabel: i18n.getMsg('orte.berichtstext'), |
1284
faecbb446a04
Ortserstellung: new Messpunkt from map, clone or form
Maximilian Krambach <mkrambach@intevation.de>
parents:
1279
diff
changeset
|
123 name: 'berichtstext' |
1289
bfdc00c24baf
Ortszuordnung for messprogramm and probe using same form
Maximilian Krambach <mkrambach@intevation.de>
parents:
1288
diff
changeset
|
124 }, { |
bfdc00c24baf
Ortszuordnung for messprogramm and probe using same form
Maximilian Krambach <mkrambach@intevation.de>
parents:
1288
diff
changeset
|
125 xtype: 'tfield', |
bfdc00c24baf
Ortszuordnung for messprogramm and probe using same form
Maximilian Krambach <mkrambach@intevation.de>
parents:
1288
diff
changeset
|
126 labelWidth: 125, |
bfdc00c24baf
Ortszuordnung for messprogramm and probe using same form
Maximilian Krambach <mkrambach@intevation.de>
parents:
1288
diff
changeset
|
127 maxLength: 100, |
bfdc00c24baf
Ortszuordnung for messprogramm and probe using same form
Maximilian Krambach <mkrambach@intevation.de>
parents:
1288
diff
changeset
|
128 name: 'anlageId', |
bfdc00c24baf
Ortszuordnung for messprogramm and probe using same form
Maximilian Krambach <mkrambach@intevation.de>
parents:
1288
diff
changeset
|
129 fieldLabel: i18n.getMsg('orte.anlageId') |
bfdc00c24baf
Ortszuordnung for messprogramm and probe using same form
Maximilian Krambach <mkrambach@intevation.de>
parents:
1288
diff
changeset
|
130 }, { |
bfdc00c24baf
Ortszuordnung for messprogramm and probe using same form
Maximilian Krambach <mkrambach@intevation.de>
parents:
1288
diff
changeset
|
131 xtype: 'tfield', |
bfdc00c24baf
Ortszuordnung for messprogramm and probe using same form
Maximilian Krambach <mkrambach@intevation.de>
parents:
1288
diff
changeset
|
132 labelWidth: 125, |
bfdc00c24baf
Ortszuordnung for messprogramm and probe using same form
Maximilian Krambach <mkrambach@intevation.de>
parents:
1288
diff
changeset
|
133 maxLength: 100, |
bfdc00c24baf
Ortszuordnung for messprogramm and probe using same form
Maximilian Krambach <mkrambach@intevation.de>
parents:
1288
diff
changeset
|
134 name: 'zone', |
bfdc00c24baf
Ortszuordnung for messprogramm and probe using same form
Maximilian Krambach <mkrambach@intevation.de>
parents:
1288
diff
changeset
|
135 fieldLabel: i18n.getMsg('orte.zone') |
bfdc00c24baf
Ortszuordnung for messprogramm and probe using same form
Maximilian Krambach <mkrambach@intevation.de>
parents:
1288
diff
changeset
|
136 },{ |
bfdc00c24baf
Ortszuordnung for messprogramm and probe using same form
Maximilian Krambach <mkrambach@intevation.de>
parents:
1288
diff
changeset
|
137 xtype: 'tfield', |
bfdc00c24baf
Ortszuordnung for messprogramm and probe using same form
Maximilian Krambach <mkrambach@intevation.de>
parents:
1288
diff
changeset
|
138 labelWidth: 125, |
bfdc00c24baf
Ortszuordnung for messprogramm and probe using same form
Maximilian Krambach <mkrambach@intevation.de>
parents:
1288
diff
changeset
|
139 maxLength: 100, |
bfdc00c24baf
Ortszuordnung for messprogramm and probe using same form
Maximilian Krambach <mkrambach@intevation.de>
parents:
1288
diff
changeset
|
140 name: 'sektor', |
bfdc00c24baf
Ortszuordnung for messprogramm and probe using same form
Maximilian Krambach <mkrambach@intevation.de>
parents:
1288
diff
changeset
|
141 fieldLabel: i18n.getMsg('orte.sektor') |
bfdc00c24baf
Ortszuordnung for messprogramm and probe using same form
Maximilian Krambach <mkrambach@intevation.de>
parents:
1288
diff
changeset
|
142 },{ |
bfdc00c24baf
Ortszuordnung for messprogramm and probe using same form
Maximilian Krambach <mkrambach@intevation.de>
parents:
1288
diff
changeset
|
143 xtype: 'tfield', |
bfdc00c24baf
Ortszuordnung for messprogramm and probe using same form
Maximilian Krambach <mkrambach@intevation.de>
parents:
1288
diff
changeset
|
144 labelWidth: 125, |
bfdc00c24baf
Ortszuordnung for messprogramm and probe using same form
Maximilian Krambach <mkrambach@intevation.de>
parents:
1288
diff
changeset
|
145 maxLength: 100, |
bfdc00c24baf
Ortszuordnung for messprogramm and probe using same form
Maximilian Krambach <mkrambach@intevation.de>
parents:
1288
diff
changeset
|
146 name: 'ortTyp', |
bfdc00c24baf
Ortszuordnung for messprogramm and probe using same form
Maximilian Krambach <mkrambach@intevation.de>
parents:
1288
diff
changeset
|
147 fieldLabel: i18n.getMsg('orte.ortTyp') |
bfdc00c24baf
Ortszuordnung for messprogramm and probe using same form
Maximilian Krambach <mkrambach@intevation.de>
parents:
1288
diff
changeset
|
148 },{ |
bfdc00c24baf
Ortszuordnung for messprogramm and probe using same form
Maximilian Krambach <mkrambach@intevation.de>
parents:
1288
diff
changeset
|
149 xtype: 'tfield', |
bfdc00c24baf
Ortszuordnung for messprogramm and probe using same form
Maximilian Krambach <mkrambach@intevation.de>
parents:
1288
diff
changeset
|
150 labelWidth: 125, |
bfdc00c24baf
Ortszuordnung for messprogramm and probe using same form
Maximilian Krambach <mkrambach@intevation.de>
parents:
1288
diff
changeset
|
151 maxLength: 100, |
bfdc00c24baf
Ortszuordnung for messprogramm and probe using same form
Maximilian Krambach <mkrambach@intevation.de>
parents:
1288
diff
changeset
|
152 name: 'zustaendigkeit', |
bfdc00c24baf
Ortszuordnung for messprogramm and probe using same form
Maximilian Krambach <mkrambach@intevation.de>
parents:
1288
diff
changeset
|
153 fieldLabel: i18n.getMsg('orte.zustaendigkeit') |
bfdc00c24baf
Ortszuordnung for messprogramm and probe using same form
Maximilian Krambach <mkrambach@intevation.de>
parents:
1288
diff
changeset
|
154 },{ |
bfdc00c24baf
Ortszuordnung for messprogramm and probe using same form
Maximilian Krambach <mkrambach@intevation.de>
parents:
1288
diff
changeset
|
155 xtype: 'tfield', |
bfdc00c24baf
Ortszuordnung for messprogramm and probe using same form
Maximilian Krambach <mkrambach@intevation.de>
parents:
1288
diff
changeset
|
156 labelWidth: 125, |
bfdc00c24baf
Ortszuordnung for messprogramm and probe using same form
Maximilian Krambach <mkrambach@intevation.de>
parents:
1288
diff
changeset
|
157 maxLength: 100, |
bfdc00c24baf
Ortszuordnung for messprogramm and probe using same form
Maximilian Krambach <mkrambach@intevation.de>
parents:
1288
diff
changeset
|
158 name: 'mpArt', |
bfdc00c24baf
Ortszuordnung for messprogramm and probe using same form
Maximilian Krambach <mkrambach@intevation.de>
parents:
1288
diff
changeset
|
159 fieldLabel: i18n.getMsg('orte.mpArt') |
bfdc00c24baf
Ortszuordnung for messprogramm and probe using same form
Maximilian Krambach <mkrambach@intevation.de>
parents:
1288
diff
changeset
|
160 },{ |
bfdc00c24baf
Ortszuordnung for messprogramm and probe using same form
Maximilian Krambach <mkrambach@intevation.de>
parents:
1288
diff
changeset
|
161 xtype: 'tfield', |
bfdc00c24baf
Ortszuordnung for messprogramm and probe using same form
Maximilian Krambach <mkrambach@intevation.de>
parents:
1288
diff
changeset
|
162 labelWidth: 125, |
bfdc00c24baf
Ortszuordnung for messprogramm and probe using same form
Maximilian Krambach <mkrambach@intevation.de>
parents:
1288
diff
changeset
|
163 maxLength: 100, |
bfdc00c24baf
Ortszuordnung for messprogramm and probe using same form
Maximilian Krambach <mkrambach@intevation.de>
parents:
1288
diff
changeset
|
164 name: 'nutsCode', |
bfdc00c24baf
Ortszuordnung for messprogramm and probe using same form
Maximilian Krambach <mkrambach@intevation.de>
parents:
1288
diff
changeset
|
165 fieldLabel: i18n.getMsg('orte.nutsCode') |
bfdc00c24baf
Ortszuordnung for messprogramm and probe using same form
Maximilian Krambach <mkrambach@intevation.de>
parents:
1288
diff
changeset
|
166 },{ |
bfdc00c24baf
Ortszuordnung for messprogramm and probe using same form
Maximilian Krambach <mkrambach@intevation.de>
parents:
1288
diff
changeset
|
167 xtype: 'tfield', |
bfdc00c24baf
Ortszuordnung for messprogramm and probe using same form
Maximilian Krambach <mkrambach@intevation.de>
parents:
1288
diff
changeset
|
168 labelWidth: 125, |
bfdc00c24baf
Ortszuordnung for messprogramm and probe using same form
Maximilian Krambach <mkrambach@intevation.de>
parents:
1288
diff
changeset
|
169 maxLength: 100, |
bfdc00c24baf
Ortszuordnung for messprogramm and probe using same form
Maximilian Krambach <mkrambach@intevation.de>
parents:
1288
diff
changeset
|
170 name: 'ozId', |
bfdc00c24baf
Ortszuordnung for messprogramm and probe using same form
Maximilian Krambach <mkrambach@intevation.de>
parents:
1288
diff
changeset
|
171 fieldLabel: i18n.getMsg('orte.ozId') |
1284
faecbb446a04
Ortserstellung: new Messpunkt from map, clone or form
Maximilian Krambach <mkrambach@intevation.de>
parents:
1279
diff
changeset
|
172 }]; |
1289
bfdc00c24baf
Ortszuordnung for messprogramm and probe using same form
Maximilian Krambach <mkrambach@intevation.de>
parents:
1288
diff
changeset
|
173 |
1284
faecbb446a04
Ortserstellung: new Messpunkt from map, clone or form
Maximilian Krambach <mkrambach@intevation.de>
parents:
1279
diff
changeset
|
174 this.dockedItems = [{ |
faecbb446a04
Ortserstellung: new Messpunkt from map, clone or form
Maximilian Krambach <mkrambach@intevation.de>
parents:
1279
diff
changeset
|
175 xtype: 'toolbar', |
faecbb446a04
Ortserstellung: new Messpunkt from map, clone or form
Maximilian Krambach <mkrambach@intevation.de>
parents:
1279
diff
changeset
|
176 dock: 'bottom', |
faecbb446a04
Ortserstellung: new Messpunkt from map, clone or form
Maximilian Krambach <mkrambach@intevation.de>
parents:
1279
diff
changeset
|
177 border: '0, 1, 1, 1', |
faecbb446a04
Ortserstellung: new Messpunkt from map, clone or form
Maximilian Krambach <mkrambach@intevation.de>
parents:
1279
diff
changeset
|
178 style: { |
faecbb446a04
Ortserstellung: new Messpunkt from map, clone or form
Maximilian Krambach <mkrambach@intevation.de>
parents:
1279
diff
changeset
|
179 borderBottom: '1px solid #b5b8c8 !important', |
faecbb446a04
Ortserstellung: new Messpunkt from map, clone or form
Maximilian Krambach <mkrambach@intevation.de>
parents:
1279
diff
changeset
|
180 borderLeft: '1px solid #b5b8c8 !important', |
faecbb446a04
Ortserstellung: new Messpunkt from map, clone or form
Maximilian Krambach <mkrambach@intevation.de>
parents:
1279
diff
changeset
|
181 borderRight: '1px solid #b5b8c8 !important' |
faecbb446a04
Ortserstellung: new Messpunkt from map, clone or form
Maximilian Krambach <mkrambach@intevation.de>
parents:
1279
diff
changeset
|
182 }, |
faecbb446a04
Ortserstellung: new Messpunkt from map, clone or form
Maximilian Krambach <mkrambach@intevation.de>
parents:
1279
diff
changeset
|
183 items: ['->', { |
faecbb446a04
Ortserstellung: new Messpunkt from map, clone or form
Maximilian Krambach <mkrambach@intevation.de>
parents:
1279
diff
changeset
|
184 text: i18n.getMsg('save'), |
faecbb446a04
Ortserstellung: new Messpunkt from map, clone or form
Maximilian Krambach <mkrambach@intevation.de>
parents:
1279
diff
changeset
|
185 action: 'save', |
faecbb446a04
Ortserstellung: new Messpunkt from map, clone or form
Maximilian Krambach <mkrambach@intevation.de>
parents:
1279
diff
changeset
|
186 handler: me.saveOrt, |
faecbb446a04
Ortserstellung: new Messpunkt from map, clone or form
Maximilian Krambach <mkrambach@intevation.de>
parents:
1279
diff
changeset
|
187 disabled: true |
1279
291df0037835
Ortszuordnung window: create, change and display (wip)
Maximilian Krambach <mkrambach@intevation.de>
parents:
diff
changeset
|
188 }, { |
1284
faecbb446a04
Ortserstellung: new Messpunkt from map, clone or form
Maximilian Krambach <mkrambach@intevation.de>
parents:
1279
diff
changeset
|
189 text: i18n.getMsg('close'), |
faecbb446a04
Ortserstellung: new Messpunkt from map, clone or form
Maximilian Krambach <mkrambach@intevation.de>
parents:
1279
diff
changeset
|
190 action: 'close', |
faecbb446a04
Ortserstellung: new Messpunkt from map, clone or form
Maximilian Krambach <mkrambach@intevation.de>
parents:
1279
diff
changeset
|
191 handler: function() { |
faecbb446a04
Ortserstellung: new Messpunkt from map, clone or form
Maximilian Krambach <mkrambach@intevation.de>
parents:
1279
diff
changeset
|
192 me.close(); |
1279
291df0037835
Ortszuordnung window: create, change and display (wip)
Maximilian Krambach <mkrambach@intevation.de>
parents:
diff
changeset
|
193 } |
291df0037835
Ortszuordnung window: create, change and display (wip)
Maximilian Krambach <mkrambach@intevation.de>
parents:
diff
changeset
|
194 }] |
291df0037835
Ortszuordnung window: create, change and display (wip)
Maximilian Krambach <mkrambach@intevation.de>
parents:
diff
changeset
|
195 }]; |
1284
faecbb446a04
Ortserstellung: new Messpunkt from map, clone or form
Maximilian Krambach <mkrambach@intevation.de>
parents:
1279
diff
changeset
|
196 |
faecbb446a04
Ortserstellung: new Messpunkt from map, clone or form
Maximilian Krambach <mkrambach@intevation.de>
parents:
1279
diff
changeset
|
197 this.callParent(arguments); |
faecbb446a04
Ortserstellung: new Messpunkt from map, clone or form
Maximilian Krambach <mkrambach@intevation.de>
parents:
1279
diff
changeset
|
198 this.getForm().loadRecord(this.record); |
1279
291df0037835
Ortszuordnung window: create, change and display (wip)
Maximilian Krambach <mkrambach@intevation.de>
parents:
diff
changeset
|
199 }, |
291df0037835
Ortszuordnung window: create, change and display (wip)
Maximilian Krambach <mkrambach@intevation.de>
parents:
diff
changeset
|
200 |
291df0037835
Ortszuordnung window: create, change and display (wip)
Maximilian Krambach <mkrambach@intevation.de>
parents:
diff
changeset
|
201 /** |
1289
bfdc00c24baf
Ortszuordnung for messprogramm and probe using same form
Maximilian Krambach <mkrambach@intevation.de>
parents:
1288
diff
changeset
|
202 * checks if the Messpunkt can be committed. |
1279
291df0037835
Ortszuordnung window: create, change and display (wip)
Maximilian Krambach <mkrambach@intevation.de>
parents:
diff
changeset
|
203 * Disables the save button if false |
291df0037835
Ortszuordnung window: create, change and display (wip)
Maximilian Krambach <mkrambach@intevation.de>
parents:
diff
changeset
|
204 */ |
291df0037835
Ortszuordnung window: create, change and display (wip)
Maximilian Krambach <mkrambach@intevation.de>
parents:
diff
changeset
|
205 checkCommitEnabled: function() { |
1284
faecbb446a04
Ortserstellung: new Messpunkt from map, clone or form
Maximilian Krambach <mkrambach@intevation.de>
parents:
1279
diff
changeset
|
206 var savebutton = this.down('toolbar').down('button[action=save]'); |
1279
291df0037835
Ortszuordnung window: create, change and display (wip)
Maximilian Krambach <mkrambach@intevation.de>
parents:
diff
changeset
|
207 var form = this.getForm(); |
1289
bfdc00c24baf
Ortszuordnung for messprogramm and probe using same form
Maximilian Krambach <mkrambach@intevation.de>
parents:
1288
diff
changeset
|
208 if (form.findField('kdaId').getValue() || |
bfdc00c24baf
Ortszuordnung for messprogramm and probe using same form
Maximilian Krambach <mkrambach@intevation.de>
parents:
1288
diff
changeset
|
209 form.findField('koordYExtern').getValue() || |
bfdc00c24baf
Ortszuordnung for messprogramm and probe using same form
Maximilian Krambach <mkrambach@intevation.de>
parents:
1288
diff
changeset
|
210 form.findField('koordXExtern').getValue()) { |
1284
faecbb446a04
Ortserstellung: new Messpunkt from map, clone or form
Maximilian Krambach <mkrambach@intevation.de>
parents:
1279
diff
changeset
|
211 if (this.checkCoordinates()) { |
faecbb446a04
Ortserstellung: new Messpunkt from map, clone or form
Maximilian Krambach <mkrambach@intevation.de>
parents:
1279
diff
changeset
|
212 savebutton.setDisabled(false); |
faecbb446a04
Ortserstellung: new Messpunkt from map, clone or form
Maximilian Krambach <mkrambach@intevation.de>
parents:
1279
diff
changeset
|
213 } else { |
faecbb446a04
Ortserstellung: new Messpunkt from map, clone or form
Maximilian Krambach <mkrambach@intevation.de>
parents:
1279
diff
changeset
|
214 savebutton.setDisabled(true); |
faecbb446a04
Ortserstellung: new Messpunkt from map, clone or form
Maximilian Krambach <mkrambach@intevation.de>
parents:
1279
diff
changeset
|
215 } |
1289
bfdc00c24baf
Ortszuordnung for messprogramm and probe using same form
Maximilian Krambach <mkrambach@intevation.de>
parents:
1288
diff
changeset
|
216 } else if (form.findField('gemId').getValue() || |
bfdc00c24baf
Ortszuordnung for messprogramm and probe using same form
Maximilian Krambach <mkrambach@intevation.de>
parents:
1288
diff
changeset
|
217 form.findField('staatId').getValue() >= 0 ) { |
1279
291df0037835
Ortszuordnung window: create, change and display (wip)
Maximilian Krambach <mkrambach@intevation.de>
parents:
diff
changeset
|
218 savebutton.setDisabled(false); |
291df0037835
Ortszuordnung window: create, change and display (wip)
Maximilian Krambach <mkrambach@intevation.de>
parents:
diff
changeset
|
219 } else { |
291df0037835
Ortszuordnung window: create, change and display (wip)
Maximilian Krambach <mkrambach@intevation.de>
parents:
diff
changeset
|
220 savebutton.setDisabled(true); |
291df0037835
Ortszuordnung window: create, change and display (wip)
Maximilian Krambach <mkrambach@intevation.de>
parents:
diff
changeset
|
221 } |
291df0037835
Ortszuordnung window: create, change and display (wip)
Maximilian Krambach <mkrambach@intevation.de>
parents:
diff
changeset
|
222 }, |
291df0037835
Ortszuordnung window: create, change and display (wip)
Maximilian Krambach <mkrambach@intevation.de>
parents:
diff
changeset
|
223 |
291df0037835
Ortszuordnung window: create, change and display (wip)
Maximilian Krambach <mkrambach@intevation.de>
parents:
diff
changeset
|
224 /** |
291df0037835
Ortszuordnung window: create, change and display (wip)
Maximilian Krambach <mkrambach@intevation.de>
parents:
diff
changeset
|
225 * Validates the coordinate fields kdaId, koordXExtern, koordYExtern |
291df0037835
Ortszuordnung window: create, change and display (wip)
Maximilian Krambach <mkrambach@intevation.de>
parents:
diff
changeset
|
226 */ |
291df0037835
Ortszuordnung window: create, change and display (wip)
Maximilian Krambach <mkrambach@intevation.de>
parents:
diff
changeset
|
227 checkCoordinates: function() { |
291df0037835
Ortszuordnung window: create, change and display (wip)
Maximilian Krambach <mkrambach@intevation.de>
parents:
diff
changeset
|
228 var x = this.getForm().findField('koordXExtern').getValue(); |
291df0037835
Ortszuordnung window: create, change and display (wip)
Maximilian Krambach <mkrambach@intevation.de>
parents:
diff
changeset
|
229 var y = this.getForm().findField('koordYExtern').getValue(); |
291df0037835
Ortszuordnung window: create, change and display (wip)
Maximilian Krambach <mkrambach@intevation.de>
parents:
diff
changeset
|
230 var kda = this.getForm().findField('kdaId').getValue(); |
291df0037835
Ortszuordnung window: create, change and display (wip)
Maximilian Krambach <mkrambach@intevation.de>
parents:
diff
changeset
|
231 if (x && y && kda) { |
291df0037835
Ortszuordnung window: create, change and display (wip)
Maximilian Krambach <mkrambach@intevation.de>
parents:
diff
changeset
|
232 if (kda === 4){ |
291df0037835
Ortszuordnung window: create, change and display (wip)
Maximilian Krambach <mkrambach@intevation.de>
parents:
diff
changeset
|
233 if (x > -180 && x < 180 |
291df0037835
Ortszuordnung window: create, change and display (wip)
Maximilian Krambach <mkrambach@intevation.de>
parents:
diff
changeset
|
234 && y > -90 && y < 90) { |
291df0037835
Ortszuordnung window: create, change and display (wip)
Maximilian Krambach <mkrambach@intevation.de>
parents:
diff
changeset
|
235 return true; |
291df0037835
Ortszuordnung window: create, change and display (wip)
Maximilian Krambach <mkrambach@intevation.de>
parents:
diff
changeset
|
236 } else { |
291df0037835
Ortszuordnung window: create, change and display (wip)
Maximilian Krambach <mkrambach@intevation.de>
parents:
diff
changeset
|
237 // TODO: WGS84 (degrees- decimal), coordinates invalid |
291df0037835
Ortszuordnung window: create, change and display (wip)
Maximilian Krambach <mkrambach@intevation.de>
parents:
diff
changeset
|
238 return false; |
291df0037835
Ortszuordnung window: create, change and display (wip)
Maximilian Krambach <mkrambach@intevation.de>
parents:
diff
changeset
|
239 } |
291df0037835
Ortszuordnung window: create, change and display (wip)
Maximilian Krambach <mkrambach@intevation.de>
parents:
diff
changeset
|
240 } else if (kda === 5){ |
291df0037835
Ortszuordnung window: create, change and display (wip)
Maximilian Krambach <mkrambach@intevation.de>
parents:
diff
changeset
|
241 if (x >= 1000000 && x < 61000000 && |
291df0037835
Ortszuordnung window: create, change and display (wip)
Maximilian Krambach <mkrambach@intevation.de>
parents:
diff
changeset
|
242 y > -10000000 && y < 10000000) { |
291df0037835
Ortszuordnung window: create, change and display (wip)
Maximilian Krambach <mkrambach@intevation.de>
parents:
diff
changeset
|
243 return true; |
291df0037835
Ortszuordnung window: create, change and display (wip)
Maximilian Krambach <mkrambach@intevation.de>
parents:
diff
changeset
|
244 } else { |
291df0037835
Ortszuordnung window: create, change and display (wip)
Maximilian Krambach <mkrambach@intevation.de>
parents:
diff
changeset
|
245 // TODO: UTM, coordinates invalid |
291df0037835
Ortszuordnung window: create, change and display (wip)
Maximilian Krambach <mkrambach@intevation.de>
parents:
diff
changeset
|
246 return false; |
291df0037835
Ortszuordnung window: create, change and display (wip)
Maximilian Krambach <mkrambach@intevation.de>
parents:
diff
changeset
|
247 } |
291df0037835
Ortszuordnung window: create, change and display (wip)
Maximilian Krambach <mkrambach@intevation.de>
parents:
diff
changeset
|
248 } else { |
291df0037835
Ortszuordnung window: create, change and display (wip)
Maximilian Krambach <mkrambach@intevation.de>
parents:
diff
changeset
|
249 // TODO KDA not supported |
291df0037835
Ortszuordnung window: create, change and display (wip)
Maximilian Krambach <mkrambach@intevation.de>
parents:
diff
changeset
|
250 return false; |
291df0037835
Ortszuordnung window: create, change and display (wip)
Maximilian Krambach <mkrambach@intevation.de>
parents:
diff
changeset
|
251 } |
291df0037835
Ortszuordnung window: create, change and display (wip)
Maximilian Krambach <mkrambach@intevation.de>
parents:
diff
changeset
|
252 } else { |
291df0037835
Ortszuordnung window: create, change and display (wip)
Maximilian Krambach <mkrambach@intevation.de>
parents:
diff
changeset
|
253 // TODO: not all fields filled in |
291df0037835
Ortszuordnung window: create, change and display (wip)
Maximilian Krambach <mkrambach@intevation.de>
parents:
diff
changeset
|
254 return false; |
291df0037835
Ortszuordnung window: create, change and display (wip)
Maximilian Krambach <mkrambach@intevation.de>
parents:
diff
changeset
|
255 } |
291df0037835
Ortszuordnung window: create, change and display (wip)
Maximilian Krambach <mkrambach@intevation.de>
parents:
diff
changeset
|
256 }, |
291df0037835
Ortszuordnung window: create, change and display (wip)
Maximilian Krambach <mkrambach@intevation.de>
parents:
diff
changeset
|
257 |
1284
faecbb446a04
Ortserstellung: new Messpunkt from map, clone or form
Maximilian Krambach <mkrambach@intevation.de>
parents:
1279
diff
changeset
|
258 saveOrt: function() { |
faecbb446a04
Ortserstellung: new Messpunkt from map, clone or form
Maximilian Krambach <mkrambach@intevation.de>
parents:
1279
diff
changeset
|
259 var this_panel = this.up('panel'); |
faecbb446a04
Ortserstellung: new Messpunkt from map, clone or form
Maximilian Krambach <mkrambach@intevation.de>
parents:
1279
diff
changeset
|
260 var form = this_panel.getForm(); |
faecbb446a04
Ortserstellung: new Messpunkt from map, clone or form
Maximilian Krambach <mkrambach@intevation.de>
parents:
1279
diff
changeset
|
261 var data = form.getFieldValues(true); |
faecbb446a04
Ortserstellung: new Messpunkt from map, clone or form
Maximilian Krambach <mkrambach@intevation.de>
parents:
1279
diff
changeset
|
262 for (var key in data) { |
faecbb446a04
Ortserstellung: new Messpunkt from map, clone or form
Maximilian Krambach <mkrambach@intevation.de>
parents:
1279
diff
changeset
|
263 form.getRecord().set(key, data[key]); |
1279
291df0037835
Ortszuordnung window: create, change and display (wip)
Maximilian Krambach <mkrambach@intevation.de>
parents:
diff
changeset
|
264 } |
1284
faecbb446a04
Ortserstellung: new Messpunkt from map, clone or form
Maximilian Krambach <mkrambach@intevation.de>
parents:
1279
diff
changeset
|
265 this_panel.record.set('letzteAenderung', 0); |
faecbb446a04
Ortserstellung: new Messpunkt from map, clone or form
Maximilian Krambach <mkrambach@intevation.de>
parents:
1279
diff
changeset
|
266 this_panel.record.set('id', null); |
faecbb446a04
Ortserstellung: new Messpunkt from map, clone or form
Maximilian Krambach <mkrambach@intevation.de>
parents:
1279
diff
changeset
|
267 this_panel.record.set('ortId', null); |
faecbb446a04
Ortserstellung: new Messpunkt from map, clone or form
Maximilian Krambach <mkrambach@intevation.de>
parents:
1279
diff
changeset
|
268 this_panel.record.set('netzbetreiberId', Lada.netzbetreiber[0]); |
faecbb446a04
Ortserstellung: new Messpunkt from map, clone or form
Maximilian Krambach <mkrambach@intevation.de>
parents:
1279
diff
changeset
|
269 this_panel.record.save({ |
faecbb446a04
Ortserstellung: new Messpunkt from map, clone or form
Maximilian Krambach <mkrambach@intevation.de>
parents:
1279
diff
changeset
|
270 success: function(record, response) { |
faecbb446a04
Ortserstellung: new Messpunkt from map, clone or form
Maximilian Krambach <mkrambach@intevation.de>
parents:
1279
diff
changeset
|
271 var newOrtId; |
faecbb446a04
Ortserstellung: new Messpunkt from map, clone or form
Maximilian Krambach <mkrambach@intevation.de>
parents:
1279
diff
changeset
|
272 var ozw = this_panel.up().parentWindow; |
faecbb446a04
Ortserstellung: new Messpunkt from map, clone or form
Maximilian Krambach <mkrambach@intevation.de>
parents:
1279
diff
changeset
|
273 ozw.ortstore.load({ |
faecbb446a04
Ortserstellung: new Messpunkt from map, clone or form
Maximilian Krambach <mkrambach@intevation.de>
parents:
1279
diff
changeset
|
274 callback: function(records, operation, success) { |
faecbb446a04
Ortserstellung: new Messpunkt from map, clone or form
Maximilian Krambach <mkrambach@intevation.de>
parents:
1279
diff
changeset
|
275 ozw.down('map').addLocations(ozw.ortstore); |
1289
bfdc00c24baf
Ortszuordnung for messprogramm and probe using same form
Maximilian Krambach <mkrambach@intevation.de>
parents:
1288
diff
changeset
|
276 var osg = ozw.down('ortstammdatengrid'); |
bfdc00c24baf
Ortszuordnung for messprogramm and probe using same form
Maximilian Krambach <mkrambach@intevation.de>
parents:
1288
diff
changeset
|
277 osg.setStore(ozw.ortstore); |
1284
faecbb446a04
Ortserstellung: new Messpunkt from map, clone or form
Maximilian Krambach <mkrambach@intevation.de>
parents:
1279
diff
changeset
|
278 var id = Ext.decode(response.response.responseText).data.id; |
1289
bfdc00c24baf
Ortszuordnung for messprogramm and probe using same form
Maximilian Krambach <mkrambach@intevation.de>
parents:
1288
diff
changeset
|
279 var record = osg.store.getById(id); |
bfdc00c24baf
Ortszuordnung for messprogramm and probe using same form
Maximilian Krambach <mkrambach@intevation.de>
parents:
1288
diff
changeset
|
280 var selmod = osg.getView().getSelectionModel(); |
bfdc00c24baf
Ortszuordnung for messprogramm and probe using same form
Maximilian Krambach <mkrambach@intevation.de>
parents:
1288
diff
changeset
|
281 selmod.select(record); |
bfdc00c24baf
Ortszuordnung for messprogramm and probe using same form
Maximilian Krambach <mkrambach@intevation.de>
parents:
1288
diff
changeset
|
282 Ext.Msg.show({ |
bfdc00c24baf
Ortszuordnung for messprogramm and probe using same form
Maximilian Krambach <mkrambach@intevation.de>
parents:
1288
diff
changeset
|
283 title: Lada.getApplication().bundle.getMsg('success'), |
bfdc00c24baf
Ortszuordnung for messprogramm and probe using same form
Maximilian Krambach <mkrambach@intevation.de>
parents:
1288
diff
changeset
|
284 autoScroll: true, |
bfdc00c24baf
Ortszuordnung for messprogramm and probe using same form
Maximilian Krambach <mkrambach@intevation.de>
parents:
1288
diff
changeset
|
285 msg: 'Ort erfolgreich angelegt!', |
bfdc00c24baf
Ortszuordnung for messprogramm and probe using same form
Maximilian Krambach <mkrambach@intevation.de>
parents:
1288
diff
changeset
|
286 buttons: Ext.Msg.OK |
bfdc00c24baf
Ortszuordnung for messprogramm and probe using same form
Maximilian Krambach <mkrambach@intevation.de>
parents:
1288
diff
changeset
|
287 }); |
1284
faecbb446a04
Ortserstellung: new Messpunkt from map, clone or form
Maximilian Krambach <mkrambach@intevation.de>
parents:
1279
diff
changeset
|
288 this_panel.close(); |
faecbb446a04
Ortserstellung: new Messpunkt from map, clone or form
Maximilian Krambach <mkrambach@intevation.de>
parents:
1279
diff
changeset
|
289 }, |
faecbb446a04
Ortserstellung: new Messpunkt from map, clone or form
Maximilian Krambach <mkrambach@intevation.de>
parents:
1279
diff
changeset
|
290 scope: this |
faecbb446a04
Ortserstellung: new Messpunkt from map, clone or form
Maximilian Krambach <mkrambach@intevation.de>
parents:
1279
diff
changeset
|
291 }); |
1289
bfdc00c24baf
Ortszuordnung for messprogramm and probe using same form
Maximilian Krambach <mkrambach@intevation.de>
parents:
1288
diff
changeset
|
292 |
1284
faecbb446a04
Ortserstellung: new Messpunkt from map, clone or form
Maximilian Krambach <mkrambach@intevation.de>
parents:
1279
diff
changeset
|
293 }, |
faecbb446a04
Ortserstellung: new Messpunkt from map, clone or form
Maximilian Krambach <mkrambach@intevation.de>
parents:
1279
diff
changeset
|
294 failure: function(record, response) { |
1288
08085b7d1d0b
Ortszuordnung: Search, new orte, display and validity check
Maximilian Krambach <mkrambach@intevation.de>
parents:
1284
diff
changeset
|
295 var json = Ext.decode(response.response.responseText); |
08085b7d1d0b
Ortszuordnung: Search, new orte, display and validity check
Maximilian Krambach <mkrambach@intevation.de>
parents:
1284
diff
changeset
|
296 if (json) { |
08085b7d1d0b
Ortszuordnung: Search, new orte, display and validity check
Maximilian Krambach <mkrambach@intevation.de>
parents:
1284
diff
changeset
|
297 if(json.errors.totalCount > 0 || json.warnings.totalCount > 0){ |
08085b7d1d0b
Ortszuordnung: Search, new orte, display and validity check
Maximilian Krambach <mkrambach@intevation.de>
parents:
1284
diff
changeset
|
298 formPanel.setMessages(json.errors, json.warnings); |
08085b7d1d0b
Ortszuordnung: Search, new orte, display and validity check
Maximilian Krambach <mkrambach@intevation.de>
parents:
1284
diff
changeset
|
299 } |
08085b7d1d0b
Ortszuordnung: Search, new orte, display and validity check
Maximilian Krambach <mkrambach@intevation.de>
parents:
1284
diff
changeset
|
300 if(json.message){ |
08085b7d1d0b
Ortszuordnung: Search, new orte, display and validity check
Maximilian Krambach <mkrambach@intevation.de>
parents:
1284
diff
changeset
|
301 Ext.Msg.alert(Lada.getApplication().bundle.getMsg('err.msg.save.title') |
08085b7d1d0b
Ortszuordnung: Search, new orte, display and validity check
Maximilian Krambach <mkrambach@intevation.de>
parents:
1284
diff
changeset
|
302 +' #'+json.message, |
08085b7d1d0b
Ortszuordnung: Search, new orte, display and validity check
Maximilian Krambach <mkrambach@intevation.de>
parents:
1284
diff
changeset
|
303 Lada.getApplication().bundle.getMsg(json.message)); |
08085b7d1d0b
Ortszuordnung: Search, new orte, display and validity check
Maximilian Krambach <mkrambach@intevation.de>
parents:
1284
diff
changeset
|
304 } else { |
08085b7d1d0b
Ortszuordnung: Search, new orte, display and validity check
Maximilian Krambach <mkrambach@intevation.de>
parents:
1284
diff
changeset
|
305 Ext.Msg.alert(Lada.getApplication().bundle.getMsg('err.msg.save.title'), |
08085b7d1d0b
Ortszuordnung: Search, new orte, display and validity check
Maximilian Krambach <mkrambach@intevation.de>
parents:
1284
diff
changeset
|
306 Lada.getApplication().bundle.getMsg('err.msg.generic.body')); |
08085b7d1d0b
Ortszuordnung: Search, new orte, display and validity check
Maximilian Krambach <mkrambach@intevation.de>
parents:
1284
diff
changeset
|
307 } |
08085b7d1d0b
Ortszuordnung: Search, new orte, display and validity check
Maximilian Krambach <mkrambach@intevation.de>
parents:
1284
diff
changeset
|
308 } else { |
08085b7d1d0b
Ortszuordnung: Search, new orte, display and validity check
Maximilian Krambach <mkrambach@intevation.de>
parents:
1284
diff
changeset
|
309 Ext.Msg.alert(Lada.getApplication().bundle.getMsg('err.msg.save.title'), |
08085b7d1d0b
Ortszuordnung: Search, new orte, display and validity check
Maximilian Krambach <mkrambach@intevation.de>
parents:
1284
diff
changeset
|
310 Lada.getApplication().bundle.getMsg('err.msg.response.body')); |
08085b7d1d0b
Ortszuordnung: Search, new orte, display and validity check
Maximilian Krambach <mkrambach@intevation.de>
parents:
1284
diff
changeset
|
311 } |
1284
faecbb446a04
Ortserstellung: new Messpunkt from map, clone or form
Maximilian Krambach <mkrambach@intevation.de>
parents:
1279
diff
changeset
|
312 } |
faecbb446a04
Ortserstellung: new Messpunkt from map, clone or form
Maximilian Krambach <mkrambach@intevation.de>
parents:
1279
diff
changeset
|
313 }); |
1279
291df0037835
Ortszuordnung window: create, change and display (wip)
Maximilian Krambach <mkrambach@intevation.de>
parents:
diff
changeset
|
314 } |
291df0037835
Ortszuordnung window: create, change and display (wip)
Maximilian Krambach <mkrambach@intevation.de>
parents:
diff
changeset
|
315 }); |