Ext.BLANK_IMAGE_URL = "/img/s.gif"; var curStep = false; var mM4GridTarifSettingsDlg; var mM4ColSelectionDialog = function(config) { }; var mM4UserRegDialog = function(config) { config = config || {}; if(typeof config == "string"){ config = {title: config}; } // success function for login var regSuccess = function(o) { Ext.MessageBox.alert("Achtung:","Der Benutzer wurde angelegt. Sie können sich nun auf der Loginseite anmelden."); mM4App.getUserRegDialog().hide(); }; // fail function for login var regFailure = function(o) { Ext.MessageBox.alert("Achtung:","Ein Benutzer mit der angegeben E-Mailadresse existiert bereits. Sollten Sie Ihr Passwort vergessen haben, können Sie dieses auf der Loginseite anfordern."); }; var dialog = new Ext.LayoutDialog( config.id || Ext.id(), { autoCreate: config.autoCreate || true, closable: config.closable || false, modal: true, resizable: false, minWidth: config.minWidth || 375, minHeight: config.minHeight || 465, syncHeightBeforeShadow: true, shadow: true, fixedcenter: true, draggable: false, shim: true, center: { autoScroll: false, titlebar: false } }); dialog.setTitle( config.title || "Registrieren"); dialog.getLayout().beginUpdate(); var centerViewEl = dialog.body.createChild({tag:'div', id:Ext.id(), style:'color:#FFF; background-color:#666; position:absolute; padding: 10px;'}); var dlgPanel = new Ext.ContentPanel(centerViewEl, { fitToFrame: true, autoScroll: false }); // error output besides the form field Ext.form.Field.prototype.msgTarget = 'side'; // some basic setup stuff var submitUrl = "/perl/index.pl"; var formBaseParams = { rm: 'doRegister', sid: "99b44161a6cf3910e92537a444c4f991" }; // create the form var registerForm = new Ext.form.Form({ labelAlign: 'right', buttonAlign: 'right', labelWidth: 102, url: submitUrl, baseParams: formBaseParams }); // submit actions registerForm.on('actioncomplete', regSuccess); registerForm.on('actionfailed', regFailure); var anreden = [ ['Herr', 'Herr'], ['Frau', 'Frau'] ]; var anredeStore = new Ext.data.SimpleStore({ fields: ['name', 'wert'], data : anreden }); var RecordDef = Ext.data.Record.create([ {name: 'taetigkeit', mapping: 'taetigkeit'} ]); var branchenStore = new Ext.data.Store({ proxy: new Ext.data.HttpProxy({url: '/perl/index.pl', params: { sid: '99b44161a6cf3910e92537a444c4f991', rm: 'getBranchen' }}), reader: new Ext.data.JsonReader({id: "taetigkeit"}, RecordDef) }); branchenStore.load({url: '/perl/index.pl', params: { sid: '99b44161a6cf3910e92537a444c4f991', rm: 'getBranchen' }}); // add the form fields registerForm.fieldset( {legend: 'Informationen'}, new Ext.form.ComboBox({ store: anredeStore, displayField:'name', typeAhead: true, mode: 'local', triggerAction: 'all', emptyText:'Bitte wählen...', selectOnFocus:true, resizable:true, fieldLabel: "Anrede", name: "anrede", width: 110, allowBlank: false }), new Ext.form.TextField({ fieldLabel: "Vorname", name: "fname", width: 190 }), new Ext.form.TextField({ fieldLabel: "Name", name: "name", width: 190, allowBlank: false }), new Ext.form.TextField({ fieldLabel: "Firma", name: "company", width: 190 }), new Ext.form.TextArea({ fieldLabel: "Anschrift", name: "addr", width: 190 }), new Ext.form.TextField({ fieldLabel: "Telefon", name: "tel", width: 190 }), new Ext.form.ComboBox({ store: branchenStore, displayField:'taetigkeit', typeAhead: true, mode: 'local', triggerAction: 'all', emptyText:'Bitte wählen...', selectOnFocus:true, resizable:true, fieldLabel: "Branche", name: "taetigkeit", width: 190, allowBlank: false }) ); registerForm.fieldset( {legend: 'Accountdaten'}, new Ext.form.TextField({ fieldLabel: "E-Mail", name: "email", width: 190, allowBlank: false }), new Ext.form.TextField({ fieldLabel: "Passwort", name: "upw", width: 190, allowBlank: false, inputType: "password" }), new Ext.form.TextField({ fieldLabel: "Passwort (Wdh.)", name: "upw2", width: 190, allowBlank: false, inputType: "password" }) ); // add the buttons registerForm.addButton({ text: 'Login Seite', handler: function() { mM4App.getUserRegDialog().hide(); } }); registerForm.addButton({ text: 'Registrieren', handler: function() { if ( !registerForm.isValid() ) { Ext.MessageBox.alert("Achtung:","Bitte füllen Sie die markierten Felder aus."); return; } var thisFields = registerForm.getValues(); if (thisFields.upw != thisFields.upw2) { Ext.MessageBox.alert("Achtung:","Die angegebenen Passwörter stimmen nicht überein!
Bitte geben Sie diese nochmal ein."); return; } registerForm.submit({ waitMsg: "Benutzer wird angelegt..." }); } }); dialog.getLayout().add('center', dlgPanel); dialog.getLayout().endUpdate(); registerForm.render( dlgPanel.getEl() ); this.registerForm = registerForm; this.dlgPanel = dlgPanel; this.dialog = dialog; dialog.resizeTo("375", "465"); Ext.EventManager.onWindowResize(function() { this.dialog.center(); }, this); }; mM4UserRegDialog.prototype = { show : function( el ) { this.dialog.show(el); this.dialog.center(); }, hide : function() { this.dialog.hide(); } }; var mM4LoginDialog = function(config) { config = config || {}; if(typeof config == "string"){ config = {title: config}; } var loginSuccess = function(o) { //Ext.MessageBox.show({title:'Login Success',minWidth:200,msg:"Rüschtüsch"}); //document.location = "/perl/index.pl?sid=99b44161a6cf3910e92537a444c4f991"; mM4App.getLoginWindow().hide(); mM4App.showAnalysenSelection({closable: true}); }; // fail function for login var loginFailure = function(o) { Ext.MessageBox.alert("Achtung:","Falsche Login Daten!
Bitte wiederholen Sie den Vorgang."); }; var mailpwSuccess = function(o) { Ext.MessageBox.alert('Achtung:',"Ihr Passwort wurde an Ihre E-Mailadresse versandt."); }; // fail function for login var mailpwFailure = function(o) { Ext.MessageBox.alert("Achtung:","Es gibt kein Konto mit der angegebenen E-Mailadresse. Bitte prüfen Sie Ihre Angaben.
Sollten Sie noch kein Konto erstellt haben, registrieren Sie sich bitte zunächst."); }; var dialog = new Ext.LayoutDialog( config.id || Ext.id(), { autoCreate: config.autoCreate || true, closable: config.closable || false, modal: true, resizable: false, minWidth: config.minWidth || 310, minHeight: config.minHeight || 125, syncHeightBeforeShadow: true, shadow: true, fixedcenter: true, draggable: false, shim: true, center: { autoScroll: false, titlebar: false } }); dialog.setTitle( config.title || "Login:"); dialog.getLayout().beginUpdate(); var centerViewEl = dialog.body.createChild({tag:'div', id:Ext.id(), style:'color:#FFF; background-color:#666; position:absolute; padding: 10px;'}); var dlgPanel = new Ext.ContentPanel(centerViewEl, { fitToFrame: true, autoScroll: false }); Ext.form.Field.prototype.msgTarget = 'side'; // some basic setup stuff var submitUrl = "/perl/index.pl"; var formBaseParams = { rm: 'doLogin', sid: "99b44161a6cf3910e92537a444c4f991" }; // create the form var loginForm = new Ext.form.Form({ labelAlign: 'right', buttonAlign: 'right', labelWidth: 98, url: submitUrl, baseParams: formBaseParams }); var unamefield = new Ext.form.TextField({ fieldLabel: "E-Mail Adresse", name: "uid", width: 170, allowBlank: false }); unamefield.addListener('specialkey', function( field, e ) { if ( e.getKey() == 13 ) { if ( this.loginForm.isValid() == false ) { Ext.MessageBox.alert("Achtung:","Bitte füllen Sie die markierten Felder aus."); return; } loginForm.un('actioncomplete', mailpwSuccess); loginForm.un('actionfailed', mailpwFailure); loginForm.on('actioncomplete', loginSuccess, this); loginForm.on('actionfailed', loginFailure); loginForm.submit({ waitMsg: "Daten werden verifiziert..." }); } }); var upwfield = new Ext.form.TextField({ fieldLabel: "Passwort", name: "upw", width: 170, allowBlank: false, inputType: "password" }); upwfield.addListener('specialkey', function( field, e ) { if ( e.getKey() == 13 ) { if ( loginForm.isValid() == false ) { Ext.MessageBox.alert("Achtung:","Bitte füllen Sie die markierten Felder aus."); return; } loginForm.un('actioncomplete', mailpwSuccess); loginForm.un('actionfailed', mailpwFailure); loginForm.on('actioncomplete', loginSuccess, this); loginForm.on('actionfailed', loginFailure); loginForm.submit({ waitMsg: "Daten werden verifiziert..." }); } }); loginForm.add(unamefield); loginForm.add(upwfield); // add the buttons loginForm.addButton({ text: 'Registrieren', handler: function() { //document.location = "/perl/index.pl?sid=99b44161a6cf3910e92537a444c4f991&rm=showRegister"; mM4App.showUserRegDialog(); } }); loginForm.addButton({ text: 'Passwort vergessen', handler: function() { var thisFields = loginForm.getValues(); if (thisFields.uid == "") { Ext.MessageBox.alert("Achtung:","Bitte geben Sie Ihre E-Mailadresse ein."); } loginForm.findField('upw').setValue(" "); loginForm.un('actioncomplete', loginSuccess); loginForm.un('actionfailed', loginFailure); loginForm.on('actioncomplete', mailpwSuccess); loginForm.on('actionfailed', mailpwFailure); loginForm.submit({ params: { rm: 'mailPW', sid: "99b44161a6cf3910e92537a444c4f991" }, waitMsg: "Daten werden verifiziert..." }); } }); loginForm.addButton({ text: 'Login', handler: function() { if ( loginForm.isValid() == false ) { Ext.MessageBox.alert("Achtung:","Bitte füllen Sie die markierten Felder aus."); return; } loginForm.un('actioncomplete', mailpwSuccess); loginForm.un('actionfailed', mailpwFailure); loginForm.on('actioncomplete', loginSuccess, this); loginForm.on('actionfailed', loginFailure); loginForm.submit({ waitMsg: "Daten werden verifiziert..." }); } }); dialog.getLayout().add('center', dlgPanel); dialog.getLayout().endUpdate(); loginForm.render( dlgPanel.getEl() ); this.loginForm = loginForm; this.dlgPanel = dlgPanel; this.dialog = dialog; dialog.resizeTo("310", "125"); Ext.EventManager.onWindowResize(function() { this.dialog.center(); }, this); }; mM4LoginDialog.prototype = { show : function( el ) { this.dialog.show(el); this.dialog.center(); }, hide : function() { this.dialog.hide(); } }; var mM4StdDialog = function(config) { config = config || {}; if(typeof config == "string"){ config = {title: config}; } var dialog = new Ext.LayoutDialog( config.id || Ext.id(), { autoCreate: config.autoCreate || true, modal: config.modal || true, resizable: config.resizable || false, minWidth: config.minWidth || 600, minHeight: config.minHeight || 400, syncHeightBeforeShadow: true, shadow: true, fixedcenter: true, draggable: false, shim: true, center: { autoScroll: true, titlebar: false } }); dialog.setTitle( config.title || "Sessions"); dialog.getEl().addClass('ychooser-dlg'); // dialog content url this.url = config.url; // dialog content params this.params = config.params; this.backButton = dialog.addButton("<< Zurück", this.goBack, this); this.backButton.disable(); this.closeButton = dialog.addButton("Schließen", dialog.hide, dialog); this.closeButton.disable(); // show close button if ( config.closeButton ) { dialog.addKeyListener(27, dialog.hide, dialog); this.closeButton.enable(); } // dialog events dialog.on('show', this.load, this); dialog.on('hide', this.doCallback, this); // layout sektion dialog.getLayout().beginUpdate(); // list output area var centerViewEl = dialog.body.createChild({tag:'div', id:Ext.id(), style:'position:absolute;'}); var dlgPanel = new Ext.ContentPanel(centerViewEl, { fitToFrame: true, autoScroll: false }); dialog.getLayout().add('center', dlgPanel); dialog.getLayout().endUpdate(); this.dlgPanel = dlgPanel; this.dialog = dialog; Ext.apply(this, config, { width: 320, height: 450 }); dialog.resizeTo(this.width, this.height); }; mM4StdDialog.prototype = { show : function( el, callback ) { this.dialog.show(el); this.callback = callback; }, hide : function() { this.dialog.hide(); }, showCloseButton : function() { if ( this.closeButton.disabled == true ) { this.closeButton.enable(); } }, hideCloseButton : function() { if ( this.closeButton.disabled == false ) { this.closeButton.disable(); } }, showBackButton : function() { this.backButton.enable(); }, hideBackButton : function() { this.backButton.disable(); }, goBack : function() { this.dlgPanel.load( { url: this.url, params: this.backParams, scripts: true }); }, setBackParams : function(inParams) { if ( inParams != "" ) { this.backParams = inParams; } }, setUrl : function(inUrl) { if ( inUrl != "" ) { this.url = inUrl; } }, setParams : function(inParams) { if ( inParams != "" ) { this.params = inParams; } }, load : function() { this.dlgPanel.load( { url: this.url, params: this.params, scripts: true }); }, loadUrl : function( params ) { this.dlgPanel.load( { url: this.url, params: params, scripts: true }); }, doCallback : function() { if ( this.callback ) { var callback = this.callback; callback(); } } }; var mM4SessionListDialog = function( config ) { config = config || {}; if(typeof config == "string"){ config = {title: config}; } var dialog = new Ext.LayoutDialog( config.id || Ext.id(), { autoCreate: config.autoCreate || true, modal: config.modal || true, resizable: config.resizable || false, minWidth: config.minWidth || 600, minHeight: config.minHeight || 400, syncHeightBeforeShadow: true, shadow: true, fixedcenter: true, draggable: false, shim: true, center: { autoScroll: true, titlebar: false } }); this.mode = config.mode || 'lasthour'; dialog.setTitle( config.title || "Sessions"); dialog.getEl().addClass('ychooser-dlg'); dialog.addKeyListener(27, dialog.hide, dialog); // close button this.lasthour = dialog.addButton(" Letzte Stunde ", function() { this.loadGrid("lasthour"); }, this); this.today = dialog.addButton("Heute", function() { this.loadGrid( "today" ); }, this); this.yesterday = dialog.addButton("Gestern", function() { this.loadGrid("yesterday"); }, this); this.thismonth = dialog.addButton(" Diesen Monat ", function() { this.loadGrid("thismonth"); }, this); this.lastmonth = dialog.addButton(" Letzten Monat ", function() { this.loadGrid("lastmonth"); }, this); this.refresh = dialog.addButton(" Aktualisieren ", function() { this.loadGrid(); }, this); this.csv = dialog.addButton("CSV Export", function() { this.csvExport(); }, this); this.cancel = dialog.addButton("Schließen", dialog.hide, dialog); // dialog events dialog.on('show', this.load, this); dialog.on('hide', this.doCallback, this); this.dialog = dialog; // layout sektion var layout = dialog.getLayout(); layout.beginUpdate(); // list output area var centerViewEl = this.dialog.body.createChild({tag:'div', id:'centerPanelSessions'}); var gridViewEl = centerViewEl.createChild({tag:'div', id:'sessionListGrid', style:'width: 1005px; height: 536px; overflow: auto;'}); var RecordDef = Ext.data.Record.create([ {name: 'id', mapping: 'id'}, {name: 'sessionid', mapping: 'sessionid'}, {name: 'analyse', mapping: 'titel'}, {name: 'userid', mapping: 'userid'}, {name: 'nameuser', mapping: 'nameuser'}, {name: 'userlevel', mapping: 'userlevel'}, {name: 'account', mapping: 'account'}, {name: 'provider', mapping: 'provider'}, {name: 'clientip', mapping: 'clientip'}, {name: 'firstuse', mapping: 'firstuse'}, {name: 'lastuse', mapping: 'lastuse'} ]); var gridDS = new Ext.data.Store({ proxy: new Ext.data.HttpProxy({url: '/perl/index.pl', params: { sid: SID, rm: 'showSessions', mode: this.mode, r: Math.random() }}), reader: new Ext.data.JsonReader({id: "id"}, RecordDef) }); var gridCM = new Ext.grid.ColumnModel([ { header: "ID", width: 45, dataIndex: 'id', align: 'right', sortable: true, resizable: false }, { header: "Analyse", width: 190, dataIndex: 'analyse', sortable: true, resizable: true }, { header: "uID", width: 55, dataIndex: 'userid', sortable: true, resizable: true }, { header: "NameUser", width: 180, dataIndex: 'nameuser', sortable: true, resizable: true }, { header: "UL", width: 40, dataIndex: 'userlevel', sortable: true, resizable: true }, { header: "Account", width: 60, dataIndex: 'account', sortable: true, resizable: true }, { header: "Provider", width: 60, dataIndex: 'provider', sortable: true, resizable: true }, { header: "ClientIP", width: 100, dataIndex: 'clientip', sortable: true, resizable: true }, { header: "FirstUse", width: 125, dataIndex: 'firstuse', sortable: true, resizable: true }, { header: "LastUse", width: 125, dataIndex: 'lastuse', sortable: true, resizable: true } ]); var formEl = Ext.get('updatesessionlist'); var gridForm = new Ext.BasicForm( formEl, { method: 'POST', url: '/perl/index.pl', baseParams: { sid: SID } } ); var grid = new Ext.grid.Grid(gridViewEl, { ds: gridDS, cm: gridCM, trackMouseOver: true, selModel: new Ext.grid.RowSelectionModel({singleSelect: true}) }); grid.render(); var gridHeaderPanel = grid.getView().getHeaderPanel(true); // var gridTB = new Ext.Toolbar( gridHeaderPanel ); this.grid = grid; this.gridDS = gridDS; this.gridCM = gridCM; // this.gridTB = gridTB; // this.gridTB.add(btnLastHour); // this.gridTB.add(btnToday); // this.gridTB.add(btnYesterday); Ext.apply(this, config, { width: 1010, height: 600 }); dialog.resizeTo(this.width, this.height); }; mM4SessionListDialog.prototype = { show : function( el, callback ) { this.dialog.show(el); this.callback = callback; }, hide : function() { this.dialog.hide(); }, setUrl : function( url ) { this.url = url; }, load : function() { this.loadGrid(); }, csvExport : function() { var url = "/perl/index.pl?sid=" + SID + "&rm=csvSessions&mode="+this.mode+"&r=" + Math.random(); window.open(url,"CSVExport","resizeable,width=800,height=600"); }, loadGrid : function( mode ) { if ( mode && mode != "" ) { this.mode = mode; } this.gridDS.reload({ url: "/perl/index.pl", params: { sid: SID, rm: 'showSessions', mode: this.mode, r: Math.random() }, scripts: true }); }, doCallback : function() { if ( this.callback ) { var callback = this.callback; callback(); } } }; var mM4GridTarifSettingsDialog = function ( config ) { config = config || {}; if(typeof config == "string"){ config = {title: config}; } var dialog = new Ext.LayoutDialog( config.id || Ext.id(), { autoCreate: config.autoCreate || true, modal: config.modal || true, resizable: config.resizable || false, minWidth: config.minWidth || 320, minHeight: config.minHeight || 370, syncHeightBeforeShadow: true, shadow: true, fixedcenter: true, draggable: false, north: { titlebar: false, split: false, autoScroll: true, autoTabs: false, initialSize: 45 }, center: { autoScroll: true, titlebar: false }, south: { titlebar: false, split: false, autoScroll: true, autoTabs: false, initialSize: 35 } }); this.listID = config.listID; this.flatIndex = config.flatIndex; this.einschaltung = config.einschaltung || false; dialog.setTitle( config.title || "Tarifeinstellungen"); dialog.getEl().addClass('ychooser-dlg'); dialog.addKeyListener(27, dialog.hide, dialog); // close button this.cancel = dialog.addButton("Abbrechen", dialog.hide, dialog); this.ok = dialog.addButton("Übernehmen", this.setTarif, this); // dialog events dialog.on('show', this.load, this); dialog.on('hide', this.doCallback, this); // layout sektion dialog.getLayout().beginUpdate(); // list output area var northViewEl = dialog.body.createChild({tag:'div', id:'tarifGridDlgnPanel', style:'position:absolute; background-color: #EFEFEF; padding: 3px; border-bottom: 1px solid #666;'}); var centerViewEl = dialog.body.createChild({tag:'div', id:'tarifGridDlgPanel', style:'position:absolute;'}); var southViewEl = dialog.body.createChild({tag:'div', id:'tarifGridDlgsPanel', style:'position:absolute; background-color: #EFEFEF; padding: 3px; font-size: -1; border-top: 1px solid #666;'}); var tarifHeaderPanel = new Ext.ContentPanel( northViewEl, { fitToFrame: true, autoScroll: true }); this.tarifHeaderPanel = tarifHeaderPanel; var tarifPanel = new Ext.ContentPanel(centerViewEl, { fitToFrame: true, autoScroll: false }); var tarifFooterPanel = new Ext.ContentPanel( southViewEl, { fitToFrame: true, autoScroll: true }); this.tarifFooterPanel = tarifFooterPanel; dialog.getLayout().add('north', tarifHeaderPanel); dialog.getLayout().add('center', tarifPanel); dialog.getLayout().add('south', tarifFooterPanel); dialog.getLayout().endUpdate(); Ext.apply(this, config, { width: 320, height: 365 }); dialog.resizeTo(this.width, this.height); this.tarifPanel = tarifPanel; this.dialog = dialog; }; mM4GridTarifSettingsDialog.prototype = { show : function( config ) { this.config = config; this.dialog.show(config.el); if ( config.width && config.height ) { this.dialog.resizeTo( config.width, config.height ); } if ( config.flatIndex ) { this.setFlatIndex( config.flatIndex ); } if ( config.listID ) { this.setListID( config.listID ); } if ( config.einschaltung ) { this.setEinschaltung( config.einschaltung ); } else { this.setEinschaltung( false ); } if ( config.callback ) { this.callback = config.callback; } else { this.callback = false; } }, setEinschaltung : function( einschaltung ) { this.einschaltung = einschaltung; }, setTarif : function() { if ( !this.einschaltung ) { Ext.get('scriptContainer').getUpdateManager().update({ url: "/perl/index.pl", params: { sid: SID, rm: "setItemTarif", werbeformID: thisTarifGrid.wID, werbeformName: thisTarifGrid.wName, listID: this.listID, flatIndex: this.flatIndex, fixPreis: thisTarifGrid.wFixPreis }, scripts: true }); } else { Ext.get('scriptContainer').getUpdateManager().update({ url: "/perl/index.pl", params: { sid: SID, rm: "setEinschaltungTarif", werbeformID: thisTarifGrid.wID, werbeformName: thisTarifGrid.wName, listID: this.listID, flatIndex: this.flatIndex, einschaltung: this.einschaltung, fixPreis: thisTarifGrid.wFixPreis }, scripts: true }); } this.doCallback(); this.dialog.hide(); }, setFlatIndex : function( flatIndex ) { this.flatIndex = flatIndex; }, setListID : function( listID ) { this.listID = listID; }, setUrl : function( url ) { this.url = url; }, load : function() { this.tarifPanel.load( { url: '/perl/index.pl', params: { sid: SID, rm: 'showGridTarifSettings', listID: this.listID, flatIndex: this.flatIndex, r: Math.random() }, scripts: true, callback: this.setText }); }, setText : function() { mM4GridTarifSettingsDlg.tarifHeaderPanel.setContent(thisTarifGrid.dialogTopText); mM4GridTarifSettingsDlg.tarifFooterPanel.setContent(thisTarifGrid.dialogBottomText); }, doCallback : function() { var callback = this.callback; if ( callback ) { callback(); } }, hide : function() { this.dialog.hide(); } }; var mM4TarifSettingsDialog = function( config ) { config = config || {}; if(typeof config == "string"){ config = {title: config}; } var dialog = new Ext.LayoutDialog( config.id || Ext.id(), { autoCreate: config.autoCreate || true, modal: config.modal || true, resizable: config.resizable || false, minWidth: config.minWidth || 320, minHeight: config.minHeight || 370, syncHeightBeforeShadow: true, shadow: true, fixedcenter: true, draggable: false, center: { autoScroll: true, titlebar: false } }); dialog.setTitle( config.title || "Tarifeinstellungen"); dialog.getEl().addClass('ychooser-dlg'); dialog.addKeyListener(27, dialog.hide, dialog); // close button this.cancel = dialog.addButton("Abbrechen", dialog.hide, dialog); this.ok = dialog.addButton("Übernehmen", this.setTarife, this); // dialog events dialog.on('show', this.load, this); dialog.on('hide', this.doCallback, this); // layout sektion dialog.getLayout().beginUpdate(); // list output area var centerViewEl = dialog.body.createChild({tag:'div', id:'kcenterPanel', style:'position:absolute;'}); var tarifPanel = new Ext.ContentPanel(centerViewEl, { fitToFrame: true, autoScroll: false }); dialog.getLayout().add('center', tarifPanel); dialog.getLayout().endUpdate(); this.tarifPanel = tarifPanel; this.dialog = dialog; Ext.apply(this, config, { width: 320, height: 400 }); dialog.resizeTo(this.width, this.height); }; mM4TarifSettingsDialog.prototype = { show : function( el, callback ) { this.dialog.show(el); this.callback = callback; }, hide : function() { this.dialog.hide(); }, setUrl : function( url ) { this.url = url; }, load : function() { this.tarifPanel.load( { url: '/perl/index.pl', params: { sid: SID, rm: 'showTarifSettings', r: Math.random() }, scripts: true } ); }, setTarife : function() { var items = document.tarife.elements; var url = "/perl/index.pl?sid=" + SID + "&rm=setTarife"; for ( var i = 0; i < items.length; i++ ) { if ( items[i].type == "radio" ) { if ( items[i].checked ) { url += "&" + items[i].name + "=" + items[i].value; } } else if ( items[i].type == "checkbox" ) { if (items[i].checked) { url += "&" + items[i].name + "=" + items[i].value; } } else { url += "&" + items[i].name + "=" + items[i].value; } } mM4App.loadIframe( url, false, false ); this.hide(); }, doCallback : function() { var callback = this.callback; if ( callback ) { callback(); } } }; var mM4TimeFrameSelection = function( config ) { config = config || {}; if(typeof config == "string"){ config = {title: config}; } var dialog = new Ext.LayoutDialog( config.id || Ext.id(), { autoCreate: config.autoCreate || true, modal: config.modal, resizable: config.resizable || false, minWidth: config.minWidth || 600, minHeight: config.minHeight || 400, resizable: config.resizable || false, closable: config.closable || false, syncHeightBeforeShadow: true, shadow: true, fixedcenter: true, center: { autoScroll: true, titlebar: false } }); dialog.setTitle( "Planungszeitraum wählen:" ); dialog.getEl().addClass('ychooser-dlg'); dialog.addKeyListener(27, dialog.hide, dialog); // dialog events //dialog.on('show', this.load, this); // dialog panels //var ho = dialog.body.createChild({tag:'div', id:'helpOutput'}); dialog.getLayout().add('center', new Ext.ContentPanel('dateSelector', {fitToFrame: true})); Ext.apply(this, config, { width: 325, height: 120 }); dialog.resizeTo(this.width, this.height); this.dialog = dialog; this.startDateMenu = new Ext.menu.DateMenu(); this.startDateMenu.on('select', this.setStartMenuText, this); this.endDateMenu = new Ext.menu.DateMenu(); this.endDateMenu.on('select', this.setEndMenuText, this); this.startMenuButton = new Ext.MenuButton('startDateContainer',{ text : 'Startdatum', menu : this.startDateMenu }); this.endMenuButton = new Ext.MenuButton('endDateContainer',{ text : 'Enddatum', menu : this.endDateMenu }); // dialog buttons this.close = dialog.addButton("Abbrechen", this.hide, this); this.btnSetDate = dialog.addButton("Übernehmen", this.setDate, this); this.btnPrev = dialog.addButton("Zurück", this.guidePrevStep, this); this.btnPrev.hide(); this.btnNext = dialog.addButton("Weiter", this.guideNextStep, this); this.btnNext.hide(); this.startDate = ""; this.endDate = ""; if ( false ) { this.startDate = "START_DATUM"; this.endDate = "END_DATUM"; this.startMenuButton.setText( "START_DATUM_BUTTON" ); this.endMenuButton.setText( "END_DATUM_BUTTON" ); } }; mM4TimeFrameSelection.prototype = { show : function(el, guide, callback){ this.reset(); this.guide = guide || false; if ( this.guide ) { this.btnPrev.show(); this.btnNext.show(); this.close.hide(); this.btnSetDate.hide(); } else { this.btnPrev.hide(); this.btnNext.hide(); this.close.show(); this.btnSetDate.show(); } this.callback = callback; this.dialog.show(el); }, guideNextStep : function() { if ( this.startDate != "" && this.endDate != "" ) { if (this.endDate 0 ) { var selectedRow = grid.getSelectionModel().getSelected(); var params = { sid: SID, fileID: selectedRow.data.id, rm: 'delProject', r: Math.random() }; gridDS.remove(selectedRow); gridForm.submit({ waitMsg: "Einen Moment bitte ...", params: params, success: function(form, action) { gridDS.load({ url: "/perl/index.pl", params: { sid: SID, rm: 'showProjects' }, scripts: true }); }, failure: function(form, action) { alert( "Die Aktion konnte nicht ausgeführt werden ..." ); gridDS.load({ url: "/perl/index.pl", params: { sid: SID, rm: 'showProjects' }, scripts: true }); } }); } else { mM4App.msg("Achtung:","Bitte wählen Sie ein Projekt zum löschen."); } }; var gridHeaderPanel = grid.getView().getHeaderPanel(true); var gridTB = new Ext.Toolbar( gridHeaderPanel, [ { text: "Löschen", handler: function() { delProject(); } } ]); this.grid = grid; this.gridDS = gridDS; this.gridCM = gridCM; Ext.apply(this, config, { width: 600, height: 400 }); layout.endUpdate(); dialog.resizeTo(this.width, this.height); }; mM4ProjectListDialog.prototype = { show : function( el, callback ) { this.dialog.show(el); this.callback = callback; }, hide : function() { this.dialog.hide(); }, setUrl : function( url ) { this.url = url; }, load : function() { this.loadGrid(); }, loadFile : function() { var selRow = this.grid.getSelectionModel().getSelected(); var file = selRow.data.id; document.location = "/perl/index.pl?sid=" + SID + "&rm=loadProject&fileID=" + file; this.hide(); }, loadGrid : function() { this.gridDS.load({ url: "/perl/index.pl", params: { sid: SID, rm: 'showProjects', r: Math.random() }, scripts: true }); }, doCallback : function() { if ( this.callback ) { var callback = this.callback; callback(); } } }; var mM4HelpBrowser = function(config) { config = config || {}; if(typeof config == "string"){ config = {title: config}; } var dialog = new Ext.LayoutDialog( config.id || Ext.id(), { autoCreate: config.autoCreate || true, modal: config.modal || false, resizable: config.resizable || false, minWidth: config.minWidth || 550, minHeight: config.minHeight || 350, syncHeightBeforeShadow: true, shadow: true, fixedcenter: true, draggable: false, center: { autoScroll: true, titlebar: false } }); dialog.setTitle( config.title || "Hilfe"); dialog.getEl().addClass('ychooser-dlg'); dialog.addKeyListener(27, dialog.hide, dialog); // dialog buttons this.close = dialog.addButton("Schließen", this.hide, this); // dialog events dialog.on('show', this.load, this); // dialog panels var ho = dialog.body.createChild({tag:'div', id:'helpOutput'}); dialog.getLayout().add('center', new Ext.ContentPanel('helpOutput', {fitToFrame: true})); Ext.apply(this, config, { width: 550, height: 350 }); dialog.resizeTo(this.width, this.height); this.dialog = dialog; }; mM4HelpBrowser.prototype = { show : function( el, callback ) { this.dialog.show(el); }, hide : function() { this.dialog.hide(); }, reset : function() { this.url = "/help/de/index.html"; }, setUrl : function( url ) { this.url = url; }, load : function() { this.dialog.getLayout().getRegion('center').getActivePanel().load( this.url ); } }; var mM4maLoginDialog = function(config) { config = config || {}; if(typeof config == "string"){ config = {title: config}; } var dialog = new Ext.LayoutDialog( config.id || Ext.id(), { autoCreate: config.autoCreate || true, modal: config.modal, resizable: config.resizable || false, minWidth: config.minWidth || 600, minHeight: config.minHeight || 400, resizable: config.resizable || false, closable: config.closable || false, syncHeightBeforeShadow: true, shadow: true, fixedcenter: true, draggable: false, center: { autoScroll: true, titlebar: false } }); dialog.setTitle( config.title ); dialog.getEl().addClass('ychooser-dlg'); dialog.addKeyListener(13, this.doLogin, this); this.declineBtn = dialog.addButton("Abbrechen", this.doDecline, this); this.acceptBtn = dialog.addButton("Login", this.doLogin, this); // dialog events //dialog.on('show', this.load, this); dialog.on('hide', this.doCallback, this); // dialog panels var tmpID = Ext.id(); var ho = dialog.body.createChild({tag:'div', id:tmpID, autoScroll: false, style: "overflow: hidden;"}); dialog.getLayout().add('center', new Ext.ContentPanel(tmpID, {fitToFrame: true, autoScroll: false})); Ext.apply(this, config, { width: 400, height: 300 }); dialog.resizeTo(this.width, this.height); this.url = config.url; this.params = config.params; this.dialog = dialog; }; mM4maLoginDialog.prototype = { show : function( el, callback ) { this.dialog.show(el); this.load(); if ( callback ) { this.callback = callback; } }, doLogin: function() { Ext.get('scriptContainer').getUpdateManager().update({ url: "/perl/index.pl", params: { sid: SID, rm: 'doMALogin', maid: document.maLoginForm.maid.value, r: Math.random() }, scripts: true }); }, doDecline: function() { this.hide(); mM4App.showAnalysenSelection(); }, hide : function() { this.dialog.hide(); }, reset : function() { //this.url = '/help/de/index.html'; }, setUrl : function( url ) { this.url = url; }, setParams : function( params ) { params = params || {}; if(typeof config == "string"){ params = {rm: params}; } this.params = params; }, load : function() { this.dialog.getLayout().getRegion('center').getActivePanel().setUrl( {url: this.url, params: this.params, scripts: true} ); this.dialog.getLayout().getRegion('center').getActivePanel().refresh( {url: this.url, params: this.params, scripts: true} ); }, loadUrl : function( params ) { this.dialog.getLayout().getRegion('center').getActivePanel().load( { url: this.url, params: params, scripts: true }); }, doCallback : function(){ var callback = this.callback; if ( callback ) { callback(); } } }; var mM4AppNutzungDialog = function(config) { config = config || {}; if(typeof config == "string"){ config = {title: config}; } var dialog = new Ext.LayoutDialog( config.id || Ext.id(), { autoCreate: config.autoCreate || true, modal: config.modal, resizable: config.resizable || false, minWidth: config.minWidth || 600, minHeight: config.minHeight || 400, resizable: config.resizable || false, closable: config.closable || false, syncHeightBeforeShadow: true, shadow: true, fixedcenter: true, draggable: false, center: { autoScroll: true, titlebar: false } }); dialog.setTitle( config.title ); dialog.getEl().addClass('ychooser-dlg'); this.declineBtn = dialog.addButton("Ablehnen", this.doDecline, this); this.acceptBtn = dialog.addButton("Akzeptieren", this.doAccept, this); // dialog events //dialog.on('show', this.load, this); dialog.on('hide', this.doCallback, this); // dialog panels var tmpID = Ext.id(); var ho = dialog.body.createChild({tag:'div', id:tmpID, autoScroll: false, style: "overflow: hidden;"}); dialog.getLayout().add('center', new Ext.ContentPanel(tmpID, {fitToFrame: true, autoScroll: false})); Ext.apply(this, config, { width: 400, height: 300 }); dialog.resizeTo(this.width, this.height); this.url = config.url; this.params = config.params; this.dialog = dialog; }; mM4AppNutzungDialog.prototype = { show : function( el, callback ) { this.dialog.show(el); this.load(); if ( callback ) { this.callback = callback; } }, doAccept: function() { this.hide(); Ext.get('scriptContainer').getUpdateManager().update({ url: "/perl/index.pl", params: { sid: SID, rm: 'acceptUsage', r: Math.random() }, scripts: true }); }, doDecline: function() { this.hide(); mM4App.showAnalysenSelection(); }, hide : function() { this.dialog.hide(); }, reset : function() { //this.url = '/help/de/index.html'; }, setUrl : function( url ) { this.url = url; }, setParams : function( params ) { params = params || {}; if(typeof config == "string"){ params = {rm: params}; } this.params = params; }, load : function() { this.dialog.getLayout().getRegion('center').getActivePanel().setUrl( {url: this.url, params: this.params, scripts: true} ); this.dialog.getLayout().getRegion('center').getActivePanel().refresh( {url: this.url, params: this.params, scripts: true} ); }, loadUrl : function( params ) { this.dialog.getLayout().getRegion('center').getActivePanel().load( { url: this.url, params: params, scripts: true }); }, doCallback : function(){ var callback = this.callback; if ( callback ) { callback(); } } }; var mM4AppSelectionDialog = function(config) { config = config || {}; if(typeof config == "string"){ config = {title: config, autoScroll: true}; } var dialog = new Ext.LayoutDialog( config.id || Ext.id(), { autoCreate: config.autoCreate || true, modal: config.modal, resizable: config.resizable || false, minWidth: config.minWidth || 600, minHeight: config.minHeight || 400, resizable: config.resizable || false, closable: config.closable || false, syncHeightBeforeShadow: true, shadow: true, fixedcenter: true, draggable: false, center: { autoScroll: true, titlebar: false } }); dialog.setTitle( config.title ); dialog.getEl().addClass('ychooser-dlg'); dialog.addKeyListener(27, dialog.hide, dialog); if ( config.autoScroll != false && config.autoScroll != true ) { config.autoScroll = true; } // dialog buttons this.close = false; this.close = dialog.addButton("Schließen", this.hide, this); this.close.disable(); if ( config.closable ) { this.close.enable(); } // dialog events //dialog.on('show', this.load, this); dialog.on('hide', this.doCallback, this); // dialog panels var tmpID = Ext.id(); var ho = dialog.body.createChild({tag:'div', id:tmpID, autoScroll: false, style: "overflow: hidden;"}); dialog.getLayout().add('center', new Ext.ContentPanel(tmpID, {fitToFrame: true, autoScroll: config.autoScroll})); Ext.apply(this, config, { width: 400, height: 300 }); dialog.resizeTo(this.width, this.height); this.url = config.url; this.params = config.params; this.dialog = dialog; } mM4AppSelectionDialog.prototype = { show : function( el, closable, callback ) { this.dialog.show(el); this.load(); if ( callback ) { this.callback = callback; } if ( closable ) { this.closable = true; this.dialog.closable = true; this.close.enable(); } else { this.closable = false; this.dialog.closable = false; this.close.disable(); } }, hide : function() { this.dialog.hide(); }, reset : function() { //this.url = '/help/de/index.html'; }, setUrl : function( url ) { this.url = url; }, setParams : function( params ) { params = params || {}; if(typeof config == "string"){ params = {rm: params}; } this.params = params; }, load : function() { this.dialog.getLayout().getRegion('center').getActivePanel().setUrl( {url: this.url, params: this.params, scripts: true} ); this.dialog.getLayout().getRegion('center').getActivePanel().refresh( {url: this.url, params: this.params, scripts: true} ); }, loadUrl : function( params ) { this.dialog.getLayout().getRegion('center').getActivePanel().load( { url: this.url, params: params, scripts: true }); }, doCallback : function(){ var callback = this.callback; if ( callback ) { callback(); } } }; var mM4AppLayerSelection = function (config){ var layer = new Ext.Layer({ autoCreate: true, shadow: true }, config.id || Ext.id()); layer.addClass('mM4-bordered-selection'); layer.setZIndex(1000); this.layer = layer; if ( config.template ) { this.thumbTemplate = new Ext.Template(config.template); } else { this.thumbTemplate = new Ext.Template('
' + '
' + '{desc}
'); } this.thumbTemplate.compile(); this.view = new Ext.JsonView( this.layer, this.thumbTemplate, { singleSelect: true, emptyText: config.emptyText || '
THERE ARE NO ANALYSEN AVAILABLE
' }); this.view.on('click', this.doCallback, this); this.view.on('loadexception', this.onLoadException, this); Ext.apply(this, config, { width: 400, height: 300 }); layer.setSize( this.width, this.height ); layer.center('content-div'); this.loaded = false; }; mM4AppLayerSelection.prototype = { show : function(el, callback){ this.reset(); this.load(); this.layer.fadeIn(el, {duration:.8,remove:false}); this.callback = callback; }, reset : function(){ this.loaded = false; this.view.getEl().dom.scrollTop = 0; this.view.select(0); }, hide : function() { this.layer.fadeOut({duration:.8,remove:false}); }, alignHCenter : function(){ this.layer.setX( this.layer.getEl().getParent().getWidth()/2 - this.layer.getWith() / 2 ); }, alignVCenter : function(){ this.layer.setY( this.layer.getEl().getParent().getHeight()/2 - this.layer.getHeight() / 2 ); }, alignCenter : function(){ this.alignHCenter(); this.alignVCenter(); }, onLoad : function() { this.loaded = true; this.view.select(0); }, load : function(){ if(!this.loaded){ this.view.load({url: this.url, params: this.params, callback: this.onLoad.createDelegate(this)}); } }, setRunmode : function( newRM ) { this.params.rm = newRM; }, onLoadException : function(v,o){ var msg = "Error loading data from Url:
" + this.url + "

With Params:"; msg = msg + "
" + this.params; this.view.getEl().update('
' + msg + '
'); }, doCallback : function(){ var selectedNode = this.view.getSelectedNodes()[0]; var callback = this.callback; if ( selectedNode && callback ) { this.layer.fadeOut({duration:.8,remove:false}); callback( selectedNode.id ); } } }; var mM4App = function() { var msgCt; var loading; var loadingMask; var contentPanel; var contentPanelUpdateManager; var quickinfoPanel; var quickinfoPanelUpdateManager; var analysenChooser; var steckbriefDlg = false; var nutzungDlg = false; var maDlg = false; var planStepChooser; var mM4Chooser; var mM4AppLoginDlg = false; var mM4AppUserRegDlg = false; var universeChooser; var auswertungsChooser; var pageLayout; var pageWestLayout; var menuTree; var menuTreeRoot; var guideTree; var guideTreeRoot; var guideOptNodesSeen = new Array; var mM4Selection; var mM4PlanEntry; var mM4KontaktEingabe; var mM4helpDialog; var mM4PlanungsSelector; var mM4PlanzielSelector; var mM4MarketSelection = false; var mM4SpaltenSelection = false; var mM4TarifSettings; var projectListDialog; var sessionListDialog; var reloadTreeEventFunction; var initTreeEventFunction; var iFrameHasListener = false; var curGuideNode; // Menu Items var pMenuNew; var pMenuSave; var pMenuSaveAs; var pMenuLoad; var pMenuQuit; var tmpCurNodeID = false; var curAuswertungID = false; // standard funktionen reloadTreeEventFunction = function() { mM4App.reloadTree(); Ext.get('content-iframe').un("load", reloadTreeEventFunction); iFrameHasListener = false; } initTreeEventFunction = function() { mM4App.initTree( "Projekt", true ); Ext.get('content-iframe').un("load", initTreeEventFunction); iFrameHasListener = false; } function createBox(t, s){ return ['
', '
', '

', t, '

', s, '
', '
', '
'].join(''); } return { init : function() { // init quicktips engine (for hover quicktips) Ext.QuickTips.init(); // aplication layout pageLayout = new Ext.BorderLayout(document.body, { west: { split:false, initialSize: 245, collapsible: true, titlebar: true, title: "Projektmanager", collapsedTitle: "Projektmanager", animate: true }, south: { split:false, initialSize: 28 }, center: { titlebar: true, split: false } }); // menu layout (with quickinfo's) pageWestLayout = new Ext.BorderLayout('pageMenu', { south: { split: false, initialSize: 170, collapsible: true, titlebar: true, title: "Quick Infos", collapsedTitle: "Quick Infos", autoScroll: true, animate: true }, center : { tabPosition: 'bottom', autoTabs: true, titlebar: false } }); this.pageWestLayout = pageWestLayout; // begin page layout (add content panels) pageLayout.beginUpdate(); pageWestLayout.beginUpdate(); var expertCP = new Ext.ContentPanel('expertNav', {title: "open", fitToFrame: true }); var beginnerCP = new Ext.ContentPanel('beginnerNav', {title: "guided", fitToFrame: true }); pageWestLayout.add('south', new Ext.ContentPanel('qi', {fitToFrame: true})); // pageWestLayout.add('center', beginnerCP); pageWestLayout.add('center', expertCP); pMenuNew = new Ext.menu.Item({ text: "Neu ...", handler: function() { mM4App.newProject(); } }); pMenuSave = new Ext.menu.Item({ text: "Speichern", handler: function() { mM4App.checkSave(); } }); if ( !LOADED ) { pMenuSave.disable(); } pMenuSaveAs = new Ext.menu.Item({ text: "Speichern unter ...", handler: function() { mM4App.showSaveAs(); } }); pMenuSaveAs.disable(); this.pMenuSaveAs = pMenuSaveAs; pMenuLoad = new Ext.menu.Item({ text: "Öffnen ...", handler: function() { mM4App.showProjectListDialog(); } }); pMenuQuit = new Ext.menu.Item({ text: "Beenden ...", handler: function() { mM4App.closeProject(); } }); var mnuProjektManager = new Ext.menu.Menu({ id: 'pmMenu' }); mnuProjektManager.addItem(pMenuNew); mnuProjektManager.addItem(new Ext.menu.Separator()); mnuProjektManager.addItem(pMenuSave); mnuProjektManager.addItem(pMenuSaveAs); mnuProjektManager.addItem(pMenuLoad); //mnuProjektManager.addItem(new Ext.menu.Separator()); var expertNavTB = new Ext.Toolbar(expertCP.el, [ { text: "Projekt", menu: mnuProjektManager } ]); if ( USERLEVEL == 9 || CLIENTIP == "217.6.73.190" ) { var sessionTBButton = new Ext.Toolbar.Button({ text: 'Sessions', tooltip: 'Zeigt alle Sessions an', handler: mM4App.showSessionListDialog }); expertNavTB.add(sessionTBButton); } pageWestLayout.getRegion('center').getPanel('expertNav').on('activate', function() { mM4App.initMenuTree("Projekt", true); mM4App.btnPrev.hide(); mM4App.btnNext.hide(); mM4App.btnAuswertung.show(); }); pageWestLayout.endUpdate(); pageLayout.add('west', new Ext.NestedLayoutPanel( pageWestLayout )); pageLayout.add('south', new Ext.ContentPanel('pageFooter', {fitToFrame:true})); pageLayout.add('center', new Ext.ContentPanel('content-div', { fitToFrame: true, autoScroll: false, resizeEl: 'content-iframe', title: "Planungs-Modi" })); //Ext.get('content-iframe').anchorTo('content-div','tl'); //pageLayout.getRegion('west').hide(); pageLayout.endUpdate(); // set iframe source Ext.get('content-iframe').dom.src = '/empty.html'; if( Ext.isSafari || Ext.isOpera ){ pageLayout.layout(); } var btnNext = new Ext.Button('pageFooter', { text: "Weiter", handler: function(btn) { mM4App.checkCurNodeStatus(); } }); btnNext.hide(); this.btnNext = btnNext; var btnPrev = new Ext.Button('pageFooter', { text: "Zurück", handler: function(btn) { mM4App.guidePrevStep(); } }); btnPrev.hide(); this.btnPrev = btnPrev; var btnAuswertung = new Ext.Button('pageFooter', { text: "Auswerten", handler: function(btn) { mM4App.setContentTitle(); mM4App.showAuswertung(); //mM4App.btnAuswertung.hide(); } }); btnAuswertung.hide(); this.btnAuswertung = btnAuswertung; var btnPlanEntry = new Ext.Button('pageFooter', { text: "Planeingabe", handler: function(btn) { mM4App.showPlanEntry(); mM4App.btnAuswertung.show(); mM4App.btnPlanEntry.hide(); } }); btnPlanEntry.hide(); this.btnPlanEntry = btnPlanEntry; var btnHelp = new Ext.Button('pageFooter', { text: "Hilfe", handler: function(btn) { mM4App.showHelp(); } }); // hide loading indicator this.hideLoading(); if ( LOADED ) { this.pMenuSaveAs.enable(); mM4App.curTree = menuTree; mM4App.initMenuTree("Projekt", true); mM4App.showNav(); var url = "/perl/index.pl?sid=" + SID + "&rm=showAuswertung&r=" + Math.random(); mM4App.showAuswertung(); } else { this.showLoginWindow(); } //Ext.get('content-iframe').fitToParent(); //Ext.get('content-iframe').setWidth( Ext.get('content-div').getWidth()-5 ); //Ext.get('content-iframe').setHeight( Ext.get('content-div').getHeight()-5 ); }, showUserRegDialog : function() { if ( !mM4AppUserRegDlg ) { mM4AppUserRegDlg = new mM4UserRegDialog({ closable: false }); } mM4AppUserRegDlg.show( Ext.get('content-div') ); }, getUserRegDialog : function() { if ( !mM4AppUserRegDlg ) { mM4AppUserRegDlg = new mM4UserRegDialog({ closable: false }); } return mM4AppUserRegDlg; }, showLoginWindow : function() { if ( !mM4AppLoginDlg ) { mM4AppLoginDlg = new mM4LoginDialog({ closable: false }); } mM4AppLoginDlg.show( Ext.get('content-div') ); }, getLoginWindow : function() { if ( !mM4AppLoginDlg ) { mM4AppLoginDlg = new mM4LoginDialog({ closable: false }); } return mM4AppLoginDlg; }, newProject : function() { Ext.MessageBox.confirm("Achtung:", "Sind Sie sicher, dass Sie ein neues Projekt beginnen möchten? Alle nicht gespeicherten Daten gehen verloren!", mM4App.checkNewProject); }, checkNewProject : function( btn ) { if ( btn == 'yes' ) { document.location = "/perl/index.pl?sid=" + SID + "&rm=newProject"; } }, closeProject : function() { Ext.MessageBox.confirm("Achtung:", "Sind Sie sicher, dass Sie das aktuelle Projekt beenden möchten? Alle nicht gespeicherten Daten gehen verloren!", mM4App.checkCloseProject); }, checkCloseProject : function( btn ) { if ( btn == 'yes' ) { top.location = "/perl/index.pl?sid=" + SID + "&rm=closeProject"; } }, setContentTitle : function(strTitel){ var thisTitel; if ( strTitel ) { if ( AUSWERTUNGNAME && AUSWERTUNGNAME != "" ) { if ( AUSWERTUNGNAME != strTitel ) { thisTitel = AUSWERTUNGNAME + " - " + strTitel; } else { thisTitel = AUSWERTUNGNAME; } } else { thisTitel = strTitel; } } else if ( AUSWERTUNGNAME && AUSWERTUNGNAME != "" ) { thisTitel = AUSWERTUNGNAME; } if ( thisTitel != "" ) { pageLayout.getRegion('center').getActivePanel().setTitle( thisTitel ); } }, showEinstiegSelection : function( config ) { config = config || {}; if(typeof config == "string"){ config = {closable: config}; } if ( !mM4Chooser ) { mM4Chooser = new mM4AppSelectionDialog({ url: '/perl/index.pl', params: { sid: SID, rm: 'einstiegSelection' }, title: "Planungs-Modi", modal: true, resizable: false, closable: true, width: 490, height: 320 }); } mM4Chooser.show( Ext.get('content-div'), config.closable || true ); }, setEinstieg : function( entryType ) { if ( entryType != "" ) { mM4Chooser.hide(); if ( entryType == 'GUIDED') { mM4App.setContentTitle(""GUIDED PLANNING""); } else { pageWestLayout.getRegion('center').showPanel('expertNav'); mM4App.curTree = menuTree; } mM4App.loadContent({ rm: 'setEinstieg', type: entryType }); } }, showUniverseSelection : function( config ) { config = config || {}; if(typeof config == "string"){ config = {closable: config}; } if ( !universeChooser ) { universeChooser = new mM4AppSelectionDialog({ url: '/perl/index.pl', params: { sid: SID, rm: 'getUniverses', uirm: config.rm || 'setUniverse', guideMode: config.guideMode, nodeID: config.nodeID, r: Math.random() }, title: "Universumsauswahl", modal: true, resizable: false, closable: false, width: 470, height: 300 }); } universeChooser.setUrl( '/perl/index.pl?r=' + Math.random() ); if ( config.guideMode ) { var tmpNode = guideTree.getNodeById( config.nodeID ); if ( tmpNode.attributes.cls == "checked" ) { config.rm = "switchUniverse"; } } universeChooser.setParams( { sid: SID, rm: 'getUniverses', uirm: config.rm || 'setUniverse', guideMode: config.guideMode, nodeID: config.nodeID, r: Math.random() } ); universeChooser.show( Ext.get('content-div'), config.closable ); }, setUniverse : function ( id, runmode, guideMode, nodeID ) { universeChooser.hide(); if ( nodeID ) { var tmpNode = guideTree.getNodeById( nodeID ); tmpNode.ui.addClass('checked'); tmpNode.ui.removeClass('unchecked'); tmpNode.attributes.cls = "checked"; if ( tmpNode.nextSibling ) { tmpNode.nextSibling.enable(); } else { tmpNode.parentNode.nextSibling.firstChild.enable(); } tmpNode.render(); } mM4App.loadContent( { rm: runmode, universeID: id, guideMode: guideMode } ); }, showAuswertungsSelection : function( config ) { config = config || {}; if(typeof config == "string"){ config = {closable: config}; } if ( !auswertungsChooser ) { auswertungsChooser = new mM4AppSelectionDialog({ url: '/perl/index.pl', params: { sid: SID, rm: 'auswertungsSelection' }, title: "Auswertungsauswahl", modal: true, resizable: false, closable: false, width: 500, height: 550 }); } auswertungsChooser.show( Ext.get('content-div'), config.closable ); }, setAuswertung : function ( aid, auswName ) { auswertungsChooser.hide(); curAuswertungID = aid; mM4App.showNav(); if ( auswName ) { AUSWERTUNGNAME = auswName; mM4App.setContentTitle(); } mM4App.showQuickInfo( aid, function() { mM4App.loadContent( { rm: 'setAuswertung', aid: aid, guideMode: false } ); }); }, showSteckbrief : function( config ) { config = config || {}; if(typeof config == "string"){ config = {closable: config}; } if ( !steckbriefDlg ) { steckbriefDlg = new mM4AppSelectionDialog({ url: '/perl/index.pl', params: { sid: SID, rm: 'showSteckbriefDialog' }, title: "Steckbrief", modal: true, resizable: false, closable: config.closable, width: 364, height: 210 }); } steckbriefDlg.show( Ext.get('content-div'), config.closable ); }, showMAEntry : function( config ) { config = config || {}; if(typeof config == "string"){ config = {closable: config}; } if ( !maDlg ) { maDlg = new mM4maLoginDialog({ url: '/perl/index.pl', params: { sid: SID, rm: 'showMALogin' }, title: "ma Login", modal: true, resizable: false, width: 400, height: 180 }); } maDlg.show( Ext.get('content-div'), config.closable ); }, hideMALogin : function() { if ( maDlg ) { maDlg.hide(); } }, showNutzung : function( config ) { config = config || {}; if(typeof config == "string"){ config = {closable: config}; } if ( !nutzungDlg ) { nutzungDlg = new mM4AppNutzungDialog({ url: '/perl/index.pl', params: { sid: SID, rm: 'showNutzungDialog' }, title: "Nutzungsbedingungen", modal: true, resizable: false, width: 400, height: 210 }); } nutzungDlg.show( Ext.get('content-div'), config.closable ); }, showAnalysenSelection : function( config ) { config = config || {}; if(typeof config == "string"){ config = {closable: config, autoScroll: false}; } if ( !analysenChooser ) { analysenChooser = new mM4AppSelectionDialog({ url: '/perl/index.pl', params: { sid: SID, rm: 'analysenGroupSelection', guideMode: config.guideMode, nodeID: config.nodeID }, title: "Studienauswahl", modal: true, resizable: false, closable: config.closable, autoScroll: false, width: 615, height: 420 }); } analysenChooser.setParams( { sid: SID, rm: 'analysenGroupSelection', guideMode: config.guideMode, nodeID: config.nodeID } ); analysenChooser.show( Ext.get('content-div'), config.closable ); }, getAnalysenSelectionDlg : function() { return analysenChooser; }, setAnalyse : function( aid, guideMode, nodeID ) { analysenChooser.hide(); this.pMenuSaveAs.enable(); if ( guideMode && nodeID ) { var tmpNode = guideTree.getNodeById( nodeID ); tmpNode.ui.addClass('checked'); tmpNode.ui.removeClass('unchecked'); tmpNode.attributes.cls = "checked"; if ( tmpNode.nextSibling ) { tmpNode.nextSibling.enable(); } else { tmpNode.parentNode.nextSibling.firstChild.enable(); } tmpNode.render(); } mM4App.loadContent( { rm: 'setAnalyse', aid: aid, guideMode: guideMode } ); }, switchWestPanel : function( panelName, refresh ) { panelName = panelName || 'beginnerNav'; pageWestLayout.getRegion('center').showPanel(panelName); if ( refresh ) { mM4App.initGuideTree( refresh ); } }, showPlanStepChooser : function ( config ) { config = config || {}; if(typeof config == "string"){ config = {closable: config}; } if ( !planStepChooser ) { planStepChooser = new mM4AppSelectionDialog({ url: '/perl/index.pl', params: { sid: SID, rm: 'planugsGruppenSelektion' }, title: "Planungsschritte wählen", modal: true, resizable: false, closable: false, width: 405, height: 350 }); } planStepChooser.show( Ext.get('content-div'), config.closable ); }, setPlanSteps : function ( grpID ) { planStepChooser.hide(); mM4App.showNav(); mM4App.curTree = guideTree; mM4App.btnPrev.show(); mM4App.btnNext.show(); mM4App.btnAuswertung.hide(); mM4App.loadContent({ rm: 'setGuideGroup', grpID: grpID }); }, displayPlanzielSelection : function( guide ) { if ( !mM4PlanzielSelector ) { mM4PlanzielSelector = new mM4PlanTargetInput({ modal: true, resizable: false, closable: false, width: 310, height: 165 }); } mM4PlanzielSelector.show( Ext.get('content-div'), guide ); }, showPlanzielSelection : function( guide ) { if ( !mM4PlanzielSelector ) { Ext.get('scriptContainer').getUpdateManager().update({ url: "/perl/index.pl", params: { sid: SID, rm: 'mM4AppPlanTargetDialog', r: Math.random() }, callback: function() { mM4App.displayPlanzielSelection(guide); }, scripts: true }); } else { mM4App.displayPlanzielSelection(guide); } }, showZeitraumSelection : function( guide ) { if ( !mM4PlanungsSelector ) { mM4PlanungsSelector = new mM4TimeFrameSelection({ modal: true, resizable: false, closable: false, width: 300, height: 150 }); } mM4PlanungsSelector.show( Ext.get('content-div'), guide ); }, showMarkenSelection : function( listID, listTitle, callback ) { var titleItems = listTitle.split(" "); mM4App.setContentTitle( titleItems[0] ); mM4App.loadIframe( '/perl/index.pl?sid=' + SID + "&rm=markenSelectionPage&listID=" + listID + "&r=" + Math.random(), false ); }, showSelection : function( listID, listTitle, callback ) { var titleItems = listTitle.split(" "); mM4App.setContentTitle( titleItems[0] ); mM4App.loadIframe( '/perl/index.pl?sid=' + SID + "&rm=selectionPage&listID=" + listID + "&r=" + Math.random(), false ); }, showGridTarifSettings : function( listID, flatIndex, einschaltung, callback ) { var config = { width: 430, height: 365, listID: listID, flatIndex: flatIndex, einschaltung: einschaltung, callback: callback, el: Ext.get('content-div') }; if ( !mM4GridTarifSettingsDlg ) { mM4GridTarifSettingsDlg = new mM4GridTarifSettingsDialog( config ); } mM4GridTarifSettingsDlg.show( config ); }, showMarketSelection : function( showclosebutton ) { if ( !mM4MarketSelection ) { mM4MarketSelection = new mM4StdDialog({ title: "Marktauswahl", url: '/perl/index.pl', params: { sid: SID, rm: 'getMaerkte' }, closeButton: showclosebutton, width: 320, height: 340 }); } if (showclosebutton) { mM4MarketSelection.showCloseButton(); } mM4MarketSelection.show( Ext.get('content-div') ); }, getMarketSelectionDlg : function() { return mM4MarketSelection; }, showSpaltenSelection : function() { if ( !mM4SpaltenSelection ) { mM4SpaltenSelection = new mM4StdDialog({ title: "Spaltenauswahl", url: '/perl/index.pl', params: { sid: SID, rm: 'showSpaltenSelection' }, closeButton: false, width: 320, height: 300 }); } mM4SpaltenSelection.show( Ext.get('content-div'), this.showAuswertung ); }, getSpaltenSelectionDlg : function() { return mM4SpaltenSelection; }, showTarifSettings : function() { if ( !mM4TarifSettings ) { mM4TarifSettings = new mM4TarifSettingsDialog({ width: 320, height: 400 }); } mM4TarifSettings.show( Ext.get('content-div') ); }, showKontaktEingabe : function() { if ( !mM4KontaktEingabe ) { mM4KontaktEingabe = new mM4KontaktEingabeDialog({ width: 320, height: 370 }); } mM4KontaktEingabe.show( Ext.get('content-div') ); }, showKontaktEingabeOld : function() { mM4App.setContentTitle( "KONTAKTEINGABE" ); mM4App.loadIframe( '/perl/index.pl?sid=' + SID + "&rm=kontaktEingabe&r=" + Math.random(), false ); }, showSaveAs : function() { Ext.MessageBox.show({ title: "Speichern unter ...", msg: "Bitte geben Sie eine Beschreibung für das Projekt ein.", width:300, buttons: Ext.MessageBox.OKCANCEL, multiline: true, fn: mM4App.doSaveAs }); }, checkSave : function() { Ext.MessageBox.confirm("Achtung:", "Sind Sie sicher, dass Sie das Projekt überschreiben möchten?", mM4App.doSave); }, doSave : function(btn) { if ( btn == 'yes' ) { Ext.get('scriptContainer').getUpdateManager().update({ url: "/perl/index.pl", params: { sid: SID, rm: 'saveProject', r: Math.random() }, scripts: true }); } }, doSaveAs : function( btn, text ) { if ( btn == "ok" ) { if ( text != "" ) { pMenuSave.enable(); Ext.get('scriptContainer').getUpdateManager().update({ url: "/perl/index.pl", params: { sid: SID, rm: 'saveProjectAs', fileDesc: text, r: Math.random() }, scripts: true }); } else { mM4App.msg("Achtung:","Bitte geben Sie eine Beschreibung ein."); mM4App.showSaveAs(); } } }, showPlanEntry : function() { mM4App.loadIframe( '/perl/index.pl?sid=' + SID + "&rm=planPage&r=" + Math.random(), false ); }, showSessionListDialog : function() { if ( !sessionListDialog ) { sessionListDialog = new mM4SessionListDialog({ width: 1010, height: 600 }); } sessionListDialog.show( Ext.get('content-div') ); }, showProjectListDialog : function() { if ( !projectListDialog ) { projectListDialog = new mM4ProjectListDialog({ width: 600, height: 400 }); } projectListDialog.show( Ext.get('content-div') ); }, showPlanEntryALT : function(){ if ( !mM4PlanEntry ) { mM4PlanEntry = new mM4PlanEntryDialog({ width: 550, height: 550 }); } mM4PlanEntry.show( Ext.get('content-div'), this.showAuswertung ); }, msg : function(title, format){ if(!msgCt){ msgCt = Ext.DomHelper.insertFirst(document.body, {id:'msg-div'}, true); } msgCt.alignTo(document, 't-t'); var s = String.format.apply(String, Array.prototype.slice.call(arguments, 1)); var m = Ext.DomHelper.append(msgCt, {html:createBox(title, s)}, true); m.slideIn('t').pause(3).ghost("t", {remove:true}); }, showNav : function(){ pageLayout.getRegion('west').show(); mM4App.btnAuswertung.show(); }, showLoading : function() { if (!loading) { loading = Ext.get('loading'); } if (!loadingMask) { loadingMask = Ext.get('loading-mask'); } loading.fadeIn({duration:.9}); loadingMask.fadeIn({duration:1, endOpacity:.6}); }, hideLoading : function() { if (!loading) { loading = Ext.get('loading'); } if (!loadingMask) { loadingMask = Ext.get('loading-mask'); } loadingMask.fadeOut({duration:.8,remove:false}); loading.fadeOut({duration:.6,remove:false}); }, setFilter : function(listID, itemID) { mM4App.loadContent( { rm: 'setCurItem', listID: listID, itemID: itemID } ); }, printAuswertung : function() { var url = "/perl/index.pl?sid=" + SID + "&rm=showAuswertung&print=1&r=" + Math.random(); window.open(url,"Print","resizable,width=1000,height=650"); }, exportAuswertung : function( rm ) { var url = "/perl/index.pl?sid=" + SID + "&rm=" + rm + "&r=" + Math.random(); window.open(url,rm,"resizable,width=800,height=600"); }, showHelp : function ( url, parent ) { if ( !mM4helpDialog ) { mM4helpDialog = new mM4HelpBrowser({ minWidth: 550, minHeight: 350 }); } mM4helpDialog.reset(); if ( url && url != "" ) { mM4helpDialog.setUrl( url ); } mM4helpDialog.show( parent || Ext.get('content-div') ); }, showAuswertung : function( aid ) { var url = '/perl/index.pl?sid=' + SID + "&rm=showAuswertung&r=" + Math.random(); if ( !aid || aid == "" ) { if ( curAuswertungID ) { aid = curAuswertungID; } } if ( aid ) { curAuswertungID = aid; url += "&aid=" + aid; } mM4App.showQuickInfo( aid, function() { mM4App.loadIframe( url, true ); }); }, loadIframe : function( url, reloadTree, initTree ) { if ( initTree == true ) { Ext.get('content-iframe').on("load", initTreeEventFunction); iFrameHasListener = true; } else { if ( reloadTree == true && iFrameHasListener == false ) { Ext.get('content-iframe').on("load", reloadTreeEventFunction); iFrameHasListener = true; } else if ( reloadTree == false && iFrameHasListener == true ) { Ext.get('content-iframe').un("load", reloadTreeEventFunction); iFrameHasListener = false; } } Ext.get('content-iframe').dom.src = url; }, loadContent : function(params, callback) { if ( !contentPanel ) { //contentPanel = Ext.get('content-iframe'); contentPanel = Ext.get('scriptContainer'); } if ( !contentPanelUpdateManager ) { contentPanelUpdateManager = contentPanel.getUpdateManager(); } params['sid'] = SID; contentPanelUpdateManager.update({ url: "/perl/index.pl", params: params, scripts: true }, callback ); }, loadQI : function( params ) { if ( !quickinfoPanel ) { quickinfoPanel = Ext.get('qi'); } if ( !quickinfoPanelUpdateManager ) { quickinfoPanellUpdateManager = contentPanel.getUpdateManager(); } params['sid'] = SID; if ( !params['rm'] ) { params['rm'] = 'qi'; } quickinfoPanelUpdateManager.update({ url: "/perl/index.pl", params: params, scripts: true }); }, initTree : function( item1, item2 ){ if ( pageWestLayout.getRegion('center').getActivePanel().getId() == "expertNav" ) { mM4App.initMenuTree( item1, item2 ); } else { mM4App.initGuideTree( item1, item2 ); } }, reloadTree : function(strAtt,strValue){ if ( pageWestLayout.getRegion('center').getActivePanel().getId() == "expertNav" ) { mM4App.reloadMenuTree(strAtt,strValue); } else { mM4App.reloadGuideTree(strAtt,strValue); } }, activeGuideNode : function ( guideNodeID ) { if ( guideNodeID ) { curGuideNode = guideNodeID; } return curGuideNode; }, checkCurNodeStatus : function( nodeID ) { nodeID = nodeID || mM4App.activeGuideNode(); Ext.get('scriptContainer').getUpdateManager().update({ url: "/perl/index.pl", params: { sid: SID, rm: 'checkNodeStatus', nodeID: nodeID }, callback : function(oElement, bSuccess, oResponse) { if ( oResponse.status == 200 ) { var addClass = "checked"; var removeClass = "unchecked"; var tmpNode = guideTree.getNodeById(mM4App.activeGuideNode()); if ( oResponse.responseText == "unchecked" ) { addClass = "unchecked"; removeClass = "checked"; } else { if ( tmpNode.nextSibling && tmpNode.nextSibling.disabled && tmpNode.nextSibling.attributes.cls == "unchecked" ) { tmpNode.nextSibling.enable(); } else { tmpNode.parentNode.nextSibling.firstChild.enable(); } } tmpNode.ui.addClass(addClass); tmpNode.ui.removeClass(removeClass); tmpNode.attributes.cls = addClass; tmpNode.render(); mM4App.guideNextStep(); } }, scripts: true }); }, guidePrevStep : function() { if ( mM4App.activeGuideNode() && mM4App.activeGuideNode() != "" ) { var tmpNode = guideTree.getNodeById(mM4App.activeGuideNode()); if ( tmpNode.previousSibling ) { if ( tmpNode.previousSibling.isLeaf() ) { mM4App.activeGuideNode( tmpNode.previousSibling.id ); eval( tmpNode.previousSibling.attributes.jsFunction ); } else { mM4App.activeGuideNode( tmpNode.previousSibling.firstChild.id ); eval( tmpNode.previousSibling.firstChild.attributes.jsFunction ); } } else if ( tmpNode.parentNode.previousSibling ) { tmpNode.parentNode.previousSibling.lastChild.enable(); mM4App.activeGuideNode( tmpNode.parentNode.previousSibling.lastChild.id ); eval( tmpNode.parentNode.previousSibling.lastChild.attributes.jsFunction ); } } }, disableBtnNext : function( node ) { var tmpRootNode = guideTree.getRootNode(); var lChild = tmpRootNode.lastChild; var llChild = lChild.lastChild; if ( llChild.id == node.id ) { mM4App.btnNext.disable(); } else if ( llChild.id == node.parentNode.id ) { mM4App.btnNext.disable(); } }, getNextNode : function( node ) { var nextNode = node.nextSibling; if ( !nextNode || nextNode == "" ) { nextNode = node.parentNode.nextSibling.firstChild; } else if ( nextNode.firstChild ) { nextNode = nextNode.firstChild; } if ( nextNode.attributes.cls == 'checked' || ( nextNode.attributes.optional == true && guideOptNodesSeen[nextNode.id] ) ) { nextNode = mM4App.getNextNode(nextNode); } return nextNode; }, guideNextStep : function() { var ns = false; if ( mM4App.activeGuideNode() && mM4App.activeGuideNode() != "" ) { var curNode = guideTree.getNodeById(mM4App.activeGuideNode()); if ( curNode.attributes.cls == 'unchecked' && curNode.disabled == false && curNode.attributes.optional != true ) { if ( curNode.attributes.emptyMsg != "" ) { mM4App.msg("Achtung:", curNode.attributes.emptyMsg); return; } } else { ns = mM4App.getNextNode( curNode ); if (ns.attributes.hideBtnNext == 1) { mM4App.disableBtnNext(ns); } mM4App.activeGuideNode( ns.id ); if ( ns.attributes.optional == true ) { guideOptNodesSeen[ns.id] = true; } eval( ns.attributes.jsFunction ); } } }, initGuideTree : function( refresh, node ) { if ( !guideTree ) { guideTree = new Ext.tree.TreePanel('beginnerNav', { animate: true, loader: new Ext.tree.TreeLoader({dataUrl: '/perl/index.pl', baseParams: { sid: SID, rm: 'getGuideTreeNodes'}}), enableDD: false, containerScroll: true, lines: false, rootVisible: false }); guideTreeRoot = new Ext.tree.AsyncTreeNode({ text: "Geführter Planungsprozess", draggable: false, id: '0' }); guideTree.on('click', function(n){ if( n.isLeaf() && n.attributes.jsFunction != "" && n.disabled != true ) { eval( n.attributes.jsFunction ); } }); guideTree.setRootNode(guideTreeRoot); guideTree.render(); guideTree.expandAll(); } if ( refresh ) { guideTreeRoot.reload(); guideTree.expandAll(); } }, reloadGuideTree : function(strAtt,strValue){ if ( strAtt && strValue != "" ) { guideTreeRoot.findChild( strAtt, strValue ).reload( callback() ); } else { guideTreeRoot.reload(); guideTree.expandAll(); } }, showQuickInfo : function( infoID, callback ) { pageWestLayout.getRegion('south').getActivePanel().load( { url: "/perl/index.pl", params: { sid: SID, rm: 'showQI', infoID: infoID, r: Math.random() }, callback: callback, scripts: true } ); }, initMenuTree : function( analysenName, refresh ) { if ( !menuTree ) { menuTree = new Ext.tree.TreePanel('expertNav', { animate: true, loader: new Ext.tree.TreeLoader({dataUrl: '/perl/index.pl', baseParams: { sid: SID, rm: 'getMenuTreeNode'}}), enableDD: false, containerScroll: true }); menuTreeRoot = new Ext.tree.AsyncTreeNode({ text: analysenName, draggable: false, id: 'start' }); menuTree.on('click', function(n){ if(n.isLeaf()){ if (n.parentNode.id != 'planEntry') { mM4App.btnAuswertung.show(); mM4App.btnPlanEntry.hide(); } if ( n.id == "addAuswertung" ) { if ( n.disabled == false ) { mM4App.showAuswertungsSelection( {closable: true} ); } else { mM4App.msg("Achtung:", "Es stehen keine weiteren Auswertungen zur Verfügung."); } } else if ( n.id == "analyse" ) { mM4App.showSteckbrief({closable: true}); } else if ( n.id == "universe" ) { mM4App.showQuickInfo( n.id, function() { mM4App.showUniverseSelection( { closable: true, rm: 'switchUniverse' } ); }); } else if ( n.id == "plantarget" ) { mM4App.showQuickInfo( n.id, function() { mM4App.showPlanzielSelection( false ); }); } else if ( n.id == "timeframe" ) { mM4App.showQuickInfo( n.id, function() { mM4App.showZeitraumSelection(); }); } else if ( n.id == "tarif" ) { mM4App.showQuickInfo( n.id, function() { mM4App.showTarifSettings(); }); } else if ( n.id == "market" ) { mM4App.showQuickInfo( n.id, function() { mM4App.showMarketSelection(true); }); } else if ( n.id == "spalten" ) { mM4App.showQuickInfo( n.id, function() { mM4App.showSpaltenSelection(); }); } else if ( n.parentNode.id == "auswertungen" || n.parentNode.id == "MPA" ) { mM4App.setContentTitle( n.text ); tmpCurNodeID = n.id; mM4App.showQuickInfo( n.id, function() { mM4App.showAuswertung( n.id ); }); } else if ( n.parentNode.id == "inputs" && n.id > 2000000 ) { mM4App.showKontaktEingabe(); } else if ( n.parentNode.id == "inputs" && ( n.id == 7 || n.id == 8 ) ) { mM4App.showQuickInfo( n.id, function() { mM4App.showMarkenSelection( n.id, n.text ); }); // mM4App.showQuickInfo( n.id, mM4App.showMarkenSelection( n.id, n.text ) ); } else if ( (n.parentNode.id == "inputs" && n.id != 'planEntry') || (n.parentNode.id == 'planEntry') ) { mM4App.showQuickInfo( n.id, function() { mM4App.showSelection( n.id, n.text ); }); if (n.parentNode.id == 'planEntry') { mM4App.btnAuswertung.hide(); mM4App.btnPlanEntry.show(); } } } else if (n.parentNode.id == "inputs" && n.id == 'planEntry') { mM4App.showPlanEntry(); } }); menuTree.setRootNode(menuTreeRoot); menuTree.render(); menuTreeRoot.expand(); } if ( refresh ) { menuTreeRoot.reload(); } }, reloadMenuTree : function(strAtt,strValue){ if ( strAtt && strValue != "" ) { menuTreeRoot.findChild( strAtt, strValue ).reload(); } else { menuTreeRoot.reload(); } }, setCurTree : function ( treeRef ) { mM4App.curTree = treeRef; }, reloadCurTree : function(strAtt,strValue) { if ( strAtt && strValue != "" ) { mM4App.curTree.getRootNode.findChild( strAtt, strValue ).reload(); } else { mM4App.curTree.getRootNode.reload(); } }, getPlanEntry : function() { return mM4PlanEntry; } } }(); Ext.onReady(mM4App.init, mM4App, true);