raimund@642: /* Copyright (C) 2013 by Bundesamt fuer Strahlenschutz
raimund@642:  * Software engineering by Intevation GmbH
raimund@642:  *
raimund@642:  * This file is Free Software under the GNU GPL (v>=3)
raimund@642:  * and comes with ABSOLUTELY NO WARRANTY! Check out
raimund@642:  * the documentation coming with IMIS-Labordaten-Application for details.
raimund@642:  */
raimund@642: 
raimund@642: /*
raimund@642:  * Window to edit a Messung
raimund@642:  */
raimund@642: Ext.define('Lada.view.window.OrtCreate', {
raimund@642:     extend: 'Ext.window.Window',
raimund@642:     alias: 'widget.ortcreate',
raimund@642: 
raimund@642:     requires: [
raimund@642:         'Lada.view.panel.Map',
raimund@642:         'Lada.view.form.Ort',
raimund@642:         'Lada.view.form.Location'
raimund@642:     ],
raimund@642: 
raimund@642:     collapsible: true,
raimund@642:     maximizable: true,
raimund@642:     autoshow: true,
raimund@642:     layout: 'border',
dustin@688:     constrain: true,
raimund@642: 
raimund@642:     record: null,
raimund@642:     grid: null,
raimund@642: 
raimund@642:     initComponent: function() {
raimund@642:         this.title = 'Ort';
raimund@642:         this.buttons = [{
raimund@642:             text: 'Schließen',
raimund@642:             scope: this,
raimund@642:             handler: this.close
raimund@642:         }];
raimund@642:         this.width = 900;
raimund@642:         this.height = 515;
raimund@642:         this.bodyStyle = {background: '#fff'};
raimund@642: 
dustin@709:         // add listeners to change the window appearence when it becomes inactive
dustin@709:         this.on({
dustin@709:             activate: function(){
dustin@709:                 this.getEl().removeCls('window-inactive');
dustin@709:             },
dustin@709:             deactivate: function(){
dustin@709:                 this.getEl().addCls('window-inactive');
dustin@709:             }
dustin@709:         });
dustin@709: 
raimund@642:         this.items = [{
raimund@642:             region: 'west',
raimund@642:             border: 0,
raimund@642:             layout: 'vbox',
raimund@642:             items: [{
raimund@642:                 xtype: 'ortform',
raimund@642:                 margin: 5
raimund@642:             }, {
raimund@642:                 xtype: 'locationform',
raimund@642:                 margin: 5
raimund@642:             }]
raimund@642:         }, {
raimund@642:             xtype: 'fset',
raimund@642:             bodyStyle: {
raimund@642:                 background: '#fff'
raimund@642:             },
raimund@642:             layout: 'border',
raimund@642:             name: 'mapfield',
raimund@642:             title: 'Karte',
raimund@642:             region: 'center',
raimund@642:             padding: '5, 5',
raimund@642:             margin: 5,
raimund@642:             items: [{
raimund@642:                 xtype: 'map',
raimund@642:                 region: 'center',
raimund@642:                 layout: 'border',
raimund@642:                 bodyStyle: {
raimund@642:                     background: '#fff'
raimund@642:                 },
raimund@642:                 name: 'map'
raimund@642:             }]
raimund@642:         }];
raimund@642:         this.callParent(arguments);
raimund@642:     },
raimund@642: 
raimund@642:     initData: function() {
raimund@642:         var ort = Ext.create('Lada.model.Ort', {
raimund@642:             probeId: this.record.get('id')
raimund@642:         });
raimund@642:         this.down('ortform').setRecord(ort);
raimund@642:     },
raimund@642: 
raimund@642:     setMessages: function(errors, warnings) {
raimund@642:         //todo this is a stub
raimund@642:     },
raimund@642: 
raimund@642:     clearMessages: function() {
raimund@642:         //todo this is a stub
raimund@642:     }
raimund@642: });