-- Bug fix issues/74

This commit is contained in:
PhantomVl 2020-05-04 16:29:45 +03:00 committed by Diederik de Groot
parent 1637731d99
commit a3c240b63f
No known key found for this signature in database
GPG key ID: AFA728250A1BECD6
15 changed files with 80 additions and 62 deletions

View file

@ -741,7 +741,7 @@ class Sccp_manager extends \FreePBX_Helpers implements \BMO {
} }
} else { } else {
$this->deleteSccpDeviceXML('all'); $this->deleteSccpDeviceXML('all');
$models = $this->dbinterface->get_db_SccpTableData("SccpDevice"); $models = $this->dbinterface->HWextension_db_SccpTableData("SccpDevice");
} }
$this->createDefaultSccpXml(); // Default XML $this->createDefaultSccpXml(); // Default XML
@ -915,7 +915,7 @@ class Sccp_manager extends \FreePBX_Helpers implements \BMO {
return $result; return $result;
break; break;
case 'getExtensionGrid': case 'getExtensionGrid':
$result = $this->dbinterface->get_db_SccpTableData('SccpExtension'); $result = $this->dbinterface->HWextension_db_SccpTableData('SccpExtension');
if (empty($result)) { if (empty($result)) {
return array(); return array();
} }
@ -940,7 +940,7 @@ class Sccp_manager extends \FreePBX_Helpers implements \BMO {
case 'getPhoneGrid': case 'getPhoneGrid':
$cmd_type = !empty($request['type']) ? $request['type'] : ''; $cmd_type = !empty($request['type']) ? $request['type'] : '';
$result = $this->dbinterface->get_db_SccpTableData('SccpDevice', array('type' => $cmd_type)); $result = $this->dbinterface->HWextension_db_SccpTableData('SccpDevice', array('type' => $cmd_type));
if ($cmd_type == 'cisco-sip') { if ($cmd_type == 'cisco-sip') {
return $result; return $result;
} }
@ -1030,7 +1030,7 @@ class Sccp_manager extends \FreePBX_Helpers implements \BMO {
'monitor' => array('name' => 'Record Calls', 'value' => '') 'monitor' => array('name' => 'Record Calls', 'value' => '')
); );
// $lines_list = $this->dbinterface->get_db_SccpTableData('SccpExtension'); // $lines_list = $this->dbinterface->HWextension_db_SccpTableData('SccpExtension');
$max_btn = ((!empty($get_settings['buttonscount']) ? $get_settings['buttonscount'] : 100)); $max_btn = ((!empty($get_settings['buttonscount']) ? $get_settings['buttonscount'] : 100));
$last_btn = $max_btn; $last_btn = $max_btn;
for ($it = $max_btn; $it >= 0; $it--) { for ($it = $max_btn; $it >= 0; $it--) {
@ -1075,7 +1075,7 @@ class Sccp_manager extends \FreePBX_Helpers implements \BMO {
case 'monitor': case 'monitor':
$btn_t = 'speeddial'; $btn_t = 'speeddial';
$btn_opt = (string) $get_settings['button' . $it . '_line']; $btn_opt = (string) $get_settings['button' . $it . '_line'];
$db_res = $this->dbinterface->get_db_SccpTableData('SccpExtension', array('name' => $btn_opt)); $db_res = $this->dbinterface->HWextension_db_SccpTableData('SccpExtension', array('name' => $btn_opt));
$btn_n = $db_res[0]['label']; $btn_n = $db_res[0]['label'];
$btn_opt .= ',' . $btn_opt . $this->hint_context['default']; $btn_opt .= ',' . $btn_opt . $this->hint_context['default'];
break; break;
@ -1145,7 +1145,7 @@ class Sccp_manager extends \FreePBX_Helpers implements \BMO {
$save_settings = array(); $save_settings = array();
$save_codec = array(); $save_codec = array();
$name_dev = ''; $name_dev = '';
$db_field = $this->dbinterface->get_db_SccpTableData("get_colums_sccpdevice"); $db_field = $this->dbinterface->HWextension_db_SccpTableData("get_colums_sccpdevice");
$hw_id = (empty($get_settings['sccp_deviceid'])) ? 'new' : $get_settings['sccp_deviceid']; $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']; $hw_type = (empty($get_settings['sccp_device_typeid'])) ? 'sccpdevice' : $get_settings['sccp_device_typeid'];
$update_hw = ($hw_id == 'new') ? 'update' : 'clear'; $update_hw = ($hw_id == 'new') ? 'update' : 'clear';
@ -1384,7 +1384,7 @@ class Sccp_manager extends \FreePBX_Helpers implements \BMO {
); );
*/ */
$name_dev = ''; $name_dev = '';
$db_field = $this->dbinterface->get_db_SccpTableData("get_colums_sccpuser"); $db_field = $this->dbinterface->HWextension_db_SccpTableData("get_colums_sccpuser");
// $hw_id = (empty($get_settings['sccp_deviceid'])) ? 'new' : $get_settings['sccp_deviceid']; // $hw_id = (empty($get_settings['sccp_deviceid'])) ? 'new' : $get_settings['sccp_deviceid'];
// $update_hw = ($hw_id == 'new') ? 'update' : 'clear'; // $update_hw = ($hw_id == 'new') ? 'update' : 'clear';
$hw_prefix = 'SEP'; $hw_prefix = 'SEP';
@ -1806,13 +1806,13 @@ class Sccp_manager extends \FreePBX_Helpers implements \BMO {
if (!empty($hw_list)) { if (!empty($hw_list)) {
$buton_list = array(); $buton_list = array();
foreach ($hw_list as $value) { foreach ($hw_list as $value) {
$buton_tmp = $this->dbinterface->get_db_SccpTableData("get_sccpdevice_buttons", array('buttontype' => 'speeddial', 'id' => $value['name'])); $buton_tmp = $this->dbinterface->HWextension_db_SccpTableData("get_sccpdevice_buttons", array('buttontype' => 'speeddial', 'id' => $value['name']));
if (!empty($buton_tmp)) { if (!empty($buton_tmp)) {
$buton_list = array_merge($buton_list, $buton_tmp); $buton_list = array_merge($buton_list, $buton_tmp);
} }
} }
} else { } else {
$buton_list = $this->dbinterface->get_db_SccpTableData("get_sccpdevice_buttons", array('buttontype' => 'speeddial')); $buton_list = $this->dbinterface->HWextension_db_SccpTableData("get_sccpdevice_buttons", array('buttontype' => 'speeddial'));
} }
if (empty($buton_list)) { if (empty($buton_list)) {
return array('Response' => ' Found 0 device ', 'data' => ''); return array('Response' => ' Found 0 device ', 'data' => '');
@ -1897,13 +1897,13 @@ class Sccp_manager extends \FreePBX_Helpers implements \BMO {
$data_value = array(); $data_value = array();
$dev_line_data = null; $dev_line_data = null;
$dev_config = $this->dbinterface->get_db_SccpTableData("get_sccpdevice_byid", array('id' => $dev_id)); $dev_config = $this->dbinterface->HWextension_db_SccpTableData("get_sccpdevice_byid", array('id' => $dev_id));
// Support Cisco Sip Device // Support Cisco Sip Device
if (!empty($dev_config['type'])) { if (!empty($dev_config['type'])) {
if (strpos($dev_config['type'], 'sip') !== false) { if (strpos($dev_config['type'], 'sip') !== false) {
$sccp_native = false; $sccp_native = false;
$tmp_bind = $this->sipconfigs->getSipConfig(); $tmp_bind = $this->sipconfigs->getSipConfig();
$dev_ext_config = $this->dbinterface->get_db_SccpTableData("SccpDevice", array('name' => $dev_id, 'fields' => 'sip_ext')); $dev_ext_config = $this->dbinterface->HWextension_db_SccpTableData("SccpDevice", array('name' => $dev_id, 'fields' => 'sip_ext'));
$data_value = array_merge($data_value, $dev_ext_config); $data_value = array_merge($data_value, $dev_ext_config);
$data_tmp = explode(';', $dev_ext_config['sip_lines']); $data_tmp = explode(';', $dev_ext_config['sip_lines']);
$data_value['sbind'] = array(); $data_value['sbind'] = array();
@ -2152,7 +2152,7 @@ class Sccp_manager extends \FreePBX_Helpers implements \BMO {
} }
// Update info from sccp_db // Update info from sccp_db
$tmp_data = $this->dbinterface->get_db_SccpTableData('SccpExtension'); $tmp_data = $this->dbinterface->HWextension_db_SccpTableData('SccpExtension');
foreach ($tmp_data as $value) { foreach ($tmp_data as $value) {
$name_l = $value['name']; $name_l = $value['name'];
if (!empty($res[$name_l . $default_hint])) { if (!empty($res[$name_l . $default_hint])) {

View file

@ -32,7 +32,7 @@ class dbinterface
public function get_db_SccpTableByID($dataid, $data = array(), $indexField = '') public function get_db_SccpTableByID($dataid, $data = array(), $indexField = '')
{ {
$resut = array(); $resut = array();
$raw = $this->get_db_SccpTableData($dataid, $data); $raw = $this->HWextension_db_SccpTableData($dataid, $data);
if (empty($raw) || empty($indexField)) { if (empty($raw) || empty($indexField)) {
return $raw; return $raw;
} }
@ -43,7 +43,7 @@ class dbinterface
return $resut; return $resut;
} }
public function get_db_SccpTableData($dataid, $data = array()) public function HWextension_db_SccpTableData($dataid, $data = array())
{ {
if ($dataid == '') { if ($dataid == '') {
return false; return false;
@ -216,7 +216,7 @@ class dbinterface
} }
break; break;
case "extension": case "extension":
$sql = "SELECT " . $sel_inf . " FROM sccpdevmodel WHERE (dns = 0)ORDER BY model "; $sql = "SELECT " . $sel_inf . " FROM sccpdevmodel WHERE (dns = 0) and (enabled > 0) ORDER BY model ";
break; break;
case "enabled": case "enabled":
case "phones": case "phones":

View file

@ -134,7 +134,7 @@ class xmlinterface
'phoneServices' => 'null', 'certHash' => 'null', 'phoneServices' => 'null', 'certHash' => 'null',
'deviceSecurityMode' => '1'); 'deviceSecurityMode' => '1');
// $var_hw_config = $this->dbinterface->get_db_SccpTableData("get_sccpdevice_byid", array('id' => $dev_id)); // $var_hw_config = $this->dbinterface->HWextension_db_SccpTableData("get_sccpdevice_byid", array('id' => $dev_id));
if (empty($dev_config)) { if (empty($dev_config)) {
return false; return false;
@ -506,7 +506,7 @@ class xmlinterface
'phoneServices' => 'null', 'certHash' => 'null', 'deviceProtocol' => 'SIP', 'phoneServices' => 'null', 'certHash' => 'null', 'deviceProtocol' => 'SIP',
'deviceSecurityMode' => '1'); 'deviceSecurityMode' => '1');
// $var_hw_config = $this->dbinterface->get_db_SccpTableData("get_sccpdevice_byid", array('id' => $dev_id)); // $var_hw_config = $this->dbinterface->HWextension_db_SccpTableData("get_sccpdevice_byid", array('id' => $dev_id));
if (empty($dev_config)) { if (empty($dev_config)) {
return false; return false;

View file

@ -1284,7 +1284,7 @@ and open the template in the editor. Base Version before all crash :-)
<label>Addon</label> <label>Addon</label>
<name>addon</name> <name>addon</name>
<default>NONE</default> <default>NONE</default>
<select name="model" dataval="buttons">model</select> <select name="model" dataval="buttons">description</select>
<class>hw_select sccp-custom</class> <class>hw_select sccp-custom</class>
<help>Addon: Addons are model specific and only work with certain base phones. This phone model is identified as being a phone that does not accept sidecars. Update devmodel if this is not correct.</help> <help>Addon: Addons are model specific and only work with certain base phones. This phone model is identified as being a phone that does not accept sidecars. Update devmodel if this is not correct.</help>
</item> </item>

View file

@ -26,20 +26,20 @@ $keysetarray = $this->extconfigs->getextConfig('keyset');
'uriaction' => array('default')); 'uriaction' => array('default'));
*/ */
// ------------------------------------- Key Set Display information --------------------------------------------------------- // ------------------------------------- Key Set Display information ---------------------------------------------------------
$keynamearray = array('onhook' => array(sname => 'ONHOOK', name =>'Display Onhook',help =>'help.'), $keynamearray = array('onhook' => array('sname' => 'ONHOOK', 'name' =>'Display Onhook', 'help' =>'help.'),
'connected' => array(sname => 'CONNECTED', name =>'Display Connected',help =>'help.'), 'connected' => array('sname' => 'CONNECTED', 'name' =>'Display Connected', 'help' =>'help.'),
'onhold' => array(sname => 'ONHOLD', name =>'Display onhold',help =>'help.'), 'onhold' => array('sname' => 'ONHOLD', 'name' =>'Display onhold', 'help' =>'help.'),
'ringin' => array(sname => 'RINGIN', name =>'Display ringin',help =>'help.'), 'ringin' => array('sname' => 'RINGIN', 'name' =>'Display ringin', 'help' =>'help.'),
'offhook' => array(sname => 'OFFHOOK', name =>'Display offhook',help =>'help.'), 'offhook' => array('sname' => 'OFFHOOK', 'name' =>'Display offhook', 'help' =>'help.'),
'conntrans' => array(sname => 'CONNTRANS', name =>'Display conntrans',help =>'help.'), 'conntrans' => array('sname' => 'CONNTRANS', 'name' =>'Display conntrans', 'help' =>'help.'),
'digitsfoll' => array(sname => 'DIGITSFOLL', name =>'Display digitsfoll',help =>'help.'), 'digitsfoll' => array('sname' => 'DIGITSFOLL', 'name' =>'Display digitsfoll', 'help' =>'help.'),
'connconf' => array(sname => 'CONNCONF', name =>'Display connconf',help =>'help.'), 'connconf' => array('sname' => 'CONNCONF', 'name' =>'Display connconf', 'help' =>'help.'),
'ringout' => array(sname => 'RINGOUT', name =>'Display ringout',help =>'help.'), 'ringout' => array('sname' => 'RINGOUT', 'name' =>'Display ringout', 'help' =>'help.'),
'offhookfeat'=> array(sname => 'OFFHOOKFEAT', name =>'Display offhookfeat',help =>'help.'), 'offhookfeat'=> array('sname' => 'OFFHOOKFEAT', 'name' =>'Display offhookfeat', 'help' =>'help.'),
'onhint' => array(sname => 'ONHINT', name =>'Display onhint',help =>'help.'), 'onhint' => array('sname' => 'ONHINT', 'name' =>'Display onhint', 'help' =>'help.'),
'onstealable'=> array(sname => 'onstealable', name =>'Display onstealable',help =>'help.'), 'onstealable'=> array('sname' => 'onstealable', 'name' =>'Display onstealable', 'help' =>'help.'),
'holdconf' => array(sname => 'HOLDCONF', name =>'Display holdconf',help =>'help.'), 'holdconf' => array('sname' => 'HOLDCONF', 'name' =>'Display holdconf', 'help' =>'help.'),
'uriaction' => array(sname => '', name =>'Display uriaction',help =>'help.') 'uriaction' => array('sname' => '', 'name' =>'Display uriaction', 'help' =>'help.')
); );
?> ?>

View file

@ -29,7 +29,7 @@ if (!empty($_REQUEST['new_id'])) {
if (!empty($_REQUEST['id'])) { if (!empty($_REQUEST['id'])) {
$dev_id = $_REQUEST['id']; $dev_id = $_REQUEST['id'];
$dev_new = $dev_id; $dev_new = $dev_id;
$db_res = $this->dbinterface->get_db_SccpTableData('get_sccpdevice_byid', array("id" => $dev_id)); $db_res = $this->dbinterface->HWextension_db_SccpTableData('get_sccpdevice_byid', array("id" => $dev_id));
foreach ($db_res as $key => $val) { foreach ($db_res as $key => $val) {
if (!empty($val)) { if (!empty($val)) {
switch ($key) { switch ($key) {

View file

@ -11,7 +11,7 @@ $dev_new = null;
if (!empty($_REQUEST['ru_id'])) { if (!empty($_REQUEST['ru_id'])) {
$dev_id = $_REQUEST['ru_id']; $dev_id = $_REQUEST['ru_id'];
$def_val['id'] = array("keyword" => 'id', "data" => $dev_id, "seq" => "99"); $def_val['id'] = array("keyword" => 'id', "data" => $dev_id, "seq" => "99");
$db_res = $this->dbinterface->get_db_SccpTableData('get_sccpuser', array("id" => $dev_id)); $db_res = $this->dbinterface->HWextension_db_SccpTableData('get_sccpuser', array("id" => $dev_id));
if (!empty($db_res)) { if (!empty($db_res)) {
foreach ($db_res as $key => $val) { foreach ($db_res as $key => $val) {
if (!empty($val)) { if (!empty($val)) {

View file

@ -29,7 +29,7 @@ if (!empty($_REQUEST['new_id'])) {
if (!empty($_REQUEST['id'])) { if (!empty($_REQUEST['id'])) {
$dev_id = $_REQUEST['id']; $dev_id = $_REQUEST['id'];
$dev_new = $dev_id; $dev_new = $dev_id;
$db_res = $this->dbinterface->get_db_SccpTableData('get_sccpdevice_byid', array("id" => $dev_id)); $db_res = $this->dbinterface->HWextension_db_SccpTableData('get_sccpdevice_byid', array("id" => $dev_id));
foreach ($db_res as $key => $val) { foreach ($db_res as $key => $val) {
if (!empty($val)) { if (!empty($val)) {
switch ($key) { switch ($key) {

View file

@ -19,8 +19,8 @@ $feature_list= array('parkinglot'=>'Park Slots','monitor'=> "Record Calls",'dev
*/ */
$lines_list = $this->dbinterface->get_db_SccpTableData('SccpExtension'); $lines_list = $this->dbinterface->HWextension_db_SccpTableData('SccpExtension');
//$hint_list = $this->dbinterface->get_db_SccpTableData('SccpExtension'); //$hint_list = $this->dbinterface->HWextension_db_SccpTableData('SccpExtension');
$hint_list = $this->getHintInformation(true, array('context'=>'park-hints')) ; $hint_list = $this->getHintInformation(true, array('context'=>'park-hints')) ;
// print_r($hint_list); // print_r($hint_list);
@ -30,8 +30,8 @@ $show_buttons =1;
//print_r($hint_list); //print_r($hint_list);
if (!empty($_REQUEST['id'])) { if (!empty($_REQUEST['id'])) {
$dev_id = $_REQUEST['id']; $dev_id = $_REQUEST['id'];
$db_buttons = $this->dbinterface->get_db_SccpTableData('get_sccpdevice_buttons', array("id" => $dev_id)); $db_buttons = $this->dbinterface->HWextension_db_SccpTableData('get_sccpdevice_buttons', array("id" => $dev_id));
$db_device = $this->dbinterface->get_db_SccpTableData('get_sccpdevice_byid', array("id" => $dev_id)); $db_device = $this->dbinterface->HWextension_db_SccpTableData('get_sccpdevice_byid', array("id" => $dev_id));
$max_buttons = $db_device['buttons']; $max_buttons = $db_device['buttons'];
if (!empty($db_device['addon_buttons'])) { if (!empty($db_device['addon_buttons'])) {
$max_buttons += $db_device['addon_buttons']; $max_buttons += $db_device['addon_buttons'];
@ -41,7 +41,7 @@ if (!empty($_REQUEST['id'])) {
if (!empty($_REQUEST['new_id'])) { if (!empty($_REQUEST['new_id'])) {
$val = $_REQUEST['type']; $val = $_REQUEST['type'];
$dev_schema = $this-> getSccpModelInformation('byid', false, "all", array('model' =>$val)); $dev_schema = $this-> getSccpModelInformation('byid', false, "all", array('model' =>$val));
// $db_device = $this->dbinterface->get_db_SccpTableData('get_sccpdevice_byid', array("id" => $val)); // $db_device = $this->dbinterface->HWextension_db_SccpTableData('get_sccpdevice_byid', array("id" => $val));
$max_buttons = $dev_schema[0]['buttons']; $max_buttons = $dev_schema[0]['buttons'];
if (!empty($_REQUEST['addon'])) { if (!empty($_REQUEST['addon'])) {
$val = $_REQUEST['addon']; $val = $_REQUEST['addon'];
@ -52,7 +52,7 @@ if (!empty($_REQUEST['new_id'])) {
} }
if (!empty($_REQUEST['ru_id'])) { if (!empty($_REQUEST['ru_id'])) {
$dev_id = $_REQUEST['ru_id']; $dev_id = $_REQUEST['ru_id'];
$db_buttons = $this->dbinterface->get_db_SccpTableData('get_sccpdevice_buttons', array("id" => $dev_id)); $db_buttons = $this->dbinterface->HWextension_db_SccpTableData('get_sccpdevice_buttons', array("id" => $dev_id));
$show_buttons = $max_buttons; $show_buttons = $max_buttons;
} }

View file

@ -15,9 +15,9 @@ $forminfo =array(
$buttons_type= array("empty","line","speeddial"); $buttons_type= array("empty","line","speeddial");
$feature_list= array('parkinglot'=>'Park Slots','monitor'=> "Record Calls",'devstate'=> "Change Status"); $feature_list= array('parkinglot'=>'Park Slots','monitor'=> "Record Calls",'devstate'=> "Change Status");
//$lines_list = $this->dbinterface->get_db_SccpTableData('SccpExtension'); //$lines_list = $this->dbinterface->HWextension_db_SccpTableData('SccpExtension');
$lines_list = $this->sipconfigs->get_db_sip_TableData('Device'); $lines_list = $this->sipconfigs->get_db_sip_TableData('Device');
//$hint_list = $this->dbinterface->get_db_SccpTableData('SccpExtension'); //$hint_list = $this->dbinterface->HWextension_db_SccpTableData('SccpExtension');
$hint_list = $this->getHintInformation(true, array('context'=>'park-hints')) ; $hint_list = $this->getHintInformation(true, array('context'=>'park-hints')) ;
// print_r($lines_list); // print_r($lines_list);
@ -27,8 +27,8 @@ $show_buttons =1;
//print_r($hint_list); //print_r($hint_list);
if (!empty($_REQUEST['id'])) { if (!empty($_REQUEST['id'])) {
$dev_id = $_REQUEST['id']; $dev_id = $_REQUEST['id'];
$db_buttons = $this->dbinterface->get_db_SccpTableData('get_sccpdevice_buttons', array("id" => $dev_id)); $db_buttons = $this->dbinterface->HWextension_db_SccpTableData('get_sccpdevice_buttons', array("id" => $dev_id));
$db_device = $this->dbinterface->get_db_SccpTableData('get_sccpdevice_byid', array("id" => $dev_id)); $db_device = $this->dbinterface->HWextension_db_SccpTableData('get_sccpdevice_byid', array("id" => $dev_id));
$max_buttons = $db_device['buttons']; $max_buttons = $db_device['buttons'];
if (!empty($db_device['addon_buttons'])) { if (!empty($db_device['addon_buttons'])) {
$max_buttons += $db_device['addon_buttons']; $max_buttons += $db_device['addon_buttons'];
@ -38,7 +38,7 @@ if (!empty($_REQUEST['id'])) {
if (!empty($_REQUEST['new_id'])) { if (!empty($_REQUEST['new_id'])) {
$val = $_REQUEST['type']; $val = $_REQUEST['type'];
$dev_schema = $this-> getSccpModelInformation('byid', false, "all", array('model' =>$val)); $dev_schema = $this-> getSccpModelInformation('byid', false, "all", array('model' =>$val));
// $db_device = $this->dbinterface->get_db_SccpTableData('get_sccpdevice_byid', array("id" => $val)); // $db_device = $this->dbinterface->HWextension_db_SccpTableData('get_sccpdevice_byid', array("id" => $val));
$max_buttons = $dev_schema[0]['buttons']; $max_buttons = $dev_schema[0]['buttons'];
if (!empty($_REQUEST['addon'])) { if (!empty($_REQUEST['addon'])) {
$val = $_REQUEST['addon']; $val = $_REQUEST['addon'];
@ -49,7 +49,7 @@ if (!empty($_REQUEST['new_id'])) {
} }
if (!empty($_REQUEST['ru_id'])) { if (!empty($_REQUEST['ru_id'])) {
$dev_id = $_REQUEST['ru_id']; $dev_id = $_REQUEST['ru_id'];
$db_buttons = $this->dbinterface->get_db_SccpTableData('get_sccpdevice_buttons', array("id" => $dev_id)); $db_buttons = $this->dbinterface->HWextension_db_SccpTableData('get_sccpdevice_buttons', array("id" => $dev_id));
$show_buttons = $max_buttons; $show_buttons = $max_buttons;
} }

View file

@ -46,9 +46,9 @@ $dialplan_list = array();
//$time_zone = \FreePBX::Sccp_manager()-> extconfigs-> getextConfig('cisco_time'); //$time_zone = \FreePBX::Sccp_manager()-> extconfigs-> getextConfig('cisco_time');
//$system_time_zone = \FreePBX::Sccp_manager()->getSysnemTimeZone(); //$system_time_zone = \FreePBX::Sccp_manager()->getSysnemTimeZone();
//$sofkey_list = \FreePBX::Sccp_manager()-> srvinterface -> sccp_list_keysets(); //$sofkey_list = \FreePBX::Sccp_manager()-> srvinterface -> sccp_list_keysets();
//$model_list = \FreePBX::Sccp_manager()->dbinterface->get_db_SccpTableData("HWDevice"); //$model_list = \FreePBX::Sccp_manager()->dbinterface->HWextension_db_SccpTableData("HWDevice");
//$extension_list = \FreePBX::Sccp_manager()->dbinterface->get_db_SccpTableData("HWextension"); //$extension_list = \FreePBX::Sccp_manager()->dbinterface->HWextension_db_SccpTableData("HWextension");
//$device_list = \FreePBX::Sccp_manager()->dbinterface->get_db_SccpTableData("SccpDevice"); //$device_list = \FreePBX::Sccp_manager()->dbinterface->HWextension_db_SccpTableData("SccpDevice");
//$extension_list[]=array(model=>'NONE', vendor=>'CISCO', dns=>'0'); //$extension_list[]=array(model=>'NONE', vendor=>'CISCO', dns=>'0');
//$device_list[]=array(name=>'NONE', description=>'No Device'); //$device_list[]=array(name=>'NONE', description=>'No Device');
@ -659,26 +659,35 @@ foreach ($items as $child) {
} }
if ($child['type'] == 'SDM') { if ($child['type'] == 'SDM') {
if (empty($model_list)) { if (empty($model_list)) {
$model_list = \FreePBX::Sccp_manager()->dbinterface->get_db_SccpTableData("HWDevice"); $model_list = \FreePBX::Sccp_manager()->dbinterface->HWextension_db_SccpTableData("HWDevice");
} }
$select_opt= $model_list; $select_opt= $model_list;
} }
if ($child['type'] == 'SDMS') { if ($child['type'] == 'SDMS') {
if (empty($model_list)) { if (empty($model_list)) {
$model_list = \FreePBX::Sccp_manager()->dbinterface->get_db_SccpTableData("HWSipDevice"); $model_list = \FreePBX::Sccp_manager()->dbinterface->HWextension_db_SccpTableData("HWSipDevice");
} }
$select_opt= $model_list; $select_opt= $model_list;
} }
if ($child['type'] == 'SDE') { if ($child['type'] == 'SDE') {
if (empty($extension_list)) { if (empty($extension_list)) {
$extension_list = \FreePBX::Sccp_manager()->dbinterface->get_db_SccpTableData("HWextension"); $extension_list = \FreePBX::Sccp_manager()->dbinterface->HWextension_db_SccpTableData("HWextension");
$extension_list[]=array( model => 'NONE', vendor => 'CISCO', dns => '0'); $extension_list[]=array( model => 'NONE', vendor => 'CISCO', dns => '0');
foreach ($extension_list as &$data) {
$d_name = explode(';', $data['model']);
if (is_array($d_name) && (count($d_name) > 1)) {
$data['description'] = count($d_name).'x '.$d_name[0];
} else {
$data['description'] = $data['model'];
}
}
unset($data);
} }
$select_opt= $extension_list; $select_opt= $extension_list;
} }
if ($child['type'] == 'SDD') { if ($child['type'] == 'SDD') {
if (empty($device_list)) { if (empty($device_list)) {
$device_list = \FreePBX::Sccp_manager()->dbinterface->get_db_SccpTableData("SccpDevice"); $device_list = \FreePBX::Sccp_manager()->dbinterface->HWextension_db_SccpTableData("SccpDevice");
$device_list[]=array(name=>'NONE', description=>'No Device'); $device_list[]=array(name=>'NONE', description=>'No Device');
} }
$select_opt = $device_list; $select_opt = $device_list;

View file

@ -54,8 +54,13 @@
function DispayTypeFormatter(value, row, index) { function DispayTypeFormatter(value, row, index) {
var exp_model = value; var exp_model = value;
if (row['addon'] !== null ) { if (row['addon'] !== null ) {
var posd = row['addon'].indexOf(';');
if (posd >0) {
exp_model += ' + 2x ' + row['addon'].substring(0, posd);
} else {
exp_model += ' + ' + row['addon']; exp_model += ' + ' + row['addon'];
} }
}
return exp_model; return exp_model;
} }

View file

@ -61,13 +61,17 @@
return exp_model; return exp_model;
} }
function DispayTypeFormatterS(value, row, index) { function DispayTypeFormatter(value, row, index) {
var exp_model = value; var exp_model = value;
if (row['addon'] !== null ) { if (row['addon'] !== null ) {
var posd = row['addon'].indexOf(';');
if (posd >0) {
exp_model += ' + 2x ' + row['addon'].substring(0, posd);
} else {
exp_model += ' + ' + row['addon']; exp_model += ' + ' + row['addon'];
} }
}
return exp_model; return exp_model;
} }
function LineFormatterS(value, row, index) { function LineFormatterS(value, row, index) {
if (value === null) { if (value === null) {

View file

@ -16,7 +16,7 @@ $sccp_disalow = $sccp_disalow_def;
if (!empty($_REQUEST['id'])) { if (!empty($_REQUEST['id'])) {
$dev_id = $_REQUEST['id']; $dev_id = $_REQUEST['id'];
$db_res = $this->dbinterface->get_db_SccpTableData('get_sccpdevice_byid', array("id" => $dev_id)); $db_res = $this->dbinterface->HWextension_db_SccpTableData('get_sccpdevice_byid', array("id" => $dev_id));
if (!empty($db_res['allow'])) { if (!empty($db_res['allow'])) {
$i = 1; $i = 1;
foreach (explode(';', $db_res['allow']) as $c) { foreach (explode(';', $db_res['allow']) as $c) {

View file

@ -422,7 +422,7 @@ if ($test_ami == 1) {
// print_r($this->aminterface->close()); // print_r($this->aminterface->close());
// //
// //
//print_r($this->dbinterface->get_db_SccpTableData('SccpExtension')); //print_r($this->dbinterface->HWextension_db_SccpTableData('SccpExtension'));
// print_r($this->srvinterface->getеtestChanSCC()); // print_r($this->srvinterface->getеtestChanSCC());
// $test_data = $this->srvinterface-> astman_GetRaw('ExtensionStateList'); // $test_data = $this->srvinterface-> astman_GetRaw('ExtensionStateList');
// print_r($test_data); // print_r($test_data);