rbrindley: branch rbrindley/welcome_revamp r4162 - in /team/rbrindley/welcome...
SVN commits to the Asterisk-GUI project
asterisk-gui-commits at lists.digium.com
Thu Nov 20 14:21:57 CST 2008
Author: rbrindley
Date: Thu Nov 20 14:21:56 2008
New Revision: 4162
URL: http://svn.digium.com/view/asterisk-gui?view=rev&rev=4162
Log:
merge from branches/2.0
Added:
team/rbrindley/welcome_revamp/config/js/backup.js
- copied unchanged from r4161, branches/2.0/config/js/backup.js
team/rbrindley/welcome_revamp/config/js/bulkadd.js
- copied unchanged from r4161, branches/2.0/config/js/bulkadd.js
team/rbrindley/welcome_revamp/config/js/callingrules.js
- copied unchanged from r4161, branches/2.0/config/js/callingrules.js
team/rbrindley/welcome_revamp/config/js/cdr.js
- copied unchanged from r4161, branches/2.0/config/js/cdr.js
team/rbrindley/welcome_revamp/config/js/dialplans.js
- copied unchanged from r4161, branches/2.0/config/js/dialplans.js
team/rbrindley/welcome_revamp/config/js/features.js
- copied unchanged from r4161, branches/2.0/config/js/features.js
team/rbrindley/welcome_revamp/config/js/feditor.js
- copied unchanged from r4161, branches/2.0/config/js/feditor.js
team/rbrindley/welcome_revamp/config/js/flashupdate.js
- copied unchanged from r4161, branches/2.0/config/js/flashupdate.js
team/rbrindley/welcome_revamp/config/js/followme.js
- copied unchanged from r4161, branches/2.0/config/js/followme.js
team/rbrindley/welcome_revamp/config/js/hardware.js
- copied unchanged from r4161, branches/2.0/config/js/hardware.js
team/rbrindley/welcome_revamp/config/js/hardware_aa50.js
- copied unchanged from r4161, branches/2.0/config/js/hardware_aa50.js
team/rbrindley/welcome_revamp/config/js/iax.js
- copied unchanged from r4161, branches/2.0/config/js/iax.js
team/rbrindley/welcome_revamp/config/js/incoming.js
- copied unchanged from r4161, branches/2.0/config/js/incoming.js
team/rbrindley/welcome_revamp/config/js/meetme.js
- copied unchanged from r4161, branches/2.0/config/js/meetme.js
team/rbrindley/welcome_revamp/config/js/menuprompts_record.js
- copied unchanged from r4161, branches/2.0/config/js/menuprompts_record.js
team/rbrindley/welcome_revamp/config/js/menuprompts_upload.js
- copied unchanged from r4161, branches/2.0/config/js/menuprompts_upload.js
team/rbrindley/welcome_revamp/config/js/menus.js
- copied unchanged from r4161, branches/2.0/config/js/menus.js
team/rbrindley/welcome_revamp/config/js/misdn.js
- copied unchanged from r4161, branches/2.0/config/js/misdn.js
team/rbrindley/welcome_revamp/config/js/mohfiles.js
- copied unchanged from r4161, branches/2.0/config/js/mohfiles.js
team/rbrindley/welcome_revamp/config/js/networking.js
- copied unchanged from r4161, branches/2.0/config/js/networking.js
team/rbrindley/welcome_revamp/config/js/paging.js
- copied unchanged from r4161, branches/2.0/config/js/paging.js
team/rbrindley/welcome_revamp/config/js/preferences.js
- copied unchanged from r4161, branches/2.0/config/js/preferences.js
team/rbrindley/welcome_revamp/config/js/queues.js
- copied unchanged from r4161, branches/2.0/config/js/queues.js
team/rbrindley/welcome_revamp/config/js/registerg729.js
- copied unchanged from r4161, branches/2.0/config/js/registerg729.js
team/rbrindley/welcome_revamp/config/js/ringgroups.js
- copied unchanged from r4161, branches/2.0/config/js/ringgroups.js
team/rbrindley/welcome_revamp/config/js/sip.js
- copied unchanged from r4161, branches/2.0/config/js/sip.js
team/rbrindley/welcome_revamp/config/js/status.js
- copied unchanged from r4161, branches/2.0/config/js/status.js
team/rbrindley/welcome_revamp/config/js/sysinfo.js
- copied unchanged from r4161, branches/2.0/config/js/sysinfo.js
team/rbrindley/welcome_revamp/config/js/timeintervals.js
- copied unchanged from r4161, branches/2.0/config/js/timeintervals.js
team/rbrindley/welcome_revamp/config/js/timezone.js
- copied unchanged from r4161, branches/2.0/config/js/timezone.js
team/rbrindley/welcome_revamp/config/js/trunks_analog.js
- copied unchanged from r4161, branches/2.0/config/js/trunks_analog.js
team/rbrindley/welcome_revamp/config/js/trunks_digital.js
- copied unchanged from r4161, branches/2.0/config/js/trunks_digital.js
team/rbrindley/welcome_revamp/config/js/trunks_providers.js
- copied unchanged from r4161, branches/2.0/config/js/trunks_providers.js
team/rbrindley/welcome_revamp/config/js/trunks_sps.js
- copied unchanged from r4161, branches/2.0/config/js/trunks_sps.js
team/rbrindley/welcome_revamp/config/js/trunks_voip.js
- copied unchanged from r4161, branches/2.0/config/js/trunks_voip.js
team/rbrindley/welcome_revamp/config/js/users.js
- copied unchanged from r4161, branches/2.0/config/js/users.js
team/rbrindley/welcome_revamp/config/js/vmgroups.js
- copied unchanged from r4161, branches/2.0/config/js/vmgroups.js
team/rbrindley/welcome_revamp/config/js/voicemail.js
- copied unchanged from r4161, branches/2.0/config/js/voicemail.js
team/rbrindley/welcome_revamp/config/js/welcome.js
- copied unchanged from r4161, branches/2.0/config/js/welcome.js
Modified:
team/rbrindley/welcome_revamp/config/backup.html
team/rbrindley/welcome_revamp/config/bulkadd.html
team/rbrindley/welcome_revamp/config/callingrules.html
team/rbrindley/welcome_revamp/config/cdr.html
team/rbrindley/welcome_revamp/config/dialplans.html
team/rbrindley/welcome_revamp/config/features.html
team/rbrindley/welcome_revamp/config/feditor.html
team/rbrindley/welcome_revamp/config/flashupdate.html
team/rbrindley/welcome_revamp/config/followme.html
team/rbrindley/welcome_revamp/config/hardware.html
team/rbrindley/welcome_revamp/config/hardware_aa50.html
team/rbrindley/welcome_revamp/config/iax.html
team/rbrindley/welcome_revamp/config/incoming.html
team/rbrindley/welcome_revamp/config/meetme.html
team/rbrindley/welcome_revamp/config/menuprompts_record.html
team/rbrindley/welcome_revamp/config/menuprompts_upload.html
team/rbrindley/welcome_revamp/config/menus.html
team/rbrindley/welcome_revamp/config/misdn.html
team/rbrindley/welcome_revamp/config/mohfiles.html
team/rbrindley/welcome_revamp/config/networking.html
team/rbrindley/welcome_revamp/config/paging.html
team/rbrindley/welcome_revamp/config/preferences.html
team/rbrindley/welcome_revamp/config/queues.html
team/rbrindley/welcome_revamp/config/registerg729.html
team/rbrindley/welcome_revamp/config/ringgroups.html
team/rbrindley/welcome_revamp/config/sip.html
team/rbrindley/welcome_revamp/config/status.html
team/rbrindley/welcome_revamp/config/sysinfo.html
team/rbrindley/welcome_revamp/config/timeintervals.html
team/rbrindley/welcome_revamp/config/timezone.html
team/rbrindley/welcome_revamp/config/trunks_analog.html
team/rbrindley/welcome_revamp/config/trunks_digital.html
team/rbrindley/welcome_revamp/config/trunks_providers.html
team/rbrindley/welcome_revamp/config/trunks_sps.html
team/rbrindley/welcome_revamp/config/trunks_voip.html
team/rbrindley/welcome_revamp/config/users.html
team/rbrindley/welcome_revamp/config/vmgroups.html
team/rbrindley/welcome_revamp/config/voicemail.html
team/rbrindley/welcome_revamp/config/welcome.html
Modified: team/rbrindley/welcome_revamp/config/backup.html
URL: http://svn.digium.com/view/asterisk-gui/team/rbrindley/welcome_revamp/config/backup.html?view=diff&rev=4162&r1=4161&r2=4162
==============================================================================
--- team/rbrindley/welcome_revamp/config/backup.html (original)
+++ team/rbrindley/welcome_revamp/config/backup.html Thu Nov 20 14:21:56 2008
@@ -20,6 +20,7 @@
-->
<script src="js/jquery.js"></script>
<script src="js/astman.js"></script>
+<script src="js/backup.js"></script>
<link href="stylesheets/schwing.css" media="all" rel="Stylesheet" type="text/css" />
<style type="text/css">
#table_one tr{
@@ -45,273 +46,7 @@
*/
}
</style>
-<script>
-var bkpPath = ASTGUI.paths.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
-onUploadForm_beforeUploading = function(){
- if( !parent.sessionData.PLATFORM.isAA50 && !parent.sessionData.PLATFORM.isABE && top.sessionData.PLATFORM.isAST_1_4 ){
- alert("File Uploads are supported in Asterisk 1.6.0/trunk");
- return;
- }
- starteduploading = 1;
- parent.ASTGUI.dialog.waitWhile('File Upload in progress, please wait ..');
- return true;
-};
-
-onUploadForm_load = function(){
- if( parent.sessionData.PLATFORM.isABE ){ // ABE-1600
- $('#uploadForm_container').hide();
- return;
- }
- if(!top.sessionData.httpConf.postmappings_defined || !top.sessionData.httpConf.uploadPaths['backups'] ){
- ASTGUI.Log.Error('AG102');
- $('#uploadForm_container').hide();
- return ;
- }
-
- upload_Path = top.sessionData.httpConf.uploadPaths['backups'] ;
- var upload_action_path = (top.sessionData.httpConf.prefix) ? '/' + top.sessionData.httpConf.prefix + '/backups' : '/backups' ;
- _$('uploadiframe').contentWindow.document.getElementById('form22').action = upload_action_path ;
- _$('uploadiframe').contentWindow.document.getElementById('UploadFORM_UPLOAD_BUTTON').value = 'Upload Backup to Unit' ;
-};
-
-
-onUploadForm_unload = function(){
- if(!starteduploading){ return; }
- parent.ASTGUI.dialog.waitWhile('Backup File Uploaded');
- ASTGUI.feedback({ msg:'Backup File Uploaded !!', showfor: 3 });
- $('#uploadForm_container').hide();
- setTimeout( function(){ window.location.href = 'backup.html'; } , 1000 );
- return;
-};
-
-function localajaxinit() {
- top.document.title = 'Configuration Backups';
- if( parent.sessionData.PLATFORM.isAA50 && !parent.sessionData.hasCompactFlash ){
- $('#nocf').show();
- $('#thispageContent').hide();
- return true;
- }
-
- 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){
- a = a.join('');
- if( a.contains(rand_2) ){
- ASTGUI.systemCmd( "rm '"+ ASTGUI.paths['ConfigBkp'] + rand_2 + "'" , function(){});
- }else{
- ASTGUI.dialog.alertmsg( 'missing ' + ASTGUI.paths['ConfigBkp'] + '<BR> OR Asterisk does not have write privileges on ' + ASTGUI.paths['ConfigBkp'] );
- return;
- }
-
- localajaxinit_2();
- });
- });
- };
-
- tmp_check_perms_guibkps();
-
-}
-
-var localajaxinit_2 = function(){
- parent.ASTGUI.dialog.waitWhile(' Loading list of Previous Backup files !');
- parent.ASTGUI.systemCmd( "mkdir -p " + bkpPath , function(){
- parent.ASTGUI.listSystemFiles( bkpPath , function(bkpfiles) {
- try{
- ASTGUI.domActions.clear_table(_$('bkpfilesTable'))
- for( var i =0 ; i < bkpfiles.length ; i++){
- addrow_totable( bkpfiles[i].stripTags(), i );
- }
- var _bft = _$('bkpfilesTable') ;
- if( _bft.rows.length == 0 ){
- _$('table_one').style.display="none";
- var newRow = _bft.insertRow(-1);
- var newCell0 = newRow.insertCell(0);
- newCell0 .align = "center";
- newCell0 .innerHTML = "<BR><I> No Previous Backup configurations found !!</I> <BR><BR>" +
- "Please click on the 'Create New Backup' button<BR> to take a backup of the current system configuration<BR><BR>" ;
- }
- }finally{
- parent.ASTGUI.dialog.hide();
- }
- });
- });
-}
-
-function restore_uploadedbkpfile(){
-
-}
-
-function addrow_totable(filename, i ){
- if(!filename.contains('__')){ return true;}
- var fname = filename.split("__") ; // var fname[1] = 2007mar12.tar
- var filedate = fname[1].split(".tar");
- var day = filedate[0].substr(7);
- var month = filedate[0].substr(4,3);
- var year = filedate[0].substr(0,4);
-
- var newRow = _$('bkpfilesTable').insertRow(-1);
- newRow.style.backgroundColor='#FFFFFF';
- newRow.onmouseover= function(){ this.style.backgroundColor='#F9F0D1'; };
- newRow.onmouseout=function(){ this.style.backgroundColor='#FFFFFF'; };
-
- ASTGUI.domActions.tr_addCell( newRow , { html: _$('bkpfilesTable').rows.length , width:35, align:'center' } );
- ASTGUI.domActions.tr_addCell( newRow , { html: fname[0] , width:180 } );
- ASTGUI.domActions.tr_addCell( newRow , { html: month.capitalizeFirstChar() + " " + day + ", " + year , width : 125 } );
-
- var tmp = "<span onclick='dld_bkp(\""+ filename + "\")'class=\"guiButton\">Download from Unit</span> " +
- "<span onclick='restore_bkp(\""+ filename + "\")' class=\"guiButton\">Restore Previous Config</span> " +
- "<span onclick='delete_bkp(\""+ filename + "\")' class=\"guiButtonDelete\">Delete</span>" ;
- ASTGUI.domActions.tr_addCell( newRow , { html: tmp , align:'center'} );
-}
-
-
-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(){
- var location_dir = window.location.href ;
- location_dir = location_dir.rChop('backup.html') ;
- var download_link = location_dir + "private/bkps/" + filename ;
- var save_text = ( jQuery.browser.msie ) ? "'Save Target As...'" : "'Save Link As..'" ;
-
- ASTGUI.feedback( { msg:'Download using the <i>Download File</i> link', showfor:2 });
- _$('backup_download_Link_url').innerHTML = '<center><A href="' + download_link + '"><b>Download File</b></A>'
- + "<BR>Right Click on the above link and download using the " + save_text + " option</center>" ;
- $('#backup_download_Link').show();
- //var dld_window = window.open ("", "mywindow","toolbar=0,scrollbars=0,location=0,statusbar=0,menubar=0,resizable=0,width=500,height=200");
- //dld_window.document.write('<BR><center><A href="' + download_link + '"><b>Download From Unit</b></A></center>');
-
- });
- });
-}
-
-
-function restore_bkp(filename){
- if( parent.sessionData.PLATFORM.isAA50 ){
- if(confirm('This will restart the appliance after restoring the backup configuration. \n\n Are you sure you want to proceed ?')){
- restore_bkp_step3(bkpPath + filename);
- }else{
- return;
- }
- }else{
- if(confirm('All your old configuration will be replaced by this backup configuration. \n\n Are you sure you want to proceed ?')){
- //parent.astmanEngine.run_tool("rm /etc/asterisk/* -rf ", callback=function(){ } );
- restore_bkp_step3(bkpPath + filename);
- }
- }
-}
-
-function restore_bkp_step3(file_fullpath){
- if( parent.sessionData.PLATFORM.isAA50 ){
- parent.ASTGUI.dialog.waitWhile(' The Sytem will reboot shortly ');
- parent.ASTGUI.systemCmd( ASTGUI.scripts.restoreBackup + " " + file_fullpath, function(){
- ASTGUI.feedback( { msg:'Configuration restored !!', showfor:2 });
- parent.miscFunctions.AFTER_REBOOT_CMD();
- /* ***************** Todo Restart ******************* */
- //if(starteduploading){ delete_bkp2(file_fullpath); }
- });
- }else{
- parent.ASTGUI.dialog.waitWhile(' Restoring Configuration ');
- parent.ASTGUI.systemCmd( " tar -xvf " + file_fullpath + ' -C / ', function(){
- ASTGUI.feedback( { msg:'Configuration restored !!', showfor:2 });
-
- if(starteduploading){
- delete_bkp2(file_fullpath);
- }else{
- var t = ASTGUI.cliCommand('reload') ;
- setTimeout( function(){ top.window.location.reload(); } , 1000 );
- }
- });
- }
-}
-
-function delete_bkp( filename ){
- if(!confirm("Delete selected Backup Configuration ?")){ return ; }
- delete_bkp2( bkpPath + filename );
-}
-
-function delete_bkp2( file_fullpath ){
- parent.ASTGUI.systemCmd( "/bin/rm -f " + file_fullpath , function(){
- ASTGUI.feedback( { msg:'Delete Request Successfull !', showfor:2 });
- setTimeout( function(){ window.location.reload(); } , 1000 );
- });
-}
-
-
-function take_bkp(){
- ASTGUI.showbg(true);
-
- var months = ["jan", "feb","mar","apr","may","jun","jul","aug","sep","oct","nov","dec"];
- var today=new Date()
- var year = today.getFullYear();
- var month = months[ today.getMonth() ];
- var day = today.getDate().addZero();
- var hour = today.getHours().addZero() ;
- var minute = today.getMinutes().addZero() ;
- var seconds = today.getSeconds().addZero() ;
- var bkpfile = "backup_" + year + month + day + "_" + hour + minute + seconds ;
-
- ASTGUI.updateFieldToValue( 'newbkp_name', bkpfile );
-
- if( parent.sessionData.PLATFORM.isAA50 ){
- $(".AA50only").show();
- }else{
- $(".AA50only").hide();
- }
-
- $('#newbkp_content').show() ;
- _$('newbkp_name').focus();
-}
-
-function cancel_newbackup(){
- ASTGUI.showbg(false);
- _$('newbkp_content').style.display="none" ;
-}
-
-function backup_new(){
- var _nn = _$('newbkp_name');
- if ( !ASTGUI.checkRequiredFields( [_nn] ) ) return ;
- if ( !ASTGUI.validateFields( [_nn] ) ) return ;
-
- var months = ["jan", "feb","mar","apr","may","jun","jul","aug","sep","oct","nov","dec"];
- var today=new Date()
- var year = today.getFullYear();
- var month = months[ today.getMonth() ];
- var day = today.getDate().addZero();
- //var hour =addzero(today.getHours());
- //var minute =addzero(today.getMinutes());
- //var seconds =addzero(today.getSeconds());
- var bkpfile = _nn.value +"__" + year + month + day +".tar";
-
- if( parent.sessionData.PLATFORM.isAA50 ){
- var fullback = _$('newbkp_completeBackup').checked ;
- if(fullback){
- var tmp_script = ASTGUI.scripts.takeBackup + ' ' + bkpPath + bkpfile + ' ' + 'YES';
- }else{
- var tmp_script = ASTGUI.scripts.takeBackup + ' ' + bkpPath + bkpfile ;
- }
- parent.ASTGUI.systemCmd( tmp_script , function(){
- ASTGUI.feedback( { msg:'Backup Successful', showfor:2 });
- window.location.reload();
- }) ;
- return ;
- }else{
- parent.ASTGUI.systemCmd( "tar -cf " + bkpPath + bkpfile + ' ' + ' /etc/asterisk', function(){
- ASTGUI.feedback( { msg:'Backup Successful', showfor:2 });
- parent.ASTGUI.dialog.waitWhile('Reloading List of backup Files');
- setTimeout( function(){ parent.ASTGUI.dialog.hide(); window.location.reload(); } , 2000 );
- });
- return ;
- }
-}
-
-</script>
<body bgcolor="EFEFEF">
<div class="iframeTitleBar">
Backup / Restore Configurations
@@ -366,8 +101,13 @@
</tr>
<tr class='AA50only'> <td colspan=2 align=center height=6></td> </tr>
- <tr class='AA50only'> <td class="field_text" align="right"> Complete Backup: </td>
- <td><input type='checkbox' id='newbkp_completeBackup' class="input9"></td>
+ <tr class='AA50only'>
+ <td valign=top align="right">
+ <input type='checkbox' id='newbkp_completeBackup' class="input9">
+ </td>
+ <td class="field_text">
+ <label for='newbkp_completeBackup'>Also backup Voicemails & Custom Prompts</label>
+ </td>
</tr>
<tr> <td colspan=2 align=center height=6></td> </tr>
@@ -376,6 +116,7 @@
<span class='guiButtonEdit' id="getbackup" onclick='backup_new();'>Backup</span>
</td>
</tr>
+ <tr> <td colspan=2 align=center height=16></td> </tr>
</table>
</div>
</body>
Modified: team/rbrindley/welcome_revamp/config/bulkadd.html
URL: http://svn.digium.com/view/asterisk-gui/team/rbrindley/welcome_revamp/config/bulkadd.html?view=diff&rev=4162&r1=4161&r2=4162
==============================================================================
--- team/rbrindley/welcome_revamp/config/bulkadd.html (original)
+++ team/rbrindley/welcome_revamp/config/bulkadd.html Thu Nov 20 14:21:56 2008
@@ -20,135 +20,14 @@
-->
<script src="js/jquery.js"></script>
<script src="js/astman.js"></script>
+<script src="js/bulkadd.js"></script>
<script src="js/jquery.tooltip.js"></script>
<link href="stylesheets/schwing.css" media="all" rel="Stylesheet" type="text/css" />
<style type="text/css">
</style>
-<script>
-var newusers_list = [];
-var NEW_USERS = {} ;
-var localajaxinit = function(){
- ASTGUI.selectbox.populateArray('RANGE_Number', [5,10,15,20,25,30,35,40,45,50]);
- top.document.title = 'Bulk Add' ;
-
- (function(){
- var t = [{ url:'#',
- desc:'Create New users from CSV list',
- click_function: function(){
- $('#table_usersFromCSV').show();
- $('#table_usersFromRange').hide();
- }
- },{ url: '#',
- desc: 'Create a Range of new users',
- click_function: function(){
- $('#table_usersFromCSV').hide();
- $('#table_usersFromRange').show();
- }
- }];
- ASTGUI.tabbedOptions( _$('tabbedMenu') , t );
- })();
-
- $('#tabbedMenu').find('A:eq(0)').click();
-};
-
-
-
-var create_NEW_USERS = function(){
- var addUser_OR_reloadGUI = function(){
- var tmp_first_user = newusers_list[0];
- parent.astgui_manageusers.addUser( tmp_first_user , NEW_USERS[tmp_first_user] , function(){
- newusers_list.splice(0,1);
- if( newusers_list.length ){
- addUser_OR_reloadGUI();
- }else{
- alert( 'Users added \n Click Ok to reload GUI' );
- top.window.location.reload();
- }
- });
- };
-
- ASTGUI.dialog.waitWhile( "Creating list of users ");
- addUser_OR_reloadGUI();
-};
-
-
-
-var addUsers_from_CSV_field = function(){
- NEW_USERS = {} ;
- newusers_list = [];
-
- var csv_text = _$('ta_ba_csv').value ;
- var tmp_lines = csv_text.split('\n');
- var tmp_Heads = tmp_lines[0]; tmp_lines.splice(0, 1);
- var HEADS = tmp_Heads.split(',');
- if( HEADS[0] != 'User' ){
- alert('The first column should be User');
- return;
- }
-
- for(var tli =0; tli< tmp_lines.length ; tli++ ){
- var this_line = tmp_lines[tli];
- if( this_line.trim() == '' ){ continue; }
- var this_user_details = this_line.split(',');
- if( this_user_details.length != HEADS.length ){
- alert('Error: Invalid Number of Fields in line ' + (tli + 1) );
- return;
- }
-
- var this_user = this_user_details[0]; // User
- if( parent.miscFunctions.ifExtensionAlreadyExists(this_user) ){
- alert('Error: Duplicate Extension \n\n '+ ' Extension ' + this_user + ' already exists \n' + ' Please change extension in line ' + (tli + 1) );
- return;
- }
-
- newusers_list.push( this_user ) ;
- NEW_USERS[ this_user ] = {} ;
- for( var f = 1 ; f < HEADS.length ; f++ ){
- NEW_USERS[ this_user ][ HEADS[f] ] = this_user_details[ f ] ;
- }
- };
-
- create_NEW_USERS();
-};
-
-
-var add_RangeOfUsers = function(){
- NEW_USERS = {} ;
- newusers_list = [];
-
- var t = Number( ASTGUI.getFieldValue('RANGE_Number') );
- var tmp_user = Number(ASTGUI.getFieldValue('RANGE_Start'));
-
- while(t){
- var tmp_nu = String(tmp_user);
- if( parent.miscFunctions.ifExtensionAlreadyExists(tmp_nu) ){
- tmp_user++ ;
- continue;
- }
-
- newusers_list.push(tmp_nu);
- ASTGUI.Log.Debug( 'adding user ' + tmp_nu);
- NEW_USERS[ tmp_nu ] = {} ;
- NEW_USERS[ tmp_nu ]['fullname'] = 'User ' + tmp_nu;
- NEW_USERS[ tmp_nu ]['cid_number'] = tmp_nu;
- NEW_USERS[ tmp_nu ]['context'] = '';
- NEW_USERS[ tmp_nu ]['hasvoicemail'] = 'yes';
- NEW_USERS[ tmp_nu ]['vmsecret'] = tmp_nu;
- NEW_USERS[ tmp_nu ]['hassip'] = 'yes';
- NEW_USERS[ tmp_nu ]['hasiax'] = 'yes';
- NEW_USERS[ tmp_nu ]['secret'] = tmp_nu;
- tmp_user++ ;
- t--;
- }
-
- create_NEW_USERS();
-};
-
-
-</script>
<body bgcolor="EFEFEF">
<div class="iframeTitleBar">
Bulk Add <span class='refresh_icon' onclick="window.location.reload();" > <img src="images/refresh.png" title=" Refresh " border=0 > </span>
Modified: team/rbrindley/welcome_revamp/config/callingrules.html
URL: http://svn.digium.com/view/asterisk-gui/team/rbrindley/welcome_revamp/config/callingrules.html?view=diff&rev=4162&r1=4161&r2=4162
==============================================================================
--- team/rbrindley/welcome_revamp/config/callingrules.html (original)
+++ team/rbrindley/welcome_revamp/config/callingrules.html Thu Nov 20 14:21:56 2008
@@ -20,6 +20,7 @@
-->
<script src="js/jquery.js"></script>
<script src="js/astman.js"></script>
+<script src="js/callingrules.js"></script>
<script src="js/jquery.tooltip.js"></script>
<link href="stylesheets/schwing.css" media="all" rel="Stylesheet" type="text/css" />
<style type="text/css">
@@ -43,327 +44,7 @@
</style>
-<script>
-/*
-sessionData.pbxinfo.callingRules : {
- CallingRule_US : [
- '_91NXXXXXXXXX,1,Macro( trunkdial-failover-0.1, ${trunk_1}/${EXTEN:1}, ${trunk_2}/${EXTEN:1} )'
- ]
-}
-*/
-
-var EDIT_CR ; //calling rule being edited
-var EDIT_CR_RULE ;
-var isNew;
-
-var newCallingRule_form = function(){
- isNew = true ;
- EDIT_CR = '';
- EDIT_CR_RULE = '';
-
- _$('cr_dialog_title').innerHTML =' New CallingRule';
- ASTGUI.resetTheseFields ( [ DOM_new_crl_name, DOM_new_crl_pattern, DOM_new_crl_trunk, DOM_new_crl_tr_stripx, DOM_new_crl_tr_prepend, DOM_new_crl_foChkbx, DOM_new_crl_fotrunk, DOM_new_crl_fotr_stripx, DOM_new_crl_fotr_prepend , 'toLocalDest' , 'new_crl_localDest'] );
- _$('toLocalDest').updateStatus();
- $(DOM_new_CRL_DIV).showWithBg();
- ASTGUI.feedback({ msg:'New CallingRule !', showfor:1 });
-};
-
-var edit_CR_form = function(a,b){
- isNew = false;
- _$('cr_dialog_title').innerHTML =' Edit Calling Rule';
-
- EDIT_CR = a;
- EDIT_CR_RULE = b;
- var tmp_cr = ASTGUI.parseContextLine.obCallingRule(b) ;
-
- DOM_new_crl_name.value = EDIT_CR.withOut(ASTGUI.contexts.CallingRulePrefix) ;
- DOM_new_crl_name.disabled = true;
- DOM_new_crl_pattern.value = tmp_cr.pattern ;
- _$('new_crl_localDest').selectedIndex = -1;
- if( tmp_cr.destination ){
- ASTGUI.selectbox.selectOption('new_crl_localDest', tmp_cr.destination);
- _$('toLocalDest').checked = true;
- }else{
- _$('toLocalDest').checked = false;
- ASTGUI.selectbox.selectOption(DOM_new_crl_trunk, tmp_cr.firstTrunk );
- DOM_new_crl_tr_stripx.value = tmp_cr.stripdigits_firstTrunk ;
- DOM_new_crl_tr_prepend.value = tmp_cr.firstPrepend ;
- if(tmp_cr.secondTrunk){
- DOM_new_crl_foChkbx.checked = true
- ASTGUI.selectbox.selectOption(DOM_new_crl_fotrunk, tmp_cr.secondTrunk );
- DOM_new_crl_fotr_stripx.value = tmp_cr.stripdigits_secondTrunk ;
- DOM_new_crl_fotr_prepend.value = tmp_cr.secondPrepend ;
- }
- en_db_fofields();
- }
-
- _$('toLocalDest').updateStatus();
- $(DOM_new_CRL_DIV).showWithBg();
- ASTGUI.feedback({ msg:'Edit CallingRule !', showfor:1 });
-};
-
-
-var en_db_fofields = function(){
- var t = !DOM_new_crl_foChkbx.checked;
- DOM_new_crl_fotrunk.disabled = t;
- DOM_new_crl_fotr_stripx.disabled = t;
- DOM_new_crl_fotr_prepend.disabled = t;
-};
-
-
-var load_DOMelements = function(){
- DOM_tbl_crls = _$('table_CRLS_list');
- // new calling rule dom elements
- DOM_new_cr_button = _$('new_cr_button');
- DOM_new_CRL_DIV = _$('new_CRL_DIV');
- DOM_new_crl_name = _$('new_crl_name');
- DOM_new_crl_pattern = _$('new_crl_pattern');
- DOM_new_crl_trunk = _$('new_crl_trunk');
- DOM_new_crl_tr_stripx = _$('new_crl_tr_stripx');
- DOM_new_crl_tr_prepend = _$('new_crl_tr_prepend');
- DOM_new_crl_foChkbx = _$('new_crl_foChkbx');
- DOM_new_crl_fotrunk = _$('new_crl_fotrunk');
- DOM_new_crl_fotr_stripx = _$('new_crl_fotr_stripx');
- DOM_new_crl_fotr_prepend = _$('new_crl_fotr_prepend');
- // new calling rule dom elements
- (function(){
- en_db_fofields();
- ASTGUI.events.add( DOM_new_crl_foChkbx, 'change' , en_db_fofields);
- ASTGUI.events.add( DOM_new_cr_button , 'click' , newCallingRule_form);
-
- var t = parent.astgui_managetrunks.listofAllTrunks();
- var TMP_FORSORT = [];
- t.each(function(item){
- TMP_FORSORT.push( parent.astgui_managetrunks.misc.getTrunkName(item) + ':::::::' + item);
- });
- TMP_FORSORT.sort();
- TMP_FORSORT.each( function(this_str){
- var a = this_str.split(':::::::');
- ASTGUI.selectbox.append( DOM_new_crl_trunk, a[0], a[1] );
- ASTGUI.selectbox.append( DOM_new_crl_fotrunk , a[0], a[1] );
- });
- })();
-};
-
-moveCrUpDown = function(context , rule , updown){
- ASTGUI.miscFunctions.moveUpDown_In_context( context , rule , updown , function(newcontext){
- parent.sessionData.pbxinfo.callingRules[context] = newcontext ;
- ASTGUI.feedback( { msg: 'Updated !', showfor: 2 , color: 'blue', bgcolor: '#FFFFFF' } );
- window.location.reload();
- });
-};
-
-var update_CRLSTable = function(){
- //DOM_tbl_crls
- var addCell = ASTGUI.domActions.tr_addCell; // temporarily store the function
- (function(){ // add first row
- var newRow = DOM_tbl_crls.insertRow(-1);
- newRow.className = "frow";
- addCell( newRow , { html:'', width: '100px' } );
- addCell( newRow , { html:'Calling Rule'} );
- addCell( newRow , { html:'Pattern'} );
- addCell( newRow , { html:'Trunk'} );
- addCell( newRow , { html:'Failover Trunk'} );
- addCell( newRow , { html:''} );
- //addCell( newRow , { html:'OutBound CID'} );
- })();
-
- var PreviousTRColor = 'odd' ; // 'odd' : 'even' ;
-
- (function (){
- var c = ASTGUI.cloneObject(parent.sessionData.pbxinfo.callingRules) ;
- for(var d in c){if(c.hasOwnProperty(d)){
- var crd = c[d]; // temporarily store all the details of this calling rule
- var tmp = '';
- PreviousTRColor = (PreviousTRColor == 'odd') ? 'even' : 'odd' ;
-
- var this_crl_set = ASTGUI.cloneObject(c[d]) ;
- var crl = d.withOut(ASTGUI.contexts.CallingRulePrefix);
-
- this_crl_set.each( function(this_rule, this_rule_index ){
- ////////////////////////
- var tmp_movepriorities = '';
- if( this_rule_index == 0 ){
- tmp_movepriorities = '<img src=images/arrow_blank.png border=0> ' ;
- }else{
- tmp_movepriorities = "<A href=# title='Move this rule Up'><img src=images/arrow_up.png border=0 onclick=\"moveCrUpDown('" + d + "','" + this_rule+ "', 1)\"></A> " ;
- }
-
- if( this_rule_index != ( this_crl_set.length -1 ) ){
- tmp_movepriorities += "<A href=# title='Move this rule Down'><img src=images/arrow_down.png border=0 onclick=\"moveCrUpDown('" + d + "','" + this_rule+ "', 0)\"></A>" ;
- }else{
- tmp_movepriorities += '<img src=images/arrow_blank.png border=0>' ;
- }
- //////////////////////
-
- var tmp_cr = ASTGUI.parseContextLine.obCallingRule(this_rule) ;
- var newRow = DOM_tbl_crls.insertRow(-1);
- newRow.className = PreviousTRColor ;
-
- addCell( newRow , { html: tmp_movepriorities } );
- addCell( newRow , { html: crl });
- addCell( newRow , { html: tmp_cr.pattern });
-
- if( tmp_cr.hasOwnProperty('firstTrunk') ){
- addCell( newRow , { html: tmp_cr.firstTrunk ? ( parent.astgui_managetrunks.misc.getTrunkName(tmp_cr.firstTrunk) || '<i><font color=red>Invalid Trunk</font></i>' ) : '<i><font color=red>None Assigned</font></i>' });
- addCell( newRow , { html: tmp_cr.secondTrunk ? ( parent.astgui_managetrunks.misc.getTrunkName(tmp_cr.secondTrunk) || '<i><font color=red>Invalid Trunk</font></i>' ): '<i>None Selected</i>' });
- }else{
- addCell( newRow , { html: '<i><font color=blue>Local Destination : ' + ASTGUI.parseContextLine.showAs(tmp_cr.destination) + '</font></i>', align: 'left', colspan : 2 });
- }
-
- tmp = "<span class='guiButton' onclick=\"edit_CR_form('" + d +"','" + this_rule + "')\">Edit</span>" +
- "<span class='guiButtonDelete' onclick=\"delete_CR_confirm('" + d +"','" + this_rule + "')\">Delete</span>" ;
-
- addCell( newRow , { html: tmp} );
- });
- }}
-
- if(DOM_tbl_crls.rows.length == 1){
- ASTGUI.domActions.clear_table(DOM_tbl_crls);
- var newRow = DOM_tbl_crls.insertRow(-1);
- newRow.className = 'even';
- addCell( newRow , { html:'No CallingRules defined !!'} );
- return ;
- }
- })();
-};
-
-
-var localajaxinit = function() {
- top.document.title = "Edit Calling Rules";
- ASTGUI.selectbox.populateArray( 'new_crl_localDest' , parent.miscFunctions.getAllDestinations() );
- ASTGUI.domActions.showHideClassByCheckBox( 'toLocalDest', 'STT_TR_OPTIONS', true );
- load_DOMelements();
- update_CRLSTable();
- ASTGUI.events.add( 'restore_default_clrs_button', 'click' , restore_default_callingRules );
-};
-
-
-var restore_default_callingRules = function(){
- if( !confirm( 'This would restore the factory default Calling Rules.'
- + '\n Any other custom calling rules will not be edited or deleted.'
- + '\n Click OK to continue ' ) )return;
-
-
- var x = new listOfActions('extensions.conf');
- x.new_action('delcat', 'CallingRule_Longdistance', '', '');
- x.new_action('newcat', 'CallingRule_Longdistance', '', '');
- x.new_action('append', 'CallingRule_Longdistance', 'exten', '_91XXXXXXXXXX!,1,Macro(' + ASTGUI.contexts.dialtrunks + ',${}/${EXTEN:1}, , , )' );
-
- x.new_action('delcat', 'CallingRule_IAXTEL', '', '');
- x.new_action('newcat', 'CallingRule_IAXTEL', '', '');
- x.new_action('append', 'CallingRule_IAXTEL', 'exten', '_91700XXXXXXX!,1,Macro(' + ASTGUI.contexts.dialtrunks + ',${}/${EXTEN:1}, , , )' );
-
- x.new_action('delcat', 'CallingRule_Local_AreaCode', '', '');
- x.new_action('newcat', 'CallingRule_Local_AreaCode', '', '');
- x.new_action('append', 'CallingRule_Local_AreaCode', 'exten', '_9256XXXXXXX!,1,Macro(' + ASTGUI.contexts.dialtrunks + ',${}/${EXTEN:4}, , , )' );
-
- x.new_action('delcat', 'CallingRule_International', '', '');
- x.new_action('newcat', 'CallingRule_International', '', '');
- x.new_action('append', 'CallingRule_International', 'exten', '_9011XXXXX.,1,Macro(' + ASTGUI.contexts.dialtrunks + ',${}/${EXTEN:1}, , , )' );
-
- x.new_action('delcat', 'CallingRule_Local_7_digits', '', '');
- x.new_action('newcat', 'CallingRule_Local_7_digits', '', '');
- x.new_action('append', 'CallingRule_Local_7_digits', 'exten', '_9XXXXXXX!,1,Macro(' + ASTGUI.contexts.dialtrunks + ',${}/${EXTEN:1}, , , )' );
-
- x.new_action('delcat', 'CallingRule_Emergency', '', '');
- x.new_action('newcat', 'CallingRule_Emergency', '', '');
- x.new_action('append', 'CallingRule_Emergency', 'exten', '_911!,1,Macro(' + ASTGUI.contexts.dialtrunks + ',${}/${EXTEN:0}, , , )' );
-
-
- x.callActions(function(){
- ASTGUI.feedback( { msg : "Restored 'default Calling Rules' !", showfor: 3, color:'red' });
- alert( "Restored 'default Calling Rules' !" + '\n' + 'The gui will now reload' );
- top.window.location.reload();
- });
-};
-
-
-var new_crl_save_go = function(){
- if ( !ASTGUI.validateFields( [ DOM_new_crl_name, DOM_new_crl_pattern, 'new_crl_tr_stripx' , 'new_crl_tr_prepend' , 'new_crl_fotr_stripx' , 'new_crl_fotr_prepend' ] ) ){
- return ;
- }
-
- if( _$('toLocalDest').checked ){
- if ( !ASTGUI.checkRequiredFields([DOM_new_crl_name, DOM_new_crl_pattern]) ){
- return ;
- }
- if( !_$('new_crl_localDest').value ){
- ASTGUI.feedback( { msg:'select a destination !', showfor:2, color:'red' });
- return ;
- }
- }else{
- if ( !ASTGUI.checkRequiredFields([DOM_new_crl_name, DOM_new_crl_pattern, DOM_new_crl_trunk ]) ){
- return ;
- }
- }
-
- if(_$('new_crl_foChkbx').checked){
- if ( !ASTGUI.checkRequiredFields([DOM_new_crl_fotrunk]) ){
- return ;
- }
- }
-
- if( _$('toLocalDest').checked ){
- var as = DOM_new_crl_pattern.value + ',1,' + ASTGUI.getFieldValue('new_crl_localDest') ;
- }else{
- var t1 = ASTGUI.getFieldValue(DOM_new_crl_trunk);
- var t2 = ASTGUI.getFieldValue(DOM_new_crl_fotrunk);
- if( _$('new_crl_foChkbx').checked && t1 == t2 ){
- ASTGUI.feedback( { msg:'Failover trunk can not be same as the primary trunk !', showfor: 3, color:'red' });
- DOM_new_crl_fotrunk.focus();
- return ;
- }
-
- var tmp_stripx = DOM_new_crl_tr_stripx.value || '0' ;
- var tmp_fotr_stripx = DOM_new_crl_fotr_stripx.value || '0' ;
- var tmp_checkThis = ( DOM_new_crl_pattern.value.beginsWith('_') ) ? DOM_new_crl_pattern.value.length -1 : DOM_new_crl_pattern.value.length ;
-
- if( Number(tmp_stripx) > tmp_checkThis ){
- ASTGUI.feedback( { msg:'You can not strip more digits than in the pattern !', showfor: 3, color:'red' });
- DOM_new_crl_tr_stripx.focus();
- return ;
- }
-
- if( DOM_new_crl_foChkbx.checked && Number(tmp_fotr_stripx) > tmp_checkThis ){
- ASTGUI.feedback( { msg:'You can not strip more digits than in the pattern !', showfor: 3, color:'red' });
- DOM_new_crl_fotr_stripx.focus();
- return ;
- }
-
- var Trunk_Build_str = ',${' + t1 + '}/' + DOM_new_crl_tr_prepend.value + '${EXTEN:' + tmp_stripx + '}' ;
- var foTrunk_Build_str = ',' ;
- if(DOM_new_crl_foChkbx.checked){
- foTrunk_Build_str += '${' + t2 + '}/' + DOM_new_crl_fotr_prepend.value + '${EXTEN:' + tmp_fotr_stripx + '}' ;
- }
-
- var t1 = ',' + t1 ;
- var t2 = ',' + t2 ;
- var as = DOM_new_crl_pattern.value + ',1,Macro(' + ASTGUI.contexts.dialtrunks + Trunk_Build_str + foTrunk_Build_str + t1 + t2 + ')' ;
- }
-
- if( isNew ){
- parent.astgui_manageCallingRules.createCallingRule( DOM_new_crl_name.value , as)
- ASTGUI.feedback( { msg:'CallingRule Created !', showfor:2, color:'green' });
- window.location.reload();
- }else{
- //parent.astgui_manageCallingRules.update( EDIT_CR, DOM_new_crl_name.value , cr_object ) ;
- parent.ASTGUI.dialog.waitWhile(' Updating ...');
- parent.astgui_manageCallingRules.updateCallingRule( EDIT_CR, EDIT_CR_RULE, as )
- ASTGUI.feedback( { msg:'Calling Rule Updated !', showfor:2, color:'green' });
- parent.ASTGUI.dialog.hide();
- window.location.reload();
- }
-};
-
-var delete_CR_confirm = function(a,b){
- if( !confirm('Delete Calling Rule ?') ) return;
- parent.astgui_manageCallingRules.deleteCallingRule(a,b);
- ASTGUI.feedback( { msg:'Calling Rule Deleted !', showfor:2, color:'red' });
- window.location.reload();
-};
-
-</script>
+
<body bgcolor="EFEFEF">
<div class="iframeTitleBar">
Manage Calling Rules
Modified: team/rbrindley/welcome_revamp/config/cdr.html
URL: http://svn.digium.com/view/asterisk-gui/team/rbrindley/welcome_revamp/config/cdr.html?view=diff&rev=4162&r1=4161&r2=4162
==============================================================================
--- team/rbrindley/welcome_revamp/config/cdr.html (original)
+++ team/rbrindley/welcome_revamp/config/cdr.html Thu Nov 20 14:21:56 2008
@@ -21,6 +21,7 @@
-->
<script src="js/jquery.js"></script>
<script src="js/astman.js"></script>
+<script src="js/cdr.js"></script>
<script src="js/jquery.tooltip.js"></script>
<script src="js/jquery.fixedheader.js"></script> <!-- OPTIONAL, for fixed table header. Need not be present -->
<link href="stylesheets/schwing.css" media="all" rel="Stylesheet" type="text/css" />
@@ -55,410 +56,7 @@
}
</style>
-<script type="text/javascript">
-//<![CDATA[
- var backend = "CDR-CSV";
- var records = [];
- var viewCount = 25; /* number of CDR rows displayed at once */
- var offset = 0; /* index into CDR records for first row of current display */
- var fields = [ /* Table column header text */
- "",
- "Account Code", "Source", "Destination", "Dest. Context",
- "Caller ID", "Channel", "Dest. Channel", "Last app.",
- "Last data", "Start time", "Answer Time", "End Time",
- "Duration", "Billable seconds", "Disposition", "AMA flags",
- "Unique ID", "Log userfield"
- ];
- var svindex = [ /* which field to display for short version, add 1 to get index into headers */
- /* use as-is for index into CDR record fields */
- /* -1 is special case for first column (black header, 1..n for each row) */
- -1, 9, 12, 1, 2, 4, 14
- ];
- var longversion = false; /* long version displays all CDR-CSV fields, short only those selected above */
- var sortby = 0; /* Which column (CDR field) to sort the displayed CDR list by. */
- /* negative means descending. Subtract 1 to get index into the records fields array */
- var maxColumns = 0; /* maximum number of columns found in CDR records */
-
- var recordsInbound = [];
- var recordsOutbound = [];
- var recordsInternal = [];
- var recordsExternal = [];
- var recordsSystem = [];
- var uniqueIDs = [];
- var recordsSelected = [];
-
- var showSystemCalls = false; /* don't display CDR records with destination of "asterisk_guitools" */
- var showOutboundCalls = true;
[... 11845 lines stripped ...]
More information about the asterisk-gui-commits
mailing list