torsten@472: /* Copyright (C) 2013 by Bundesamt fuer Strahlenschutz torsten@472: * Software engineering by Intevation GmbH torsten@472: * torsten@472: * This file is Free Software under the GNU GPL (v>=3) torsten@472: * and comes with ABSOLUTELY NO WARRANTY! Check out raimund@497: * the documentation coming with IMIS-Labordaten-Application for details. torsten@472: */ torsten@472: torsten@341: /** torsten@341: * Viewport for the Lada-Client torsten@341: * torsten@341: * The viewport initialises the graphical elements of the application. For torsten@341: * debugging it is possible to initialize other components directly see the torsten@341: * initComponent function. torsten@341: */ raimund@497: Ext.define('Lada.view.Viewport', { torsten@12: extend: 'Ext.container.Viewport', torsten@12: requires: [ torsten@259: 'Lada.store.Info', torsten@259: 'Lada.view.search.List', torsten@369: 'Lada.view.proben.List' torsten@12: ], torsten@425: layout: 'fit', torsten@12: initComponent: function() { torsten@357: this.initSearch(); torsten@173: raimund@497: // Development related: torsten@173: // Disable "initSearch" call and enable one of the following init torsten@173: // methods to get a dialog directly without the need to click through torsten@173: // the whole application. raimund@497: // this.initProbe(); raimund@497: // this.initOrt(); raimund@497: // this.initMessung(); raimund@497: // this.initMesswert(); torsten@173: torsten@357: this.setInfo(); torsten@173: this.callParent(arguments); torsten@173: }, torsten@341: /** torsten@341: * Set some information about user, client and server version in the top torsten@341: * of the application window. The data will be fetched from the server. torsten@341: */ torsten@259: setInfo: function() { torsten@259: var store = Ext.create('Lada.store.Info'); torsten@259: store.load({ raimund@497: callback: function() { torsten@259: var info = store.data.items[0]; torsten@259: var user = info.get('user'); torsten@259: var groups = info.get('groups'); torsten@383: var groupinfo = Ext.getCmp('groupinfo'); torsten@383: var userinfo = Ext.getCmp('userinfo'); torsten@383: userinfo.update(user); torsten@383: groupinfo.update(groups); torsten@259: } torsten@259: }); torsten@259: }, torsten@341: /** torsten@412: * Function to initialize the edit window for a particular probe directly torsten@341: * @private torsten@341: */ torsten@230: initProbe: function() { torsten@230: var store = Ext.getStore('Proben'); torsten@230: store.load({ torsten@230: params: { raimund@497: probeId: '000007575943X' torsten@230: }, torsten@230: callback: function() { torsten@230: var mstore = Ext.getStore('Messungen'); torsten@230: mstore.load({ torsten@230: params: { raimund@497: probeId: '000007575943X' torsten@230: } torsten@230: }); torsten@230: var model = store.data.items[0]; raimund@497: Ext.create('Lada.view.proben.Edit', { raimund@497: model: model raimund@497: }); torsten@230: } torsten@230: }); torsten@230: }, torsten@341: /** torsten@341: * Function to initialize the edit window for a priticular messwert directly torsten@341: * @private torsten@341: */ torsten@180: initMesswert: function() { torsten@180: var store = Ext.getStore('Messwerte'); torsten@180: store.load({ torsten@180: params: { raimund@497: probeId: '000007575853X', raimund@497: messungsId: '1' torsten@184: }, torsten@184: callback: function() { torsten@184: var model = store.data.items[0]; raimund@497: Ext.create('Lada.view.messwerte.Create', { raimund@491: model: model raimund@491: }); torsten@180: } torsten@180: }); torsten@180: }, torsten@341: /** torsten@341: * Function to initialize the edit window for a priticular ort directly torsten@341: * @private torsten@341: */ torsten@180: initOrt: function() { torsten@180: var ort = Ext.create('Lada.model.Ort'); raimund@497: Ext.create('Lada.view.orte.Create', { raimund@491: model: ort raimund@491: }); torsten@180: }, torsten@341: /** torsten@341: * Function to initialize the edit window for a priticular ort directly torsten@341: * @private torsten@341: */ torsten@173: initMessung: function() { torsten@180: var store = Ext.getStore('Messungen'); raimund@490: var kstore = Ext.getStore('KommentareM'); torsten@184: var mstore = Ext.getStore('Messwerte'); torsten@184: var sstore = Ext.getStore('Status'); raimund@497: var probeId = '000007578314X'; torsten@180: store.load({ torsten@180: params: { torsten@180: probeId: probeId torsten@180: }, raimund@497: callback: function() { torsten@180: var messung = store.data.items[0]; torsten@180: kstore.load({ torsten@180: params: { torsten@180: probeId: probeId, torsten@214: messungsId: messung.get('id').messungsId torsten@180: } torsten@180: }); torsten@184: sstore.load({ torsten@184: params: { torsten@184: probeId: probeId, torsten@214: messungsId: messung.get('id').messungsId torsten@184: } torsten@184: }); torsten@184: mstore.load({ torsten@184: params: { torsten@184: probeId: probeId, torsten@214: messungsId: messung.get('id').messungsId torsten@184: } torsten@184: }); raimund@497: // var messung = Ext.create('Lada.model.Messung'); raimund@497: Ext.create('Lada.view.messungen.Create', { raimund@497: model: messung raimund@497: }); torsten@180: } torsten@180: }); torsten@173: }, torsten@341: /** torsten@341: * Function to initialize the search window. This is the default method raimund@497: * called by the {@link Lada.view.Viewport#initComponent initComponent} raimund@497: * method. torsten@341: * @private torsten@341: */ torsten@173: initSearch: function() { torsten@383: this.items = [{ torsten@25: title: '
Probenauswahlmaske
', raimund@520: layout: 'border', raimund@520: items: [{ raimund@520: layout: { raimund@520: type: 'vbox', raimund@520: align: 'stretch' raimund@520: }, raimund@520: region: 'west', raimund@520: split: true, raimund@520: border: 1, raimund@520: flex: 1, raimund@520: dockedItems: [{ raimund@520: xtype: 'toolbar', raimund@520: dock: 'top', raimund@520: items: [{ raimund@520: xtype: 'splitbutton', raimund@520: text: 'Info', raimund@520: menu: { raimund@520: items: [{ raimund@520: id: 'AboutBtn', raimund@520: text: 'About' raimund@520: }] raimund@520: } raimund@520: }, '->', { raimund@520: xtype: 'box', raimund@520: autoEl: { raimund@520: tag: 'img', raimund@520: src: 'gfx/user-identity.png' raimund@520: } raimund@520: }, { raimund@520: xtype: 'tbtext', raimund@520: id: 'userinfo', raimund@520: text: '' raimund@520: }, { raimund@520: xtype: 'box', raimund@520: autoEl: { raimund@520: tag: 'img', raimund@520: src: 'gfx/network-workgroup.png' raimund@520: } raimund@520: }, { raimund@520: xtype: 'tbtext', raimund@520: id: 'groupinfo', raimund@520: text: '' raimund@520: }] raimund@520: }], raimund@491: items: [{ raimund@520: // Auswahl einer Abfrage. raimund@520: xtype: 'queryselector', raimund@520: margin: '0, 10, 0, 10', raimund@520: id: 'queryselector' raimund@491: }, { raimund@520: // Variables settings for the current selected sql statement. raimund@520: xtype: 'fieldset', raimund@520: id: 'queryfilters', raimund@520: title: 'Variablenbelegung', raimund@520: hidden: true, raimund@520: margin: '0, 10, 0, 10', raimund@520: items: [] raimund@491: }] raimund@491: }, { raimund@491: // Resultlist for the query. raimund@491: id: 'result', raimund@520: flex: 3, raimund@491: xtype: 'probenlist', raimund@520: hidden: false, raimund@520: region: 'center' raimund@491: }] torsten@383: }]; torsten@12: } torsten@12: });