Ext.namespace('it.elman.pel.wui'); it.elman.pel.wui.elman_ac_menu = function() { var selected_mmsi=null; var selected_imo_number=null; // private space function loadPage(url, proxy, target) { if ( target != "_self" ) { //impostaStatoLogin(2, 'iaovov04qlr1hii1a72jks0j17'); } clearTimeout(it.elman.pel.wui.AIS_TIMEOUT); if ( target == "_blank" ) { window.open(url, "AISGIS"); } else if ( target == "_top" ) { top.location = url; } else { var cpanel = Ext.getCmp('center-panel'); cpanel.purgeListeners(); //var forload = Ext.get("center"); var upd = cpanel.getUpdater(); upd.update({ url: url, //callback: function (){alert("OK");}, text: "Loading...", scripts: true }); } //impostaStatoLogin(2, 'iaovov04qlr1hii1a72jks0j17'); //CGR: } /* function it.elman.pel.wui.elman_ac_menu.onItemClick(item){ if ( Ext.isEmpty(item.menu) ) { clearTimeout(it.elman.pel.wui.timeout_function); it.elman.pel.wui.elmTrace.log("clearTimeout(it.elman.pel.wui.timeout_function);"); if (it.elman.pel.wui.monitoring && it.elman.pel.wui.monitoring.core_parameters && it.elman.pel.wui.monitoring.core_parameters.counting) { clearTimeout(it.elman.pel.wui.monitoring.core_parameters.counting); it.elman.pel.wui.elmTrace.log("clearTimeout(it.elman.pel.wui.monitoring.core_parameters.counting);"); } //alert(item.link); if (item.text == "AIS Gis" || item.text == "OL GIS") { check_gis = true; } if (item.text == "Home") { check_home = true; } if ( item.link != null && item.link != "" ) { loadPage(item.link, "forload", item.target); return true; } } } */ function build_ac_menu() { tb.add(' ',' '); tb.add(' ',' '); tb.add(' ', ' ', ' '); tb.add('-'); tb.add( { //text: "Home", id: 'home-button', iconCls: "go-home", tooltip: it.elman.pel.wui.wui_name+" Home", handler: it.elman.pel.wui.elman_ac_menu.onItemClick, //it.elman.pel.wui.elman_ac_menu.onItemClick, link: it.elman.pel.wui.elman_ac_menu.homePage,//"../../ac/auth/login.htm", //CGR: link impostato in default.js.php target: "_top", menu: null } ,'-' ); // CGR: 20110606 if ( it.elman.pel.wui.elman_ac_menu.loggedIn ) { var permalink = ''; //----------- DMO 20231106 - BEGIN ----------- //----------- DMO 20231106 - END ----------- } if ( it.elman.pel.wui.elman_ac_menu.loggedIn ) { //CGR: it.elman.pel.wui.elman_ac_menu.loggedIn � settato in default.php (controllato anche in default_login.js) tb.add('->'); /* tb.add( //'-', "User: " ); */ var text_title = ''+username+''; if (country != '') text_title += '   '; tb.add( { xtype: 'button', tooltip: 'Group: '+groupDesc, id:'account_button', text: text_title, iconCls:'icon-user', menu: { xtype: 'menu', items: [ { text: "Change Password", iconCls: "change_password", tooltip: "Change Password", handler: function() { var forload = Ext.get("forload"); var upd = forload.getUpdater(); upd.update({ url: this.link, text: "Loading...", scripts: true }); }, link: "ac/auth/changePassword.htm.php", //ENG_acmenu.loginPage, target: "", menu: null },//'-', { text: "Change Email", iconCls: "inbox", //hidden: true, tooltip: "Change Email", handler: function() { var forload = Ext.get("forload"); var upd = forload.getUpdater(); upd.update({ url: this.link, text: "Loading...", scripts: true }); }, link: "ac/auth/changeEmail.htm.php", //ENG_acmenu.loginPage, target: "", menu: null }, /* { xtype: 'menuitem', text: "Edit account data", id: 'edit_web_user_button', //iconCls: 'profiles',//curr_item.get('ICONCLS'), handler: it.elman.pel.wui.elman_ac_menu.onItemClick, link: 'ac/web_users/web_users.php',//curr_item.get('HREF'), //CGR: link preso dall'XML target: ''//curr_item.get('TARGET'), }, */ /**/ '-', { text: "Log Out", iconCls: "logout", tooltip: "Logout from "+it.elman.pel.wui.wui_name, handler: function() { var forload = Ext.get("forload"); var upd = forload.getUpdater(); upd.update({ url: this.link, text: "Loading...", scripts: true }); }, link: it.elman.pel.wui.elman_ac_menu.logoutPage, target: "", menu: null } ] } } ); tb.add(' '); tb.add('-'); tb.add({ text:'', //text: "Help", iconCls: "help", menu: { xtype: 'menu', items: [ { xtype: 'menuitem', text: 'WUI - Quick Start Guide (ENG)', id: 'wui_quick_guide_en_button', iconCls: '', handler: function () { if (!ManualWindow || ManualWindow.closed) { ManualWindow = window.open('/help/wui_quick_guide_en.pdf','GIS - Quick Start Guide','left=20,top=20,width=750,height=576,toolbar=1,resizable=1,scrollbars=1,menubar=1,location=0'); } else { ManualWindow.close(); ManualWindow = window.open('/help/wui_quick_guide_en.pdf','GIS - Quick Start Guide','left=20,top=20,width=750,height=576,toolbar=1,resizable=1,scrollbars=1,menubar=1,location=0'); } } } ,{ xtype: 'menuitem', text: 'WUI - Guida Rapida (ITA)', id: 'wui_quick_guide_it_button', iconCls: '', handler: function () { if (!ManualWindow || ManualWindow.closed) { ManualWindow = window.open('/help/wui_quick_guide_it.pdf','GIS - Guida Rapida','left=20,top=20,width=750,height=576,toolbar=1,resizable=1,scrollbars=1,menubar=1,location=0'); } else { ManualWindow.close(); ManualWindow = window.open('/help/wui_quick_guide_it.pdf','GIS - Guida Rapida','left=20,top=20,width=750,height=576,toolbar=1,resizable=1,scrollbars=1,menubar=1,location=0'); } } } ,'-' ,{ xtype: 'menuitem', text: 'GIS - Quick Start Guide (ENG)', id: 'gis_quick_guide_en_button', iconCls: '', handler: function () { if (!ManualWindow || ManualWindow.closed) { ManualWindow = window.open('/help/gis_quick_guide_en.pdf','GIS - Quick Start Guide','left=20,top=20,width=750,height=576,toolbar=1,resizable=1,scrollbars=1,menubar=1,location=0'); } else { ManualWindow.close(); ManualWindow = window.open('/help/gis_quick_guide_en.pdf','GIS - Quick Start Guide','left=20,top=20,width=750,height=576,toolbar=1,resizable=1,scrollbars=1,menubar=1,location=0'); } } } ,{ xtype: 'menuitem', text: 'GIS - Guida Rapida (ITA)', id: 'gis_quick_guide_it_button', iconCls: '', handler: function () { if (!ManualWindow || ManualWindow.closed) { ManualWindow = window.open('/help/gis_quick_guide_it.pdf','GIS - Guida Rapida','left=20,top=20,width=750,height=576,toolbar=1,resizable=1,scrollbars=1,menubar=1,location=0'); } else { ManualWindow.close(); ManualWindow = window.open('/help/gis_quick_guide_it.pdf','GIS - Guida Rapida','left=20,top=20,width=750,height=576,toolbar=1,resizable=1,scrollbars=1,menubar=1,location=0'); } } } ] } }); /* tb.add( ' ', '-', ' ', { text: "Log Out", iconCls: "logout", tooltip: "Logout from "+it.elman.pel.wui.wui_name, handler: function() { var forload = Ext.get("forload"); var upd = forload.getUpdater(); upd.update({ url: this.link, text: "Loading...", scripts: true }); }, link: it.elman.pel.wui.elman_ac_menu.logoutPage, target: "", menu: null } ); */ tb.add(' ', ' '); /* var HTMLManualWin; var PDFManualWin; var GISFirstAccessWin; var WhatIsNewWin; tb.add({ text: "Help", iconCls: "help", link: it.elman.pel.wui.elman_ac_menu.help, target: "", menu: { xtype: 'menu', items: [ { xtype: 'menuitem', text: 'GIS First Access', id: 'first_access_button_pdf', iconCls: 'help', handler: function () { if (!GISFirstAccessWin || GISFirstAccessWin.closed) { GISFirstAccessWin = window.open('../help/MARES_gis_first_access_quick_guide.pdf','GIS First Access - Quick Guide','left=20,top=20,width=750,height=576,toolbar=1,resizable=1,scrollbars=1,menubar=1,location=0'); } } }, { xtype: 'menuitem', text: 'What is New', id: 'what_is_new_button_pdf', iconCls: 'help', handler: function () { if (!WhatIsNewWin || WhatIsNewWin.closed) { WhatIsNewWin = window.open('../help/SystemUserManual_AISMediterraneanServer_U.pdf','What is New','left=20,top=20,width=750,height=576,toolbar=1,resizable=1,scrollbars=1,menubar=1,location=0'); } } }, { xtype: 'menuitem', text: 'User Manual (PFD)', id: 'user_manual_button_pdf', iconCls: 'help', handler: function () { if (!PDFManualWin || PDFManualWin.closed) { PDFManualWin = window.open('../help/SystemUserManual_AISMediterraneanServer.pdf','User Manual (PDF)','left=20,top=20,width=750,height=576,toolbar=1,resizable=1,scrollbars=1,menubar=1,location=0'); } } }, { xtype: 'menuitem', text: 'User Manual (HTML)', id: 'user_manual_button_html', iconCls: 'help', handler: function () { if (!HTMLManualWin || HTMLManualWin.closed) { HTMLManualWin = window.open('../help/html/SystemUserManual_AISMediterraneanServer.htm','User Manual (HTML)','left=20,top=20,width=750,height=576,toolbar=1,resizable=1,scrollbars=1,menubar=1,location=0'); } } } ] } }); */ } else { tb.add('->'); tb.add("You are not logged into "+it.elman.pel.wui.wui_name); tb.add(' '); tb.add(' '); //tb.add(' '); /* tb.add(' ', '-', ' '); tb.add({ text: "Login", iconCls: "login", tooltip: "Login into "+it.elman.pel.wui.wui_name, handler: function() { var forload = Ext.get("forload"); var upd = forload.getUpdater(); upd.update({ url: this.link, text: "Loading...", scripts: true }); }, link: it.elman.pel.wui.elman_ac_menu.loginPage, target: "", menu: null }); tb.add(' '); */ } tb.render('toolbar'); it.elman.pel.wui.elman_ac_menu.afterload(); } var ManualWindow; var tb = new Ext.Toolbar({cls: 'x-panel-header'}); return { // public methods loggedIn : false, root_path : "", afterload : Ext.emptyFn(), loadFile : "", homePage : "", loginPage : "", logoutPage : "", help : "", toolbar : tb, loadPage : loadPage, onItemClick: function(item) { if ( Ext.isEmpty(item.menu) ) { clearTimeout(it.elman.pel.wui.timeout_function); //it.elman.pel.wui.elmTrace.log("clearTimeout(it.elman.pel.wui.timeout_function);"); if (it.elman.pel.wui.monitoring && it.elman.pel.wui.monitoring.core_parameters && it.elman.pel.wui.monitoring.core_parameters.counting) { clearTimeout(it.elman.pel.wui.monitoring.core_parameters.counting); //it.elman.pel.wui.elmTrace.log("clearTimeout(it.elman.pel.wui.monitoring.core_parameters.counting);"); } if (it.elman.pel.wui.monitoring && it.elman.pel.wui.monitoring.navtex_radios) { it.elman.pel.wui.monitoring.navtex_radios.clear_all_monitor(); }//mod dsc (grazie claudio) if (typeof timer_radio != 'undefined') { //per refresh radio dsc clearInterval(timer_radio); } if (typeof timer_navtex_radio != 'undefined') { //per refresh radio navtex clearInterval(timer_navtex_radio); } if (typeof timer_update_logbook != 'undefined') { //per refresh logbook clearInterval(timer_update_logbook); } if (it.elman.pel.wui.monitoring && it.elman.pel.wui.monitoring.voice_schedule){ it.elman.pel.wui.monitoring.voice_schedule.clearAutoRefresh(); } if (document.getElementById('html_eastPanel')){ document.getElementById('html_eastPanel').hidden=false; it.elman.pel.wui.eastPanel.setTitle(''); document.getElementById('html_eastPanel').innerHTML = ''; } //mod AME 10/10/2014 pulisce la sidebar in caso di cambio sezione if (it.elman.pel.wui.inbox){ it.elman.pel.wui.inbox.clearTimer(); it.elman.pel.wui.inbox.hidePanels(); if (Ext.getCmp('new_message-window')){ Ext.getCmp('new_message-window').destroy(); } } if (Ext4 && Ext4.TaskManager) { Ext4.TaskManager.stopAll() } if (item.text == "AIS Gis" || item.text == "OL GIS") { check_gis = true; } if (item.text == "Home") { check_home = true; } if ( item.link != null && item.link != "" ) { loadPage(item.link, "forload", item.target); return true; } } }, setImoNumber: function(imo){ selected_imo_number=imo; }, setMMSI: function(mmsi){ selected_mmsi=mmsi; }, getImoNumber: function(imo){ return selected_imo_number; }, getMMSI: function(mmsi){ return selected_mmsi; }, init: function() { build_ac_menu(); if ( Ext.isEmpty( Ext.get("forload") ) ) { Ext.get(document.body).insertHtml('beforeEnd','
',false); } } // end of init() }; }(); // end of app //Ext.onReady(menu_space.app.init, menu_space.app);