Fix Spelling Sccp_manager.class.php

Switch to using camelCase for functions in Sccp_manager.class.php
Remove old TODO comments
Remove comments that don't add information

Signed-off-by: Diederik de Groot <dkgroot@talon.nl>
This commit is contained in:
Diederik de Groot 2020-04-09 10:16:15 +00:00
parent de0a07562f
commit 1afe5c5438
No known key found for this signature in database
GPG key ID: AFA728250A1BECD6
23 changed files with 272 additions and 445 deletions

File diff suppressed because it is too large Load diff

View file

@ -502,7 +502,7 @@ class aminterface
}
return $result;
}
function sccp_device_reset($devicename, $action = '')
function sccpDeviceReset($devicename, $action = '')
{
if ($this->_connect_state) {
if ($action == 'tokenack') {

View file

@ -489,7 +489,7 @@ class oldinterface
/*
* [Segments] => ( [0] => general [1] => device [2] => line [3] => softkey )
*/
function getеtestChanSCCP_GlablsInfo($Segment = '')
function getGlobalsFromMetaData($Segment = '')
{
global $astman;
$params = array();

View file

@ -240,7 +240,7 @@ class dbinterface
return $raw_settings;
}
function sccp_save_db($db_name = "", $save_value = array(), $mode = 'update', $key_fld = "", $hwid = "")
function write($db_name = "", $save_value = array(), $mode = 'update', $key_fld = "", $hwid = "")
{
// mode clear - Empty tabele before update
// mode update - update / replace record

View file

@ -74,7 +74,7 @@ class sipconfigs
// $result['tlsport'] = \FreePBX::Sipsettings()->getConfig('tlsbindport');
// $tmp_sipsetigs = \FreePBX::Sipsettings()->getChanSipSettings();
$tmp_binds = \FreePBX::Sipsettings()->getBinds();
$if_list = $this->paren_class ->getIP_information2('ip4');
$if_list = $this->paren_class ->getIpInformation('ip4');
/*
$tmp_bind_ip = !empty($tmp_sipsetigs['externhost_val']) ? $tmp_sipsetigs['externhost_val'] : '';

View file

@ -62,19 +62,19 @@ class srvinterface
'about' => 'Server interface data ver: ' . $Ver . "\n " . $info);
}
public function sccp_device_reset($id = '')
public function sccpDeviceReset($id = '')
{
if ($this->ami_mode) {
return $this->aminterface->sccp_device_reset($id, 'reset');
return $this->aminterface->sccpDeviceReset($id, 'reset');
} else {
return $this->oldinterface->sccp_core_commands(array('cmd' => 'reset_phone', 'name' => $id));
}
}
public function sccp_device_restart($id = '')
public function sccpDeviceRestart($id = '')
{
if ($this->ami_mode) {
return $this->aminterface->sccp_device_reset($id, 'restart');
return $this->aminterface->sccpDeviceReset($id, 'restart');
} else {
return $this->oldinterface->sccp_core_commands(array('cmd' => 'reset_phone', 'name' => $id));
}
@ -83,7 +83,7 @@ class srvinterface
public function sccp_device_reload($id = '')
{
if ($this->ami_mode) {
return $this->aminterface->sccp_device_reset($id, 'full');
return $this->aminterface->sccpDeviceReset($id, 'full');
} else {
return $this->oldinterface->sccp_core_commands(array('cmd' => 'reload_phone', 'name' => $id));
}
@ -92,7 +92,7 @@ class srvinterface
public function sccp_reset_token($id = '')
{
if ($this->ami_mode) {
return $this->aminterface->sccp_device_reset($id, 'tokenack');
return $this->aminterface->sccpDeviceReset($id, 'tokenack');
} else {
return $this->oldinterface->sccp_core_commands(array('cmd' => 'reset_token', 'name' => $id));
}
@ -124,19 +124,19 @@ class srvinterface
if (!empty($params['cmd'])) {
switch ($params['cmd']) {
case 'reset_phone':
return $this->aminterface->sccp_device_reset($params['name'], 'reset');
return $this->aminterface->sccpDeviceReset($params['name'], 'reset');
break;
case 'restart_phone':
return $this->aminterface->sccp_device_reset($params['name'], 'restart');
return $this->aminterface->sccpDeviceReset($params['name'], 'restart');
break;
case 'reload_phone':
return $this->aminterface->sccp_device_reset($params['name'], 'full');
return $this->aminterface->sccpDeviceReset($params['name'], 'full');
break;
case 'reset_token':
return $this->aminterface->sccp_device_reset($params['name'], 'tokenack');
return $this->aminterface->sccpDeviceReset($params['name'], 'tokenack');
break;
case 'reload_line':
// return $this->aminterface->sccp_device_reset($params['name'], 'full');
// return $this->aminterface->sccpDeviceReset($params['name'], 'full');
break;
// case 'get_version':
// case 'sccp_reload':

View file

@ -778,7 +778,7 @@ class xmlinterface
return time();
}
function save_DialPlan($confDir, $get_settings)
function saveDialPlan($confDir, $get_settings)
{
$xmlstr = "<DIALTEMPLATE>\n";
$xmlstr .= "<versionStamp>" . time() . "</versionStamp>\n";

View file

@ -1038,11 +1038,11 @@ and open the template in the editor. Base Version before all crash :-)
<item type="IS" id="4" seq="90">
<name>system_rouminguser</name>
<label>User Rouming</label>
<label>User Roaming</label>
<default>no</default>
<button value="yes">Yes</button>
<button value="no">No</button>
<help>Experemental Function Rouming Users</help>
<help>Experemental Function Roaming Users</help>
</item>
</page_group>
@ -1609,10 +1609,10 @@ and open the template in the editor. Base Version before all crash :-)
</page_group>
<!--
Rouming User Pages
Roaming User Pages
-->
<page_group name="sccp_ruser">
<label>Rouming User configuration</label>
<label>Roaming User configuration</label>
<item type="IE" id="1" seq="99">
<label>User ID</label>
<input>
@ -1650,7 +1650,7 @@ and open the template in the editor. Base Version before all crash :-)
</item>
<item type="IS" id="13" seq="99">
<name>roaminglogin</name>
<label>Rouming</label>
<label>Roaming</label>
<default>off</default>
<button value="off">Disabled</button>
<button value="on">Enable Single</button>
@ -1676,7 +1676,7 @@ and open the template in the editor. Base Version before all crash :-)
</item>
</page_group>
<!--
Rouming User Pages
Roaming User Pages
-->
<page_group name="sccp_ruser_time">
<label>Time Work configuration</label>

View file

@ -1005,8 +1005,8 @@ if (!$sccp_db_ver) {
}
outn("<br>");
// $ss->save_submit($request);
// $ss->sccp_create_sccp_init();
// $ss->sccp_db_save_setting();
// $ss->handleSubmit($request);
// $ss->createDefaultSccpConfig();
// $ss->saveSccpSettings();
//
//}

View file

@ -16,10 +16,10 @@ if (!defined('FREEPBX_IS_AUTH')) {
//
$spage = FreePBX::create()->Sccp_manager;
if (empty($spage->class_error)) {
$display_page = $spage->AdvServerShowPage();
$display_page = $spage->advServerShowPage();
$display_info = _("SCCP Advance Server Configuration");
} else {
$display_page = $spage->InfoServerShowPage();
$display_page = $spage->infoServerShowPage();
$display_info = _("SCCP Server Configuration");
}
?>

View file

@ -16,10 +16,10 @@ if (!defined('FREEPBX_IS_AUTH')) {
//
$spage = FreePBX::create()->Sccp_manager;
if (empty($spage->class_error)) {
$display_page = $spage->PhoneShowPage();
$display_page = $spage->phoneShowPage();
$display_info = _("SCCP Phone Manager");
} else {
$display_page = $spage->InfoServerShowPage();
$display_page = $spage->infoServerShowPage();
$display_info = _("SCCP Server Configuration");
}

View file

@ -34,7 +34,7 @@ if (!empty($_REQUEST['id'])) {
if (!empty($val)) {
switch ($key) {
case 'type':
$tmp_raw = $this->getSccp_model_information('byid', true, 'all', array('model'=>$val));
$tmp_raw = $this->getSccpModelInformation('byid', true, 'all', array('model'=>$val));
if (!empty($tmp_raw[0])) {
$tmp_raw = $tmp_raw[0];
}
@ -108,15 +108,15 @@ if (!empty($device_warning)) {
echo '<input type="hidden" name="sccp_deviceid" value="'.$dev_id.'">';
}
if (empty($dev_id)) {
echo $this->ShowGroup('sccp_hw_dev', 1, 'sccp_hw', $def_val);
echo $this->showGroup('sccp_hw_dev', 1, 'sccp_hw', $def_val);
} else {
echo $this->ShowGroup('sccp_hw_dev_edit', 1, 'sccp_hw', $def_val);
echo $this->showGroup('sccp_hw_dev_edit', 1, 'sccp_hw', $def_val);
}
echo $this->ShowGroup('sccp_hw_dev2', 1, 'sccp_hw', $def_val);
echo $this->ShowGroup('sccp_hw_dev_advance', 1, 'sccp_hw', $def_val);
echo $this->ShowGroup('sccp_hw_dev_softkey', 1, 'sccp_hw', $def_val);
echo $this->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);
echo $this->showGroup('sccp_hw_dev2', 1, 'sccp_hw', $def_val);
echo $this->showGroup('sccp_hw_dev_advance', 1, 'sccp_hw', $def_val);
echo $this->showGroup('sccp_hw_dev_softkey', 1, 'sccp_hw', $def_val);
echo $this->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);
?>
</form>

View file

@ -28,7 +28,7 @@ if (!empty($_REQUEST['ru_id'])) {
<input type="hidden" name="Submit" value="Submit">
<?php
echo $this->ShowGroup('sccp_ruser', 1, 'sccp_ru', $def_val);
echo $this->ShowGroup('sccp_ruser_time', 1, 'sccp_ru', $def_val);
echo $this->showGroup('sccp_ruser', 1, 'sccp_ru', $def_val);
echo $this->showGroup('sccp_ruser_time', 1, 'sccp_ru', $def_val);
?>
</form>

View file

@ -34,7 +34,7 @@ if (!empty($_REQUEST['id'])) {
if (!empty($val)) {
switch ($key) {
case 'type':
$tmp_raw = $this->getSccp_model_information('byid', true, 'all', array('model'=>$val));
$tmp_raw = $this->getSccpModelInformation('byid', true, 'all', array('model'=>$val));
if (!empty($tmp_raw[0])) {
$tmp_raw = $tmp_raw[0];
}
@ -110,16 +110,16 @@ if (!empty($device_warning)) {
echo '<input type="hidden" name="sccp_deviceid" value="'.$dev_id.'">';
}
if (empty($dev_id)) {
echo $this->ShowGroup('sccp_hw_sip_dev', 1, 'sccp_hw', $def_val);
echo $this->showGroup('sccp_hw_sip_dev', 1, 'sccp_hw', $def_val);
} else {
echo $this->ShowGroup('sccp_hw_dev_edit', 1, 'sccp_hw', $def_val);
echo $this->showGroup('sccp_hw_dev_edit', 1, 'sccp_hw', $def_val);
}
echo $this->ShowGroup('sccp_hw_dev2', 1, 'sccp_hw', $def_val);
echo $this->ShowGroup('sccp_hw_sip_conf', 1, 'sccp_hw', $def_val);
// echo $this->ShowGroup('sccp_hw_dev_advance', 1, 'sccp_hw', $def_val);
// echo $this->ShowGroup('sccp_hw_dev_softkey', 1, 'sccp_hw', $def_val);
// echo $this->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);
echo $this->showGroup('sccp_hw_dev2', 1, 'sccp_hw', $def_val);
echo $this->showGroup('sccp_hw_sip_conf', 1, 'sccp_hw', $def_val);
// echo $this->showGroup('sccp_hw_dev_advance', 1, 'sccp_hw', $def_val);
// echo $this->showGroup('sccp_hw_dev_softkey', 1, 'sccp_hw', $def_val);
// echo $this->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);
?>
</form>

View file

@ -21,7 +21,7 @@ $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(true, array('context'=>'park-hints')) ;
$hint_list = $this->getHintInformation(true, array('context'=>'park-hints')) ;
// print_r($hint_list);
$line_id =0;
@ -40,12 +40,12 @@ if (!empty($_REQUEST['id'])) {
}
if (!empty($_REQUEST['new_id'])) {
$val = $_REQUEST['type'];
$dev_schema = $this-> getSccp_model_information('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));
$max_buttons = $dev_schema[0]['buttons'];
if (!empty($_REQUEST['addon'])) {
$val = $_REQUEST['addon'];
$dev_schema = $this-> getSccp_model_information('byid', false, "all", array('model' =>$val));
$dev_schema = $this-> getSccpModelInformation('byid', false, "all", array('model' =>$val));
$max_buttons += $dev_schema[0]['buttons'];
}
$show_buttons = $max_buttons;

View file

@ -6,7 +6,7 @@
* and open the template in the editor.
*/
//$list_data = $this->get_DialPlan('dialplan');
//$list_data = $this->getDialPlan('dialplan');
//print_r($list_data);
//$dialFelds = array('match','timeout','line','rewrite','tone');
//$dialFelds = array('match','timeout','User','rewrite','tone');
@ -16,7 +16,7 @@ if (!empty($_REQUEST['extdisplay'])) {
$dev_id = $_REQUEST['extdisplay'];
}
if ($dev_id != '*new*') {
$list_data= $this->get_DialPlan($dev_id);
$list_data= $this->getDialPlan($dev_id);
$data_s= '';
foreach ($list_data['template'] as $key => $value) {
foreach ($dialFelds as $fld) {
@ -41,7 +41,7 @@ if ($dev_id != '*new*') {
<input type="hidden" name="Submit" value="Submit">
<?php
if ($dev_id == '*new*') {
echo $this->ShowGroup('sccp_dp_new_template', 0, 'sccp_dial', $def_val);
echo $this->showGroup('sccp_dp_new_template', 0, 'sccp_dial', $def_val);
}
?>
@ -74,7 +74,7 @@ if ($dev_id != '*new*') {
<?php
// echo $this->ShowGroup('sccp_dp_new_template',0,'sccp_dial',$def_val);
echo $this->ShowGroup('sccp_dp_template', 0, 'sccp_dial', $def_val);
// echo $this->showGroup('sccp_dp_new_template',0,'sccp_dial',$def_val);
echo $this->showGroup('sccp_dp_template', 0, 'sccp_dial', $def_val);
?>
</form>

View file

@ -18,7 +18,7 @@ $feature_list= array('parkinglot'=>'Park Slots','monitor'=> "Record Calls",'dev
//$lines_list = $this->dbinterface->get_db_SccpTableData('SccpExtension');
$lines_list = $this->sipconfigs->get_db_sip_TableData('Device');
//$hint_list = $this->dbinterface->get_db_SccpTableData('SccpExtension');
$hint_list = $this->get_hint_info(true, array('context'=>'park-hints')) ;
$hint_list = $this->getHintInformation(true, array('context'=>'park-hints')) ;
// print_r($lines_list);
$line_id =0;
@ -37,12 +37,12 @@ if (!empty($_REQUEST['id'])) {
}
if (!empty($_REQUEST['new_id'])) {
$val = $_REQUEST['type'];
$dev_schema = $this-> getSccp_model_information('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));
$max_buttons = $dev_schema[0]['buttons'];
if (!empty($_REQUEST['addon'])) {
$val = $_REQUEST['addon'];
$dev_schema = $this-> getSccp_model_information('byid', false, "all", array('model' =>$val));
$dev_schema = $this-> getSccpModelInformation('byid', false, "all", array('model' =>$val));
$max_buttons += $dev_schema[0]['buttons'];
}
$show_buttons = $max_buttons;

View file

@ -437,7 +437,7 @@ foreach ($items as $child) {
}
if ($child['type'] == 'SLP') {
if (empty($dialplan_list)) {
foreach (\FreePBX::Sccp_manager()->get_DialPlanList() as $tmpkey) {
foreach (\FreePBX::Sccp_manager()->getDialPlanList() as $tmpkey) {
$tmp_id = $tmpkey['id'];
$dialplan_list[$tmp_id] = $tmp_id;
}

View file

@ -12,8 +12,8 @@
<?php
echo $this->ShowGroup('sccp_srst', 1);
// echo $this->ShowGroup('sccp_dev_time',1);
echo $this->showGroup('sccp_srst', 1);
// echo $this->showGroup('sccp_dev_time',1);
?>
</form>

View file

@ -12,8 +12,8 @@
<?php
echo $this->ShowGroup('sccp_dev_ntp', 1);
echo $this->ShowGroup('sccp_dev_time', 1);
echo $this->showGroup('sccp_dev_ntp', 1);
echo $this->showGroup('sccp_dev_time', 1);
?>
</form>

View file

@ -7,7 +7,7 @@
*/
/*
$data = 'none;';
foreach ($this->get_DialPlanList() as $value) {
foreach ($this->getDialPlanList() as $value) {
$data .= $value['id'].';';
}
if (strlen($data) >0 ){
@ -22,11 +22,11 @@ if (strlen($data) >0 ){
<input type="hidden" name="Submit" value="Submit">
<?php
echo $this->ShowGroup('sccp_dev_config', 1);
echo $this->ShowGroup('sccp_dev_group_config', 1);
echo $this->ShowGroup('sccp_dev_advconfig', 1);
echo $this->ShowGroup('sccp_dev_softkey', 1);
echo $this->ShowGroup('sccp_dev_url', 1);
echo $this->ShowGroup('sccp_hotline_config', 1);
echo $this->showGroup('sccp_dev_config', 1);
echo $this->showGroup('sccp_dev_group_config', 1);
echo $this->showGroup('sccp_dev_advconfig', 1);
echo $this->showGroup('sccp_dev_softkey', 1);
echo $this->showGroup('sccp_dev_url', 1);
echo $this->showGroup('sccp_hotline_config', 1);
?>
</form>

View file

@ -427,7 +427,7 @@ if ($test_ami == 1) {
// $test_data = $this->srvinterface-> astman_GetRaw('ExtensionStateList');
// print_r($test_data);
// print_r($this->srvinterface-> core_list_all_exten());
// print_r($this->get_hint_info());
// print_r($this->getHintInformation());
// print_r($this->aminterface->open());
// print_r($this->aminterface-> core_list_all_exten('exten'));
// print_r($this->aminterface->Sok_param['total']);
@ -516,5 +516,5 @@ foreach ($info as $key => $value) {
</div>
</div>
<?php echo $this->ShowGroup('sccp_info', 0); ?>
<?php echo $this->showGroup('sccp_info', 0); ?>

View file

@ -22,12 +22,12 @@
</div>
</div>
<?php
echo $this->ShowGroup('sccp_general', 1);
echo $this->ShowGroup('sccp_dev_time_s', 1);
echo $this->ShowGroup('sccp_net', 1);
echo $this->ShowGroup('sccp_lang', 1);
echo $this->ShowGroup('sccp_qos_config', 1);
echo $this->ShowGroup('sccp_extpath_config', 1);
echo $this->showGroup('sccp_general', 1);
echo $this->showGroup('sccp_dev_time_s', 1);
echo $this->showGroup('sccp_net', 1);
echo $this->showGroup('sccp_lang', 1);
echo $this->showGroup('sccp_qos_config', 1);
echo $this->showGroup('sccp_extpath_config', 1);
?>
@ -44,7 +44,7 @@
<div class="modal-body">
<ul class="nav nav-tabs" role="tablist">
<?php
// echo $this->ShowGroup('add_network_1',0);
// echo $this->showGroup('add_network_1',0);
?>
</ul>
</div>