annotate app/view/form/Ortserstellung.js @ 1297:5dfd5798cbcc

i18n-wording We often called it Gemeinde, though it can be any (larger) administrative unit.
author Tom Gottfried <tom@intevation.de>
date Thu, 02 Feb 2017 11:44:32 +0100
parents 171eacf989d8
children c86fd6976264
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,
1297
5dfd5798cbcc i18n-wording
Tom Gottfried <tom@intevation.de>
parents: 1295
diff changeset
55 fieldLabel: i18n.getMsg('orte.verwaltungseinheit'),
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',
1294
c1b7db04b39c changed some form buttons to look like buttons
Maximilian Krambach <mkrambach@intevation.de>
parents: 1289
diff changeset
177 ui: 'footer',
1284
faecbb446a04 Ortserstellung: new Messpunkt from map, clone or form
Maximilian Krambach <mkrambach@intevation.de>
parents: 1279
diff changeset
178 border: '0, 1, 1, 1',
faecbb446a04 Ortserstellung: new Messpunkt from map, clone or form
Maximilian Krambach <mkrambach@intevation.de>
parents: 1279
diff changeset
179 style: {
faecbb446a04 Ortserstellung: new Messpunkt from map, clone or form
Maximilian Krambach <mkrambach@intevation.de>
parents: 1279
diff changeset
180 borderBottom: '1px solid #b5b8c8 !important',
faecbb446a04 Ortserstellung: new Messpunkt from map, clone or form
Maximilian Krambach <mkrambach@intevation.de>
parents: 1279
diff changeset
181 borderLeft: '1px solid #b5b8c8 !important',
faecbb446a04 Ortserstellung: new Messpunkt from map, clone or form
Maximilian Krambach <mkrambach@intevation.de>
parents: 1279
diff changeset
182 borderRight: '1px solid #b5b8c8 !important'
faecbb446a04 Ortserstellung: new Messpunkt from map, clone or form
Maximilian Krambach <mkrambach@intevation.de>
parents: 1279
diff changeset
183 },
faecbb446a04 Ortserstellung: new Messpunkt from map, clone or form
Maximilian Krambach <mkrambach@intevation.de>
parents: 1279
diff changeset
184 items: ['->', {
faecbb446a04 Ortserstellung: new Messpunkt from map, clone or form
Maximilian Krambach <mkrambach@intevation.de>
parents: 1279
diff changeset
185 text: i18n.getMsg('save'),
faecbb446a04 Ortserstellung: new Messpunkt from map, clone or form
Maximilian Krambach <mkrambach@intevation.de>
parents: 1279
diff changeset
186 action: 'save',
faecbb446a04 Ortserstellung: new Messpunkt from map, clone or form
Maximilian Krambach <mkrambach@intevation.de>
parents: 1279
diff changeset
187 handler: me.saveOrt,
faecbb446a04 Ortserstellung: new Messpunkt from map, clone or form
Maximilian Krambach <mkrambach@intevation.de>
parents: 1279
diff changeset
188 disabled: true
1279
291df0037835 Ortszuordnung window: create, change and display (wip)
Maximilian Krambach <mkrambach@intevation.de>
parents:
diff changeset
189 }, {
1284
faecbb446a04 Ortserstellung: new Messpunkt from map, clone or form
Maximilian Krambach <mkrambach@intevation.de>
parents: 1279
diff changeset
190 text: i18n.getMsg('close'),
faecbb446a04 Ortserstellung: new Messpunkt from map, clone or form
Maximilian Krambach <mkrambach@intevation.de>
parents: 1279
diff changeset
191 action: 'close',
faecbb446a04 Ortserstellung: new Messpunkt from map, clone or form
Maximilian Krambach <mkrambach@intevation.de>
parents: 1279
diff changeset
192 handler: function() {
faecbb446a04 Ortserstellung: new Messpunkt from map, clone or form
Maximilian Krambach <mkrambach@intevation.de>
parents: 1279
diff changeset
193 me.close();
1279
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 }]
291df0037835 Ortszuordnung window: create, change and display (wip)
Maximilian Krambach <mkrambach@intevation.de>
parents:
diff changeset
196 }];
1284
faecbb446a04 Ortserstellung: new Messpunkt from map, clone or form
Maximilian Krambach <mkrambach@intevation.de>
parents: 1279
diff changeset
197
faecbb446a04 Ortserstellung: new Messpunkt from map, clone or form
Maximilian Krambach <mkrambach@intevation.de>
parents: 1279
diff changeset
198 this.callParent(arguments);
faecbb446a04 Ortserstellung: new Messpunkt from map, clone or form
Maximilian Krambach <mkrambach@intevation.de>
parents: 1279
diff changeset
199 this.getForm().loadRecord(this.record);
1279
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
291df0037835 Ortszuordnung window: create, change and display (wip)
Maximilian Krambach <mkrambach@intevation.de>
parents:
diff changeset
202 /**
1289
bfdc00c24baf Ortszuordnung for messprogramm and probe using same form
Maximilian Krambach <mkrambach@intevation.de>
parents: 1288
diff changeset
203 * checks if the Messpunkt can be committed.
1279
291df0037835 Ortszuordnung window: create, change and display (wip)
Maximilian Krambach <mkrambach@intevation.de>
parents:
diff changeset
204 * Disables the save button if false
291df0037835 Ortszuordnung window: create, change and display (wip)
Maximilian Krambach <mkrambach@intevation.de>
parents:
diff changeset
205 */
291df0037835 Ortszuordnung window: create, change and display (wip)
Maximilian Krambach <mkrambach@intevation.de>
parents:
diff changeset
206 checkCommitEnabled: function() {
1284
faecbb446a04 Ortserstellung: new Messpunkt from map, clone or form
Maximilian Krambach <mkrambach@intevation.de>
parents: 1279
diff changeset
207 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
208 var form = this.getForm();
1289
bfdc00c24baf Ortszuordnung for messprogramm and probe using same form
Maximilian Krambach <mkrambach@intevation.de>
parents: 1288
diff changeset
209 if (form.findField('kdaId').getValue() ||
bfdc00c24baf Ortszuordnung for messprogramm and probe using same form
Maximilian Krambach <mkrambach@intevation.de>
parents: 1288
diff changeset
210 form.findField('koordYExtern').getValue() ||
bfdc00c24baf Ortszuordnung for messprogramm and probe using same form
Maximilian Krambach <mkrambach@intevation.de>
parents: 1288
diff changeset
211 form.findField('koordXExtern').getValue()) {
1284
faecbb446a04 Ortserstellung: new Messpunkt from map, clone or form
Maximilian Krambach <mkrambach@intevation.de>
parents: 1279
diff changeset
212 if (this.checkCoordinates()) {
faecbb446a04 Ortserstellung: new Messpunkt from map, clone or form
Maximilian Krambach <mkrambach@intevation.de>
parents: 1279
diff changeset
213 savebutton.setDisabled(false);
faecbb446a04 Ortserstellung: new Messpunkt from map, clone or form
Maximilian Krambach <mkrambach@intevation.de>
parents: 1279
diff changeset
214 } else {
faecbb446a04 Ortserstellung: new Messpunkt from map, clone or form
Maximilian Krambach <mkrambach@intevation.de>
parents: 1279
diff changeset
215 savebutton.setDisabled(true);
faecbb446a04 Ortserstellung: new Messpunkt from map, clone or form
Maximilian Krambach <mkrambach@intevation.de>
parents: 1279
diff changeset
216 }
1289
bfdc00c24baf Ortszuordnung for messprogramm and probe using same form
Maximilian Krambach <mkrambach@intevation.de>
parents: 1288
diff changeset
217 } else if (form.findField('gemId').getValue() ||
bfdc00c24baf Ortszuordnung for messprogramm and probe using same form
Maximilian Krambach <mkrambach@intevation.de>
parents: 1288
diff changeset
218 form.findField('staatId').getValue() >= 0 ) {
1279
291df0037835 Ortszuordnung window: create, change and display (wip)
Maximilian Krambach <mkrambach@intevation.de>
parents:
diff changeset
219 savebutton.setDisabled(false);
291df0037835 Ortszuordnung window: create, change and display (wip)
Maximilian Krambach <mkrambach@intevation.de>
parents:
diff changeset
220 } else {
291df0037835 Ortszuordnung window: create, change and display (wip)
Maximilian Krambach <mkrambach@intevation.de>
parents:
diff changeset
221 savebutton.setDisabled(true);
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 /**
291df0037835 Ortszuordnung window: create, change and display (wip)
Maximilian Krambach <mkrambach@intevation.de>
parents:
diff changeset
226 * Validates the coordinate fields kdaId, koordXExtern, koordYExtern
291df0037835 Ortszuordnung window: create, change and display (wip)
Maximilian Krambach <mkrambach@intevation.de>
parents:
diff changeset
227 */
291df0037835 Ortszuordnung window: create, change and display (wip)
Maximilian Krambach <mkrambach@intevation.de>
parents:
diff changeset
228 checkCoordinates: function() {
291df0037835 Ortszuordnung window: create, change and display (wip)
Maximilian Krambach <mkrambach@intevation.de>
parents:
diff changeset
229 var x = this.getForm().findField('koordXExtern').getValue();
291df0037835 Ortszuordnung window: create, change and display (wip)
Maximilian Krambach <mkrambach@intevation.de>
parents:
diff changeset
230 var y = this.getForm().findField('koordYExtern').getValue();
291df0037835 Ortszuordnung window: create, change and display (wip)
Maximilian Krambach <mkrambach@intevation.de>
parents:
diff changeset
231 var kda = this.getForm().findField('kdaId').getValue();
291df0037835 Ortszuordnung window: create, change and display (wip)
Maximilian Krambach <mkrambach@intevation.de>
parents:
diff changeset
232 if (x && y && kda) {
291df0037835 Ortszuordnung window: create, change and display (wip)
Maximilian Krambach <mkrambach@intevation.de>
parents:
diff changeset
233 if (kda === 4){
291df0037835 Ortszuordnung window: create, change and display (wip)
Maximilian Krambach <mkrambach@intevation.de>
parents:
diff changeset
234 if (x > -180 && x < 180
291df0037835 Ortszuordnung window: create, change and display (wip)
Maximilian Krambach <mkrambach@intevation.de>
parents:
diff changeset
235 && y > -90 && y < 90) {
291df0037835 Ortszuordnung window: create, change and display (wip)
Maximilian Krambach <mkrambach@intevation.de>
parents:
diff changeset
236 return true;
291df0037835 Ortszuordnung window: create, change and display (wip)
Maximilian Krambach <mkrambach@intevation.de>
parents:
diff changeset
237 } else {
291df0037835 Ortszuordnung window: create, change and display (wip)
Maximilian Krambach <mkrambach@intevation.de>
parents:
diff changeset
238 // TODO: WGS84 (degrees- decimal), coordinates invalid
291df0037835 Ortszuordnung window: create, change and display (wip)
Maximilian Krambach <mkrambach@intevation.de>
parents:
diff changeset
239 return false;
291df0037835 Ortszuordnung window: create, change and display (wip)
Maximilian Krambach <mkrambach@intevation.de>
parents:
diff changeset
240 }
291df0037835 Ortszuordnung window: create, change and display (wip)
Maximilian Krambach <mkrambach@intevation.de>
parents:
diff changeset
241 } else if (kda === 5){
291df0037835 Ortszuordnung window: create, change and display (wip)
Maximilian Krambach <mkrambach@intevation.de>
parents:
diff changeset
242 if (x >= 1000000 && x < 61000000 &&
291df0037835 Ortszuordnung window: create, change and display (wip)
Maximilian Krambach <mkrambach@intevation.de>
parents:
diff changeset
243 y > -10000000 && y < 10000000) {
291df0037835 Ortszuordnung window: create, change and display (wip)
Maximilian Krambach <mkrambach@intevation.de>
parents:
diff changeset
244 return true;
291df0037835 Ortszuordnung window: create, change and display (wip)
Maximilian Krambach <mkrambach@intevation.de>
parents:
diff changeset
245 } else {
291df0037835 Ortszuordnung window: create, change and display (wip)
Maximilian Krambach <mkrambach@intevation.de>
parents:
diff changeset
246 // TODO: UTM, coordinates invalid
291df0037835 Ortszuordnung window: create, change and display (wip)
Maximilian Krambach <mkrambach@intevation.de>
parents:
diff changeset
247 return false;
291df0037835 Ortszuordnung window: create, change and display (wip)
Maximilian Krambach <mkrambach@intevation.de>
parents:
diff changeset
248 }
291df0037835 Ortszuordnung window: create, change and display (wip)
Maximilian Krambach <mkrambach@intevation.de>
parents:
diff changeset
249 } else {
291df0037835 Ortszuordnung window: create, change and display (wip)
Maximilian Krambach <mkrambach@intevation.de>
parents:
diff changeset
250 // TODO KDA not supported
291df0037835 Ortszuordnung window: create, change and display (wip)
Maximilian Krambach <mkrambach@intevation.de>
parents:
diff changeset
251 return false;
291df0037835 Ortszuordnung window: create, change and display (wip)
Maximilian Krambach <mkrambach@intevation.de>
parents:
diff changeset
252 }
291df0037835 Ortszuordnung window: create, change and display (wip)
Maximilian Krambach <mkrambach@intevation.de>
parents:
diff changeset
253 } else {
291df0037835 Ortszuordnung window: create, change and display (wip)
Maximilian Krambach <mkrambach@intevation.de>
parents:
diff changeset
254 // TODO: not all fields filled in
291df0037835 Ortszuordnung window: create, change and display (wip)
Maximilian Krambach <mkrambach@intevation.de>
parents:
diff changeset
255 return false;
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 },
291df0037835 Ortszuordnung window: create, change and display (wip)
Maximilian Krambach <mkrambach@intevation.de>
parents:
diff changeset
258
1284
faecbb446a04 Ortserstellung: new Messpunkt from map, clone or form
Maximilian Krambach <mkrambach@intevation.de>
parents: 1279
diff changeset
259 saveOrt: function() {
faecbb446a04 Ortserstellung: new Messpunkt from map, clone or form
Maximilian Krambach <mkrambach@intevation.de>
parents: 1279
diff changeset
260 var this_panel = this.up('panel');
faecbb446a04 Ortserstellung: new Messpunkt from map, clone or form
Maximilian Krambach <mkrambach@intevation.de>
parents: 1279
diff changeset
261 var form = this_panel.getForm();
faecbb446a04 Ortserstellung: new Messpunkt from map, clone or form
Maximilian Krambach <mkrambach@intevation.de>
parents: 1279
diff changeset
262 var data = form.getFieldValues(true);
faecbb446a04 Ortserstellung: new Messpunkt from map, clone or form
Maximilian Krambach <mkrambach@intevation.de>
parents: 1279
diff changeset
263 for (var key in data) {
faecbb446a04 Ortserstellung: new Messpunkt from map, clone or form
Maximilian Krambach <mkrambach@intevation.de>
parents: 1279
diff changeset
264 form.getRecord().set(key, data[key]);
1279
291df0037835 Ortszuordnung window: create, change and display (wip)
Maximilian Krambach <mkrambach@intevation.de>
parents:
diff changeset
265 }
1284
faecbb446a04 Ortserstellung: new Messpunkt from map, clone or form
Maximilian Krambach <mkrambach@intevation.de>
parents: 1279
diff changeset
266 this_panel.record.set('letzteAenderung', 0);
faecbb446a04 Ortserstellung: new Messpunkt from map, clone or form
Maximilian Krambach <mkrambach@intevation.de>
parents: 1279
diff changeset
267 this_panel.record.set('id', null);
faecbb446a04 Ortserstellung: new Messpunkt from map, clone or form
Maximilian Krambach <mkrambach@intevation.de>
parents: 1279
diff changeset
268 this_panel.record.set('ortId', null);
faecbb446a04 Ortserstellung: new Messpunkt from map, clone or form
Maximilian Krambach <mkrambach@intevation.de>
parents: 1279
diff changeset
269 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
270 this_panel.record.save({
faecbb446a04 Ortserstellung: new Messpunkt from map, clone or form
Maximilian Krambach <mkrambach@intevation.de>
parents: 1279
diff changeset
271 success: function(record, response) {
faecbb446a04 Ortserstellung: new Messpunkt from map, clone or form
Maximilian Krambach <mkrambach@intevation.de>
parents: 1279
diff changeset
272 var newOrtId;
faecbb446a04 Ortserstellung: new Messpunkt from map, clone or form
Maximilian Krambach <mkrambach@intevation.de>
parents: 1279
diff changeset
273 var ozw = this_panel.up().parentWindow;
1295
171eacf989d8 Show error and warnings in new forms
Maximilian Krambach <mkrambach@intevation.de>
parents: 1294
diff changeset
274 var json = Ext.decode(response.response.responseText);
171eacf989d8 Show error and warnings in new forms
Maximilian Krambach <mkrambach@intevation.de>
parents: 1294
diff changeset
275 if (json) {
171eacf989d8 Show error and warnings in new forms
Maximilian Krambach <mkrambach@intevation.de>
parents: 1294
diff changeset
276 this_panel.clearMessages();
171eacf989d8 Show error and warnings in new forms
Maximilian Krambach <mkrambach@intevation.de>
parents: 1294
diff changeset
277 this_panel.setMessages(json.errors, json.warnings);
171eacf989d8 Show error and warnings in new forms
Maximilian Krambach <mkrambach@intevation.de>
parents: 1294
diff changeset
278 }
1284
faecbb446a04 Ortserstellung: new Messpunkt from map, clone or form
Maximilian Krambach <mkrambach@intevation.de>
parents: 1279
diff changeset
279 ozw.ortstore.load({
faecbb446a04 Ortserstellung: new Messpunkt from map, clone or form
Maximilian Krambach <mkrambach@intevation.de>
parents: 1279
diff changeset
280 callback: function(records, operation, success) {
faecbb446a04 Ortserstellung: new Messpunkt from map, clone or form
Maximilian Krambach <mkrambach@intevation.de>
parents: 1279
diff changeset
281 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
282 var osg = ozw.down('ortstammdatengrid');
bfdc00c24baf Ortszuordnung for messprogramm and probe using same form
Maximilian Krambach <mkrambach@intevation.de>
parents: 1288
diff changeset
283 osg.setStore(ozw.ortstore);
1284
faecbb446a04 Ortserstellung: new Messpunkt from map, clone or form
Maximilian Krambach <mkrambach@intevation.de>
parents: 1279
diff changeset
284 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
285 var record = osg.store.getById(id);
bfdc00c24baf Ortszuordnung for messprogramm and probe using same form
Maximilian Krambach <mkrambach@intevation.de>
parents: 1288
diff changeset
286 var selmod = osg.getView().getSelectionModel();
bfdc00c24baf Ortszuordnung for messprogramm and probe using same form
Maximilian Krambach <mkrambach@intevation.de>
parents: 1288
diff changeset
287 selmod.select(record);
bfdc00c24baf Ortszuordnung for messprogramm and probe using same form
Maximilian Krambach <mkrambach@intevation.de>
parents: 1288
diff changeset
288 Ext.Msg.show({
bfdc00c24baf Ortszuordnung for messprogramm and probe using same form
Maximilian Krambach <mkrambach@intevation.de>
parents: 1288
diff changeset
289 title: Lada.getApplication().bundle.getMsg('success'),
bfdc00c24baf Ortszuordnung for messprogramm and probe using same form
Maximilian Krambach <mkrambach@intevation.de>
parents: 1288
diff changeset
290 autoScroll: true,
bfdc00c24baf Ortszuordnung for messprogramm and probe using same form
Maximilian Krambach <mkrambach@intevation.de>
parents: 1288
diff changeset
291 msg: 'Ort erfolgreich angelegt!',
bfdc00c24baf Ortszuordnung for messprogramm and probe using same form
Maximilian Krambach <mkrambach@intevation.de>
parents: 1288
diff changeset
292 buttons: Ext.Msg.OK
bfdc00c24baf Ortszuordnung for messprogramm and probe using same form
Maximilian Krambach <mkrambach@intevation.de>
parents: 1288
diff changeset
293 });
1284
faecbb446a04 Ortserstellung: new Messpunkt from map, clone or form
Maximilian Krambach <mkrambach@intevation.de>
parents: 1279
diff changeset
294 },
faecbb446a04 Ortserstellung: new Messpunkt from map, clone or form
Maximilian Krambach <mkrambach@intevation.de>
parents: 1279
diff changeset
295 scope: this
faecbb446a04 Ortserstellung: new Messpunkt from map, clone or form
Maximilian Krambach <mkrambach@intevation.de>
parents: 1279
diff changeset
296 });
1289
bfdc00c24baf Ortszuordnung for messprogramm and probe using same form
Maximilian Krambach <mkrambach@intevation.de>
parents: 1288
diff changeset
297
1284
faecbb446a04 Ortserstellung: new Messpunkt from map, clone or form
Maximilian Krambach <mkrambach@intevation.de>
parents: 1279
diff changeset
298 },
faecbb446a04 Ortserstellung: new Messpunkt from map, clone or form
Maximilian Krambach <mkrambach@intevation.de>
parents: 1279
diff changeset
299 failure: function(record, response) {
1288
08085b7d1d0b Ortszuordnung: Search, new orte, display and validity check
Maximilian Krambach <mkrambach@intevation.de>
parents: 1284
diff changeset
300 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
301 if (json) {
08085b7d1d0b Ortszuordnung: Search, new orte, display and validity check
Maximilian Krambach <mkrambach@intevation.de>
parents: 1284
diff changeset
302 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
303 formPanel.setMessages(json.errors, json.warnings);
08085b7d1d0b Ortszuordnung: Search, new orte, display and validity check
Maximilian Krambach <mkrambach@intevation.de>
parents: 1284
diff changeset
304 }
08085b7d1d0b Ortszuordnung: Search, new orte, display and validity check
Maximilian Krambach <mkrambach@intevation.de>
parents: 1284
diff changeset
305 if(json.message){
08085b7d1d0b Ortszuordnung: Search, new orte, display and validity check
Maximilian Krambach <mkrambach@intevation.de>
parents: 1284
diff changeset
306 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
307 +' #'+json.message,
08085b7d1d0b Ortszuordnung: Search, new orte, display and validity check
Maximilian Krambach <mkrambach@intevation.de>
parents: 1284
diff changeset
308 Lada.getApplication().bundle.getMsg(json.message));
08085b7d1d0b Ortszuordnung: Search, new orte, display and validity check
Maximilian Krambach <mkrambach@intevation.de>
parents: 1284
diff changeset
309 } else {
08085b7d1d0b Ortszuordnung: Search, new orte, display and validity check
Maximilian Krambach <mkrambach@intevation.de>
parents: 1284
diff changeset
310 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
311 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
312 }
08085b7d1d0b Ortszuordnung: Search, new orte, display and validity check
Maximilian Krambach <mkrambach@intevation.de>
parents: 1284
diff changeset
313 } else {
08085b7d1d0b Ortszuordnung: Search, new orte, display and validity check
Maximilian Krambach <mkrambach@intevation.de>
parents: 1284
diff changeset
314 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
315 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
316 }
1284
faecbb446a04 Ortserstellung: new Messpunkt from map, clone or form
Maximilian Krambach <mkrambach@intevation.de>
parents: 1279
diff changeset
317 }
faecbb446a04 Ortserstellung: new Messpunkt from map, clone or form
Maximilian Krambach <mkrambach@intevation.de>
parents: 1279
diff changeset
318 });
1295
171eacf989d8 Show error and warnings in new forms
Maximilian Krambach <mkrambach@intevation.de>
parents: 1294
diff changeset
319 },
171eacf989d8 Show error and warnings in new forms
Maximilian Krambach <mkrambach@intevation.de>
parents: 1294
diff changeset
320
171eacf989d8 Show error and warnings in new forms
Maximilian Krambach <mkrambach@intevation.de>
parents: 1294
diff changeset
321 setMessages: function(errors, warnings) {
171eacf989d8 Show error and warnings in new forms
Maximilian Krambach <mkrambach@intevation.de>
parents: 1294
diff changeset
322 var key;
171eacf989d8 Show error and warnings in new forms
Maximilian Krambach <mkrambach@intevation.de>
parents: 1294
diff changeset
323 var element;
171eacf989d8 Show error and warnings in new forms
Maximilian Krambach <mkrambach@intevation.de>
parents: 1294
diff changeset
324 var content;
171eacf989d8 Show error and warnings in new forms
Maximilian Krambach <mkrambach@intevation.de>
parents: 1294
diff changeset
325 var i18n = Lada.getApplication().bundle;
171eacf989d8 Show error and warnings in new forms
Maximilian Krambach <mkrambach@intevation.de>
parents: 1294
diff changeset
326 if (warnings) {
171eacf989d8 Show error and warnings in new forms
Maximilian Krambach <mkrambach@intevation.de>
parents: 1294
diff changeset
327 for (key in warnings) {
171eacf989d8 Show error and warnings in new forms
Maximilian Krambach <mkrambach@intevation.de>
parents: 1294
diff changeset
328 element = this.down('component[name=' + key + ']');
171eacf989d8 Show error and warnings in new forms
Maximilian Krambach <mkrambach@intevation.de>
parents: 1294
diff changeset
329 if (!element) {
171eacf989d8 Show error and warnings in new forms
Maximilian Krambach <mkrambach@intevation.de>
parents: 1294
diff changeset
330 continue;
171eacf989d8 Show error and warnings in new forms
Maximilian Krambach <mkrambach@intevation.de>
parents: 1294
diff changeset
331 }
171eacf989d8 Show error and warnings in new forms
Maximilian Krambach <mkrambach@intevation.de>
parents: 1294
diff changeset
332 content = warnings[key];
171eacf989d8 Show error and warnings in new forms
Maximilian Krambach <mkrambach@intevation.de>
parents: 1294
diff changeset
333 var warnText = '';
171eacf989d8 Show error and warnings in new forms
Maximilian Krambach <mkrambach@intevation.de>
parents: 1294
diff changeset
334 for (var i = 0; i < content.length; i++) {
171eacf989d8 Show error and warnings in new forms
Maximilian Krambach <mkrambach@intevation.de>
parents: 1294
diff changeset
335 warnText += i18n.getMsg(content[i].toString()) + '\n';
171eacf989d8 Show error and warnings in new forms
Maximilian Krambach <mkrambach@intevation.de>
parents: 1294
diff changeset
336 }
171eacf989d8 Show error and warnings in new forms
Maximilian Krambach <mkrambach@intevation.de>
parents: 1294
diff changeset
337 element.showWarnings(warnText);
171eacf989d8 Show error and warnings in new forms
Maximilian Krambach <mkrambach@intevation.de>
parents: 1294
diff changeset
338 }
171eacf989d8 Show error and warnings in new forms
Maximilian Krambach <mkrambach@intevation.de>
parents: 1294
diff changeset
339 }
171eacf989d8 Show error and warnings in new forms
Maximilian Krambach <mkrambach@intevation.de>
parents: 1294
diff changeset
340 if (errors) {
171eacf989d8 Show error and warnings in new forms
Maximilian Krambach <mkrambach@intevation.de>
parents: 1294
diff changeset
341 for (key in errors) {
171eacf989d8 Show error and warnings in new forms
Maximilian Krambach <mkrambach@intevation.de>
parents: 1294
diff changeset
342 element = this.down('component[name=' + key + ']');
171eacf989d8 Show error and warnings in new forms
Maximilian Krambach <mkrambach@intevation.de>
parents: 1294
diff changeset
343 if (!element) {
171eacf989d8 Show error and warnings in new forms
Maximilian Krambach <mkrambach@intevation.de>
parents: 1294
diff changeset
344 continue;
171eacf989d8 Show error and warnings in new forms
Maximilian Krambach <mkrambach@intevation.de>
parents: 1294
diff changeset
345 }
171eacf989d8 Show error and warnings in new forms
Maximilian Krambach <mkrambach@intevation.de>
parents: 1294
diff changeset
346 content = errors[key];
171eacf989d8 Show error and warnings in new forms
Maximilian Krambach <mkrambach@intevation.de>
parents: 1294
diff changeset
347 var errorText = '';
171eacf989d8 Show error and warnings in new forms
Maximilian Krambach <mkrambach@intevation.de>
parents: 1294
diff changeset
348 for (var i = 0; i < content.length; i++) {
171eacf989d8 Show error and warnings in new forms
Maximilian Krambach <mkrambach@intevation.de>
parents: 1294
diff changeset
349 errorText += i18n.getMsg(content[i].toString()) + '\n';
171eacf989d8 Show error and warnings in new forms
Maximilian Krambach <mkrambach@intevation.de>
parents: 1294
diff changeset
350 }
171eacf989d8 Show error and warnings in new forms
Maximilian Krambach <mkrambach@intevation.de>
parents: 1294
diff changeset
351 element.showErrors(errorText);
171eacf989d8 Show error and warnings in new forms
Maximilian Krambach <mkrambach@intevation.de>
parents: 1294
diff changeset
352 }
171eacf989d8 Show error and warnings in new forms
Maximilian Krambach <mkrambach@intevation.de>
parents: 1294
diff changeset
353 }
171eacf989d8 Show error and warnings in new forms
Maximilian Krambach <mkrambach@intevation.de>
parents: 1294
diff changeset
354 },
171eacf989d8 Show error and warnings in new forms
Maximilian Krambach <mkrambach@intevation.de>
parents: 1294
diff changeset
355
171eacf989d8 Show error and warnings in new forms
Maximilian Krambach <mkrambach@intevation.de>
parents: 1294
diff changeset
356 clearMessages: function() {
171eacf989d8 Show error and warnings in new forms
Maximilian Krambach <mkrambach@intevation.de>
parents: 1294
diff changeset
357 // TODO: this is a stub
171eacf989d8 Show error and warnings in new forms
Maximilian Krambach <mkrambach@intevation.de>
parents: 1294
diff changeset
358 }
171eacf989d8 Show error and warnings in new forms
Maximilian Krambach <mkrambach@intevation.de>
parents: 1294
diff changeset
359
1279
291df0037835 Ortszuordnung window: create, change and display (wip)
Maximilian Krambach <mkrambach@intevation.de>
parents:
diff changeset
360 });

http://lada.wald.intevation.org