pari: branch 2.0 r4192 - in /branches/2.0/config: ./ js/

SVN commits to the Asterisk-GUI project asterisk-gui-commits at lists.digium.com
Fri Nov 21 15:18:49 CST 2008


Author: pari
Date: Fri Nov 21 15:18:48 2008
New Revision: 4192

URL: http://svn.digium.com/view/asterisk-gui?view=rev&rev=4192
Log:


 Move all directories/paths/scripts/application names that are
 hardcoded in astman.js into top.sessionData



Modified:
    branches/2.0/config/index.html
    branches/2.0/config/js/astman.js
    branches/2.0/config/js/backup.js
    branches/2.0/config/js/cdr.js
    branches/2.0/config/js/feditor.js
    branches/2.0/config/js/hardware.js
    branches/2.0/config/js/hardware_aa50.js
    branches/2.0/config/js/index.js
    branches/2.0/config/js/menuprompts_record.js
    branches/2.0/config/js/menuprompts_upload.js
    branches/2.0/config/js/menus.js
    branches/2.0/config/js/misdn.js
    branches/2.0/config/js/mohfiles.js
    branches/2.0/config/js/networking.js
    branches/2.0/config/js/pbx.js
    branches/2.0/config/js/registerg729.js
    branches/2.0/config/js/sysinfo.js
    branches/2.0/config/language.html

Modified: branches/2.0/config/index.html
URL: http://svn.digium.com/view/asterisk-gui/branches/2.0/config/index.html?view=diff&rev=4192&r1=4191&r2=4192
==============================================================================
--- branches/2.0/config/index.html (original)
+++ branches/2.0/config/index.html Fri Nov 21 15:18:48 2008
@@ -62,6 +62,7 @@
 		'lpc10': 'LPC10' ,
 		'g729' : 'G.729'
 	},
+	directories:{},// sessionData.directories
 	FileCache:{}, // Object to Cache config files .. sessionData.FileCache['users.conf'].content , sessionData.FileCache['users.conf'].modified
 	FXO_PORTS_DETECTED : [], // so that we do not have to parse ztscan output each time where we want this list
 				// sessionData.FXO_PORTS_DETECTED

Modified: branches/2.0/config/js/astman.js
URL: http://svn.digium.com/view/asterisk-gui/branches/2.0/config/js/astman.js?view=diff&rev=4192&r1=4191&r2=4192
==============================================================================
--- branches/2.0/config/js/astman.js (original)
+++ branches/2.0/config/js/astman.js Fri Nov 21 15:18:48 2008
@@ -314,7 +314,7 @@
 		GUI_DB : 'astgui', // name of the ASTDB database used by GUI -- ASTGUI.globals.GUI_DB
 		msg_notLoggedIn: 'Message: Authentication Required',
 		configfile : 'guipreferences.conf', // will be created if the file does not exist , ASTGUI.globals.configfile
-		g729RegInfo: 'g729reginfo.conf', // ASTGUI.globals.g729RegInfo, the ASTGUI.scripts.Registerg729 script will read this file to generate tab delimited file
+		g729RegInfo: 'g729reginfo.conf', // ASTGUI.globals.g729RegInfo, the sessionData.directories.script_Registerg729 script will read this file to generate tab delimited file
 		hwcfgFile: 'gui_confighw.conf', // file to store configured hardware information
 		zaptelIncludeFile: 'zaptel_guiRead.conf', // file that will be used to read zapte.conf, ASTGUI.globals.zaptelIncludeFile
 		pingInterval : 5000,
@@ -1298,8 +1298,8 @@
 		// ASTGUI.listSystemFiles( dir , callBackFunction )
 		// list of files in 'dir' will be sent to callBackFunction as an array
 		try{
-		this.systemCmd( this.scripts.ListFiles + ' ' +  dir , function(){
-			var op = ASTGUI.loadHTML( ASTGUI.paths.output_SysInfo );
+		this.systemCmd( top.sessionData.directories.script_ListFiles + ' ' +  dir , function(){
+			var op = ASTGUI.loadHTML( top.sessionData.directories.output_SysInfo );
 			var tmp_files = op.split('\n');
 			var files = [];
 			for( var i =0 ; i < tmp_files.length ; i++){
@@ -1360,7 +1360,7 @@
 				var s = $.ajax({ url: ASTGUI.paths.rawman+'?action=createconfig&filename='+ fileName , async: false }).responseText;
 				callback();
 			}else{
-				ASTGUI.systemCmd( 'touch ' + ASTGUI.paths.asteriskConfig + fileName, callback );
+				ASTGUI.systemCmd( 'touch ' + top.sessionData.directories.asteriskConfig + fileName, callback );
 			}
 		},
 
@@ -2354,10 +2354,10 @@
 		// usage :: ASTGUI.systemCmdWithOutput( 'uptime' , callback(output){ /* do something with output */ } );
 		// Use this function when you want to execute a specific system command and read the output
 		// output will be sent as a argument to the callback function
-		var fcmd = cmd + ' > ' + this.paths['guiInstall'] + ( this.paths['output_SysInfo'].afterChar('/') || this.paths['output_SysInfo'] ) ;
+		var fcmd = cmd + ' > ' + top.sessionData.directories.guiInstall + ( top.sessionData.directories.output_SysInfo.afterChar('/') || top.sessionData.directories.output_SysInfo ) ;
 		var after = function(){
 			parent.document.getElementById('ajaxstatus').style.display = 'none';
-			var op = ASTGUI.loadHTML( ASTGUI.paths.output_SysInfo ) ;
+			var op = ASTGUI.loadHTML( top.sessionData.directories.output_SysInfo ) ;
 			cb( op ) ;
 		};
 		var delay_cb = function(){ setTimeout(after,500); };
@@ -2642,38 +2642,7 @@
 }; // ( AstGUI )
 
 ASTGUI.paths = {};
-
-ASTGUI.paths['guiInstall'] = '/var/lib/asterisk/static-http/config/';
 ASTGUI.paths['rawman'] = '../../rawman';
-ASTGUI.paths['asteriskConfig'] = '/etc/asterisk/';
-ASTGUI.paths['ConfigBkp'] = '/var/lib/asterisk/gui_backups/';
-ASTGUI.paths['ConfigBkp_dldPath'] = ASTGUI.paths['guiInstall'] + 'private/bkps/'; // path for keeping the bkp files for download
-ASTGUI.paths['AGIBIN'] = '/var/lib/asterisk/agi-bin/';
-ASTGUI.paths['Sounds'] = '/var/lib/asterisk/sounds/';
-ASTGUI.paths['MOH'] = '/var/lib/asterisk/moh/' ; // path for music on hold files
-ASTGUI.paths['menusRecord'] = ASTGUI.paths['Sounds'] + 'record/' ;
-
-ASTGUI.paths['scripts'] = '/var/lib/asterisk/scripts/';/* Directory for gui scripts (listfiles, for example) */	
-ASTGUI.paths['output_SysInfo'] = './sysinfo_output.html' ;
-ASTGUI.paths['voicemails_dir'] = '/var/spool/asterisk/voicemail/default/' ;
-
-ASTGUI.scripts = {};
-
-ASTGUI.scripts['takeBackup'] = 'sh ' + ASTGUI.paths['scripts'] + 'takebackup';
-ASTGUI.scripts['restoreBackup'] = 'sh ' + ASTGUI.paths['scripts'] + 'restorebackup';
-ASTGUI.scripts['SysInfo'] = 'sh ' + ASTGUI.paths['scripts'] + 'gui_sysinfo';
-ASTGUI.scripts['ListFiles'] = 'sh ' + ASTGUI.paths['scripts'] + 'listfiles';
-ASTGUI.scripts['NetworkSettings'] = 'sh ' + ASTGUI.paths['scripts'] + 'networking.sh';
-ASTGUI.scripts['generateZaptel'] = 'sh ' + ASTGUI.paths['scripts'] + 'editzap.sh';
-ASTGUI.scripts['generatemISDN_init'] = 'sh ' + ASTGUI.paths['scripts'] + 'editmisdn.sh';
-ASTGUI.scripts['dldsoundpack'] = 'sh ' + ASTGUI.paths['scripts'] + 'dldsoundpack';
-ASTGUI.scripts['mastercsvexists'] = 'sh ' + ASTGUI.paths['scripts'] + 'mastercsvexists';
-ASTGUI.scripts['Registerg729'] = 'sh ' + ASTGUI.paths['scripts'] + 'registerg729.sh';
-
-ASTGUI.apps = {};
-ASTGUI.apps['Ztscan'] = 'ztscan > ' + ASTGUI.paths['asteriskConfig'] +'ztscan.conf' ;
-ASTGUI.apps['mISDNscan'] = 'misdn-init scan' ;
-ASTGUI.apps['flashupdate'] = 'flashupdate' ;
 
 ASTGUI.includeContexts = [ 'default' , 'parkedcalls' , ASTGUI.contexts.CONFERENCES , ASTGUI.contexts.RingGroupExtensions , ASTGUI.contexts.VoiceMenuExtensions , ASTGUI.contexts.QUEUES , ASTGUI.contexts.VoiceMailGroups , ASTGUI.contexts.Directory, ASTGUI.contexts.PageGroups , ASTGUI.contexts.PageAnExtension] ;
 

Modified: branches/2.0/config/js/backup.js
URL: http://svn.digium.com/view/asterisk-gui/branches/2.0/config/js/backup.js?view=diff&rev=4192&r1=4191&r2=4192
==============================================================================
--- branches/2.0/config/js/backup.js (original)
+++ branches/2.0/config/js/backup.js Fri Nov 21 15:18:48 2008
@@ -19,7 +19,7 @@
  *
  */
 
-var bkpPath = ASTGUI.paths.ConfigBkp ;
+var bkpPath = top.sessionData.directories.ConfigBkp ;
 var upload_Filename = ""; // will be updated by upload_form.html
 var starteduploading = 0;
 var upload_Path; // path for 'uploads' as defined in http.conf - this variable will be automatically updated from http.conf
@@ -72,14 +72,14 @@
 	var rand_2 = Math.round(100000*Math.random());
 	var tmp_check_perms_guibkps = function(){
 		ASTGUI.dialog.waitWhile('Checking write privileges on backups folder');
-		ASTGUI.systemCmd( "touch "+ ASTGUI.paths['ConfigBkp'] + rand_2 , function(){
-
-			ASTGUI.listSystemFiles( ASTGUI.paths['ConfigBkp'], function(a){
+		ASTGUI.systemCmd( "touch "+ top.sessionData.directories.ConfigBkp + rand_2 , function(){
+
+			ASTGUI.listSystemFiles( top.sessionData.directories.ConfigBkp , function(a){
 				a = a.join('');
 				if( a.contains(rand_2) ){
-					ASTGUI.systemCmd( "rm '"+ ASTGUI.paths['ConfigBkp'] + rand_2 + "'" , function(){});
+					ASTGUI.systemCmd( "rm '"+ top.sessionData.directories.ConfigBkp + rand_2 + "'" , function(){});
 				}else{
-					ASTGUI.dialog.alertmsg( 'missing ' + ASTGUI.paths['ConfigBkp'] + '<BR> OR Asterisk does not have write privileges on ' + ASTGUI.paths['ConfigBkp'] );
+					ASTGUI.dialog.alertmsg( 'missing ' + top.sessionData.directories.ConfigBkp + '<BR> OR Asterisk does not have write privileges on ' + top.sessionData.directories.ConfigBkp );
 					return;
 				}
 
@@ -154,8 +154,8 @@
 
 
 function dld_bkp( filename ){
-	parent.ASTGUI.systemCmd( "mkdir -p "+ ASTGUI.paths.ConfigBkp_dldPath + " ; /bin/rm " + ASTGUI.paths.ConfigBkp_dldPath + "* ", function(){
-		parent.ASTGUI.systemCmd( "/bin/ln -s "+ bkpPath + filename + " " + ASTGUI.paths.ConfigBkp_dldPath + filename , function(){
+	parent.ASTGUI.systemCmd( "mkdir -p "+ top.sessionData.directories.ConfigBkp_dldPath + " ; /bin/rm " + top.sessionData.directories.ConfigBkp_dldPath + "* ", function(){
+		parent.ASTGUI.systemCmd( "/bin/ln -s "+ bkpPath + filename + " " + top.sessionData.directories.ConfigBkp_dldPath + filename , function(){
 			var location_dir = window.location.href ;
 			location_dir = location_dir.rChop('backup.html') ;
 			var download_link =  location_dir + "private/bkps/" + filename ;
@@ -191,7 +191,7 @@
 function restore_bkp_step3(file_fullpath){
 	if( parent.sessionData.PLATFORM.isAA50 ){
 		parent.ASTGUI.dialog.waitWhile(' The System will reboot shortly ');
-		parent.ASTGUI.systemCmd( ASTGUI.scripts.restoreBackup + " " + file_fullpath, function(){
+		parent.ASTGUI.systemCmd( top.sessionData.directories.script_restoreBackup + " " + file_fullpath, function(){
 			ASTGUI.feedback( { msg:'Configuration restored !!', showfor:2 });
 			parent.miscFunctions.AFTER_REBOOT_CMD();
 			/* ***************** Todo Restart ******************* */
@@ -273,9 +273,9 @@
 	if( parent.sessionData.PLATFORM.isAA50  ){
 		var fullback = _$('newbkp_completeBackup').checked ;
 		if(fullback){
-			var tmp_script = ASTGUI.scripts.takeBackup + ' ' +  bkpPath + bkpfile + ' ' + 'YES';
+			var tmp_script = top.sessionData.directories.script_takeBackup + ' ' +  bkpPath + bkpfile + ' ' + 'YES';
 		}else{
-			var tmp_script = ASTGUI.scripts.takeBackup + ' ' +  bkpPath + bkpfile ;
+			var tmp_script = top.sessionData.directories.script_takeBackup + ' ' +  bkpPath + bkpfile ;
 		}
 		parent.ASTGUI.systemCmd( tmp_script , function(){
 			ASTGUI.feedback( { msg:'Backup Successful', showfor:2 });

Modified: branches/2.0/config/js/cdr.js
URL: http://svn.digium.com/view/asterisk-gui/branches/2.0/config/js/cdr.js?view=diff&rev=4192&r1=4191&r2=4192
==============================================================================
--- branches/2.0/config/js/cdr.js (original)
+++ branches/2.0/config/js/cdr.js Fri Nov 21 15:18:48 2008
@@ -319,7 +319,7 @@
 
 	parent.ASTGUI.dialog.waitWhile(' Grabbing your Records... ');
 
-	parent.ASTGUI.systemCmd(ASTGUI.scripts.mastercsvexists, function (){
+	parent.ASTGUI.systemCmd(top.sessionData.directories.script_mastercsvexists, function (){
 		var content = ASTGUI.loadHTML("./Master.csv"); /* "./" is good enough. */
 		records = content.split("\n");
 		var intDest = parent.astgui_manageusers.listOfUsers();

Modified: branches/2.0/config/js/feditor.js
URL: http://svn.digium.com/view/asterisk-gui/branches/2.0/config/js/feditor.js?view=diff&rev=4192&r1=4191&r2=4192
==============================================================================
--- branches/2.0/config/js/feditor.js (original)
+++ branches/2.0/config/js/feditor.js Fri Nov 21 15:18:48 2008
@@ -84,7 +84,7 @@
 	parent.ASTGUI.dialog.waitWhile('loading list of filenames ..');
 	ASTGUI.selectbox.append(_$('filenames'),"Config Files", "");
 	_$('filenames').options[0].style.fontWeight = "bold";
-	parent.ASTGUI.listSystemFiles( ASTGUI.paths.asteriskConfig , function(listOfFiles) {
+	parent.ASTGUI.listSystemFiles( top.sessionData.directories.asteriskConfig , function(listOfFiles) {
 		try{
 			listOfFiles.each( function( file ) {
 				if( file.endsWith('.conf') ){ ASTGUI.selectbox.append( _$('filenames'), file , file ); }

Modified: branches/2.0/config/js/hardware.js
URL: http://svn.digium.com/view/asterisk-gui/branches/2.0/config/js/hardware.js?view=diff&rev=4192&r1=4191&r2=4192
==============================================================================
--- branches/2.0/config/js/hardware.js (original)
+++ branches/2.0/config/js/hardware.js Fri Nov 21 15:18:48 2008
@@ -366,7 +366,7 @@
 		ASTGUI.Log.Debug("start function: loadConfigFiles.runZtscan()");
 
 		ASTGUI.miscFunctions.createConfig( 'applyzap.conf', function(){
-			parent.ASTGUI.systemCmd( ASTGUI.apps.Ztscan , function(){ // run ztscan and then try loading ztscan.conf
+			parent.ASTGUI.systemCmd( top.sessionData.directories.app_Ztscan , function(){ // run ztscan and then try loading ztscan.conf
 				window.setTimeout( loadConfigFiles.readZtscanConf , 700 ); // leave some time for ztscan to generate ztscan.conf
 			});
 			ASTGUI.Log.Debug("end of function: loadConfigFiles.runZtscan()");
@@ -808,7 +808,7 @@
 	},
 
 	generate_zaptel: function(){
-		parent.ASTGUI.systemCmd( ASTGUI.scripts.generateZaptel + " applysettings" , function(){
+		parent.ASTGUI.systemCmd( top.sessionData.directories.script_generateZaptel + " applysettings" , function(){
 			parent.sessionData.REQUIRE_RESTART = (HAS_ANALOGHARDWARE || HAS_DIGITALHARDWARE)? true : false;
 			parent.ASTGUI.systemCmd( "ztcfg -vv" , function(){
 				applySettings.save_opermode_settings();

Modified: branches/2.0/config/js/hardware_aa50.js
URL: http://svn.digium.com/view/asterisk-gui/branches/2.0/config/js/hardware_aa50.js?view=diff&rev=4192&r1=4191&r2=4192
==============================================================================
--- branches/2.0/config/js/hardware_aa50.js (original)
+++ branches/2.0/config/js/hardware_aa50.js Fri Nov 21 15:18:48 2008
@@ -123,7 +123,7 @@
 
 
 	generate_zaptel: function(){
-		parent.ASTGUI.systemCmd( ASTGUI.scripts.generateZaptel + " applysettings" , function(){
+		parent.ASTGUI.systemCmd( top.sessionData.directories.script_generateZaptel + " applysettings" , function(){
 			parent.sessionData.REQUIRE_RESTART = true ;
 			parent.ASTGUI.systemCmd( "ztcfg -vv" , function(){
 				applySettings.save_opermode_settings();

Modified: branches/2.0/config/js/index.js
URL: http://svn.digium.com/view/asterisk-gui/branches/2.0/config/js/index.js?view=diff&rev=4192&r1=4191&r2=4192
==============================================================================
--- branches/2.0/config/js/index.js (original)
+++ branches/2.0/config/js/index.js Fri Nov 21 15:18:48 2008
@@ -154,19 +154,19 @@
 				pu = true;
 			}
 			if( !http_conf.post_mappings.hasOwnProperty('backups') ){
-				var tmp_cbkp = ASTGUI.paths.ConfigBkp;
+				var tmp_cbkp = top.sessionData.directories.ConfigBkp ;
 				if( tmp_cbkp.endsWith('/') ){ tmp_cbkp = tmp_cbkp.rChop('/'); }
 				u.new_action('append', 'post_mappings' , 'backups', tmp_cbkp ) ;
 				pu = true;
 			}
 			if( !http_conf.post_mappings.hasOwnProperty('moh') ){
-				var tmp_cbkp = ASTGUI.paths.MOH ;
+				var tmp_cbkp = top.sessionData.directories.MOH ;
 				if( tmp_cbkp.endsWith('/') ){ tmp_cbkp = tmp_cbkp.rChop('/'); }
 				u.new_action('append', 'post_mappings' , 'moh', tmp_cbkp ) ;
 				pu = true;
 			}
 			if( !http_conf.post_mappings.hasOwnProperty('voicemenuprompts') ){
-				var tmp_cbkp = ASTGUI.paths['menusRecord'] ;
+				var tmp_cbkp = top.sessionData.directories.menusRecord ;
 				if( tmp_cbkp.endsWith('/') ){ tmp_cbkp = tmp_cbkp.rChop('/'); }
 				u.new_action('append', 'post_mappings' , 'voicemenuprompts', tmp_cbkp ) ;
 				pu = true;
@@ -187,13 +187,13 @@
 				pu = true;
 			}
 			if( !http_conf.post_mappings.hasOwnProperty('backups') ){
-				var tmp_cbkp = ASTGUI.paths['ConfigBkp'] ;
+				var tmp_cbkp = top.sessionData.directories.ConfigBkp ;
 				if( tmp_cbkp.endsWith('/') ){ tmp_cbkp = tmp_cbkp.rChop('/'); }
 				u.new_action('append', 'post_mappings' , 'backups', tmp_cbkp ) ;
 				pu = true;
 			}
 			if( !http_conf.post_mappings.hasOwnProperty('moh') ){
-				var tmp_cbkp = ASTGUI.paths.MOH ;
+				var tmp_cbkp = top.sessionData.directories.MOH ;
 				if( tmp_cbkp.endsWith('/') ){ tmp_cbkp = tmp_cbkp.rChop('/'); }
 				u.new_action('append', 'post_mappings' , 'moh', tmp_cbkp ) ;
 				pu = true;
@@ -221,7 +221,7 @@
 		var rand_1 = Math.round(100000*Math.random());
 		ASTGUI.systemCmdWithOutput( 'echo ' + rand_1  , function(s){
 			if( !s.contains(rand_1) ){
-				ASTGUI.dialog.alertmsg( 'Asterisk needs write privileges on ' + ASTGUI.paths['guiInstall'] );
+				ASTGUI.dialog.alertmsg( 'Asterisk needs write privileges on ' + top.sessionData.directories.guiInstall );
 			}
 
 			ASTGUI.dialog.waitWhile('detecting Hardware ..');
@@ -229,10 +229,52 @@
 		});
 	},
 
+	setGUI_Paths: function(){
+		// onLogInFunctions.setGUI_Paths()
+		var ASTERISK_CONF = context2json({ filename:'asterisk.conf' , context : 'directories' , usf:1 }) ;
+
+		sessionData.directories.asteriskConfig = ( ASTERISK_CONF.hasOwnProperty('astetcdir') ) ? ASTERISK_CONF.astetcdir : '/etc/asterisk/' ;
+		sessionData.directories.astvarlibdir = ( ASTERISK_CONF.hasOwnProperty('astvarlibdir') ) ? ASTERISK_CONF.astvarlibdir : '/var/lib/asterisk/' ;
+		sessionData.directories.AGIBIN = ( ASTERISK_CONF.hasOwnProperty('astagidir') ) ? ASTERISK_CONF.astagidir : '/var/lib/asterisk/agi-bin/' ;
+		sessionData.directories.astspooldir = ( ASTERISK_CONF.hasOwnProperty('astspooldir') ) ? ASTERISK_CONF.astspooldir : '/var/spool/asterisk/' ;
+
+		if( !sessionData.directories.asteriskConfig.endsWith('/') ){ sessionData.directories.asteriskConfig = sessionData.directories.asteriskConfig + '/' ; }
+		if( !sessionData.directories.astvarlibdir.endsWith('/') ){ sessionData.directories.astvarlibdir = sessionData.directories.astvarlibdir + '/' ; }
+		if( !sessionData.directories.AGIBIN.endsWith('/') ){ sessionData.directories.AGIBIN = sessionData.directories.AGIBIN + '/' ; }
+		if( !sessionData.directories.astspooldir.endsWith('/') ){ sessionData.directories.astspooldir = sessionData.directories.astspooldir + '/' ; }
+
+		sessionData.directories.guiInstall = sessionData.directories.astvarlibdir + 'static-http/config/' ;
+		sessionData.directories.ConfigBkp = sessionData.directories.astvarlibdir + 'gui_backups/';
+		sessionData.directories.ConfigBkp_dldPath = sessionData.directories.guiInstall + 'private/bkps/'; // path for keeping the bkp files for download
+		sessionData.directories.Sounds = sessionData.directories.astvarlibdir + 'sounds/' ;
+		sessionData.directories.MOH = sessionData.directories.astvarlibdir + 'moh/' ; // path for music on hold files
+		sessionData.directories.menusRecord = sessionData.directories.Sounds + 'record/' ;
+
+		sessionData.directories.scripts = sessionData.directories.astvarlibdir + 'scripts/';/* Directory for gui scripts (listfiles, for example) */	
+		sessionData.directories.output_SysInfo = './sysinfo_output.html' ;
+		sessionData.directories.voicemails_dir = '/var/spool/asterisk/voicemail/default/' ;
+
+
+		sessionData.directories.script_takeBackup =  'sh ' + sessionData.directories.scripts + 'takebackup';
+		sessionData.directories.script_restoreBackup =  'sh ' + sessionData.directories.scripts + 'restorebackup';
+		sessionData.directories.script_SysInfo = 'sh ' + sessionData.directories.scripts + 'gui_sysinfo';
+		sessionData.directories.script_ListFiles = 'sh ' + sessionData.directories.scripts + 'listfiles';
+		sessionData.directories.script_NetworkSettings = 'sh ' + sessionData.directories.scripts + 'networking.sh';
+		sessionData.directories.script_generateZaptel = 'sh ' + sessionData.directories.scripts + 'editzap.sh';
+		sessionData.directories.script_generatemISDN_init = 'sh ' + sessionData.directories.scripts + 'editmisdn.sh';
+		sessionData.directories.script_dldsoundpack = 'sh ' + sessionData.directories.scripts + 'dldsoundpack';
+		sessionData.directories.script_mastercsvexists = 'sh ' + sessionData.directories.scripts + 'mastercsvexists';
+		sessionData.directories.script_Registerg729 = 'sh ' + sessionData.directories.scripts + 'registerg729.sh';
+
+		sessionData.directories.app_Ztscan = 'ztscan > ' + sessionData.directories.asteriskConfig +'ztscan.conf' ;
+		sessionData.directories.app_mISDNscan = 'misdn-init scan' ;
+		sessionData.directories.app_flashupdate = 'flashupdate' ;
+	},
+
 	checkifLoggedIn: function(){
 		var s = $.ajax({ url: ASTGUI.paths.rawman+'?action=ping', async: false });
 		var resp = s.getResponseHeader("Server");
-
+		onLogInFunctions.setGUI_Paths();
 		onLogInFunctions.detectPlatform(resp); // <-- PLATFORM Detection
 
 		if(s.responseText.toLowerCase().match('pong')){
@@ -377,7 +419,7 @@
 		var cb = function(){
 			onLogInFunctions.updatePanels4Platform();
 		};
-		ASTGUI.systemCmd(ASTGUI.apps.Ztscan, cb);
+		ASTGUI.systemCmd(top.sessionData.directories.app_Ztscan, cb);
 	},
 
 

Modified: branches/2.0/config/js/menuprompts_record.js
URL: http://svn.digium.com/view/asterisk-gui/branches/2.0/config/js/menuprompts_record.js?view=diff&rev=4192&r1=4191&r2=4192
==============================================================================
--- branches/2.0/config/js/menuprompts_record.js (original)
+++ branches/2.0/config/js/menuprompts_record.js Fri Nov 21 15:18:48 2008
@@ -68,7 +68,7 @@
 			context : ASTGUI.contexts.guitools ,
 			exten   : 'play_file',
 			priority : '1',
-			Variable : 'var1=' + ASTGUI.paths.menusRecord + CURRENT_FILE
+			Variable : 'var1=' + top.sessionData.directories.menusRecord + CURRENT_FILE
 		});
 	}
 	if(ACTION == 'RECORD' ){
@@ -81,7 +81,7 @@
 var delete_file = function(fn){
 	if(!confirm("Delete selected Voice Menu prompt ?")){ return ; }
 	ASTGUI.dialog.waitWhile(' Deleting file ...');
-	parent.ASTGUI.systemCmd( "/bin/rm -f '" + ASTGUI.paths.menusRecord + fn + "'", function(){ 
+	parent.ASTGUI.systemCmd( "/bin/rm -f '" + top.sessionData.directories.menusRecord + fn + "'", function(){ 
 		ASTGUI.feedback( { msg:'Delete Request Successfull !', showfor:2 });
 		setTimeout ( function(){ ASTGUI.dialog.hide(); window.location.reload(); } , 1500 );
 	});
@@ -116,7 +116,7 @@
 		context : ASTGUI.contexts.guitools ,
 		exten   : 'record_vmenu',
 		priority : '1',
-		Variable : 'var1=' + ASTGUI.paths.menusRecord + CURRENT_FILE
+		Variable : 'var1=' + top.sessionData.directories.menusRecord + CURRENT_FILE
 	});
 
 	parent.ASTGUI.dialog.waitWhile( 'Please wait while the system <BR> Calls the specified Extension ... ' );
@@ -160,7 +160,7 @@
 
 	$('#whereToBuy_button').tooltip({delay:0.9,showURL:false,top:15,left:-300});
 
-	ASTGUI.listSystemFiles( ASTGUI.paths.menusRecord , function(recfiles) {
+	ASTGUI.listSystemFiles( top.sessionData.directories.menusRecord , function(recfiles) {
 		for( var i=0 ; i < recfiles.length ; i++ ){
 			var filename = recfiles[i].stripTags();
 			var newRow = _rft.insertRow(-1);

Modified: branches/2.0/config/js/menuprompts_upload.js
URL: http://svn.digium.com/view/asterisk-gui/branches/2.0/config/js/menuprompts_upload.js?view=diff&rev=4192&r1=4191&r2=4192
==============================================================================
--- branches/2.0/config/js/menuprompts_upload.js (original)
+++ branches/2.0/config/js/menuprompts_upload.js Fri Nov 21 15:18:48 2008
@@ -28,7 +28,7 @@
 		$('#uploadForm_container').hide();
 		parent.ASTGUI.dialog.waitWhile( 'Creating configuration needed for uploading voice prompts ...' );
 
-		var tmp_a = ASTGUI.paths.menusRecord.rChop('/');
+		var tmp_a = top.sessionData.directories.menusRecord.rChop('/');
 		var u = new listOfSynActions('http.conf') ;
 			if( !top.sessionData.httpConf.postmappings_defined ){
 				u.new_action( 'newcat', 'post_mappings', '', '');
@@ -92,7 +92,7 @@
 	}
 
 	parent.ASTGUI.dialog.waitWhile('Loading ...');
-	parent.ASTGUI.systemCmd( "mkdir -p " + ASTGUI.paths.menusRecord , function(){
+	parent.ASTGUI.systemCmd( "mkdir -p " + top.sessionData.directories.menusRecord , function(){
 		parent.ASTGUI.dialog.hide();
 	});
 

Modified: branches/2.0/config/js/menus.js
URL: http://svn.digium.com/view/asterisk-gui/branches/2.0/config/js/menus.js?view=diff&rev=4192&r1=4191&r2=4192
==============================================================================
--- branches/2.0/config/js/menus.js (original)
+++ branches/2.0/config/js/menus.js Fri Nov 21 15:18:48 2008
@@ -115,12 +115,12 @@
 	load_Sounds: function(){ // VoiceMenus_miscFunctions.load_Sounds();
 		parent.ASTGUI.dialog.waitWhile('loading list of sounds ..');
 
-		var LANG_PATH = ASTGUI.paths.Sounds ;
+		var LANG_PATH = top.sessionData.directories.Sounds ;
 
 		var c = config2json({filename: 'users.conf', usf:1});
 		if(c.hasOwnProperty('general')){
 			if ( c['general'].getProperty('language') != 'en' ){
-				var LANG_PATH = ASTGUI.paths.Sounds + c['general'].getProperty('language') + '/' ;
+				var LANG_PATH = top.sessionData.directories.Sounds + c['general'].getProperty('language') + '/' ;
 			}
 		}
 
@@ -138,7 +138,7 @@
 	},
 
 	load_recordedSounds: function(){
-		ASTGUI.listSystemFiles( ASTGUI.paths.menusRecord , function(recfiles) {
+		ASTGUI.listSystemFiles( top.sessionData.directories.menusRecord , function(recfiles) {
 			var tmp_obj = {};
 			recfiles.each(function( CURRENT_FILE ){
 				CURRENT_FILE = 'record/' + chop_Extension(CURRENT_FILE);
@@ -154,7 +154,7 @@
 
 	load_aig_files : function(){
 		parent.ASTGUI.dialog.waitWhile('loading list of AIG scripts ..');
-		ASTGUI.listSystemFiles( ASTGUI.paths.AGIBIN , function(recfiles) {
+		ASTGUI.listSystemFiles( top.sessionData.directories.AGIBIN , function(recfiles) {
 			AGI_FILES = recfiles;
 			parent.ASTGUI.dialog.hide();
 			ASTGUI.COMBOBOX.call( _$('newstep_agi') , AGI_FILES, 450 );

Modified: branches/2.0/config/js/misdn.js
URL: http://svn.digium.com/view/asterisk-gui/branches/2.0/config/js/misdn.js?view=diff&rev=4192&r1=4191&r2=4192
==============================================================================
--- branches/2.0/config/js/misdn.js (original)
+++ branches/2.0/config/js/misdn.js Fri Nov 21 15:18:48 2008
@@ -34,7 +34,7 @@
 var misdnConfig = {
 
 	detectCards: function(){
-		parent.ASTGUI.systemCmdWithOutput( ASTGUI.apps.mISDNscan , function(s){ // run 'misdn-init scan'
+		parent.ASTGUI.systemCmdWithOutput( top.sessionData.directories.app_mISDNscan , function(s){ // run 'misdn-init scan'
 			try{
 				var records = s.split("\n");
 				var span=1, ns;
@@ -243,7 +243,7 @@
 	x.new_action('append', d, "debug" , "0");
 	x.callActions(function(){
 		// call the script that would generate /etc/misdn-init.conf from /etc/asterisk/applymisdn.conf
-		parent.ASTGUI.systemCmd( ASTGUI.scripts.generatemISDN_init + " applysettings", function(){ 
+		parent.ASTGUI.systemCmd( top.sessionData.directories.script_generatemISDN_init + " applysettings", function(){ 
 			alert("You need to restart your machine for these settings to take effect");
 			window.location.reload();
 			return true; 

Modified: branches/2.0/config/js/mohfiles.js
URL: http://svn.digium.com/view/asterisk-gui/branches/2.0/config/js/mohfiles.js?view=diff&rev=4192&r1=4191&r2=4192
==============================================================================
--- branches/2.0/config/js/mohfiles.js (original)
+++ branches/2.0/config/js/mohfiles.js Fri Nov 21 15:18:48 2008
@@ -195,7 +195,7 @@
 			};
 
 		var tmp_MOH_PATH_PM_NAME = ASTGUI.contexts.mohdirPrefix + tmp_moh_classname ;
-		var tmp_MOH_PATH = ASTGUI.paths['MOH'] + tmp_MOH_PATH_PM_NAME ;
+		var tmp_MOH_PATH = top.sessionData.directories.MOH + tmp_MOH_PATH_PM_NAME ;
 
 		parent.ASTGUI.dialog.waitWhile(' creating moh class ...');
 		// create entry from musiconhold.conf

Modified: branches/2.0/config/js/networking.js
URL: http://svn.digium.com/view/asterisk-gui/branches/2.0/config/js/networking.js?view=diff&rev=4192&r1=4191&r2=4192
==============================================================================
--- branches/2.0/config/js/networking.js (original)
+++ branches/2.0/config/js/networking.js Fri Nov 21 15:18:48 2008
@@ -66,7 +66,7 @@
 
 		var cmd4 = "echo \" HOSTNAME=" + _$('HOSTNAME').value + " LEASE_LAN=" + _$('LEASE_LAN').value + " NTP_ADDRESS=" + _$('NTP_ADDRESS').value + " TFTP_LAN=" + _$('TFTP_LAN').value + " DOMAIN_LAN=" + _$('DOMAIN_LAN').value + " MAX_LEASE=" + _$('MAX_LEASE').value + "\" >> " + network_params;
 
-		var cmd5 = ASTGUI.scripts.NetworkSettings;
+		var cmd5 = top.sessionData.directories.script_NetworkSettings;
 
 		(function(){
 			var u = new listOfSynActions('phoneprov.conf') ;

Modified: branches/2.0/config/js/pbx.js
URL: http://svn.digium.com/view/asterisk-gui/branches/2.0/config/js/pbx.js?view=diff&rev=4192&r1=4191&r2=4192
==============================================================================
--- branches/2.0/config/js/pbx.js (original)
+++ branches/2.0/config/js/pbx.js Fri Nov 21 15:18:48 2008
@@ -628,7 +628,7 @@
 		
 		qs_x.callActions(function(){
 			if( deletevm ){
-				ASTGUI.systemCmd('rm ' + ASTGUI.paths['voicemails_dir'] + user + ' -rf', cb);
+				ASTGUI.systemCmd('rm ' + top.sessionData.directories.voicemails_dir + user + ' -rf', cb);
 			}else{
 				cb();
 			}
@@ -1857,7 +1857,7 @@
 
 	var n_Lower = n.toLowerCase();
 	if( n_Lower.contains('response: error') && n_Lower.contains('message: config file not found') ){
-		parent.ASTGUI.systemCmd( 'touch ' + ASTGUI.paths['asteriskConfig'] + ASTGUI.globals.configfile , function(){
+		parent.ASTGUI.systemCmd( 'touch ' + top.sessionData.directories.asteriskConfig + ASTGUI.globals.configfile , function(){
 			top.window.location.reload();
 		});
 		return false;
@@ -2233,7 +2233,7 @@
 			var tmp_bkpFileName = ( sessionData.PLATFORM.isABE ) ? 'Upgrade_backup_of_C1.x__' + year + month + day + '.tar' :  'Upgrade_backup_before_GUI__' + year + month + day + '.tar' ;
 	
 			parent.ASTGUI.dialog.waitWhile('Taking Backup of current configuration ...');
-			ASTGUI.systemCmd( "tar -cf " + ASTGUI.paths.ConfigBkp + tmp_bkpFileName + ' ' +  ' /etc/asterisk', function(){
+			ASTGUI.systemCmd( "tar -cf " + top.sessionData.directories.ConfigBkp + tmp_bkpFileName + ' ' +  ' /etc/asterisk', function(){
 				ASTGUI.feedback({ msg:'Backup Successful', showfor:2 });
 				do_Upgrade();
 			});

Modified: branches/2.0/config/js/registerg729.js
URL: http://svn.digium.com/view/asterisk-gui/branches/2.0/config/js/registerg729.js?view=diff&rev=4192&r1=4191&r2=4192
==============================================================================
--- branches/2.0/config/js/registerg729.js (original)
+++ branches/2.0/config/js/registerg729.js Fri Nov 21 15:18:48 2008
@@ -74,7 +74,7 @@
 
 		ASTGUI.dialog.waitWhile('Registering Key...');
 		x.callActions(function(){
-			ASTGUI.systemCmdWithOutput( ASTGUI.scripts['Registerg729'] + " " + ASTGUI.getFieldValue('text_g729licensekey'), function(result){
+			ASTGUI.systemCmdWithOutput( top.sessionData.directories.script_Registerg729 + " " + ASTGUI.getFieldValue('text_g729licensekey'), function(result){
 				ASTGUI.dialog.hide();
 				if(result.contains('SUCCESS')){
 					alert('Registration Successfull ! \n Please reboot for changes to take effect');

Modified: branches/2.0/config/js/sysinfo.js
URL: http://svn.digium.com/view/asterisk-gui/branches/2.0/config/js/sysinfo.js?view=diff&rev=4192&r1=4191&r2=4192
==============================================================================
--- branches/2.0/config/js/sysinfo.js (original)
+++ branches/2.0/config/js/sysinfo.js Fri Nov 21 15:18:48 2008
@@ -48,7 +48,7 @@
 };
 
 function getsysinfohtml(){
-	_$('sysinfohtml').innerHTML = ASTGUI.loadHTML(ASTGUI.paths.output_SysInfo);
+	_$('sysinfohtml').innerHTML = ASTGUI.loadHTML(top.sessionData.directories.output_SysInfo);
 	_$('osversion').innerHTML = _$('si_uname').innerHTML;
 	_$('uptime').innerHTML = _$('si_uptime').innerHTML.replace(/load average/, "<BR>Load Average");
 	_$('asterisk').innerHTML =  parent.sessionData.AsteriskVersionString + "<BR>" + "Asterisk GUI-version : " + ( parent.sessionData.gui_version || ASTGUI.globals.version ) ;
@@ -139,5 +139,5 @@
 		}
 		ASTGUI.tabbedOptions( _$('tabbedMenu') , t );
 	})();
-	parent.ASTGUI.systemCmd( parent.ASTGUI.scripts.SysInfo, function(){ parent.ASTGUI.dialog.hide(); getsysinfohtml(); } );
+	parent.ASTGUI.systemCmd( top.sessionData.directories.script_SysInfo, function(){ parent.ASTGUI.dialog.hide(); getsysinfohtml(); } );
 }

Modified: branches/2.0/config/language.html
URL: http://svn.digium.com/view/asterisk-gui/branches/2.0/config/language.html?view=diff&rev=4192&r1=4191&r2=4192
==============================================================================
--- branches/2.0/config/language.html (original)
+++ branches/2.0/config/language.html Fri Nov 21 15:18:48 2008
@@ -61,7 +61,7 @@
 var check_ifNeedsDownloading_andDownload = function(){
 	var download_selectedLangPack = function(){
 		var check_ifDone = function(){
-			var t = ASTGUI.loadHTML(ASTGUI.paths.output_SysInfo);
+			var t = ASTGUI.loadHTML(top.sessionData.directories.output_SysInfo);
 			if ( t.contains('DoneDoneDone') ){
 				ASTGUI.feedback({msg:' Donwloaded Sound Pack !!', showfor: 3 , color: '#5D7CBA', bgcolor: '#FFFFFF'}) ;
 				setTimeout( function(){
@@ -77,13 +77,13 @@
 		var l = ASTGUI.getFieldValue('language')
 		var platform = (parent.sessionData.PLATFORM.isAA50) ? 'AA50' : 'none';
 		parent.ASTGUI.dialog.waitWhile(' Downloading Language ...');
-		parent.ASTGUI.systemCmd( ASTGUI.scripts.dldsoundpack + ' ' + l + ' ' + platform + ' &', after);
+		parent.ASTGUI.systemCmd( top.sessionData.directories.script_dldsoundpack + ' ' + l + ' ' + platform + ' &', after);
 	};
 
  	var check_ifDownloadNeeded = function(){
 		parent.ASTGUI.dialog.waitWhile(' Checking if the selected Language Sounds are installed ...');
 		if( ASTGUI.getFieldValue('language') != 'en' ){
-			ASTGUI.listSystemFiles( ASTGUI.paths['Sounds'] +  ASTGUI.getFieldValue('language') + '/' , function(a){
+			ASTGUI.listSystemFiles( top.sessionData.directories.Sounds +  ASTGUI.getFieldValue('language') + '/' , function(a){
 				if( a.length < 15 ){
 					download_selectedLangPack();
 				}else{




More information about the asterisk-gui-commits mailing list