Begin resample Sccp_manager

more bug fix
This commit is contained in:
PhantomVl 2017-10-27 12:45:18 +03:00
parent f19109a852
commit cce4683b52
10 changed files with 54 additions and 27 deletions

View file

@ -30,6 +30,7 @@
* + Change internal use Field to _Field (new feature in chan_sccp (added for Sccp_manager))
* + Delete phone XML
* + Change Installer ?? (test )
* - Bootstrap encodeURI(row['type']) ???????
* + SRST Config
* - Failover config
* + Auto Addons!
@ -764,15 +765,17 @@ class Sccp_manager extends \FreePBX_Helpers implements \BMO {
$id_name = $dev_ids['name'];
if (empty($dev_ids['news'])) {
$dev_data = $this->srvinterface->sccp_getdevice_info($id_name);
if (!empty($dev_data['SCCP_Vendor']['model_id'])) {
// $dev_data = $this->sccp_getdevice_info($id_name);
$dev_addon= $dev_data['SCCP_Vendor']['model_addon'];
if (empty($dev_addon)) {
$dev_addon = null;
$dev_addon= $dev_data['SCCP_Vendor']['model_addon'];
if (empty($dev_addon)) {
$dev_addon = null;
}
$dev_schema = $this-> getSccp_model_information('byciscoid', false, "all", array('model' =>$dev_data['SCCP_Vendor']['model_id']));
$result[] = array('name' => $id_name, 'mac' => $id_name, 'button' => '---', 'type' => $dev_schema[0]['model'], 'new_hw' => 'Y',
'description' => '*NEW* '.$dev_ids['descr'], 'status' => '*NEW* '.$dev_ids['status'], 'address' => $dev_ids['address'],
'addon' => $dev_addon);
}
$dev_schema = $this-> getSccp_model_information('byciscoid', false, "all", array('model' =>$dev_data['SCCP_Vendor']['model_id']));
$result[] = array('name' => $id_name, 'mac' => $id_name, 'button' => '---', 'type' => $dev_schema[0]['model'], 'new_hw' => 'Y',
'description' => '*NEW* '.$dev_ids['descr'], 'status' => '*NEW* '.$dev_ids['status'], 'address' => $dev_ids['address'],
'addon' => $dev_addon);
}
}
@ -878,7 +881,7 @@ class Sccp_manager extends \FreePBX_Helpers implements \BMO {
$lines_list = $this->dbinterface->get_db_SccpTableData('SccpExtension');
$max_btn = ((!empty($get_settings['butonscount']) ? $get_settings['butonscount'] : 100));
$last_btn = $max_btn;
for ($it = $max_btn; $it >0; $it--) {
for ($it = $max_btn; $it >=0; $it--) {
if (!empty($get_settings['button' . $it . '_type'])) {
$last_btn = $it;
$btn_t = $get_settings['button' . $it . '_type'];
@ -950,12 +953,17 @@ class Sccp_manager extends \FreePBX_Helpers implements \BMO {
break;
case 'line':
case 'silent':
$btn_n = (string) $get_settings['button' . $it . '_line'];
if ($it > 0) {
if ($btn_t == 'silent') {
$btn_n .= '!silent';
$btn_t = 'line';
if (isset($get_settings['button' . $it . '_line'])) {
$btn_n = (string) $get_settings['button' . $it . '_line'];
if ($it > 0) {
if ($btn_t == 'silent') {
$btn_n .= '!silent';
$btn_t = 'line';
}
}
} else {
$btn_t = 'empty';
$btn_n = '';
}
break;
case 'empty':

View file

@ -93,7 +93,7 @@ class dbinterface {
if (!empty($filter)) {
if (!empty($filter['model'])) {
if (strpos($filter['model'],'loadInformation')) {
$sql = "SELECT " . $sel_inf . " FROM sccpdevmodel WHERE (`loadinformationid` =" . $filter['model'] . ") ORDER BY model ";
$sql = "SELECT " . $sel_inf . " FROM sccpdevmodel WHERE (`loadinformationid` ='" . $filter['model'] . "') ORDER BY model ";
} else {
$sql = "SELECT " . $sel_inf . " FROM sccpdevmodel WHERE (`loadinformationid` ='loadInformation" . $filter['model'] . "') ORDER BY model ";
}
@ -107,7 +107,7 @@ class dbinterface {
case "byid":
if (!empty($filter)) {
if (!empty($filter['model'])) {
$sql = "SELECT " . $sel_inf . " FROM sccpdevmodel WHERE (`model` =" . $filter['model'] . ") ORDER BY model ";
$sql = "SELECT " . $sel_inf . " FROM sccpdevmodel WHERE (`model` ='" . $filter['model'] . "') ORDER BY model ";
} else {
// $sql = "SELECT ".$filter['model'];
$sql = "SELECT " . $sel_inf . " FROM sccpdevmodel ORDER BY model ";

View file

@ -89,12 +89,18 @@ class srvinterface {
}
$res1 = $res3['Skinny_Phone_Type'];
$res4 = $res3['Config_Phone_Type'];
if (!empty($res3['Addons'])) {
$res2 = $res3['Addons'];
} else {
$res2 = '';
}
$res3['SCCP_Vendor']= Array('vendor' => strtok($res1,' '),'model' => strtok('('), 'model_id' => strtok(')'), 'vendor_addon' => strtok($res2,' '), 'model_addon' => strtok(' '));
if (empty($res3['SCCP_Vendor']['vendor']) || $res3['SCCP_Vendor']['vendor']=='Undefined'){
$res3['SCCP_Vendor']= Array('vendor' => 'Undefined','model' => $res4, 'model_id' => '', 'vendor_addon' => $res3['SCCP_Vendor']['vendor_addon'], 'model_addon' => $res3['SCCP_Vendor']['model_addon']);
// return $res4;
// return array();
}
return $res3;
} else {
return array();

View file

@ -284,8 +284,8 @@ $(document).ready(function () {
// var btn_add=$('#sccp_hw_addon').find(':selected').data('val');
if (type_id === 1) {
if ($('#sccp_hw_addon').val() !== 'none') {
$('#sccp_hw_addon').val('none').change();
if ($('#sccp_hw_addon').val() !== 'NONE') {
$('#sccp_hw_addon').val('NONE').change();
}
$('#sccp_hw_addon').attr("disabled", "disabled");

View file

@ -22,7 +22,8 @@ class Sccp extends \FreePBX\modules\Core\Driver {
"prettyName" => _("Sccp Custom Driver"),
"shortName" => "SCCP",
"description" => _("Sccp Device"),
"sccp_driver_ver" => "11.2"
"sccp_driver_ver" => "11.2",
"about" => "Sccp mysql class Base ver: 11.2, Sccp ver: default"
);
}

View file

@ -29,7 +29,8 @@ class Sccp extends \FreePBX\modules\Core\Driver {
"prettyName" => _("Sccp Custom Driver"),
"shortName" => "SCCP",
"description" => _("Sccp Device"),
"sccp_driver_ver" => "11.2"
"sccp_driver_ver" => "11.2",
"about" => "Sccp mysql class Base ver: 11.2, Sccp ver: 431"
);
}
public function addDevice1($id, $settings) {

View file

@ -27,6 +27,13 @@ and open the template in the editor. Base Version before all crash :-)
</input>
<help>Help.</help>
</item>
<item type="IE" id="1" seq="99"><label>Phone ssh login</label>
<input>
<name>sccp_xml_about</name>
<default>XML Base ver: 11.2, Sccp ver: default</default>
</input>
<help>Help.</help>
</item>
</page_group>

View file

@ -27,6 +27,13 @@ and open the template in the editor. Base Version before all crash :-)
</input>
<help>Help.</help>
</item>
<item type="IE" id="1" seq="99"><label>Phone ssh login</label>
<input>
<name>sccp_xml_about</name>
<default>XML Base ver: 11.2, Sccp ver: 431</default>
</input>
<help>Help.</help>
</item>
</page_group>

View file

@ -58,7 +58,7 @@ $sofkey_list = \FreePBX::Sccp_manager()-> srvinterface -> sccp_list_keysets();
$model_list = \FreePBX::Sccp_manager()->dbinterface->get_db_SccpTableData("HWDevice");
$extension_list = \FreePBX::Sccp_manager()->dbinterface->get_db_SccpTableData("HWextension");
$extension_list[]=array(model=>'none', vendor=>'CISCO', dns=>'0');
$extension_list[]=array(model=>'NONE', vendor=>'CISCO', dns=>'0');
$items = $itm -> children();

View file

@ -5,15 +5,12 @@
* and open the template in the editor.
*/
// vim: set ai ts=4 sw=4 ft=phtml:
// print_r($this->sccpvalues['sccp_compatible']);
// print_r($this->sccpvalues);
// $id_name = 'SEP000A8A5C5F25';
// print_r($this->srvinterface->getChanSCCPVersion());
// print_r('<br>');
// print_r($this->sccpvalues['sccp_compatible']);
// print_r($this->sccpvalues);
// print_r($this->srvinterface->getCoreSCCPVersion());
// $lang_arr = $this->extconfigs->getextConfig('sccp_lang','sk_SK');
// $lang_arr = $this->extconfigs->getextConfig('sccp_lang','sk_SK');
// print_r('<br>');
// print_r(timezone_identifiers_list());
// print_r(timezone_identifiers_list());
// print_r('<br>');
?>