diff --git a/Sccp_manager.class.php b/Sccp_manager.class.php index 245e17b..7b444fd 100644 --- a/Sccp_manager.class.php +++ b/Sccp_manager.class.php @@ -91,7 +91,7 @@ class Sccp_manager extends \FreePBX_Helpers implements \BMO { // private $SCCP_LANG_DICTIONARY = 'SCCP-dictionary.xml'; // CISCO LANG file search in /tftp-path private $SCCP_LANG_DICTIONARY = 'be-sccp.jar'; // CISCO LANG file search in /tftp-path private $pagedata = null; - private $sccp_driver_ver = '11.3'; + private $sccp_driver_ver = '11.3'; // Ver fore SCCP.CLASS.PHP public $sccp_manager_ver = '13.0.0.4'; private $tftpLang = array(); // private $hint_context = '@ext-local'; /// !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! Get it from Config !!! @@ -583,6 +583,7 @@ class Sccp_manager extends \FreePBX_Helpers implements \BMO { public function ajaxRequest($req, &$setting) { switch ($req) { + case 'backupsettings': case 'savesettings': case 'save_hardware': case 'save_dialplan_template': @@ -896,6 +897,35 @@ class Sccp_manager extends \FreePBX_Helpers implements \BMO { return $result; break; // ------------------------------- Old deviece suport - In the development--- + case 'backupsettings': + global $amp_conf; + $backup_files = array( $amp_conf['ASTETCDIR'].'/sccp.conf', $amp_conf['ASTETCDIR'].'/extensions_additional.conf', $amp_conf['ASTETCDIR'].'/extconfig.conf'); + + $result = $this->dbinterface->dump_sccp_tables($this->sccppath["tftp_path"],$amp_conf['AMPDBNAME'], $amp_conf['AMPDBUSER'], $amp_conf['AMPDBPASS']); + $backup_files[] = $result; + + $zip = new \ZipArchive(); + $filename = $result.".zip"; + if ($zip->open($filename, \ZIPARCHIVE::CREATE)) { + foreach ($backup_files as $file) { + $zip->addFile($file); + } + $zip->close(); + } + + $file_name = basename($filename); + + header("Content-Type: application/zip"); + header("Content-Disposition: attachment; filename=$file_name"); + header("Content-Length: " . filesize($filename)); + + readfile($filename); + unlink($result); + unlink($filename); +// return array('status' => false, 'message' => $result); + // return $result; + break; + } } diff --git a/Sccp_manager.inc/dbinterface.class.php b/Sccp_manager.inc/dbinterface.class.php index eb7b7d9..ebeaea5 100644 --- a/Sccp_manager.inc/dbinterface.class.php +++ b/Sccp_manager.inc/dbinterface.class.php @@ -210,5 +210,14 @@ class dbinterface { } return $result; } + /* + * Replace by SccpTables !!!! + * + */ + public function dump_sccp_tables($data_path, $database, $user, $pass ) { + $filename = $data_path.'/sccp_backup_'.date('G_a_m_d_y').'.sql'; + $result = exec('mysqldump '.$database.' --password='.$pass.' --user='.$user.' --single-transaction >'.$filename ,$output); + return $filename; + } } diff --git a/Sccp_manager.inc/srvinterface.class.php b/Sccp_manager.inc/srvinterface.class.php index c6a09f5..c09e773 100644 --- a/Sccp_manager.inc/srvinterface.class.php +++ b/Sccp_manager.inc/srvinterface.class.php @@ -587,7 +587,7 @@ class srvinterface { } } } else { - return $result; + return $result; return array(); } } diff --git a/assets/js/sccp_manager.js b/assets/js/sccp_manager.js index 8d29366..84b3575 100644 --- a/assets/js/sccp_manager.js +++ b/assets/js/sccp_manager.js @@ -24,6 +24,37 @@ $(document).ready(function () { } }); +/* + $('#ajaxbackup').on('click', function (e) { + var vdata = ''; + var snd_command = 'backupsettings'; + $('.fpbx-submit').each(function () { + vdata = vdata + $(this).serialize() + '&'; + }); + + $.ajax({ + type: 'POST', + url: 'ajax.php?module=sccp_manager&command=' + snd_command, + data: vdata, + success: function (data) { + if (data.status === true) { + if (data.message) { + alert(data.message); + } else { + alert('Data Save'); + } + } else { + if (Array.isArray(data.message)) { + data.message.forEach(function (entry) { + fpbxToast(entry, 'error', 'error'); + }); + } + } + } + }); + + }); +*/ $('#ajaxsubmit2').on('click', function (e) { var vdata = ''; var snd_command = 'savesettings'; diff --git a/conf/sccpgeneral.xml.v433 b/conf/sccpgeneral.xml.v433 index 1e5c5d7..665a4ac 100644 --- a/conf/sccpgeneral.xml.v433 +++ b/conf/sccpgeneral.xml.v433 @@ -419,6 +419,14 @@ and open the template in the editor. Base Version before all crash :-) Do Not Disturb. Default is Off + + transfer + + on + + + Allow the use of the transfer feature + @@ -1127,7 +1135,8 @@ and open the template in the editor. Base Version before all crash :-) transfer - off + NONE + Transfer allowed diff --git a/conf/sccpsimple.xml.v433 b/conf/sccpsimple.xml.v433 index 23d8a6c..da625af 100644 --- a/conf/sccpsimple.xml.v433 +++ b/conf/sccpsimple.xml.v433 @@ -620,6 +620,15 @@ and open the template in the editor. Base Version before all crash :-) Do Not Disturb. Default is Off + + transfer + + on + + + Allow the use of the transfer feature + + @@ -1155,7 +1164,8 @@ and open the template in the editor. Base Version before all crash :-) transfer - off + NONE + Transfer allowed diff --git a/install.php b/install.php index a1b1147..42052df 100644 --- a/install.php +++ b/install.php @@ -1,5 +1,11 @@ array('create' => 'VARCHAR(100) NULL DEFAULT NULL', 'modify' => "VARCHAR(100)"), 'backgroundImage' => array('create' => 'VARCHAR(255) NULL DEFAULT NULL', 'modify' => "VARCHAR(255)"), 'ringtone' => array('create' => 'VARCHAR(255) NULL DEFAULT NULL', 'modify' => "VARCHAR(255)"), - 'transfer' => array('create' => "enum('on','off') NOT NULL default 'on'", 'modify' => "enum('on','off')"), + 'transfer' => array('create' => "enum('on','off') NULL default NULL", 'modify' => "enum('on','off')"), 'cfwdall' => array('create' => "enum('on','off') NULL default 'on'", 'modify' => "enum('on','off')"), 'cfwdbusy' => array('create' => "enum('on','off') NULL default 'on'", 'modify' => "enum('on','off')"), 'directrtp' => array('create' => "enum('on','off') NULL default NULL", 'modify' => "enum('on','off')"), @@ -276,7 +282,7 @@ function Get_DB_config($sccp_compatible) { 'video_tos' => array('drop' => "yes"), 'video_cos' => array('drop' => "yes"), 'incominglimit' => array('create' => "INT(11) DEFAULT '6'", 'modify' => 'INT(11)', 'def_modify' => "6"), - 'transfer' => array('create' => "enum('on','off') NOT NULL default 'on'", 'modify' => "enum('on','off')"), + 'transfer' => array('create' => "enum('on','off') NULL default NULL", 'modify' => "enum('on','off')"), 'vmnum' => array('def_modify' => "*97"), 'musicclass' => array('def_modify' => "default"), 'id' => array('create' => 'MEDIUMINT(9) NOT NULL AUTO_INCREMENT, ADD UNIQUE(id);', 'modify' => "MEDIUMINT(9)", 'index' => 'id'), diff --git a/views/form.buttons.php b/views/form.buttons.php index 03ff59b..2bd8663 100644 --- a/views/form.buttons.php +++ b/views/form.buttons.php @@ -16,8 +16,23 @@ $feature_list= array('parkinglot'=>'Park Slots','monitor'=> "Record Calls",'dev $lines_list = $this->dbinterface->get_db_SccpTableData('SccpExtension'); //$hint_list = $this->dbinterface->get_db_SccpTableData('SccpExtension'); -$hint_list = $this->get_hint_info(); +$data_sort = Array(); +$hint_list1 = $this->get_hint_info(); +foreach ($hint_list1 as $key => $value) { + $data_sort[$value['name']] = $key; +} +ksort($data_sort); +//print_r(count($data_sort)); +//print_r(count($hint_list1)); +foreach ($data_sort as $key => $value) { + $hint_list[$value] = $hint_list1[$value]; +} + + +//print_r($hint_list); +//ksort($hint_list); +//natsort($hint_list); $line_id =0; $max_buttons =56; $show_buttons =1; @@ -125,8 +140,7 @@ if (!empty($_REQUEST['new_id'])) { } } else { $defaul_btn = $data_i; - } - + } } } diff --git a/views/server.info.php b/views/server.info.php index 6d92deb..b5b0c1d 100644 --- a/views/server.info.php +++ b/views/server.info.php @@ -71,18 +71,20 @@ if (empty($conf_realtime)) { } } /* + global $amp_conf; print_r("
Request:
");
  $json = '';
  print_r("
"); print_r("
"); print_r("
"); - print_r($this->srvinterface->sccp_realtime_status()); + print_r($amp_conf); print_r("DIRECT START"); print_r("
"); // print_r($this->srvinterface->t_get_meta_data()); - print_r($this->extconfigs->validate_RealTime()); + //print_r($this->extconfigs->validate_RealTime()); print("
"); */ + // $lang_arr = $this->extconfigs->getextConfig('sccp_lang','sk_SK'); // print_r('
'); // print_r(timezone_identifiers_list()); @@ -130,7 +132,9 @@ if (!empty($this->class_error)) { +   + ShowGroup('sccp_info',0); ?>