annotate app/model/Messung.js @ 482:a9184ba5ee17 1.0

Set paths
author Torsten Irländer <torsten.irlaender@intevation.de>
date Tue, 21 Jan 2014 17:05:52 +0100
parents debfcc7713e3
children f7446ebfe5d0
rev   line source
472
debfcc7713e3 Added license header to each file.
Torsten Irländer <torsten.irlaender@intevation.de>
parents: 327
diff changeset
1 /* Copyright (C) 2013 by Bundesamt fuer Strahlenschutz
debfcc7713e3 Added license header to each file.
Torsten Irländer <torsten.irlaender@intevation.de>
parents: 327
diff changeset
2 * Software engineering by Intevation GmbH
debfcc7713e3 Added license header to each file.
Torsten Irländer <torsten.irlaender@intevation.de>
parents: 327
diff changeset
3 *
debfcc7713e3 Added license header to each file.
Torsten Irländer <torsten.irlaender@intevation.de>
parents: 327
diff changeset
4 * This file is Free Software under the GNU GPL (v>=3)
debfcc7713e3 Added license header to each file.
Torsten Irländer <torsten.irlaender@intevation.de>
parents: 327
diff changeset
5 * and comes with ABSOLUTELY NO WARRANTY! Check out
debfcc7713e3 Added license header to each file.
Torsten Irländer <torsten.irlaender@intevation.de>
parents: 327
diff changeset
6 * the documentation coming with IMIS-Labordaten-Application for details.
debfcc7713e3 Added license header to each file.
Torsten Irländer <torsten.irlaender@intevation.de>
parents: 327
diff changeset
7 */
debfcc7713e3 Added license header to each file.
Torsten Irländer <torsten.irlaender@intevation.de>
parents: 327
diff changeset
8
314
65f8be677c8a Added docstring
Torsten Irländer <torsten.irlaender@intevation.de>
parents: 299
diff changeset
9 /**
65f8be677c8a Added docstring
Torsten Irländer <torsten.irlaender@intevation.de>
parents: 299
diff changeset
10 * Model class for Messungen
65f8be677c8a Added docstring
Torsten Irländer <torsten.irlaender@intevation.de>
parents: 299
diff changeset
11 */
103
3552b0ee4526 Added Messungenlist to the Proben eddit view.
Torsten Irländer <torsten@irlaender.de>
parents:
diff changeset
12 Ext.define('Lada.model.Messung', {
327
63eae13768f3 Inherit form model.base. Formatting
Torsten Irländer <torsten.irlaender@intevation.de>
parents: 314
diff changeset
13 extend: 'Lada.model.Base',
63eae13768f3 Inherit form model.base. Formatting
Torsten Irländer <torsten.irlaender@intevation.de>
parents: 314
diff changeset
14 fields: [
162
5eb0cfac0e30 Added nested id attribute which comes in JSON response to the model as we need
Torsten Irländer <torsten.irlaender@intevation.de>
parents: 159
diff changeset
15 {name: "id"},
159
f653bd7893c0 Fixed model. Added mapping.
Torsten Irländer <torsten.irlaender@intevation.de>
parents: 158
diff changeset
16 {name: "messungsId", mapping:"id.messungsId"},
f653bd7893c0 Fixed model. Added mapping.
Torsten Irländer <torsten.irlaender@intevation.de>
parents: 158
diff changeset
17 {name: "probeId", mapping:"id.probeId"},
103
3552b0ee4526 Added Messungenlist to the Proben eddit view.
Torsten Irländer <torsten@irlaender.de>
parents:
diff changeset
18 {name: "mmtId"},
3552b0ee4526 Added Messungenlist to the Proben eddit view.
Torsten Irländer <torsten@irlaender.de>
parents:
diff changeset
19 {name: "nebenprobenNr"},
3552b0ee4526 Added Messungenlist to the Proben eddit view.
Torsten Irländer <torsten@irlaender.de>
parents:
diff changeset
20 {name: "messdauer"},
299
fe199b8828a8 Use ts2date function from lib.Helpers. Remove old code
Torsten Irländer <torsten.irlaender@intevation.de>
parents: 212
diff changeset
21 {name: "messzeitpunkt", convert: Lada.lib.Helpers.ts2date, defaultValue: new Date()},
103
3552b0ee4526 Added Messungenlist to the Proben eddit view.
Torsten Irländer <torsten@irlaender.de>
parents:
diff changeset
22 {name: "fertig", type: "boolean"},
3552b0ee4526 Added Messungenlist to the Proben eddit view.
Torsten Irländer <torsten@irlaender.de>
parents:
diff changeset
23 {name: "letzteAenderung", type:"date"},
3552b0ee4526 Added Messungenlist to the Proben eddit view.
Torsten Irländer <torsten@irlaender.de>
parents:
diff changeset
24 {name: "geplant", type: "boolean"}
3552b0ee4526 Added Messungenlist to the Proben eddit view.
Torsten Irländer <torsten@irlaender.de>
parents:
diff changeset
25 ],
212
92facbaece42 add getEidi function to model
Torsten Irländer <torsten.irlaender@intevation.de>
parents: 171
diff changeset
26 idProperty: "id",
103
3552b0ee4526 Added Messungenlist to the Proben eddit view.
Torsten Irländer <torsten@irlaender.de>
parents:
diff changeset
27 proxy: {
3552b0ee4526 Added Messungenlist to the Proben eddit view.
Torsten Irländer <torsten@irlaender.de>
parents:
diff changeset
28 type: 'rest',
3552b0ee4526 Added Messungenlist to the Proben eddit view.
Torsten Irländer <torsten@irlaender.de>
parents:
diff changeset
29 appendId: true, //default
3552b0ee4526 Added Messungenlist to the Proben eddit view.
Torsten Irländer <torsten@irlaender.de>
parents:
diff changeset
30 url: 'server/rest/messung',
3552b0ee4526 Added Messungenlist to the Proben eddit view.
Torsten Irländer <torsten@irlaender.de>
parents:
diff changeset
31 reader: {
3552b0ee4526 Added Messungenlist to the Proben eddit view.
Torsten Irländer <torsten@irlaender.de>
parents:
diff changeset
32 type: 'json',
3552b0ee4526 Added Messungenlist to the Proben eddit view.
Torsten Irländer <torsten@irlaender.de>
parents:
diff changeset
33 root: 'data'
3552b0ee4526 Added Messungenlist to the Proben eddit view.
Torsten Irländer <torsten@irlaender.de>
parents:
diff changeset
34 }
212
92facbaece42 add getEidi function to model
Torsten Irländer <torsten.irlaender@intevation.de>
parents: 171
diff changeset
35 },
92facbaece42 add getEidi function to model
Torsten Irländer <torsten.irlaender@intevation.de>
parents: 171
diff changeset
36 getEidi: function() {
92facbaece42 add getEidi function to model
Torsten Irländer <torsten.irlaender@intevation.de>
parents: 171
diff changeset
37 var messId = this.get('messungsId');
92facbaece42 add getEidi function to model
Torsten Irländer <torsten.irlaender@intevation.de>
parents: 171
diff changeset
38 var probeId = this.get('probeId');
92facbaece42 add getEidi function to model
Torsten Irländer <torsten.irlaender@intevation.de>
parents: 171
diff changeset
39 return "/" + messId + "/" + probeId;
103
3552b0ee4526 Added Messungenlist to the Proben eddit view.
Torsten Irländer <torsten@irlaender.de>
parents:
diff changeset
40 }
3552b0ee4526 Added Messungenlist to the Proben eddit view.
Torsten Irländer <torsten@irlaender.de>
parents:
diff changeset
41 });
171
c5422819d7b9 Show messzeitpunkt in messung listing. Convert timestamp to date.
Torsten Irländer <torsten.irlaender@intevation.de>
parents: 162
diff changeset
42
c5422819d7b9 Show messzeitpunkt in messung listing. Convert timestamp to date.
Torsten Irländer <torsten.irlaender@intevation.de>
parents: 162
diff changeset
43 function ts2date(v, record){
c5422819d7b9 Show messzeitpunkt in messung listing. Convert timestamp to date.
Torsten Irländer <torsten.irlaender@intevation.de>
parents: 162
diff changeset
44 // Converts a timestamp into a date object.
c5422819d7b9 Show messzeitpunkt in messung listing. Convert timestamp to date.
Torsten Irländer <torsten.irlaender@intevation.de>
parents: 162
diff changeset
45 return new Date(v);
c5422819d7b9 Show messzeitpunkt in messung listing. Convert timestamp to date.
Torsten Irländer <torsten.irlaender@intevation.de>
parents: 162
diff changeset
46 }

http://lada.wald.intevation.org