annotate app/model/Status.js @ 1019:637cf968a49c

No default value for statuswerte
author Dustin Demuth <dustin@intevation.de>
date Thu, 04 Feb 2016 16:09:05 +0100
parents 23bfcbdb4527
children 00da72171de3
rev   line source
569
d9593b520b3b Added a model for Status
Dustin Demuth <dustin@intevation.de>
parents:
diff changeset
1 /* Copyright (C) 2013 by Bundesamt fuer Strahlenschutz
d9593b520b3b Added a model for Status
Dustin Demuth <dustin@intevation.de>
parents:
diff changeset
2 * Software engineering by Intevation GmbH
d9593b520b3b Added a model for Status
Dustin Demuth <dustin@intevation.de>
parents:
diff changeset
3 *
d9593b520b3b Added a model for Status
Dustin Demuth <dustin@intevation.de>
parents:
diff changeset
4 * This file is Free Software under the GNU GPL (v>=3)
d9593b520b3b Added a model for Status
Dustin Demuth <dustin@intevation.de>
parents:
diff changeset
5 * and comes with ABSOLUTELY NO WARRANTY! Check out
d9593b520b3b Added a model for Status
Dustin Demuth <dustin@intevation.de>
parents:
diff changeset
6 * the documentation coming with IMIS-Labordaten-Application for details.
d9593b520b3b Added a model for Status
Dustin Demuth <dustin@intevation.de>
parents:
diff changeset
7 */
d9593b520b3b Added a model for Status
Dustin Demuth <dustin@intevation.de>
parents:
diff changeset
8
d9593b520b3b Added a model for Status
Dustin Demuth <dustin@intevation.de>
parents:
diff changeset
9 /**
d9593b520b3b Added a model for Status
Dustin Demuth <dustin@intevation.de>
parents:
diff changeset
10 * Model class for Status
d9593b520b3b Added a model for Status
Dustin Demuth <dustin@intevation.de>
parents:
diff changeset
11 */
d9593b520b3b Added a model for Status
Dustin Demuth <dustin@intevation.de>
parents:
diff changeset
12 Ext.define('Lada.model.Status', {
d9593b520b3b Added a model for Status
Dustin Demuth <dustin@intevation.de>
parents:
diff changeset
13 extend: 'Ext.data.Model',
d9593b520b3b Added a model for Status
Dustin Demuth <dustin@intevation.de>
parents:
diff changeset
14
d9593b520b3b Added a model for Status
Dustin Demuth <dustin@intevation.de>
parents:
diff changeset
15 fields: [{
d9593b520b3b Added a model for Status
Dustin Demuth <dustin@intevation.de>
parents:
diff changeset
16 name: 'id'
d9593b520b3b Added a model for Status
Dustin Demuth <dustin@intevation.de>
parents:
diff changeset
17 }, {
702
0c8e689f3bcb Added readonly to models, Probenzusatzwertgrid does now check wheter a record is readonly and disables the roweditor in such a case
Dustin Demuth <dustin@intevation.de>
parents: 698
diff changeset
18 name: 'readonly',
0c8e689f3bcb Added readonly to models, Probenzusatzwertgrid does now check wheter a record is readonly and disables the roweditor in such a case
Dustin Demuth <dustin@intevation.de>
parents: 698
diff changeset
19 type: 'boolean',
0c8e689f3bcb Added readonly to models, Probenzusatzwertgrid does now check wheter a record is readonly and disables the roweditor in such a case
Dustin Demuth <dustin@intevation.de>
parents: 698
diff changeset
20 persist: false
0c8e689f3bcb Added readonly to models, Probenzusatzwertgrid does now check wheter a record is readonly and disables the roweditor in such a case
Dustin Demuth <dustin@intevation.de>
parents: 698
diff changeset
21 }, {
945
023e622f9551 Added the ability to work with "StatusWerten" which are delivered by the lada-server.
Dustin Demuth <dustin@intevation.de>
parents: 711
diff changeset
22 name: 'owner',
965
a2c2039bb5d9 Disabled StatusGrid Edit when StatusEdit ist false, Load StatuswerteStore differently, removed a bunch of trailing commas
Dustin Demuth <dustin@intevation.de>
parents: 956
diff changeset
23 type: 'boolean'
945
023e622f9551 Added the ability to work with "StatusWerten" which are delivered by the lada-server.
Dustin Demuth <dustin@intevation.de>
parents: 711
diff changeset
24 }, {
569
d9593b520b3b Added a model for Status
Dustin Demuth <dustin@intevation.de>
parents:
diff changeset
25 name: 'messungsId'
d9593b520b3b Added a model for Status
Dustin Demuth <dustin@intevation.de>
parents:
diff changeset
26 }, {
593
9b3adfb7b1ae Updated status model.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 569
diff changeset
27 name: 'erzeuger'
9b3adfb7b1ae Updated status model.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 569
diff changeset
28 }, {
945
023e622f9551 Added the ability to work with "StatusWerten" which are delivered by the lada-server.
Dustin Demuth <dustin@intevation.de>
parents: 711
diff changeset
29 name: 'statusStufe',
988
0ca27b761584 Do not set a default value for statusstufe
Dustin Demuth <dustin@intevation.de>
parents: 970
diff changeset
30 type: 'int'
569
d9593b520b3b Added a model for Status
Dustin Demuth <dustin@intevation.de>
parents:
diff changeset
31 }, {
945
023e622f9551 Added the ability to work with "StatusWerten" which are delivered by the lada-server.
Dustin Demuth <dustin@intevation.de>
parents: 711
diff changeset
32 name: 'statusWert',
1019
637cf968a49c No default value for statuswerte
Dustin Demuth <dustin@intevation.de>
parents: 1007
diff changeset
33 type: 'int'
945
023e622f9551 Added the ability to work with "StatusWerten" which are delivered by the lada-server.
Dustin Demuth <dustin@intevation.de>
parents: 711
diff changeset
34 }, {
023e622f9551 Added the ability to work with "StatusWerten" which are delivered by the lada-server.
Dustin Demuth <dustin@intevation.de>
parents: 711
diff changeset
35 name: 'treeModified',
023e622f9551 Added the ability to work with "StatusWerten" which are delivered by the lada-server.
Dustin Demuth <dustin@intevation.de>
parents: 711
diff changeset
36 serialize: function(value) {
023e622f9551 Added the ability to work with "StatusWerten" which are delivered by the lada-server.
Dustin Demuth <dustin@intevation.de>
parents: 711
diff changeset
37 if (value === '') {
023e622f9551 Added the ability to work with "StatusWerten" which are delivered by the lada-server.
Dustin Demuth <dustin@intevation.de>
parents: 711
diff changeset
38 return null;
023e622f9551 Added the ability to work with "StatusWerten" which are delivered by the lada-server.
Dustin Demuth <dustin@intevation.de>
parents: 711
diff changeset
39 }
023e622f9551 Added the ability to work with "StatusWerten" which are delivered by the lada-server.
Dustin Demuth <dustin@intevation.de>
parents: 711
diff changeset
40 return value;
023e622f9551 Added the ability to work with "StatusWerten" which are delivered by the lada-server.
Dustin Demuth <dustin@intevation.de>
parents: 711
diff changeset
41 }
023e622f9551 Added the ability to work with "StatusWerten" which are delivered by the lada-server.
Dustin Demuth <dustin@intevation.de>
parents: 711
diff changeset
42 }, {
023e622f9551 Added the ability to work with "StatusWerten" which are delivered by the lada-server.
Dustin Demuth <dustin@intevation.de>
parents: 711
diff changeset
43 name: 'parentModified',
023e622f9551 Added the ability to work with "StatusWerten" which are delivered by the lada-server.
Dustin Demuth <dustin@intevation.de>
parents: 711
diff changeset
44 serialize: function(value) {
023e622f9551 Added the ability to work with "StatusWerten" which are delivered by the lada-server.
Dustin Demuth <dustin@intevation.de>
parents: 711
diff changeset
45 if (value === '') {
023e622f9551 Added the ability to work with "StatusWerten" which are delivered by the lada-server.
Dustin Demuth <dustin@intevation.de>
parents: 711
diff changeset
46 return null;
023e622f9551 Added the ability to work with "StatusWerten" which are delivered by the lada-server.
Dustin Demuth <dustin@intevation.de>
parents: 711
diff changeset
47 }
023e622f9551 Added the ability to work with "StatusWerten" which are delivered by the lada-server.
Dustin Demuth <dustin@intevation.de>
parents: 711
diff changeset
48 return value;
023e622f9551 Added the ability to work with "StatusWerten" which are delivered by the lada-server.
Dustin Demuth <dustin@intevation.de>
parents: 711
diff changeset
49 }
023e622f9551 Added the ability to work with "StatusWerten" which are delivered by the lada-server.
Dustin Demuth <dustin@intevation.de>
parents: 711
diff changeset
50 }, {
023e622f9551 Added the ability to work with "StatusWerten" which are delivered by the lada-server.
Dustin Demuth <dustin@intevation.de>
parents: 711
diff changeset
51 name: 'datum',
593
9b3adfb7b1ae Updated status model.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 569
diff changeset
52 type: 'date',
9b3adfb7b1ae Updated status model.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 569
diff changeset
53 convert: function(v) {
9b3adfb7b1ae Updated status model.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 569
diff changeset
54 if (!v) {
9b3adfb7b1ae Updated status model.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 569
diff changeset
55 return v;
9b3adfb7b1ae Updated status model.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 569
diff changeset
56 }
9b3adfb7b1ae Updated status model.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 569
diff changeset
57 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: 965
diff changeset
58 }
569
d9593b520b3b Added a model for Status
Dustin Demuth <dustin@intevation.de>
parents:
diff changeset
59 }, {
945
023e622f9551 Added the ability to work with "StatusWerten" which are delivered by the lada-server.
Dustin Demuth <dustin@intevation.de>
parents: 711
diff changeset
60 name: 'text'
569
d9593b520b3b Added a model for Status
Dustin Demuth <dustin@intevation.de>
parents:
diff changeset
61 }],
d9593b520b3b Added a model for Status
Dustin Demuth <dustin@intevation.de>
parents:
diff changeset
62
d9593b520b3b Added a model for Status
Dustin Demuth <dustin@intevation.de>
parents:
diff changeset
63 idProperty: 'id',
d9593b520b3b Added a model for Status
Dustin Demuth <dustin@intevation.de>
parents:
diff changeset
64
d9593b520b3b Added a model for Status
Dustin Demuth <dustin@intevation.de>
parents:
diff changeset
65 proxy: {
d9593b520b3b Added a model for Status
Dustin Demuth <dustin@intevation.de>
parents:
diff changeset
66 type: 'rest',
999
f73ca04d73a7 Refactored Server URL
Dustin Demuth <dustin@intevation.de>
parents: 970
diff changeset
67 url: 'lada-server/rest/status',
569
d9593b520b3b Added a model for Status
Dustin Demuth <dustin@intevation.de>
parents:
diff changeset
68 reader: {
d9593b520b3b Added a model for Status
Dustin Demuth <dustin@intevation.de>
parents:
diff changeset
69 type: 'json',
d9593b520b3b Added a model for Status
Dustin Demuth <dustin@intevation.de>
parents:
diff changeset
70 root: 'data'
d9593b520b3b Added a model for Status
Dustin Demuth <dustin@intevation.de>
parents:
diff changeset
71 }
d9593b520b3b Added a model for Status
Dustin Demuth <dustin@intevation.de>
parents:
diff changeset
72 }
d9593b520b3b Added a model for Status
Dustin Demuth <dustin@intevation.de>
parents:
diff changeset
73 });

http://lada.wald.intevation.org