annotate app/view/form/Ortserstellung.js @ 1336:f879c806f880

Create orte store for grid to have only orte with the correct netzbetreiberId
author Raimund Renkert <raimund.renkert@intevation.de>
date Fri, 03 Feb 2017 17:43:23 +0100
parents b9f0bb189c25
children 7194964183f4
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
1321
f1e348109ebb Updated style to fit the other windows style.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 1320
diff changeset
23 border: 0,
f1e348109ebb Updated style to fit the other windows style.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 1320
diff changeset
24
1284
faecbb446a04 Ortserstellung: new Messpunkt from map, clone or form
Maximilian Krambach <mkrambach@intevation.de>
parents: 1279
diff changeset
25 record: null,
1279
291df0037835 Ortszuordnung window: create, change and display (wip)
Maximilian Krambach <mkrambach@intevation.de>
parents:
diff changeset
26
1314
8ace34d9352a changed behaviour of ortserstellung window on save; fix update (form)
Maximilian Krambach <mkrambach@intevation.de>
parents: 1313
diff changeset
27 trackResetOnLoad: true,
8ace34d9352a changed behaviour of ortserstellung window on save; fix update (form)
Maximilian Krambach <mkrambach@intevation.de>
parents: 1313
diff changeset
28
1279
291df0037835 Ortszuordnung window: create, change and display (wip)
Maximilian Krambach <mkrambach@intevation.de>
parents:
diff changeset
29 initComponent: function() {
291df0037835 Ortszuordnung window: create, change and display (wip)
Maximilian Krambach <mkrambach@intevation.de>
parents:
diff changeset
30 var i18n = Lada.getApplication().bundle;
291df0037835 Ortszuordnung window: create, change and display (wip)
Maximilian Krambach <mkrambach@intevation.de>
parents:
diff changeset
31 var me = this;
1284
faecbb446a04 Ortserstellung: new Messpunkt from map, clone or form
Maximilian Krambach <mkrambach@intevation.de>
parents: 1279
diff changeset
32 this.items = [{
faecbb446a04 Ortserstellung: new Messpunkt from map, clone or form
Maximilian Krambach <mkrambach@intevation.de>
parents: 1279
diff changeset
33 xtype: 'netzbetreiber',
faecbb446a04 Ortserstellung: new Messpunkt from map, clone or form
Maximilian Krambach <mkrambach@intevation.de>
parents: 1279
diff changeset
34 editable: false,
faecbb446a04 Ortserstellung: new Messpunkt from map, clone or form
Maximilian Krambach <mkrambach@intevation.de>
parents: 1279
diff changeset
35 readOnly: true,
faecbb446a04 Ortserstellung: new Messpunkt from map, clone or form
Maximilian Krambach <mkrambach@intevation.de>
parents: 1279
diff changeset
36 submitValue: true,
1289
bfdc00c24baf Ortszuordnung for messprogramm and probe using same form
Maximilian Krambach <mkrambach@intevation.de>
parents: 1288
diff changeset
37 border: 0,
1284
faecbb446a04 Ortserstellung: new Messpunkt from map, clone or form
Maximilian Krambach <mkrambach@intevation.de>
parents: 1279
diff changeset
38 fieldLabel: i18n.getMsg('netzbetreiberId'),
1289
bfdc00c24baf Ortszuordnung for messprogramm and probe using same form
Maximilian Krambach <mkrambach@intevation.de>
parents: 1288
diff changeset
39 labelWidth: 125,
1288
08085b7d1d0b Ortszuordnung: Search, new orte, display and validity check
Maximilian Krambach <mkrambach@intevation.de>
parents: 1284
diff changeset
40 value: Lada.netzbetreiber[0]
1306
c86fd6976264 Fix indentation.
Tom Gottfried <tom@intevation.de>
parents: 1297
diff changeset
41 }, {
1309
1bcc3a62e909 insert and preset OrtId field on Orterstellung
Maximilian Krambach <mkrambach@intevation.de>
parents: 1306
diff changeset
42 xtype: 'textfield',
1bcc3a62e909 insert and preset OrtId field on Orterstellung
Maximilian Krambach <mkrambach@intevation.de>
parents: 1306
diff changeset
43 name: 'ortId',
1bcc3a62e909 insert and preset OrtId field on Orterstellung
Maximilian Krambach <mkrambach@intevation.de>
parents: 1306
diff changeset
44 maxLength: 10,
1bcc3a62e909 insert and preset OrtId field on Orterstellung
Maximilian Krambach <mkrambach@intevation.de>
parents: 1306
diff changeset
45 labelWidth: 125,
1bcc3a62e909 insert and preset OrtId field on Orterstellung
Maximilian Krambach <mkrambach@intevation.de>
parents: 1306
diff changeset
46 fieldLabel: i18n.getMsg('orte.ortId')
1bcc3a62e909 insert and preset OrtId field on Orterstellung
Maximilian Krambach <mkrambach@intevation.de>
parents: 1306
diff changeset
47 }, {
1284
faecbb446a04 Ortserstellung: new Messpunkt from map, clone or form
Maximilian Krambach <mkrambach@intevation.de>
parents: 1279
diff changeset
48 xtype: 'checkbox',
1321
f1e348109ebb Updated style to fit the other windows style.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 1320
diff changeset
49 labelWidth: 125,
1284
faecbb446a04 Ortserstellung: new Messpunkt from map, clone or form
Maximilian Krambach <mkrambach@intevation.de>
parents: 1279
diff changeset
50 name: 'aktiv',
faecbb446a04 Ortserstellung: new Messpunkt from map, clone or form
Maximilian Krambach <mkrambach@intevation.de>
parents: 1279
diff changeset
51 fieldLabel: 'aktiv:'
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: 'staat',
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('staat'),
faecbb446a04 Ortserstellung: new Messpunkt from map, clone or form
Maximilian Krambach <mkrambach@intevation.de>
parents: 1279
diff changeset
56 name: 'staatId',
1306
c86fd6976264 Fix indentation.
Tom Gottfried <tom@intevation.de>
parents: 1297
diff changeset
57 forceSelection: true,
1284
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: 'verwaltungseinheit',
faecbb446a04 Ortserstellung: new Messpunkt from map, clone or form
Maximilian Krambach <mkrambach@intevation.de>
parents: 1279
diff changeset
65 labelWidth: 125,
1297
5dfd5798cbcc i18n-wording
Tom Gottfried <tom@intevation.de>
parents: 1295
diff changeset
66 fieldLabel: i18n.getMsg('orte.verwaltungseinheit'),
1289
bfdc00c24baf Ortszuordnung for messprogramm and probe using same form
Maximilian Krambach <mkrambach@intevation.de>
parents: 1288
diff changeset
67 forceSelection: true,
1284
faecbb446a04 Ortserstellung: new Messpunkt from map, clone or form
Maximilian Krambach <mkrambach@intevation.de>
parents: 1279
diff changeset
68 name: 'gemId',
faecbb446a04 Ortserstellung: new Messpunkt from map, clone or form
Maximilian Krambach <mkrambach@intevation.de>
parents: 1279
diff changeset
69 listeners: {
faecbb446a04 Ortserstellung: new Messpunkt from map, clone or form
Maximilian Krambach <mkrambach@intevation.de>
parents: 1279
diff changeset
70 change: {
faecbb446a04 Ortserstellung: new Messpunkt from map, clone or form
Maximilian Krambach <mkrambach@intevation.de>
parents: 1279
diff changeset
71 fn: function() { me.checkCommitEnabled() }
1279
291df0037835 Ortszuordnung window: create, change and display (wip)
Maximilian Krambach <mkrambach@intevation.de>
parents:
diff changeset
72 }
1284
faecbb446a04 Ortserstellung: new Messpunkt from map, clone or form
Maximilian Krambach <mkrambach@intevation.de>
parents: 1279
diff changeset
73 }
faecbb446a04 Ortserstellung: new Messpunkt from map, clone or form
Maximilian Krambach <mkrambach@intevation.de>
parents: 1279
diff changeset
74 }, {
1331
b9f0bb189c25 Use koordinaten art combobox as input field in create ort window.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 1323
diff changeset
75 xtype: 'koordinatenart',
1284
faecbb446a04 Ortserstellung: new Messpunkt from map, clone or form
Maximilian Krambach <mkrambach@intevation.de>
parents: 1279
diff changeset
76 labelWidth: 125,
faecbb446a04 Ortserstellung: new Messpunkt from map, clone or form
Maximilian Krambach <mkrambach@intevation.de>
parents: 1279
diff changeset
77 fieldLabel: i18n.getMsg('orte.kda'),
faecbb446a04 Ortserstellung: new Messpunkt from map, clone or form
Maximilian Krambach <mkrambach@intevation.de>
parents: 1279
diff changeset
78 allowDecimals: false,
faecbb446a04 Ortserstellung: new Messpunkt from map, clone or form
Maximilian Krambach <mkrambach@intevation.de>
parents: 1279
diff changeset
79 maxLength: 1,
faecbb446a04 Ortserstellung: new Messpunkt from map, clone or form
Maximilian Krambach <mkrambach@intevation.de>
parents: 1279
diff changeset
80 name: 'kdaId',
faecbb446a04 Ortserstellung: new Messpunkt from map, clone or form
Maximilian Krambach <mkrambach@intevation.de>
parents: 1279
diff changeset
81 listeners: {
faecbb446a04 Ortserstellung: new Messpunkt from map, clone or form
Maximilian Krambach <mkrambach@intevation.de>
parents: 1279
diff changeset
82 change: {
faecbb446a04 Ortserstellung: new Messpunkt from map, clone or form
Maximilian Krambach <mkrambach@intevation.de>
parents: 1279
diff changeset
83 fn: function() { me.checkCommitEnabled() }
1279
291df0037835 Ortszuordnung window: create, change and display (wip)
Maximilian Krambach <mkrambach@intevation.de>
parents:
diff changeset
84 }
1284
faecbb446a04 Ortserstellung: new Messpunkt from map, clone or form
Maximilian Krambach <mkrambach@intevation.de>
parents: 1279
diff changeset
85 }
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 xtype: 'numfield',
faecbb446a04 Ortserstellung: new Messpunkt from map, clone or form
Maximilian Krambach <mkrambach@intevation.de>
parents: 1279
diff changeset
88 labelWidth: 125,
faecbb446a04 Ortserstellung: new Messpunkt from map, clone or form
Maximilian Krambach <mkrambach@intevation.de>
parents: 1279
diff changeset
89 fieldLabel: i18n.getMsg('orte.koordx'),
faecbb446a04 Ortserstellung: new Messpunkt from map, clone or form
Maximilian Krambach <mkrambach@intevation.de>
parents: 1279
diff changeset
90 name: 'koordXExtern',
faecbb446a04 Ortserstellung: new Messpunkt from map, clone or form
Maximilian Krambach <mkrambach@intevation.de>
parents: 1279
diff changeset
91 allowDecimals: true,
faecbb446a04 Ortserstellung: new Messpunkt from map, clone or form
Maximilian Krambach <mkrambach@intevation.de>
parents: 1279
diff changeset
92 decimalPrecision: 5,
1310
9b50bf4c218b Set textfield lengths according to database schema.
Tom Gottfried <tom@intevation.de>
parents: 1309
diff changeset
93 maxLength: 22,
1284
faecbb446a04 Ortserstellung: new Messpunkt from map, clone or form
Maximilian Krambach <mkrambach@intevation.de>
parents: 1279
diff changeset
94 listeners: {
faecbb446a04 Ortserstellung: new Messpunkt from map, clone or form
Maximilian Krambach <mkrambach@intevation.de>
parents: 1279
diff changeset
95 change: {
faecbb446a04 Ortserstellung: new Messpunkt from map, clone or form
Maximilian Krambach <mkrambach@intevation.de>
parents: 1279
diff changeset
96 fn: function() { me.checkCommitEnabled() }
faecbb446a04 Ortserstellung: new Messpunkt from map, clone or form
Maximilian Krambach <mkrambach@intevation.de>
parents: 1279
diff changeset
97 }
faecbb446a04 Ortserstellung: new Messpunkt from map, clone or form
Maximilian Krambach <mkrambach@intevation.de>
parents: 1279
diff changeset
98 }
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 xtype: 'numfield',
faecbb446a04 Ortserstellung: new Messpunkt from map, clone or form
Maximilian Krambach <mkrambach@intevation.de>
parents: 1279
diff changeset
101 labelWidth: 125,
faecbb446a04 Ortserstellung: new Messpunkt from map, clone or form
Maximilian Krambach <mkrambach@intevation.de>
parents: 1279
diff changeset
102 fieldLabel: i18n.getMsg('orte.koordy'),
faecbb446a04 Ortserstellung: new Messpunkt from map, clone or form
Maximilian Krambach <mkrambach@intevation.de>
parents: 1279
diff changeset
103 name: 'koordYExtern',
faecbb446a04 Ortserstellung: new Messpunkt from map, clone or form
Maximilian Krambach <mkrambach@intevation.de>
parents: 1279
diff changeset
104 allowDecimals: true,
faecbb446a04 Ortserstellung: new Messpunkt from map, clone or form
Maximilian Krambach <mkrambach@intevation.de>
parents: 1279
diff changeset
105 decimalPrecision: 5,
1310
9b50bf4c218b Set textfield lengths according to database schema.
Tom Gottfried <tom@intevation.de>
parents: 1309
diff changeset
106 maxLength: 22,
1284
faecbb446a04 Ortserstellung: new Messpunkt from map, clone or form
Maximilian Krambach <mkrambach@intevation.de>
parents: 1279
diff changeset
107 listeners: {
faecbb446a04 Ortserstellung: new Messpunkt from map, clone or form
Maximilian Krambach <mkrambach@intevation.de>
parents: 1279
diff changeset
108 change: {
faecbb446a04 Ortserstellung: new Messpunkt from map, clone or form
Maximilian Krambach <mkrambach@intevation.de>
parents: 1279
diff changeset
109 fn: function() { me.checkCommitEnabled() }
faecbb446a04 Ortserstellung: new Messpunkt from map, clone or form
Maximilian Krambach <mkrambach@intevation.de>
parents: 1279
diff changeset
110 }
faecbb446a04 Ortserstellung: new Messpunkt from map, clone or form
Maximilian Krambach <mkrambach@intevation.de>
parents: 1279
diff changeset
111 }
faecbb446a04 Ortserstellung: new Messpunkt from map, clone or form
Maximilian Krambach <mkrambach@intevation.de>
parents: 1279
diff changeset
112 }, {
faecbb446a04 Ortserstellung: new Messpunkt from map, clone or form
Maximilian Krambach <mkrambach@intevation.de>
parents: 1279
diff changeset
113 xtype: 'numfield',
faecbb446a04 Ortserstellung: new Messpunkt from map, clone or form
Maximilian Krambach <mkrambach@intevation.de>
parents: 1279
diff changeset
114 labelWidth: 125,
1289
bfdc00c24baf Ortszuordnung for messprogramm and probe using same form
Maximilian Krambach <mkrambach@intevation.de>
parents: 1288
diff changeset
115 fieldLabel: i18n.getMsg('orte.hoeheLand'),
1284
faecbb446a04 Ortserstellung: new Messpunkt from map, clone or form
Maximilian Krambach <mkrambach@intevation.de>
parents: 1279
diff changeset
116 name: 'hoeheLand',
faecbb446a04 Ortserstellung: new Messpunkt from map, clone or form
Maximilian Krambach <mkrambach@intevation.de>
parents: 1279
diff changeset
117 maxLength: 10,
faecbb446a04 Ortserstellung: new Messpunkt from map, clone or form
Maximilian Krambach <mkrambach@intevation.de>
parents: 1279
diff changeset
118 allowDecimals: true
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,
1310
9b50bf4c218b Set textfield lengths according to database schema.
Tom Gottfried <tom@intevation.de>
parents: 1309
diff changeset
122 maxLength: 15,
1284
faecbb446a04 Ortserstellung: new Messpunkt from map, clone or form
Maximilian Krambach <mkrambach@intevation.de>
parents: 1279
diff changeset
123 name: 'kurztext',
1289
bfdc00c24baf Ortszuordnung for messprogramm and probe using same form
Maximilian Krambach <mkrambach@intevation.de>
parents: 1288
diff changeset
124 fieldLabel: i18n.getMsg('orte.kurztext')
1284
faecbb446a04 Ortserstellung: new Messpunkt from map, clone or form
Maximilian Krambach <mkrambach@intevation.de>
parents: 1279
diff changeset
125 },{
faecbb446a04 Ortserstellung: new Messpunkt from map, clone or form
Maximilian Krambach <mkrambach@intevation.de>
parents: 1279
diff changeset
126 xtype: 'tfield',
faecbb446a04 Ortserstellung: new Messpunkt from map, clone or form
Maximilian Krambach <mkrambach@intevation.de>
parents: 1279
diff changeset
127 labelWidth: 125,
1310
9b50bf4c218b Set textfield lengths according to database schema.
Tom Gottfried <tom@intevation.de>
parents: 1309
diff changeset
128 maxLength: 100,
1284
faecbb446a04 Ortserstellung: new Messpunkt from map, clone or form
Maximilian Krambach <mkrambach@intevation.de>
parents: 1279
diff changeset
129 fieldLabel: i18n.getMsg('orte.langtext'),
faecbb446a04 Ortserstellung: new Messpunkt from map, clone or form
Maximilian Krambach <mkrambach@intevation.de>
parents: 1279
diff changeset
130 name: 'langtext'
faecbb446a04 Ortserstellung: new Messpunkt from map, clone or form
Maximilian Krambach <mkrambach@intevation.de>
parents: 1279
diff changeset
131 },{
faecbb446a04 Ortserstellung: new Messpunkt from map, clone or form
Maximilian Krambach <mkrambach@intevation.de>
parents: 1279
diff changeset
132 xtype: 'tfield',
faecbb446a04 Ortserstellung: new Messpunkt from map, clone or form
Maximilian Krambach <mkrambach@intevation.de>
parents: 1279
diff changeset
133 labelWidth: 125,
1310
9b50bf4c218b Set textfield lengths according to database schema.
Tom Gottfried <tom@intevation.de>
parents: 1309
diff changeset
134 maxLength: 70,
1289
bfdc00c24baf Ortszuordnung for messprogramm and probe using same form
Maximilian Krambach <mkrambach@intevation.de>
parents: 1288
diff changeset
135 fieldLabel: i18n.getMsg('orte.berichtstext'),
1284
faecbb446a04 Ortserstellung: new Messpunkt from map, clone or form
Maximilian Krambach <mkrambach@intevation.de>
parents: 1279
diff changeset
136 name: 'berichtstext'
1289
bfdc00c24baf Ortszuordnung for messprogramm and probe using same form
Maximilian Krambach <mkrambach@intevation.de>
parents: 1288
diff changeset
137 }, {
1320
3a3148d50b9c Use new combobox widgets as input elements in create ort window.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 1314
diff changeset
138 xtype: 'kta',
1289
bfdc00c24baf Ortszuordnung for messprogramm and probe using same form
Maximilian Krambach <mkrambach@intevation.de>
parents: 1288
diff changeset
139 labelWidth: 125,
bfdc00c24baf Ortszuordnung for messprogramm and probe using same form
Maximilian Krambach <mkrambach@intevation.de>
parents: 1288
diff changeset
140 maxLength: 100,
bfdc00c24baf Ortszuordnung for messprogramm and probe using same form
Maximilian Krambach <mkrambach@intevation.de>
parents: 1288
diff changeset
141 name: 'anlageId',
bfdc00c24baf Ortszuordnung for messprogramm and probe using same form
Maximilian Krambach <mkrambach@intevation.de>
parents: 1288
diff changeset
142 fieldLabel: i18n.getMsg('orte.anlageId')
bfdc00c24baf Ortszuordnung for messprogramm and probe using same form
Maximilian Krambach <mkrambach@intevation.de>
parents: 1288
diff changeset
143 }, {
bfdc00c24baf Ortszuordnung for messprogramm and probe using same form
Maximilian Krambach <mkrambach@intevation.de>
parents: 1288
diff changeset
144 xtype: 'tfield',
bfdc00c24baf Ortszuordnung for messprogramm and probe using same form
Maximilian Krambach <mkrambach@intevation.de>
parents: 1288
diff changeset
145 labelWidth: 125,
1310
9b50bf4c218b Set textfield lengths according to database schema.
Tom Gottfried <tom@intevation.de>
parents: 1309
diff changeset
146 maxLength: 1,
1289
bfdc00c24baf Ortszuordnung for messprogramm and probe using same form
Maximilian Krambach <mkrambach@intevation.de>
parents: 1288
diff changeset
147 name: 'zone',
bfdc00c24baf Ortszuordnung for messprogramm and probe using same form
Maximilian Krambach <mkrambach@intevation.de>
parents: 1288
diff changeset
148 fieldLabel: i18n.getMsg('orte.zone')
bfdc00c24baf Ortszuordnung for messprogramm and probe using same form
Maximilian Krambach <mkrambach@intevation.de>
parents: 1288
diff changeset
149 },{
bfdc00c24baf Ortszuordnung for messprogramm and probe using same form
Maximilian Krambach <mkrambach@intevation.de>
parents: 1288
diff changeset
150 xtype: 'tfield',
bfdc00c24baf Ortszuordnung for messprogramm and probe using same form
Maximilian Krambach <mkrambach@intevation.de>
parents: 1288
diff changeset
151 labelWidth: 125,
1310
9b50bf4c218b Set textfield lengths according to database schema.
Tom Gottfried <tom@intevation.de>
parents: 1309
diff changeset
152 maxLength: 2,
1289
bfdc00c24baf Ortszuordnung for messprogramm and probe using same form
Maximilian Krambach <mkrambach@intevation.de>
parents: 1288
diff changeset
153 name: 'sektor',
bfdc00c24baf Ortszuordnung for messprogramm and probe using same form
Maximilian Krambach <mkrambach@intevation.de>
parents: 1288
diff changeset
154 fieldLabel: i18n.getMsg('orte.sektor')
bfdc00c24baf Ortszuordnung for messprogramm and probe using same form
Maximilian Krambach <mkrambach@intevation.de>
parents: 1288
diff changeset
155 },{
1320
3a3148d50b9c Use new combobox widgets as input elements in create ort window.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 1314
diff changeset
156 xtype: 'orttyp',
1289
bfdc00c24baf Ortszuordnung for messprogramm and probe using same form
Maximilian Krambach <mkrambach@intevation.de>
parents: 1288
diff changeset
157 labelWidth: 125,
bfdc00c24baf Ortszuordnung for messprogramm and probe using same form
Maximilian Krambach <mkrambach@intevation.de>
parents: 1288
diff changeset
158 maxLength: 100,
bfdc00c24baf Ortszuordnung for messprogramm and probe using same form
Maximilian Krambach <mkrambach@intevation.de>
parents: 1288
diff changeset
159 name: 'ortTyp',
bfdc00c24baf Ortszuordnung for messprogramm and probe using same form
Maximilian Krambach <mkrambach@intevation.de>
parents: 1288
diff changeset
160 fieldLabel: i18n.getMsg('orte.ortTyp')
bfdc00c24baf Ortszuordnung for messprogramm and probe using same form
Maximilian Krambach <mkrambach@intevation.de>
parents: 1288
diff changeset
161 },{
bfdc00c24baf Ortszuordnung for messprogramm and probe using same form
Maximilian Krambach <mkrambach@intevation.de>
parents: 1288
diff changeset
162 xtype: 'tfield',
bfdc00c24baf Ortszuordnung for messprogramm and probe using same form
Maximilian Krambach <mkrambach@intevation.de>
parents: 1288
diff changeset
163 labelWidth: 125,
1310
9b50bf4c218b Set textfield lengths according to database schema.
Tom Gottfried <tom@intevation.de>
parents: 1309
diff changeset
164 maxLength: 10,
1289
bfdc00c24baf Ortszuordnung for messprogramm and probe using same form
Maximilian Krambach <mkrambach@intevation.de>
parents: 1288
diff changeset
165 name: 'zustaendigkeit',
bfdc00c24baf Ortszuordnung for messprogramm and probe using same form
Maximilian Krambach <mkrambach@intevation.de>
parents: 1288
diff changeset
166 fieldLabel: i18n.getMsg('orte.zustaendigkeit')
bfdc00c24baf Ortszuordnung for messprogramm and probe using same form
Maximilian Krambach <mkrambach@intevation.de>
parents: 1288
diff changeset
167 },{
bfdc00c24baf Ortszuordnung for messprogramm and probe using same form
Maximilian Krambach <mkrambach@intevation.de>
parents: 1288
diff changeset
168 xtype: 'tfield',
bfdc00c24baf Ortszuordnung for messprogramm and probe using same form
Maximilian Krambach <mkrambach@intevation.de>
parents: 1288
diff changeset
169 labelWidth: 125,
1310
9b50bf4c218b Set textfield lengths according to database schema.
Tom Gottfried <tom@intevation.de>
parents: 1309
diff changeset
170 maxLength: 10,
1289
bfdc00c24baf Ortszuordnung for messprogramm and probe using same form
Maximilian Krambach <mkrambach@intevation.de>
parents: 1288
diff changeset
171 name: 'mpArt',
bfdc00c24baf Ortszuordnung for messprogramm and probe using same form
Maximilian Krambach <mkrambach@intevation.de>
parents: 1288
diff changeset
172 fieldLabel: i18n.getMsg('orte.mpArt')
bfdc00c24baf Ortszuordnung for messprogramm and probe using same form
Maximilian Krambach <mkrambach@intevation.de>
parents: 1288
diff changeset
173 },{
bfdc00c24baf Ortszuordnung for messprogramm and probe using same form
Maximilian Krambach <mkrambach@intevation.de>
parents: 1288
diff changeset
174 xtype: 'tfield',
bfdc00c24baf Ortszuordnung for messprogramm and probe using same form
Maximilian Krambach <mkrambach@intevation.de>
parents: 1288
diff changeset
175 labelWidth: 125,
1310
9b50bf4c218b Set textfield lengths according to database schema.
Tom Gottfried <tom@intevation.de>
parents: 1309
diff changeset
176 maxLength: 10,
1289
bfdc00c24baf Ortszuordnung for messprogramm and probe using same form
Maximilian Krambach <mkrambach@intevation.de>
parents: 1288
diff changeset
177 name: 'nutsCode',
bfdc00c24baf Ortszuordnung for messprogramm and probe using same form
Maximilian Krambach <mkrambach@intevation.de>
parents: 1288
diff changeset
178 fieldLabel: i18n.getMsg('orte.nutsCode')
bfdc00c24baf Ortszuordnung for messprogramm and probe using same form
Maximilian Krambach <mkrambach@intevation.de>
parents: 1288
diff changeset
179 },{
1320
3a3148d50b9c Use new combobox widgets as input elements in create ort window.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 1314
diff changeset
180 xtype: 'ortszusatz',
1289
bfdc00c24baf Ortszuordnung for messprogramm and probe using same form
Maximilian Krambach <mkrambach@intevation.de>
parents: 1288
diff changeset
181 labelWidth: 125,
1310
9b50bf4c218b Set textfield lengths according to database schema.
Tom Gottfried <tom@intevation.de>
parents: 1309
diff changeset
182 maxLength: 7,
1289
bfdc00c24baf Ortszuordnung for messprogramm and probe using same form
Maximilian Krambach <mkrambach@intevation.de>
parents: 1288
diff changeset
183 name: 'ozId',
bfdc00c24baf Ortszuordnung for messprogramm and probe using same form
Maximilian Krambach <mkrambach@intevation.de>
parents: 1288
diff changeset
184 fieldLabel: i18n.getMsg('orte.ozId')
1284
faecbb446a04 Ortserstellung: new Messpunkt from map, clone or form
Maximilian Krambach <mkrambach@intevation.de>
parents: 1279
diff changeset
185 }];
1289
bfdc00c24baf Ortszuordnung for messprogramm and probe using same form
Maximilian Krambach <mkrambach@intevation.de>
parents: 1288
diff changeset
186
1284
faecbb446a04 Ortserstellung: new Messpunkt from map, clone or form
Maximilian Krambach <mkrambach@intevation.de>
parents: 1279
diff changeset
187 this.dockedItems = [{
faecbb446a04 Ortserstellung: new Messpunkt from map, clone or form
Maximilian Krambach <mkrambach@intevation.de>
parents: 1279
diff changeset
188 xtype: 'toolbar',
faecbb446a04 Ortserstellung: new Messpunkt from map, clone or form
Maximilian Krambach <mkrambach@intevation.de>
parents: 1279
diff changeset
189 dock: 'bottom',
faecbb446a04 Ortserstellung: new Messpunkt from map, clone or form
Maximilian Krambach <mkrambach@intevation.de>
parents: 1279
diff changeset
190 border: '0, 1, 1, 1',
faecbb446a04 Ortserstellung: new Messpunkt from map, clone or form
Maximilian Krambach <mkrambach@intevation.de>
parents: 1279
diff changeset
191 style: {
faecbb446a04 Ortserstellung: new Messpunkt from map, clone or form
Maximilian Krambach <mkrambach@intevation.de>
parents: 1279
diff changeset
192 borderBottom: '1px solid #b5b8c8 !important',
faecbb446a04 Ortserstellung: new Messpunkt from map, clone or form
Maximilian Krambach <mkrambach@intevation.de>
parents: 1279
diff changeset
193 borderLeft: '1px solid #b5b8c8 !important',
faecbb446a04 Ortserstellung: new Messpunkt from map, clone or form
Maximilian Krambach <mkrambach@intevation.de>
parents: 1279
diff changeset
194 borderRight: '1px solid #b5b8c8 !important'
faecbb446a04 Ortserstellung: new Messpunkt from map, clone or form
Maximilian Krambach <mkrambach@intevation.de>
parents: 1279
diff changeset
195 },
faecbb446a04 Ortserstellung: new Messpunkt from map, clone or form
Maximilian Krambach <mkrambach@intevation.de>
parents: 1279
diff changeset
196 items: ['->', {
faecbb446a04 Ortserstellung: new Messpunkt from map, clone or form
Maximilian Krambach <mkrambach@intevation.de>
parents: 1279
diff changeset
197 text: i18n.getMsg('save'),
faecbb446a04 Ortserstellung: new Messpunkt from map, clone or form
Maximilian Krambach <mkrambach@intevation.de>
parents: 1279
diff changeset
198 action: 'save',
1321
f1e348109ebb Updated style to fit the other windows style.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 1320
diff changeset
199 qtip: 'Daten speichern',
f1e348109ebb Updated style to fit the other windows style.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 1320
diff changeset
200 icon: 'resources/img/dialog-ok-apply.png',
1284
faecbb446a04 Ortserstellung: new Messpunkt from map, clone or form
Maximilian Krambach <mkrambach@intevation.de>
parents: 1279
diff changeset
201 disabled: true
1279
291df0037835 Ortszuordnung window: create, change and display (wip)
Maximilian Krambach <mkrambach@intevation.de>
parents:
diff changeset
202 }, {
1321
f1e348109ebb Updated style to fit the other windows style.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 1320
diff changeset
203 text: i18n.getMsg('discard'),
f1e348109ebb Updated style to fit the other windows style.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 1320
diff changeset
204 qtip: 'Änderungen verwerfen',
f1e348109ebb Updated style to fit the other windows style.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 1320
diff changeset
205 icon: 'resources/img/dialog-cancel.png',
f1e348109ebb Updated style to fit the other windows style.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 1320
diff changeset
206 action: 'revert',
1279
291df0037835 Ortszuordnung window: create, change and display (wip)
Maximilian Krambach <mkrambach@intevation.de>
parents:
diff changeset
207 }]
291df0037835 Ortszuordnung window: create, change and display (wip)
Maximilian Krambach <mkrambach@intevation.de>
parents:
diff changeset
208 }];
1284
faecbb446a04 Ortserstellung: new Messpunkt from map, clone or form
Maximilian Krambach <mkrambach@intevation.de>
parents: 1279
diff changeset
209
faecbb446a04 Ortserstellung: new Messpunkt from map, clone or form
Maximilian Krambach <mkrambach@intevation.de>
parents: 1279
diff changeset
210 this.callParent(arguments);
faecbb446a04 Ortserstellung: new Messpunkt from map, clone or form
Maximilian Krambach <mkrambach@intevation.de>
parents: 1279
diff changeset
211 this.getForm().loadRecord(this.record);
1279
291df0037835 Ortszuordnung window: create, change and display (wip)
Maximilian Krambach <mkrambach@intevation.de>
parents:
diff changeset
212 },
291df0037835 Ortszuordnung window: create, change and display (wip)
Maximilian Krambach <mkrambach@intevation.de>
parents:
diff changeset
213
291df0037835 Ortszuordnung window: create, change and display (wip)
Maximilian Krambach <mkrambach@intevation.de>
parents:
diff changeset
214 /**
1289
bfdc00c24baf Ortszuordnung for messprogramm and probe using same form
Maximilian Krambach <mkrambach@intevation.de>
parents: 1288
diff changeset
215 * checks if the Messpunkt can be committed.
1279
291df0037835 Ortszuordnung window: create, change and display (wip)
Maximilian Krambach <mkrambach@intevation.de>
parents:
diff changeset
216 * Disables the save button if false
291df0037835 Ortszuordnung window: create, change and display (wip)
Maximilian Krambach <mkrambach@intevation.de>
parents:
diff changeset
217 */
291df0037835 Ortszuordnung window: create, change and display (wip)
Maximilian Krambach <mkrambach@intevation.de>
parents:
diff changeset
218 checkCommitEnabled: function() {
1284
faecbb446a04 Ortserstellung: new Messpunkt from map, clone or form
Maximilian Krambach <mkrambach@intevation.de>
parents: 1279
diff changeset
219 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
220 var form = this.getForm();
1314
8ace34d9352a changed behaviour of ortserstellung window on save; fix update (form)
Maximilian Krambach <mkrambach@intevation.de>
parents: 1313
diff changeset
221 if (form.isDirty()) {
8ace34d9352a changed behaviour of ortserstellung window on save; fix update (form)
Maximilian Krambach <mkrambach@intevation.de>
parents: 1313
diff changeset
222 if (form.findField('kdaId').getValue() ||
8ace34d9352a changed behaviour of ortserstellung window on save; fix update (form)
Maximilian Krambach <mkrambach@intevation.de>
parents: 1313
diff changeset
223 form.findField('koordYExtern').getValue() ||
8ace34d9352a changed behaviour of ortserstellung window on save; fix update (form)
Maximilian Krambach <mkrambach@intevation.de>
parents: 1313
diff changeset
224 form.findField('koordXExtern').getValue()) {
8ace34d9352a changed behaviour of ortserstellung window on save; fix update (form)
Maximilian Krambach <mkrambach@intevation.de>
parents: 1313
diff changeset
225 if (this.checkCoordinates()) {
8ace34d9352a changed behaviour of ortserstellung window on save; fix update (form)
Maximilian Krambach <mkrambach@intevation.de>
parents: 1313
diff changeset
226 savebutton.setDisabled(false);
8ace34d9352a changed behaviour of ortserstellung window on save; fix update (form)
Maximilian Krambach <mkrambach@intevation.de>
parents: 1313
diff changeset
227 } else {
8ace34d9352a changed behaviour of ortserstellung window on save; fix update (form)
Maximilian Krambach <mkrambach@intevation.de>
parents: 1313
diff changeset
228 savebutton.setDisabled(true);
8ace34d9352a changed behaviour of ortserstellung window on save; fix update (form)
Maximilian Krambach <mkrambach@intevation.de>
parents: 1313
diff changeset
229 }
8ace34d9352a changed behaviour of ortserstellung window on save; fix update (form)
Maximilian Krambach <mkrambach@intevation.de>
parents: 1313
diff changeset
230 } else if (form.findField('gemId').getValue() ||
8ace34d9352a changed behaviour of ortserstellung window on save; fix update (form)
Maximilian Krambach <mkrambach@intevation.de>
parents: 1313
diff changeset
231 form.findField('staatId').getValue() >= 0 ) {
1284
faecbb446a04 Ortserstellung: new Messpunkt from map, clone or form
Maximilian Krambach <mkrambach@intevation.de>
parents: 1279
diff changeset
232 savebutton.setDisabled(false);
faecbb446a04 Ortserstellung: new Messpunkt from map, clone or form
Maximilian Krambach <mkrambach@intevation.de>
parents: 1279
diff changeset
233 } else {
faecbb446a04 Ortserstellung: new Messpunkt from map, clone or form
Maximilian Krambach <mkrambach@intevation.de>
parents: 1279
diff changeset
234 savebutton.setDisabled(true);
faecbb446a04 Ortserstellung: new Messpunkt from map, clone or form
Maximilian Krambach <mkrambach@intevation.de>
parents: 1279
diff changeset
235 }
1279
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 savebutton.setDisabled(true);
291df0037835 Ortszuordnung window: create, change and display (wip)
Maximilian Krambach <mkrambach@intevation.de>
parents:
diff changeset
238 }
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
291df0037835 Ortszuordnung window: create, change and display (wip)
Maximilian Krambach <mkrambach@intevation.de>
parents:
diff changeset
241 /**
291df0037835 Ortszuordnung window: create, change and display (wip)
Maximilian Krambach <mkrambach@intevation.de>
parents:
diff changeset
242 * Validates the coordinate fields kdaId, koordXExtern, koordYExtern
291df0037835 Ortszuordnung window: create, change and display (wip)
Maximilian Krambach <mkrambach@intevation.de>
parents:
diff changeset
243 */
291df0037835 Ortszuordnung window: create, change and display (wip)
Maximilian Krambach <mkrambach@intevation.de>
parents:
diff changeset
244 checkCoordinates: function() {
291df0037835 Ortszuordnung window: create, change and display (wip)
Maximilian Krambach <mkrambach@intevation.de>
parents:
diff changeset
245 var x = this.getForm().findField('koordXExtern').getValue();
291df0037835 Ortszuordnung window: create, change and display (wip)
Maximilian Krambach <mkrambach@intevation.de>
parents:
diff changeset
246 var y = this.getForm().findField('koordYExtern').getValue();
291df0037835 Ortszuordnung window: create, change and display (wip)
Maximilian Krambach <mkrambach@intevation.de>
parents:
diff changeset
247 var kda = this.getForm().findField('kdaId').getValue();
291df0037835 Ortszuordnung window: create, change and display (wip)
Maximilian Krambach <mkrambach@intevation.de>
parents:
diff changeset
248 if (x && y && kda) {
291df0037835 Ortszuordnung window: create, change and display (wip)
Maximilian Krambach <mkrambach@intevation.de>
parents:
diff changeset
249 if (kda === 4){
291df0037835 Ortszuordnung window: create, change and display (wip)
Maximilian Krambach <mkrambach@intevation.de>
parents:
diff changeset
250 if (x > -180 && x < 180
291df0037835 Ortszuordnung window: create, change and display (wip)
Maximilian Krambach <mkrambach@intevation.de>
parents:
diff changeset
251 && y > -90 && y < 90) {
291df0037835 Ortszuordnung window: create, change and display (wip)
Maximilian Krambach <mkrambach@intevation.de>
parents:
diff changeset
252 return true;
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: WGS84 (degrees- decimal), coordinates invalid
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 } else if (kda === 5){
291df0037835 Ortszuordnung window: create, change and display (wip)
Maximilian Krambach <mkrambach@intevation.de>
parents:
diff changeset
258 if (x >= 1000000 && x < 61000000 &&
291df0037835 Ortszuordnung window: create, change and display (wip)
Maximilian Krambach <mkrambach@intevation.de>
parents:
diff changeset
259 y > -10000000 && y < 10000000) {
291df0037835 Ortszuordnung window: create, change and display (wip)
Maximilian Krambach <mkrambach@intevation.de>
parents:
diff changeset
260 return true;
291df0037835 Ortszuordnung window: create, change and display (wip)
Maximilian Krambach <mkrambach@intevation.de>
parents:
diff changeset
261 } else {
291df0037835 Ortszuordnung window: create, change and display (wip)
Maximilian Krambach <mkrambach@intevation.de>
parents:
diff changeset
262 // TODO: UTM, coordinates invalid
291df0037835 Ortszuordnung window: create, change and display (wip)
Maximilian Krambach <mkrambach@intevation.de>
parents:
diff changeset
263 return false;
291df0037835 Ortszuordnung window: create, change and display (wip)
Maximilian Krambach <mkrambach@intevation.de>
parents:
diff changeset
264 }
291df0037835 Ortszuordnung window: create, change and display (wip)
Maximilian Krambach <mkrambach@intevation.de>
parents:
diff changeset
265 } else {
291df0037835 Ortszuordnung window: create, change and display (wip)
Maximilian Krambach <mkrambach@intevation.de>
parents:
diff changeset
266 // TODO KDA not supported
291df0037835 Ortszuordnung window: create, change and display (wip)
Maximilian Krambach <mkrambach@intevation.de>
parents:
diff changeset
267 return false;
291df0037835 Ortszuordnung window: create, change and display (wip)
Maximilian Krambach <mkrambach@intevation.de>
parents:
diff changeset
268 }
291df0037835 Ortszuordnung window: create, change and display (wip)
Maximilian Krambach <mkrambach@intevation.de>
parents:
diff changeset
269 } else {
291df0037835 Ortszuordnung window: create, change and display (wip)
Maximilian Krambach <mkrambach@intevation.de>
parents:
diff changeset
270 // TODO: not all fields filled in
291df0037835 Ortszuordnung window: create, change and display (wip)
Maximilian Krambach <mkrambach@intevation.de>
parents:
diff changeset
271 return false;
291df0037835 Ortszuordnung window: create, change and display (wip)
Maximilian Krambach <mkrambach@intevation.de>
parents:
diff changeset
272 }
291df0037835 Ortszuordnung window: create, change and display (wip)
Maximilian Krambach <mkrambach@intevation.de>
parents:
diff changeset
273 },
291df0037835 Ortszuordnung window: create, change and display (wip)
Maximilian Krambach <mkrambach@intevation.de>
parents:
diff changeset
274
1284
faecbb446a04 Ortserstellung: new Messpunkt from map, clone or form
Maximilian Krambach <mkrambach@intevation.de>
parents: 1279
diff changeset
275 saveOrt: function() {
faecbb446a04 Ortserstellung: new Messpunkt from map, clone or form
Maximilian Krambach <mkrambach@intevation.de>
parents: 1279
diff changeset
276 var this_panel = this.up('panel');
1319
518b4c28e71a Ortserstellung does no longer update existing Orte
Maximilian Krambach <mkrambach@intevation.de>
parents: 1314
diff changeset
277 var me = this;
1284
faecbb446a04 Ortserstellung: new Messpunkt from map, clone or form
Maximilian Krambach <mkrambach@intevation.de>
parents: 1279
diff changeset
278 var form = this_panel.getForm();
1311
2d92be45df9e update the record according to form when sending similar Ort in Ortserstellung
Maximilian Krambach <mkrambach@intevation.de>
parents: 1310
diff changeset
279 var record = form.getRecord();
1284
faecbb446a04 Ortserstellung: new Messpunkt from map, clone or form
Maximilian Krambach <mkrambach@intevation.de>
parents: 1279
diff changeset
280 var data = form.getFieldValues(true);
faecbb446a04 Ortserstellung: new Messpunkt from map, clone or form
Maximilian Krambach <mkrambach@intevation.de>
parents: 1279
diff changeset
281 for (var key in data) {
1311
2d92be45df9e update the record according to form when sending similar Ort in Ortserstellung
Maximilian Krambach <mkrambach@intevation.de>
parents: 1310
diff changeset
282 record.set(key, data[key]);
1279
291df0037835 Ortszuordnung window: create, change and display (wip)
Maximilian Krambach <mkrambach@intevation.de>
parents:
diff changeset
283 }
1319
518b4c28e71a Ortserstellung does no longer update existing Orte
Maximilian Krambach <mkrambach@intevation.de>
parents: 1314
diff changeset
284 record.set('id', null);
1311
2d92be45df9e update the record according to form when sending similar Ort in Ortserstellung
Maximilian Krambach <mkrambach@intevation.de>
parents: 1310
diff changeset
285 record.set('netzbetreiberId', Lada.netzbetreiber[0]);
2d92be45df9e update the record according to form when sending similar Ort in Ortserstellung
Maximilian Krambach <mkrambach@intevation.de>
parents: 1310
diff changeset
286 record.save({
1314
8ace34d9352a changed behaviour of ortserstellung window on save; fix update (form)
Maximilian Krambach <mkrambach@intevation.de>
parents: 1313
diff changeset
287 success: function(newrecord, response) {
8ace34d9352a changed behaviour of ortserstellung window on save; fix update (form)
Maximilian Krambach <mkrambach@intevation.de>
parents: 1313
diff changeset
288 form.loadRecord(newrecord);
1319
518b4c28e71a Ortserstellung does no longer update existing Orte
Maximilian Krambach <mkrambach@intevation.de>
parents: 1314
diff changeset
289 this_panel.down('verwaltungseinheit').store.load(
518b4c28e71a Ortserstellung does no longer update existing Orte
Maximilian Krambach <mkrambach@intevation.de>
parents: 1314
diff changeset
290 { id:newrecord.get('gemId') });
518b4c28e71a Ortserstellung does no longer update existing Orte
Maximilian Krambach <mkrambach@intevation.de>
parents: 1314
diff changeset
291 console.log(this_panel.down('verwaltungseinheit'));
518b4c28e71a Ortserstellung does no longer update existing Orte
Maximilian Krambach <mkrambach@intevation.de>
parents: 1314
diff changeset
292 this_panel.down('staat').store.load(
518b4c28e71a Ortserstellung does no longer update existing Orte
Maximilian Krambach <mkrambach@intevation.de>
parents: 1314
diff changeset
293 { id : newrecord.get('staat') });
518b4c28e71a Ortserstellung does no longer update existing Orte
Maximilian Krambach <mkrambach@intevation.de>
parents: 1314
diff changeset
294 me.setDisabled(true);
518b4c28e71a Ortserstellung does no longer update existing Orte
Maximilian Krambach <mkrambach@intevation.de>
parents: 1314
diff changeset
295 me.hide();
1284
faecbb446a04 Ortserstellung: new Messpunkt from map, clone or form
Maximilian Krambach <mkrambach@intevation.de>
parents: 1279
diff changeset
296 var ozw = this_panel.up().parentWindow;
1295
171eacf989d8 Show error and warnings in new forms
Maximilian Krambach <mkrambach@intevation.de>
parents: 1294
diff changeset
297 var json = Ext.decode(response.response.responseText);
171eacf989d8 Show error and warnings in new forms
Maximilian Krambach <mkrambach@intevation.de>
parents: 1294
diff changeset
298 if (json) {
171eacf989d8 Show error and warnings in new forms
Maximilian Krambach <mkrambach@intevation.de>
parents: 1294
diff changeset
299 this_panel.clearMessages();
171eacf989d8 Show error and warnings in new forms
Maximilian Krambach <mkrambach@intevation.de>
parents: 1294
diff changeset
300 this_panel.setMessages(json.errors, json.warnings);
171eacf989d8 Show error and warnings in new forms
Maximilian Krambach <mkrambach@intevation.de>
parents: 1294
diff changeset
301 }
1284
faecbb446a04 Ortserstellung: new Messpunkt from map, clone or form
Maximilian Krambach <mkrambach@intevation.de>
parents: 1279
diff changeset
302 ozw.ortstore.load({
faecbb446a04 Ortserstellung: new Messpunkt from map, clone or form
Maximilian Krambach <mkrambach@intevation.de>
parents: 1279
diff changeset
303 callback: function(records, operation, success) {
faecbb446a04 Ortserstellung: new Messpunkt from map, clone or form
Maximilian Krambach <mkrambach@intevation.de>
parents: 1279
diff changeset
304 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
305 var osg = ozw.down('ortstammdatengrid');
bfdc00c24baf Ortszuordnung for messprogramm and probe using same form
Maximilian Krambach <mkrambach@intevation.de>
parents: 1288
diff changeset
306 osg.setStore(ozw.ortstore);
1284
faecbb446a04 Ortserstellung: new Messpunkt from map, clone or form
Maximilian Krambach <mkrambach@intevation.de>
parents: 1279
diff changeset
307 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
308 var record = osg.store.getById(id);
bfdc00c24baf Ortszuordnung for messprogramm and probe using same form
Maximilian Krambach <mkrambach@intevation.de>
parents: 1288
diff changeset
309 var selmod = osg.getView().getSelectionModel();
bfdc00c24baf Ortszuordnung for messprogramm and probe using same form
Maximilian Krambach <mkrambach@intevation.de>
parents: 1288
diff changeset
310 selmod.select(record);
1314
8ace34d9352a changed behaviour of ortserstellung window on save; fix update (form)
Maximilian Krambach <mkrambach@intevation.de>
parents: 1313
diff changeset
311 var resulttext;
8ace34d9352a changed behaviour of ortserstellung window on save; fix update (form)
Maximilian Krambach <mkrambach@intevation.de>
parents: 1313
diff changeset
312 if (json) {
8ace34d9352a changed behaviour of ortserstellung window on save; fix update (form)
Maximilian Krambach <mkrambach@intevation.de>
parents: 1313
diff changeset
313 if (json.message == '201') {
8ace34d9352a changed behaviour of ortserstellung window on save; fix update (form)
Maximilian Krambach <mkrambach@intevation.de>
parents: 1313
diff changeset
314 resulttext = 'Dieser Ort existiert bereits!';
8ace34d9352a changed behaviour of ortserstellung window on save; fix update (form)
Maximilian Krambach <mkrambach@intevation.de>
parents: 1313
diff changeset
315 }
8ace34d9352a changed behaviour of ortserstellung window on save; fix update (form)
Maximilian Krambach <mkrambach@intevation.de>
parents: 1313
diff changeset
316 if (json.message == '200') {
1319
518b4c28e71a Ortserstellung does no longer update existing Orte
Maximilian Krambach <mkrambach@intevation.de>
parents: 1314
diff changeset
317 resulttext = 'Ort erfolgreich angelegt!';
1314
8ace34d9352a changed behaviour of ortserstellung window on save; fix update (form)
Maximilian Krambach <mkrambach@intevation.de>
parents: 1313
diff changeset
318 }
8ace34d9352a changed behaviour of ortserstellung window on save; fix update (form)
Maximilian Krambach <mkrambach@intevation.de>
parents: 1313
diff changeset
319 }
1289
bfdc00c24baf Ortszuordnung for messprogramm and probe using same form
Maximilian Krambach <mkrambach@intevation.de>
parents: 1288
diff changeset
320 Ext.Msg.show({
bfdc00c24baf Ortszuordnung for messprogramm and probe using same form
Maximilian Krambach <mkrambach@intevation.de>
parents: 1288
diff changeset
321 title: Lada.getApplication().bundle.getMsg('success'),
bfdc00c24baf Ortszuordnung for messprogramm and probe using same form
Maximilian Krambach <mkrambach@intevation.de>
parents: 1288
diff changeset
322 autoScroll: true,
1314
8ace34d9352a changed behaviour of ortserstellung window on save; fix update (form)
Maximilian Krambach <mkrambach@intevation.de>
parents: 1313
diff changeset
323 msg: resulttext,
1289
bfdc00c24baf Ortszuordnung for messprogramm and probe using same form
Maximilian Krambach <mkrambach@intevation.de>
parents: 1288
diff changeset
324 buttons: Ext.Msg.OK
bfdc00c24baf Ortszuordnung for messprogramm and probe using same form
Maximilian Krambach <mkrambach@intevation.de>
parents: 1288
diff changeset
325 });
1284
faecbb446a04 Ortserstellung: new Messpunkt from map, clone or form
Maximilian Krambach <mkrambach@intevation.de>
parents: 1279
diff changeset
326 },
faecbb446a04 Ortserstellung: new Messpunkt from map, clone or form
Maximilian Krambach <mkrambach@intevation.de>
parents: 1279
diff changeset
327 scope: this
faecbb446a04 Ortserstellung: new Messpunkt from map, clone or form
Maximilian Krambach <mkrambach@intevation.de>
parents: 1279
diff changeset
328 });
1289
bfdc00c24baf Ortszuordnung for messprogramm and probe using same form
Maximilian Krambach <mkrambach@intevation.de>
parents: 1288
diff changeset
329
1284
faecbb446a04 Ortserstellung: new Messpunkt from map, clone or form
Maximilian Krambach <mkrambach@intevation.de>
parents: 1279
diff changeset
330 },
faecbb446a04 Ortserstellung: new Messpunkt from map, clone or form
Maximilian Krambach <mkrambach@intevation.de>
parents: 1279
diff changeset
331 failure: function(record, response) {
1288
08085b7d1d0b Ortszuordnung: Search, new orte, display and validity check
Maximilian Krambach <mkrambach@intevation.de>
parents: 1284
diff changeset
332 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
333 if (json) {
08085b7d1d0b Ortszuordnung: Search, new orte, display and validity check
Maximilian Krambach <mkrambach@intevation.de>
parents: 1284
diff changeset
334 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
335 formPanel.setMessages(json.errors, json.warnings);
08085b7d1d0b Ortszuordnung: Search, new orte, display and validity check
Maximilian Krambach <mkrambach@intevation.de>
parents: 1284
diff changeset
336 }
08085b7d1d0b Ortszuordnung: Search, new orte, display and validity check
Maximilian Krambach <mkrambach@intevation.de>
parents: 1284
diff changeset
337 if(json.message){
08085b7d1d0b Ortszuordnung: Search, new orte, display and validity check
Maximilian Krambach <mkrambach@intevation.de>
parents: 1284
diff changeset
338 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
339 +' #'+json.message,
08085b7d1d0b Ortszuordnung: Search, new orte, display and validity check
Maximilian Krambach <mkrambach@intevation.de>
parents: 1284
diff changeset
340 Lada.getApplication().bundle.getMsg(json.message));
08085b7d1d0b Ortszuordnung: Search, new orte, display and validity check
Maximilian Krambach <mkrambach@intevation.de>
parents: 1284
diff changeset
341 } else {
08085b7d1d0b Ortszuordnung: Search, new orte, display and validity check
Maximilian Krambach <mkrambach@intevation.de>
parents: 1284
diff changeset
342 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
343 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
344 }
08085b7d1d0b Ortszuordnung: Search, new orte, display and validity check
Maximilian Krambach <mkrambach@intevation.de>
parents: 1284
diff changeset
345 } else {
08085b7d1d0b Ortszuordnung: Search, new orte, display and validity check
Maximilian Krambach <mkrambach@intevation.de>
parents: 1284
diff changeset
346 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
347 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
348 }
1319
518b4c28e71a Ortserstellung does no longer update existing Orte
Maximilian Krambach <mkrambach@intevation.de>
parents: 1314
diff changeset
349 me.setDisabled(true);
1284
faecbb446a04 Ortserstellung: new Messpunkt from map, clone or form
Maximilian Krambach <mkrambach@intevation.de>
parents: 1279
diff changeset
350 }
faecbb446a04 Ortserstellung: new Messpunkt from map, clone or form
Maximilian Krambach <mkrambach@intevation.de>
parents: 1279
diff changeset
351 });
1295
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 setMessages: function(errors, warnings) {
171eacf989d8 Show error and warnings in new forms
Maximilian Krambach <mkrambach@intevation.de>
parents: 1294
diff changeset
355 var key;
171eacf989d8 Show error and warnings in new forms
Maximilian Krambach <mkrambach@intevation.de>
parents: 1294
diff changeset
356 var element;
171eacf989d8 Show error and warnings in new forms
Maximilian Krambach <mkrambach@intevation.de>
parents: 1294
diff changeset
357 var content;
171eacf989d8 Show error and warnings in new forms
Maximilian Krambach <mkrambach@intevation.de>
parents: 1294
diff changeset
358 var i18n = Lada.getApplication().bundle;
171eacf989d8 Show error and warnings in new forms
Maximilian Krambach <mkrambach@intevation.de>
parents: 1294
diff changeset
359 if (warnings) {
171eacf989d8 Show error and warnings in new forms
Maximilian Krambach <mkrambach@intevation.de>
parents: 1294
diff changeset
360 for (key in warnings) {
171eacf989d8 Show error and warnings in new forms
Maximilian Krambach <mkrambach@intevation.de>
parents: 1294
diff changeset
361 element = this.down('component[name=' + key + ']');
171eacf989d8 Show error and warnings in new forms
Maximilian Krambach <mkrambach@intevation.de>
parents: 1294
diff changeset
362 if (!element) {
171eacf989d8 Show error and warnings in new forms
Maximilian Krambach <mkrambach@intevation.de>
parents: 1294
diff changeset
363 continue;
171eacf989d8 Show error and warnings in new forms
Maximilian Krambach <mkrambach@intevation.de>
parents: 1294
diff changeset
364 }
171eacf989d8 Show error and warnings in new forms
Maximilian Krambach <mkrambach@intevation.de>
parents: 1294
diff changeset
365 content = warnings[key];
171eacf989d8 Show error and warnings in new forms
Maximilian Krambach <mkrambach@intevation.de>
parents: 1294
diff changeset
366 var warnText = '';
171eacf989d8 Show error and warnings in new forms
Maximilian Krambach <mkrambach@intevation.de>
parents: 1294
diff changeset
367 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
368 warnText += i18n.getMsg(content[i].toString()) + '\n';
171eacf989d8 Show error and warnings in new forms
Maximilian Krambach <mkrambach@intevation.de>
parents: 1294
diff changeset
369 }
171eacf989d8 Show error and warnings in new forms
Maximilian Krambach <mkrambach@intevation.de>
parents: 1294
diff changeset
370 element.showWarnings(warnText);
171eacf989d8 Show error and warnings in new forms
Maximilian Krambach <mkrambach@intevation.de>
parents: 1294
diff changeset
371 }
171eacf989d8 Show error and warnings in new forms
Maximilian Krambach <mkrambach@intevation.de>
parents: 1294
diff changeset
372 }
171eacf989d8 Show error and warnings in new forms
Maximilian Krambach <mkrambach@intevation.de>
parents: 1294
diff changeset
373 if (errors) {
171eacf989d8 Show error and warnings in new forms
Maximilian Krambach <mkrambach@intevation.de>
parents: 1294
diff changeset
374 for (key in errors) {
171eacf989d8 Show error and warnings in new forms
Maximilian Krambach <mkrambach@intevation.de>
parents: 1294
diff changeset
375 element = this.down('component[name=' + key + ']');
171eacf989d8 Show error and warnings in new forms
Maximilian Krambach <mkrambach@intevation.de>
parents: 1294
diff changeset
376 if (!element) {
171eacf989d8 Show error and warnings in new forms
Maximilian Krambach <mkrambach@intevation.de>
parents: 1294
diff changeset
377 continue;
171eacf989d8 Show error and warnings in new forms
Maximilian Krambach <mkrambach@intevation.de>
parents: 1294
diff changeset
378 }
171eacf989d8 Show error and warnings in new forms
Maximilian Krambach <mkrambach@intevation.de>
parents: 1294
diff changeset
379 content = errors[key];
171eacf989d8 Show error and warnings in new forms
Maximilian Krambach <mkrambach@intevation.de>
parents: 1294
diff changeset
380 var errorText = '';
171eacf989d8 Show error and warnings in new forms
Maximilian Krambach <mkrambach@intevation.de>
parents: 1294
diff changeset
381 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
382 errorText += i18n.getMsg(content[i].toString()) + '\n';
171eacf989d8 Show error and warnings in new forms
Maximilian Krambach <mkrambach@intevation.de>
parents: 1294
diff changeset
383 }
171eacf989d8 Show error and warnings in new forms
Maximilian Krambach <mkrambach@intevation.de>
parents: 1294
diff changeset
384 element.showErrors(errorText);
171eacf989d8 Show error and warnings in new forms
Maximilian Krambach <mkrambach@intevation.de>
parents: 1294
diff changeset
385 }
171eacf989d8 Show error and warnings in new forms
Maximilian Krambach <mkrambach@intevation.de>
parents: 1294
diff changeset
386 }
171eacf989d8 Show error and warnings in new forms
Maximilian Krambach <mkrambach@intevation.de>
parents: 1294
diff changeset
387 },
171eacf989d8 Show error and warnings in new forms
Maximilian Krambach <mkrambach@intevation.de>
parents: 1294
diff changeset
388
171eacf989d8 Show error and warnings in new forms
Maximilian Krambach <mkrambach@intevation.de>
parents: 1294
diff changeset
389 clearMessages: function() {
171eacf989d8 Show error and warnings in new forms
Maximilian Krambach <mkrambach@intevation.de>
parents: 1294
diff changeset
390 // TODO: this is a stub
171eacf989d8 Show error and warnings in new forms
Maximilian Krambach <mkrambach@intevation.de>
parents: 1294
diff changeset
391 }
171eacf989d8 Show error and warnings in new forms
Maximilian Krambach <mkrambach@intevation.de>
parents: 1294
diff changeset
392
1313
c4ac1c09c0b0 another typo
Maximilian Krambach <mkrambach@intevation.de>
parents: 1312
diff changeset
393 });

http://lada.wald.intevation.org