annotate app/model/Probe.js @ 978:7f5219b8e1bf stammdatengrids

Renamed the ProbePlanungSwitcher to a more generic ModeSwitcher and refactored the application
author Dustin Demuth <dustin@intevation.de>
date Thu, 03 Dec 2015 09:38:43 +0100
parents f4eb53ba63fc
children f73ca04d73a7
rev   line source
548
d47ee7439f44 Added new js files.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
1 /* Copyright (C) 2013 by Bundesamt fuer Strahlenschutz
d47ee7439f44 Added new js files.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
2 * Software engineering by Intevation GmbH
d47ee7439f44 Added new js files.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
3 *
d47ee7439f44 Added new js files.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
4 * This file is Free Software under the GNU GPL (v>=3)
d47ee7439f44 Added new js files.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
5 * and comes with ABSOLUTELY NO WARRANTY! Check out
d47ee7439f44 Added new js files.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
6 * the documentation coming with IMIS-Labordaten-Application for details.
d47ee7439f44 Added new js files.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
7 */
d47ee7439f44 Added new js files.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
8
d47ee7439f44 Added new js files.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
9 /**
d47ee7439f44 Added new js files.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
10 * A Probe.
d47ee7439f44 Added new js files.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
11 * This class represents and defines the model of a 'Probe'
d47ee7439f44 Added new js files.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
12 **/
d47ee7439f44 Added new js files.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
13 Ext.define('Lada.model.Probe', {
d47ee7439f44 Added new js files.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
14 extend: 'Ext.data.Model',
d47ee7439f44 Added new js files.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
15
d47ee7439f44 Added new js files.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
16 fields: [{
d47ee7439f44 Added new js files.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
17 name: 'id'
d47ee7439f44 Added new js files.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
18 }, {
691
c5b8896768a2 Added Owner to Model
Dustin Demuth <dustin@intevation.de>
parents: 677
diff changeset
19 name: 'owner',
692
c31644b3d445 added owner-field
Dustin Demuth <dustin@intevation.de>
parents: 689
diff changeset
20 type: 'boolean',
c31644b3d445 added owner-field
Dustin Demuth <dustin@intevation.de>
parents: 689
diff changeset
21 persist: false
691
c5b8896768a2 Added Owner to Model
Dustin Demuth <dustin@intevation.de>
parents: 677
diff changeset
22 }, {
548
d47ee7439f44 Added new js files.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
23 name: 'probeIdAlt'
d47ee7439f44 Added new js files.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
24 }, {
d47ee7439f44 Added new js files.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
25 name: 'hauptprobenNr'
d47ee7439f44 Added new js files.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
26 }, {
924
9265637fe6c0 changed layout of Probe form
Michael Stanko <mstanko@bfs.de>
parents: 711
diff changeset
27 name: 'test',
9265637fe6c0 changed layout of Probe form
Michael Stanko <mstanko@bfs.de>
parents: 711
diff changeset
28 type: 'boolean'
548
d47ee7439f44 Added new js files.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
29 }, {
677
394c12b7bb21 Updated probe model to serialize empty strings to a null-value.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 548
diff changeset
30 name: 'netzbetreiberId',
394c12b7bb21 Updated probe model to serialize empty strings to a null-value.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 548
diff changeset
31 serialize: function(value) {
394c12b7bb21 Updated probe model to serialize empty strings to a null-value.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 548
diff changeset
32 if (value === '') {
394c12b7bb21 Updated probe model to serialize empty strings to a null-value.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 548
diff changeset
33 return null;
394c12b7bb21 Updated probe model to serialize empty strings to a null-value.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 548
diff changeset
34 }
394c12b7bb21 Updated probe model to serialize empty strings to a null-value.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 548
diff changeset
35 return value;
394c12b7bb21 Updated probe model to serialize empty strings to a null-value.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 548
diff changeset
36 }
548
d47ee7439f44 Added new js files.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
37 }, {
d47ee7439f44 Added new js files.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
38 name: 'mstId'
d47ee7439f44 Added new js files.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
39 }, {
d47ee7439f44 Added new js files.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
40 name: 'datenbasisId'
d47ee7439f44 Added new js files.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
41 }, {
d47ee7439f44 Added new js files.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
42 name: 'baId'
d47ee7439f44 Added new js files.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
43 }, {
d47ee7439f44 Added new js files.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
44 name: 'probenartId'
d47ee7439f44 Added new js files.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
45 }, {
d47ee7439f44 Added new js files.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
46 name: 'mediaDesk'
d47ee7439f44 Added new js files.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
47 }, {
d47ee7439f44 Added new js files.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
48 name: 'media'
d47ee7439f44 Added new js files.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
49 }, {
677
394c12b7bb21 Updated probe model to serialize empty strings to a null-value.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 548
diff changeset
50 name: 'umwId',
394c12b7bb21 Updated probe model to serialize empty strings to a null-value.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 548
diff changeset
51 serialize: function(value) {
394c12b7bb21 Updated probe model to serialize empty strings to a null-value.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 548
diff changeset
52 if (value === '') {
394c12b7bb21 Updated probe model to serialize empty strings to a null-value.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 548
diff changeset
53 return null;
394c12b7bb21 Updated probe model to serialize empty strings to a null-value.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 548
diff changeset
54 }
394c12b7bb21 Updated probe model to serialize empty strings to a null-value.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 548
diff changeset
55 return value;
394c12b7bb21 Updated probe model to serialize empty strings to a null-value.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 548
diff changeset
56 }
548
d47ee7439f44 Added new js files.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
57 }, {
d47ee7439f44 Added new js files.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
58 name: 'probeentnahmeBeginn',
d47ee7439f44 Added new js files.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
59 type: 'date',
d47ee7439f44 Added new js files.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
60 convert: function(v) {
d47ee7439f44 Added new js files.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
61 if (!v) {
d47ee7439f44 Added new js files.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
62 return v;
d47ee7439f44 Added new js files.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
63 }
d47ee7439f44 Added new js files.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
64 return new Date(v);
970
f4eb53ba63fc Setting Timestamps the correct way. Before this commit the times of the instatiation of the model were used as default values, which led to wrong dates.
Dustin Demuth <dustin@intevation.de>
parents: 927
diff changeset
65 }
548
d47ee7439f44 Added new js files.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
66 }, {
d47ee7439f44 Added new js files.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
67 name: 'probeentnahmeEnde',
d47ee7439f44 Added new js files.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
68 type: 'date',
d47ee7439f44 Added new js files.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
69 convert: function(v) {
d47ee7439f44 Added new js files.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
70 if (!v) {
d47ee7439f44 Added new js files.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
71 return v;
d47ee7439f44 Added new js files.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
72 }
d47ee7439f44 Added new js files.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
73 return new Date(v);
970
f4eb53ba63fc Setting Timestamps the correct way. Before this commit the times of the instatiation of the model were used as default values, which led to wrong dates.
Dustin Demuth <dustin@intevation.de>
parents: 927
diff changeset
74 }
548
d47ee7439f44 Added new js files.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
75 }, {
d47ee7439f44 Added new js files.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
76 name: 'mittelungsdauer'
d47ee7439f44 Added new js files.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
77 }, {
d47ee7439f44 Added new js files.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
78 name: 'letzteAenderung',
d47ee7439f44 Added new js files.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
79 type: 'date',
d47ee7439f44 Added new js files.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
80 convert: function(v) {
d47ee7439f44 Added new js files.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
81 if (!v) {
d47ee7439f44 Added new js files.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
82 return v;
d47ee7439f44 Added new js files.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
83 }
d47ee7439f44 Added new js files.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
84 return new Date(v);
970
f4eb53ba63fc Setting Timestamps the correct way. Before this commit the times of the instatiation of the model were used as default values, which led to wrong dates.
Dustin Demuth <dustin@intevation.de>
parents: 927
diff changeset
85 }
548
d47ee7439f44 Added new js files.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
86 }, {
d47ee7439f44 Added new js files.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
87 name: 'erzeugerId'
d47ee7439f44 Added new js files.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
88 }, {
d47ee7439f44 Added new js files.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
89 name: 'probeNehmerId'
d47ee7439f44 Added new js files.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
90 }, {
d47ee7439f44 Added new js files.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
91 name: 'mpKat'
d47ee7439f44 Added new js files.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
92 }, {
d47ee7439f44 Added new js files.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
93 name: 'mplId'
d47ee7439f44 Added new js files.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
94 }, {
d47ee7439f44 Added new js files.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
95 name: 'mprId'
d47ee7439f44 Added new js files.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
96 }, {
d47ee7439f44 Added new js files.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
97 name: 'solldatumBeginn',
d47ee7439f44 Added new js files.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
98 type: 'date',
d47ee7439f44 Added new js files.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
99 convert: function(v) {
d47ee7439f44 Added new js files.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
100 if (!v) {
d47ee7439f44 Added new js files.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
101 return v;
d47ee7439f44 Added new js files.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
102 }
d47ee7439f44 Added new js files.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
103 return new Date(v);
927
a1783726d43e Serialize empty solldatum values to 'null'.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 926
diff changeset
104 },
a1783726d43e Serialize empty solldatum values to 'null'.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 926
diff changeset
105 serialize: function(value) {
a1783726d43e Serialize empty solldatum values to 'null'.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 926
diff changeset
106 if (value === '') {
a1783726d43e Serialize empty solldatum values to 'null'.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 926
diff changeset
107 return null;
a1783726d43e Serialize empty solldatum values to 'null'.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 926
diff changeset
108 }
a1783726d43e Serialize empty solldatum values to 'null'.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 926
diff changeset
109 return value;
926
c75f13578315 Changed 'Solldatum' fields to readonly fields without default value.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 924
diff changeset
110 }
548
d47ee7439f44 Added new js files.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
111 }, {
d47ee7439f44 Added new js files.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
112 name: 'solldatumEnde',
d47ee7439f44 Added new js files.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
113 type: 'date',
d47ee7439f44 Added new js files.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
114 convert: function(v) {
d47ee7439f44 Added new js files.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
115 if (!v) {
d47ee7439f44 Added new js files.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
116 return v;
d47ee7439f44 Added new js files.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
117 }
d47ee7439f44 Added new js files.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
118 return new Date(v);
927
a1783726d43e Serialize empty solldatum values to 'null'.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 926
diff changeset
119 },
a1783726d43e Serialize empty solldatum values to 'null'.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 926
diff changeset
120 serialize: function(value) {
a1783726d43e Serialize empty solldatum values to 'null'.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 926
diff changeset
121 if (value === '') {
a1783726d43e Serialize empty solldatum values to 'null'.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 926
diff changeset
122 return null;
a1783726d43e Serialize empty solldatum values to 'null'.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 926
diff changeset
123 }
a1783726d43e Serialize empty solldatum values to 'null'.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 926
diff changeset
124 return value;
926
c75f13578315 Changed 'Solldatum' fields to readonly fields without default value.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 924
diff changeset
125 }
548
d47ee7439f44 Added new js files.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
126 }, {
d47ee7439f44 Added new js files.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
127 name: 'readonly',
692
c31644b3d445 added owner-field
Dustin Demuth <dustin@intevation.de>
parents: 689
diff changeset
128 type: 'boolean',
548
d47ee7439f44 Added new js files.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
129 persist: false
689
c07419f07a0c Added field treeModified to models.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 677
diff changeset
130 }, {
711
af16a257d5f6 Updated the model to have correct tree_modified value and parent_modified
Raimund Renkert <raimund.renkert@intevation.de>
parents: 698
diff changeset
131 name: 'treeModified',
af16a257d5f6 Updated the model to have correct tree_modified value and parent_modified
Raimund Renkert <raimund.renkert@intevation.de>
parents: 698
diff changeset
132 serialize: function(value) {
af16a257d5f6 Updated the model to have correct tree_modified value and parent_modified
Raimund Renkert <raimund.renkert@intevation.de>
parents: 698
diff changeset
133 if (value === '') {
af16a257d5f6 Updated the model to have correct tree_modified value and parent_modified
Raimund Renkert <raimund.renkert@intevation.de>
parents: 698
diff changeset
134 return null;
af16a257d5f6 Updated the model to have correct tree_modified value and parent_modified
Raimund Renkert <raimund.renkert@intevation.de>
parents: 698
diff changeset
135 }
af16a257d5f6 Updated the model to have correct tree_modified value and parent_modified
Raimund Renkert <raimund.renkert@intevation.de>
parents: 698
diff changeset
136 return value;
af16a257d5f6 Updated the model to have correct tree_modified value and parent_modified
Raimund Renkert <raimund.renkert@intevation.de>
parents: 698
diff changeset
137 }
548
d47ee7439f44 Added new js files.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
138 }],
d47ee7439f44 Added new js files.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
139
d47ee7439f44 Added new js files.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
140 idProperty: 'id',
d47ee7439f44 Added new js files.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
141
d47ee7439f44 Added new js files.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
142 proxy: {
d47ee7439f44 Added new js files.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
143 type: 'rest',
d47ee7439f44 Added new js files.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
144 url: 'lada-server/probe',
d47ee7439f44 Added new js files.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
145 reader: {
d47ee7439f44 Added new js files.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
146 type: 'json',
d47ee7439f44 Added new js files.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
147 root: 'data'
d47ee7439f44 Added new js files.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
148 }
d47ee7439f44 Added new js files.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
149 }
d47ee7439f44 Added new js files.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
150 });

http://lada.wald.intevation.org