App.Telefonliste.Plugin = function(){
    
    // Begin private
    
    // End private
    
    // Begin public
    return{
        
        start: function(){
            App.setTrace('App.Telefonliste.Plugin.start');
            
            
            fenster = new Ext.Window({
                width: 655,
                x: 120,
                y: 85,
                closeAction: 'hide',
                resizable: false,
                autoHeight: true,
                title: 'neuer Eintrag / neue Notiz',
                id: 'plugin',
                shadow: false,
                modal: true,
               	buttonAlign: 'center',
                buttons: [{
                    text: ' eintragen ',
                    handler: function(){
                        
                        var formular = Ext.getCmp('formular');
                        formular.getForm().submit({
                            params: {
                                aktion: 'eintragen'
                            }
                        });
                        
                    }
                },{
                    text: ' eintragen / anrufen ',
                    handler: function(){
                        
                        var formular = Ext.getCmp('formular');
                        formular.getForm().submit({
                            params: {
                                aktion: 'anrufen'
                            }
                        });
                        
                        
                    }
                }],
                items: [{
                    xtype: 'form',
                    id: 'formular',
                    autoHeight: true,
                    bodyStyle: 'padding: 10px;',
                    url:'frontend/controler/app.php',
                    method: 'POST',
                    baseParams: {
                        modul: 'plugin'
                    },
                    border: false,
                    items: [{
                        xtype: 'textfield',
                        fieldLabel: 'Name *',
                        name: 'name',
                        width: 300,
                        id: 'name',
                        allowBlank: false,
                        minLength: 3
                    },{
                       xtype: 'textfield',
                       fieldLabel: 'Vorname',
                       name: 'vorname',
                       width: 300,
                       id: 'vorname' 
                    },{
                       xtype: 'textfield',
                       fieldLabel: 'PLZ',
                       name: 'plz',
                       width: 300,
                       id: 'plz'
                    },{
                       xtype: 'textfield',
                       fieldLabel: 'Ort',
                       name: 'ort',
                       width: 300,
                       id: 'ort'
                    },{
                       xtype: 'textfield',
                       fieldLabel: 'Strasse',
                       name: 'strasse',
                       width: 300,
                       id: 'strasse'
                    },{
                       xtype: 'textfield',
                       fieldLabel: 'Hausnummer',
                       name: 'hausnummer',
                       width: 300,
                       id: 'hausnummer'
                    },{
                       xtype: 'textfield',
                       fieldLabel: 'Firma',
                       name: 'firma',
                       width: 300,
                       id: 'firma'
                    },{
                       xtype: 'textfield',
                       fieldLabel: 'Telefon 1 *',
                       name: 'telefon1',
                       width: 300,
                       id: 'plugin_telefonnummer',
                       allowBlank: false,
                       minLength: 4 
                    },{
                       xtype: 'textfield',
                       fieldLabel: 'Telefon 2',
                       name: 'telefon2',
                       width: 300,
                       id: 'telefon2' 
                    },{
                       xtype: 'textfield',
                       fieldLabel: 'Handy',
                       name: 'handy1',
                       width: 300,
                       id: 'handy1' 
                    },{
                       xtype: 'textfield',
                       fieldLabel: 'E-Mail',
                       name: 'email',
                       width: 300,
                       id: 'email',
                       vtype: 'email' 
                    },{
                       xtype: 'textfield',
                       fieldLabel: 'Betreff *',
                       name: 'betreff',
                       width: 300,
                       id: 'betreff',
                       allowBlank: false,
                       minLength: 5  
                    },{
                       xtype: 'textarea',
                       fieldLabel: 'Notiz *',
                       height: 100,
                       width: 300,
                       id: 'information',
                       name: 'information',
                       allowBlank: false,
                       minLength: 5
                    },{
                       xtype: 'displayfield',
                       value: 'Felder mit * sind Pflichtfelder !',
                       cls: 'viewDisplayfield',
                       width: 300
                    }]
                }]
            });

        },
        
        wakeup: function(){
            
            App.setTrace('App.Telefonliste.Plugin.wakeup');
            
            Ext.getCmp('plugin').show();
            
        }
        
        
    }
    // End public

}();

Ext.onReady(App.Telefonliste.Plugin.start,App.Telefonliste.Plugin);

