App.Protokoll = function(){
    
    // begin private
    
    // end private
   
    // begin public
    return{
        
        start: function(){
            App.setTrace('App.Protokoll.start');
            
            App.setNavigation('Protokoll');
            this.toolbar();

        },
        
        wakeup: function(){
            
            App.setTrace('App.Protokoll.wakeup');
            
            if(!this.isWindow){
                this.isWindow = true;
                
                this.ContentLinks = Protokoll_Reuse_Links();
                
                this.changeLinks();
                this.buildWindow.add(this.ContentLinks);
                
                this.ContentRechts = Protokoll_Reuse_Rechts();
                this.changeRechts();
                this.buildWindow.add(this.ContentRechts);
                   
            }
            
            // Uebernahme der Bridge
            this.ContentLinks.store.baseParams = Ext.apply(this.ContentLinks.store.baseParams,{
                bridge: App.getBridge()
            });
            
            // Reset Form
            Ext.getCmp('ProtokollForm').getForm().reset();
            
            // laden Tabelle
            this.ContentLinks.store.load();
                       
            this.buildWindow.show();

            return;
        },
        
        ContentRechts: {},
        
        changeRechts: function(){
            App.setTrace('App.Protokoll.changeRechts');
            
            
            return;
        },
        
        ContentLinks: {},
        
        changeLinks: function(){
            App.setTrace('App.Protokoll.changeLinks');
            
            
            
           return; 
        },
        
        buildGridStore: new Ext.data.JsonStore({
            url: 'frontend/controler/app.php',
            baseParams: {
                modul: 'protokoll',
                aktion: 'holen',
                start: 0,
                limit: 10
            },
            root: 'data',
            idProperty: 'id',
            totalProperty: 'anzahl',
            fields: ['id','betreff','zeit','typ']
        }),
        
        toolbar: function(){
            App.setTrace('App.Protokoll.toolbar');
            
            var toolbar = App.getToolbar();
            toolbar.add({
                xtype: 'tbbutton',
                text: 'Protokoll',
                cls: 'x-btn-text-icon',
                icon: 'library/icons/protokoll.png',
                handler: function(){
                    App.checkNavigation('Protokoll',0);
                }
            });
            
            toolbar.add({
                xtype: 'tbseparator'
            });
            
            App.doLayoutToolbar();
            
            return;
        },
        
        isWindow: false,
        
        buildWindow: new Ext.Window({
            title: 'Protokoll',
            width: 850,
            autoHeight: true,
            x: 120,
            y: 85,
            iconCls: 'icon-protokoll',
            id: 'Protokoll',
            draggable: true,
            resizable: false,
            autoHeight: true,
            closeAction: 'hide',
            shadow: false,
            layout: 'column'
        })

    } // end public
    
}();

Ext.onReady(App.Protokoll.start,App.Protokoll);
