dustin@1013: /* Copyright (C) 2013 by Bundesamt fuer Strahlenschutz dustin@1013: * Software engineering by Intevation GmbH dustin@1013: * dustin@1013: * This file is Free Software under the GNU GPL (v>=3) dustin@1013: * and comes with ABSOLUTELY NO WARRANTY! Check out dustin@1013: * the documentation coming with IMIS-Labordaten-Application for details. dustin@1013: */ dustin@1013: dustin@1013: /** dustin@1013: * Window to create/edit the Ort / Probe Relation dustin@1013: */ dustin@1013: Ext.define('Lada.view.window.Ortszuordnung', { dustin@1013: extend: 'Ext.window.Window', dustin@1013: alias: 'widget.ortszuordnungwindow', dustin@1013: dustin@1013: requires: [ dustin@1013: 'Lada.view.form.Ortszuordnung' dustin@1013: ], dustin@1013: dustin@1013: collapsible: true, dustin@1013: maximizable: true, dustin@1013: autoshow: true, dustin@1013: layout: 'border', dustin@1013: constrain: true, dustin@1013: dustin@1013: probe: null, dustin@1013: parentWindow: null, dustin@1013: record: null, dustin@1013: grid: null, dustin@1013: dustin@1013: /** dustin@1013: * This function initialises the Window dustin@1013: */ dustin@1013: initComponent: function() { dustin@1013: var i18n = Lada.getApplication().bundle; dustin@1013: dustin@1013: this.title = i18n.getMsg('ortszuordnung.window.title'); dustin@1013: dustin@1013: if (this.record && this.probe) { dustin@1013: // A new record will be created dustin@1013: this.title = i18n.getMsg('ortszuordnung.window.title') dustin@1013: + ' ' dustin@1013: + i18n.getMsg('ortszuordnung.window.title2') dustin@1013: + ' ' dustin@1013: + i18n.getMsg('probe') dustin@1013: + ' ' dustin@1013: + probe.get('hauptprobennr') dustin@1013: + ' ' dustin@1013: + i18n.getMsg('edit'); dustin@1013: } dustin@1013: else if (this.probe) { dustin@1013: // A new record will be created dustin@1013: this.title = i18n.getMsg('ortszuordnung.window.title') dustin@1013: + ' ' dustin@1013: + i18n.getMsg('ortszuordnung.window.title2') dustin@1013: + ' ' dustin@1013: + i18n.getMsg('probe') dustin@1013: + ' ' dustin@1013: + probe.get('hauptprobennr') dustin@1013: + ' ' dustin@1013: + i18n.getMsg('create'); dustin@1013: } dustin@1013: dustin@1013: this.buttons = [{ dustin@1013: text: i18n.getMsg('close'), dustin@1013: scope: this, dustin@1013: handler: this.close dustin@1013: }]; dustin@1013: this.width = 900; dustin@1013: this.height = 515; dustin@1013: this.bodyStyle = {background: '#fff'}; dustin@1013: dustin@1013: // add listeners to change the window appearence when it becomes inactive dustin@1013: this.on({ dustin@1013: activate: function(){ dustin@1013: this.getEl().removeCls('window-inactive'); dustin@1013: }, dustin@1013: deactivate: function(){ dustin@1013: this.getEl().addCls('window-inactive'); dustin@1013: } dustin@1013: }); dustin@1013: dustin@1013: this.items = [{ dustin@1013: region: 'west', dustin@1013: border: 0, dustin@1013: layout: 'hbox', dustin@1013: items: [{ dustin@1013: xtype: 'ortszuordnungform', dustin@1013: margin: 5 dustin@1013: //}, { dustin@1013: // xtype: 'ortpanel', dustin@1013: // margin: 5 dustin@1013: }] dustin@1013: }]; dustin@1013: this.callParent(arguments); dustin@1013: }, dustin@1013: dustin@1013: /** dustin@1013: * Initialise the Data of this Window dustin@1013: */ dustin@1013: initData: function() { dustin@1013: this.down('ortszuordnungform').setRecord(this.record); dustin@1013: }, dustin@1013: dustin@1013: /** dustin@1013: * Instructs the fields / forms listed in this method to set a message. dustin@1013: * @param errors These Errors shall be shown dustin@1013: * @param warnings These Warning shall be shown dustin@1013: */ dustin@1013: setMessages: function(errors, warnings) { dustin@1013: //todo this is a stub dustin@1013: }, dustin@1013: dustin@1013: /** dustin@1013: * Instructs the fields / forms listed in this method to clear their messages. dustin@1013: */ dustin@1013: clearMessages: function() { dustin@1013: //todo this is a stub dustin@1013: } dustin@1013: }); dustin@1013: