raimund@548: /* Copyright (C) 2013 by Bundesamt fuer Strahlenschutz raimund@548: * Software engineering by Intevation GmbH raimund@548: * raimund@548: * This file is Free Software under the GNU GPL (v>=3) raimund@548: * and comes with ABSOLUTELY NO WARRANTY! Check out raimund@548: * the documentation coming with IMIS-Labordaten-Application for details. raimund@548: */ raimund@548: raimund@548: /** raimund@548: * A Probe. raimund@548: * This class represents and defines the model of a 'Probe' raimund@548: **/ raimund@548: Ext.define('Lada.model.Probe', { raimund@548: extend: 'Ext.data.Model', raimund@548: raimund@548: fields: [{ raimund@548: name: 'id' raimund@548: }, { dustin@691: name: 'owner', dustin@692: type: 'boolean', dustin@692: persist: false dustin@691: }, { tom@1217: name: 'idAlt' raimund@548: }, { raimund@548: name: 'hauptprobenNr' raimund@548: }, { mstanko@924: name: 'test', mstanko@924: type: 'boolean' raimund@548: }, { raimund@548: name: 'mstId' raimund@548: }, { raimund@1066: name: 'laborMstId' raimund@1066: }, { raimund@548: name: 'datenbasisId' raimund@548: }, { tom@1217: name: 'baId', raimund@548: }, { raimund@548: name: 'probenartId' raimund@548: }, { tom@1234: name: 'mediaDesk', tom@1234: serialize: function(value) { tom@1234: if (value === '') { tom@1234: return null; tom@1234: } tom@1234: return value; tom@1234: } raimund@548: }, { raimund@548: name: 'media' raimund@548: }, { raimund@677: name: 'umwId', raimund@677: serialize: function(value) { raimund@677: if (value === '') { raimund@677: return null; raimund@677: } raimund@677: return value; raimund@677: } raimund@548: }, { raimund@548: name: 'probeentnahmeBeginn', raimund@548: type: 'date', raimund@548: convert: function(v) { raimund@548: if (!v) { raimund@548: return v; raimund@548: } raimund@548: return new Date(v); dustin@970: } raimund@548: }, { raimund@548: name: 'probeentnahmeEnde', raimund@548: type: 'date', raimund@548: convert: function(v) { raimund@548: if (!v) { raimund@548: return v; raimund@548: } raimund@548: return new Date(v); dustin@970: } raimund@548: }, { raimund@548: name: 'mittelungsdauer' raimund@548: }, { raimund@548: name: 'letzteAenderung', raimund@548: type: 'date', raimund@548: convert: function(v) { raimund@548: if (!v) { raimund@548: return v; raimund@548: } raimund@548: return new Date(v); dustin@970: } raimund@548: }, { raimund@548: name: 'erzeugerId' raimund@548: }, { raimund@548: name: 'probeNehmerId' raimund@548: }, { raimund@548: name: 'mplId' raimund@548: }, { raimund@548: name: 'mprId' raimund@548: }, { raimund@548: name: 'solldatumBeginn', raimund@548: type: 'date', raimund@548: convert: function(v) { raimund@548: if (!v) { raimund@548: return v; raimund@548: } raimund@548: return new Date(v); raimund@927: }, raimund@927: serialize: function(value) { raimund@927: if (value === '') { raimund@927: return null; raimund@927: } raimund@927: return value; raimund@926: } raimund@548: }, { raimund@548: name: 'solldatumEnde', raimund@548: type: 'date', raimund@548: convert: function(v) { raimund@548: if (!v) { raimund@548: return v; raimund@548: } raimund@548: return new Date(v); raimund@927: }, raimund@927: serialize: function(value) { raimund@927: if (value === '') { raimund@927: return null; raimund@927: } raimund@927: return value; raimund@926: } raimund@548: }, { raimund@548: name: 'readonly', dustin@692: type: 'boolean', raimund@548: persist: false raimund@689: }, { raimund@711: name: 'treeModified', raimund@711: serialize: function(value) { raimund@711: if (value === '') { raimund@711: return null; raimund@711: } raimund@711: return value; raimund@711: } raimund@548: }], raimund@548: raimund@548: idProperty: 'id', raimund@548: raimund@548: proxy: { raimund@548: type: 'rest', dustin@999: url: 'lada-server/rest/probe', raimund@548: reader: { raimund@548: type: 'json', raimund@548: root: 'data' raimund@548: } raimund@548: } raimund@548: });