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)) { - ?> + ?>

Warning in the SCCP Device

-
+
$value) { echo '

'.$key.'

'; @@ -101,7 +101,7 @@ if (!empty($device_warning)) { - + showGroup('sccp_hw_dev_pickup', 1, 'sccp_hw', $def_val); // echo $this->showGroup('sccp_hw_dev_conference', 1, 'sccp_hw', $def_val); // echo $this->showGroup('sccp_hw_dev_network', 1, 'sccp_hw', $def_val); - ?> + ?> diff --git a/views/form.buttons.php b/views/form.buttons.php index 5708d12..2a7e3b2 100644 --- a/views/form.buttons.php +++ b/views/form.buttons.php @@ -19,8 +19,8 @@ $feature_list= array('parkinglot'=>'Park Slots','monitor'=> "Record Calls",'dev */ -$lines_list = $this->dbinterface->HWextension_db_SccpTableData('SccpExtension'); -//$hint_list = $this->dbinterface->HWextension_db_SccpTableData('SccpExtension'); +$lines_list = $this->dbinterface->getSccpDeviceTableData('SccpExtension'); +//$hint_list = $this->dbinterface->getSccpDeviceTableData('SccpExtension'); $hint_list = $this->getHintInformation(true, array('context'=>'park-hints')) ; // print_r($hint_list); @@ -30,8 +30,8 @@ $show_buttons =1; //print_r($hint_list); if (!empty($_REQUEST['id'])) { $dev_id = $_REQUEST['id']; - $db_buttons = $this->dbinterface->HWextension_db_SccpTableData('get_sccpdevice_buttons', array("id" => $dev_id)); - $db_device = $this->dbinterface->HWextension_db_SccpTableData('get_sccpdevice_byid', array("id" => $dev_id)); + $db_buttons = $this->dbinterface->getSccpDeviceTableData('get_sccpdevice_buttons', array("id" => $dev_id)); + $db_device = $this->dbinterface->getSccpDeviceTableData('get_sccpdevice_byid', array("id" => $dev_id)); $max_buttons = $db_device['buttons']; if (!empty($db_device['addon_buttons'])) { $max_buttons += $db_device['addon_buttons']; @@ -41,7 +41,7 @@ if (!empty($_REQUEST['id'])) { if (!empty($_REQUEST['new_id'])) { $val = $_REQUEST['type']; $dev_schema = $this-> getSccpModelInformation('byid', false, "all", array('model' =>$val)); -// $db_device = $this->dbinterface->HWextension_db_SccpTableData('get_sccpdevice_byid', array("id" => $val)); +// $db_device = $this->dbinterface->getSccpDeviceTableData('get_sccpdevice_byid', array("id" => $val)); $max_buttons = $dev_schema[0]['buttons']; if (!empty($_REQUEST['addon'])) { $val = $_REQUEST['addon']; @@ -52,7 +52,7 @@ if (!empty($_REQUEST['new_id'])) { } if (!empty($_REQUEST['ru_id'])) { $dev_id = $_REQUEST['ru_id']; - $db_buttons = $this->dbinterface->HWextension_db_SccpTableData('get_sccpdevice_buttons', array("id" => $dev_id)); + $db_buttons = $this->dbinterface->getSccpDeviceTableData('get_sccpdevice_buttons', array("id" => $dev_id)); $show_buttons = $max_buttons; } diff --git a/views/form.sbuttons.php b/views/form.sbuttons.php index fc60738..26cf03c 100644 --- a/views/form.sbuttons.php +++ b/views/form.sbuttons.php @@ -15,9 +15,9 @@ $forminfo =array( $buttons_type= array('empty','line','speeddial'); $feature_list= array('parkinglot'=>'Park Slots','monitor'=> 'Record Calls','devstate'=> 'Change Status'); -//$lines_list = $this->dbinterface->HWextension_db_SccpTableData('SccpExtension'); +//$lines_list = $this->dbinterface->getSccpDeviceTableData('SccpExtension'); $lines_list = $this->sipconfigs->get_db_sip_TableData('Device'); -//$hint_list = $this->dbinterface->HWextension_db_SccpTableData('SccpExtension'); +//$hint_list = $this->dbinterface->getSccpDeviceTableData('SccpExtension'); $hint_list = $this->getHintInformation(true, array('context'=>'park-hints')) ; // print_r($lines_list); @@ -27,8 +27,8 @@ $show_buttons =1; //print_r($hint_list); if (!empty($_REQUEST['id'])) { $dev_id = $_REQUEST['id']; - $db_buttons = $this->dbinterface->HWextension_db_SccpTableData('get_sccpdevice_buttons', array('id' => $dev_id)); - $db_device = $this->dbinterface->HWextension_db_SccpTableData('get_sccpdevice_byid', array('id' => $dev_id)); + $db_buttons = $this->dbinterface->getSccpDeviceTableData('get_sccpdevice_buttons', array('id' => $dev_id)); + $db_device = $this->dbinterface->getSccpDeviceTableData('get_sccpdevice_byid', array('id' => $dev_id)); $max_buttons = $db_device['buttons']; if (!empty($db_device['addon_buttons'])) { $max_buttons += $db_device['addon_buttons']; @@ -38,7 +38,7 @@ if (!empty($_REQUEST['id'])) { if (!empty($_REQUEST['new_id'])) { $val = $_REQUEST['type']; $dev_schema = $this-> getSccpModelInformation('byid', false, 'all', array('model' =>$val)); -// $db_device = $this->dbinterface->HWextension_db_SccpTableData('get_sccpdevice_byid', array("id" => $val)); +// $db_device = $this->dbinterface->getSccpDeviceTableData('get_sccpdevice_byid', array("id" => $val)); $max_buttons = $dev_schema[0]['buttons']; if (!empty($_REQUEST['addon'])) { $val = $_REQUEST['addon']; @@ -49,7 +49,7 @@ if (!empty($_REQUEST['new_id'])) { } if (!empty($_REQUEST['ru_id'])) { $dev_id = $_REQUEST['ru_id']; - $db_buttons = $this->dbinterface->HWextension_db_SccpTableData('get_sccpdevice_buttons', array('id' => $dev_id)); + $db_buttons = $this->dbinterface->getSccpDeviceTableData('get_sccpdevice_buttons', array('id' => $dev_id)); $show_buttons = $max_buttons; } diff --git a/views/formShow.php b/views/formShow.php index 8fa80e2..e06aa9e 100644 --- a/views/formShow.php +++ b/views/formShow.php @@ -649,19 +649,19 @@ foreach ($items as $child) { } if ($child['type'] == 'SDM') { if (empty($model_list)) { - $model_list = \FreePBX::Sccp_manager()->dbinterface->HWextension_db_SccpTableData("HWDevice"); + $model_list = \FreePBX::Sccp_manager()->dbinterface->getSccpDeviceTableData("HWDevice"); } $select_opt= $model_list; } if ($child['type'] == 'SDMS') { if (empty($model_list)) { - $model_list = \FreePBX::Sccp_manager()->dbinterface->HWextension_db_SccpTableData("HWSipDevice"); + $model_list = \FreePBX::Sccp_manager()->dbinterface->getSccpDeviceTableData("HWSipDevice"); } $select_opt= $model_list; } if ($child['type'] == 'SDE') { if (empty($extension_list)) { - $extension_list = \FreePBX::Sccp_manager()->dbinterface->HWextension_db_SccpTableData("HWextension"); + $extension_list = \FreePBX::Sccp_manager()->dbinterface->getSccpDeviceTableData("HWextension"); $extension_list[]=array( 'model' => 'NONE', 'vendor' => 'CISCO', 'dns' => '0'); foreach ($extension_list as &$data) { $d_name = explode(';', $data['model']); @@ -677,7 +677,7 @@ foreach ($items as $child) { } if ($child['type'] == 'SDD') { if (empty($device_list)) { - $device_list = \FreePBX::Sccp_manager()->dbinterface->HWextension_db_SccpTableData("SccpDevice"); + $device_list = \FreePBX::Sccp_manager()->dbinterface->getSccpDeviceTableData("SccpDevice"); $device_list[]=array('name' => 'NONE', 'description' => 'No Device'); } $select_opt = $device_list; diff --git a/views/server.codec.php b/views/server.codec.php index 4c5ded5..6c5e522 100644 --- a/views/server.codec.php +++ b/views/server.codec.php @@ -16,7 +16,7 @@ $sccp_disalow = $sccp_disalow_def; if (!empty($_REQUEST['id'])) { $dev_id = $_REQUEST['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)); if (!empty($db_res['allow'])) { $i = 1; foreach (explode(';', $db_res['allow']) as $c) {