diff --git a/Sccp_manager.class.php b/Sccp_manager.class.php index 946691c..d573a3f 100644 --- a/Sccp_manager.class.php +++ b/Sccp_manager.class.php @@ -69,8 +69,6 @@ * + dir "templates" * + dir "firmware" * + dir "locales" - * + Create Simple User Interface - * + sccpsimple.xml * + Add error information on the server information page (critical display error - the system can not work correctly) * - Add Warning Information on Server Info Page * - ADD Reload Line @@ -380,7 +378,7 @@ class Sccp_manager extends \FreePBX_Helpers implements \BMO { 'monitor' => array('name' => 'Record Calls', 'value' => '') ); - // $lines_list = $this->dbinterface->HWextension_db_SccpTableData('SccpExtension'); + // $lines_list = $this->dbinterface->getSccpDeviceTableData('SccpExtension'); $max_btn = ((!empty($get_settings['buttonscount']) ? $get_settings['buttonscount'] : 100)); $last_btn = $max_btn; for ($it = $max_btn; $it >= 0; $it--) { @@ -425,7 +423,7 @@ class Sccp_manager extends \FreePBX_Helpers implements \BMO { case 'monitor': $btn_t = 'speeddial'; $btn_opt = (string) $get_settings['button' . $it . '_line']; - $db_res = $this->dbinterface->HWextension_db_SccpTableData('SccpExtension', array('name' => $btn_opt)); + $db_res = $this->dbinterface->getSccpDeviceTableData('SccpExtension', array('name' => $btn_opt)); $btn_n = $db_res[0]['label']; $btn_opt .= ',' . $btn_opt . $this->hint_context['default']; break; @@ -496,7 +494,7 @@ class Sccp_manager extends \FreePBX_Helpers implements \BMO { $save_settings = array(); $save_codec = array(); $name_dev = ''; - $db_field = $this->dbinterface->HWextension_db_SccpTableData("get_columns_sccpdevice"); + $db_field = $this->dbinterface->getSccpDeviceTableData("get_columns_sccpdevice"); $hw_id = (empty($get_settings['sccp_deviceid'])) ? 'new' : $get_settings['sccp_deviceid']; $hw_type = (empty($get_settings['sccp_device_typeid'])) ? 'sccpdevice' : $get_settings['sccp_device_typeid']; $update_hw = ($hw_id == 'new') ? 'add' : 'clear'; // Possible values are delete, replace, add, clear. @@ -623,7 +621,7 @@ class Sccp_manager extends \FreePBX_Helpers implements \BMO { $save_buttons = array(); $save_settings = array(); $name_dev = ''; - $db_field = $this->dbinterface->HWextension_db_SccpTableData("get_columns_sccpuser"); + $db_field = $this->dbinterface->getSccpDeviceTableData("get_columns_sccpuser"); $hw_prefix = 'SEP'; $name_dev = $get_settings[$hdr_prefix . 'id']; $save_buttons = $this->getPhoneButtons($get_settings, $name_dev, 'sccpline'); @@ -977,13 +975,13 @@ class Sccp_manager extends \FreePBX_Helpers implements \BMO { if (!empty($hw_list)) { $buton_list = array(); foreach ($hw_list as $value) { - $buton_tmp = $this->dbinterface->HWextension_db_SccpTableData("get_sccpdevice_buttons", array('buttontype' => 'speeddial', 'id' => $value['name'])); + $buton_tmp = $this->dbinterface->getSccpDeviceTableData("get_sccpdevice_buttons", array('buttontype' => 'speeddial', 'id' => $value['name'])); if (!empty($buton_tmp)) { $buton_list = array_merge($buton_list, $buton_tmp); } } } else { - $buton_list = $this->dbinterface->HWextension_db_SccpTableData("get_sccpdevice_buttons", array('buttontype' => 'speeddial')); + $buton_list = $this->dbinterface->getSccpDeviceTableData("get_sccpdevice_buttons", array('buttontype' => 'speeddial')); } if (empty($buton_list)) { return array('Response' => ' 0 buttons found ', 'data' => ''); @@ -1062,13 +1060,13 @@ class Sccp_manager extends \FreePBX_Helpers implements \BMO { $data_value = array(); $dev_line_data = null; - $dev_config = $this->dbinterface->HWextension_db_SccpTableData("get_sccpdevice_byid", array('id' => $dev_id)); + $dev_config = $this->dbinterface->getSccpDeviceTableData("get_sccpdevice_byid", array('id' => $dev_id)); // Support Cisco Sip Device if (!empty($dev_config['type'])) { if (strpos($dev_config['type'], 'sip') !== false) { $sccp_native = false; $tmp_bind = $this->sipconfigs->getSipConfig(); - $dev_ext_config = $this->dbinterface->HWextension_db_SccpTableData("SccpDevice", array('name' => $dev_id, 'fields' => 'sip_ext')); + $dev_ext_config = $this->dbinterface->getSccpDeviceTableData("SccpDevice", array('name' => $dev_id, 'fields' => 'sip_ext')); $data_value = array_merge($data_value, $dev_ext_config); $data_tmp = explode(';', $dev_ext_config['sip_lines']); $data_value['sbind'] = array(); @@ -1344,7 +1342,7 @@ class Sccp_manager extends \FreePBX_Helpers implements \BMO { } // Update info from sccp_db - $tmp_data = $this->dbinterface->HWextension_db_SccpTableData('SccpExtension'); + $tmp_data = $this->dbinterface->getSccpDeviceTableData('SccpExtension'); foreach ($tmp_data as $value) { $name_l = $value['name']; if (!empty($res[$name_l . $default_hint])) { diff --git a/sccpManClasses/dbinterface.class.php b/sccpManClasses/dbinterface.class.php index 322115b..8a9eaaa 100644 --- a/sccpManClasses/dbinterface.class.php +++ b/sccpManClasses/dbinterface.class.php @@ -32,7 +32,7 @@ class dbinterface public function get_db_SccpTableByID($dataid, $data = array(), $indexField = '') { $result = array(); - $raw = $this->HWextension_db_SccpTableData($dataid, $data); + $raw = $this->getSccpDeviceTableData($dataid, $data); if (empty($raw) || empty($indexField)) { return $raw; } @@ -43,7 +43,7 @@ class dbinterface return $result; } - public function HWextension_db_SccpTableData($dataid, $data = array()) + public function getSccpDeviceTableData($dataid, $data = array()) { // $stmt is a single row fetch, $stmts is a fetchAll. $dbh = \FreePBX::Database(); diff --git a/sccpManClasses/xmlinterface.class.php b/sccpManClasses/xmlinterface.class.php index d1ea593..14464b8 100644 --- a/sccpManClasses/xmlinterface.class.php +++ b/sccpManClasses/xmlinterface.class.php @@ -417,7 +417,7 @@ class xmlinterface 'phoneServices' => 'null', 'certHash' => 'null', 'deviceProtocol' => 'SIP', 'deviceSecurityMode' => '1'); -// $var_hw_config = $this->dbinterface->HWextension_db_SccpTableData("get_sccpdevice_byid", array('id' => $dev_id)); +// $var_hw_config = $this->dbinterface->getSccpDeviceTableData("get_sccpdevice_byid", array('id' => $dev_id)); if (empty($dev_config)) { return false; diff --git a/sccpManTraits/ajaxHelper.php b/sccpManTraits/ajaxHelper.php index 8e7befb..29c89b1 100644 --- a/sccpManTraits/ajaxHelper.php +++ b/sccpManTraits/ajaxHelper.php @@ -114,7 +114,7 @@ trait ajaxHelper { } } else { $this->deleteSccpDeviceXML('all'); - $models = $this->dbinterface->HWextension_db_SccpTableData("SccpDevice"); + $models = $this->dbinterface->getSccpDeviceTableData("SccpDevice"); } $this->createDefaultSccpXml(); // Default XML @@ -289,7 +289,7 @@ trait ajaxHelper { return $result; break; case 'getExtensionGrid': - $result = $this->dbinterface->HWextension_db_SccpTableData('SccpExtension'); + $result = $this->dbinterface->getSccpDeviceTableData('SccpExtension'); if (empty($result)) { return array(); } @@ -300,7 +300,7 @@ trait ajaxHelper { $cmd_type = !empty($request['type']) ? $request['type'] : ''; // Find all devices defined in the database - $dbDevices = $this->dbinterface->HWextension_db_SccpTableData('SccpDevice', array('type' => $cmd_type)); + $dbDevices = $this->dbinterface->getSccpDeviceTableData('SccpDevice', array('type' => $cmd_type)); // Return if only interested in SIP devices if ($cmd_type == 'cisco-sip') { return $dbDevices; //this may be empty diff --git a/sccpManTraits/helperFunctions.php b/sccpManTraits/helperFunctions.php index a25e516..7ff9ba5 100644 --- a/sccpManTraits/helperFunctions.php +++ b/sccpManTraits/helperFunctions.php @@ -72,7 +72,7 @@ trait helperfunctions { private function getTableDefaults($table, $trim_underscore = true) { $def_val = array(); // TODO: This is ugly and overkill - needs to be cleaned up in dbinterface - $sccpTableDesc = $this->dbinterface->HWextension_db_SccpTableData("get_columns_{$table}"); + $sccpTableDesc = $this->dbinterface->getSccpDeviceTableData("get_columns_{$table}"); foreach ($sccpTableDesc as $data) { $key = (string) $data['Field']; @@ -90,7 +90,7 @@ trait helperfunctions { private function getTableEnums($table, $trim_underscore = true) { $enumFields = array(); - $sccpTableDesc = $this->dbinterface->HWextension_db_SccpTableData("get_columns_{$table}"); + $sccpTableDesc = $this->dbinterface->getSccpDeviceTableData("get_columns_{$table}"); foreach ($sccpTableDesc as $data) { $key = (string) $data['Field']; diff --git a/views/form.adddevice.php b/views/form.adddevice.php index 369e381..ffa1ef5 100644 --- a/views/form.adddevice.php +++ b/views/form.adddevice.php @@ -19,7 +19,7 @@ if (!empty($_REQUEST['new_id'])) { $dev_id = $_REQUEST['new_id']; // Get device defaults from db - $sccpDeviceDesc = $this->dbinterface->HWextension_db_SccpTableData('get_columns_sccpdevice'); + $sccpDeviceDesc = $this->dbinterface->getSccpDeviceTableData('get_columns_sccpdevice'); foreach ($sccpDeviceDesc as $data) { $key = (string) $data['Field']; @@ -43,7 +43,7 @@ if (!empty($_REQUEST['id'])) { // Editing an existing Device. Overwrite any defaults that are already set for this device. $dev_id = $_REQUEST['id']; $dev_new = $dev_id; - $db_res = $this->dbinterface->HWextension_db_SccpTableData('get_sccpdevice_byid', array("id" => $dev_id)); + $db_res = $this->dbinterface->getSccpDeviceTableData('get_sccpdevice_byid', array("id" => $dev_id)); foreach ($db_res as $key => $val) { if (!empty($val)) { switch ($key) { diff --git a/views/form.addruser.php b/views/form.addruser.php index 898d4d3..4995e02 100644 --- a/views/form.addruser.php +++ b/views/form.addruser.php @@ -11,7 +11,7 @@ $dev_new = null; if (!empty($_REQUEST['ru_id'])) { $dev_id = $_REQUEST['ru_id']; $def_val['id'] = array("keyword" => 'id', "data" => $dev_id, "seq" => "99"); - $db_res = $this->dbinterface->HWextension_db_SccpTableData('get_sccpuser', array("id" => $dev_id)); + $db_res = $this->dbinterface->getSccpDeviceTableData('get_sccpuser', array("id" => $dev_id)); if (!empty($db_res)) { foreach ($db_res as $key => $val) { if (!empty($val)) { diff --git a/views/form.addsdevice.php b/views/form.addsdevice.php index 1c0e38c..5b09bf8 100644 --- a/views/form.addsdevice.php +++ b/views/form.addsdevice.php @@ -29,7 +29,7 @@ if (!empty($_REQUEST['new_id'])) { if (!empty($_REQUEST['id'])) { $dev_id = $_REQUEST['id']; $dev_new = $dev_id; - $db_res = $this->dbinterface->HWextension_db_SccpTableData('get_sccpdevice_byid', array("id" => $dev_id)); + $db_res = $this->dbinterface->getSccpDeviceTableData('get_sccpdevice_byid', array("id" => $dev_id)); foreach ($db_res as $key => $val) { if (!empty($val)) { switch ($key) { @@ -70,14 +70,14 @@ if (!empty($_REQUEST['id'])) { } } //print_r($db_res); - + if (!empty($device_warning)) { - ?> + ?>