diff --git a/Sccp_manager.class.php b/Sccp_manager.class.php index 786536a..cb57a78 100644 --- a/Sccp_manager.class.php +++ b/Sccp_manager.class.php @@ -173,17 +173,23 @@ class Sccp_manager extends \FreePBX_Helpers implements \BMO { * Generate Input elements in Html Code from sccpgeneral.xml */ - public function showGroup($grup_name, $heder_show, $form_prefix = 'sccp', $form_values = null) { + public function showGroup($group_name, $show_Header, $form_prefix = 'sccp', $form_values = null, $show_inherit = true) { $htmlret = ""; if (empty($form_values)) { $form_values = $this->sccpvalues; } if ((array) $this->xml_data) { - foreach ($this->xml_data->xpath('//page_group[@name="' . $grup_name . '"]') as $item) { + foreach ($this->xml_data->xpath('//page_group[@name="' . $group_name . '"]') as $item) { $htmlret .= load_view(__DIR__ . '/views/formShow.php', array( - 'itm' => $item, 'h_show' => $heder_show, - 'form_prefix' => $form_prefix, 'fvalues' => $form_values, - 'tftp_lang' => $this->tftpLang, 'metainfo' => $this->sccp_metainfo)); + 'itm' => $item, + 'h_show' => $show_Header, + 'form_prefix' => $form_prefix, + 'fvalues' => $form_values, + 'tftp_lang' => $this->tftpLang, + 'metainfo' => $this->sccp_metainfo, + 'inherit' => $show_inherit + ) + ); } } else { $htmlret .= load_view(__DIR__ . '/views/formShowError.php'); @@ -680,9 +686,14 @@ class Sccp_manager extends \FreePBX_Helpers implements \BMO { $save_settings[$key] = $value; } } + // Save this device. $this->dbinterface->write('sccpdevice', $save_settings, 'replace'); + // Retrieve the phone buttons and write back to + // update sccpdeviceconfig via Trigger $save_buttons = $this->getPhoneButtons($get_settings, $name_dev, $hw_type); $this->dbinterface->write('sccpbuttons', $save_buttons, $update_hw, '', $name_dev); + // Create new XML for this device, and then reset or restart the device + // so that it loads the file from TFT. $this->createSccpDeviceXML($name_dev); if ($hw_id == 'new') { $this->aminterface->sccpDeviceReset($name_dev, 'reset'); diff --git a/assets/js/sccp_manager.js b/assets/js/sccp_manager.js index 1189908..f74f278 100644 --- a/assets/js/sccp_manager.js +++ b/assets/js/sccp_manager.js @@ -34,10 +34,10 @@ $(document).ready(function () { vdata = vdata + $(this).serialize() + '&'; }); if ($('.fpbx-submit').data('id') == "hw_edit") { - snd_command = 'save_hardware'; + snd_command = 'save_device'; } if ($('.fpbx-submit').data('id') == "hw_sedit") { - snd_command = 'save_sip_hardware'; + snd_command = 'save_sip_device'; } if ($('.fpbx-submit').data('id') == "ruser_edit") { snd_command = 'save_ruser'; @@ -71,10 +71,10 @@ $(document).ready(function () { vdata = vdata + $(this).serialize() + '&'; }); if ($('.fpbx-submit').data('id') == "hw_edit") { - snd_command = 'save_hardware'; + snd_command = 'save_device'; } if ($('.fpbx-submit').data('id') == "hw_sedit") { - snd_command = 'save_sip_hardware'; + snd_command = 'save_sip_device'; } if ($('.fpbx-submit').data('id') == "ruser_edit") { snd_command = 'save_ruser'; diff --git a/conf/sccpgeneral.xml.v433 b/conf/sccpgeneral.xml.v433 index 2334954..0d0bc08 100644 --- a/conf/sccpgeneral.xml.v433 +++ b/conf/sccpgeneral.xml.v433 @@ -536,7 +536,7 @@ and open the template in the editor. Base Version before all crash :-) - + @@ -588,7 +588,6 @@ and open the template in the editor. Base Version before all crash :-) Timeout in HH:MM format to automatically turn off phone display if outside the time specified by "daysDisplayNotActive", "displayOnTime" and "displayOnTimeout". - vendorconfig_settingsaccess @@ -688,8 +687,6 @@ and open the template in the editor. Base Version before all crash :-) Enable Link Layer Discovery Protocol on the PC (computer) port. - - @@ -1069,7 +1066,7 @@ and open the template in the editor. Base Version before all crash :-) sccp-custom - Context where direct pickup search for extensions. if not set current contect will be use. + Context where direct pickup search for extensions. if not set current context will be use. @@ -1079,7 +1076,7 @@ and open the template in the editor. Base Version before all crash :-) sccp-custom - Context where direct pickup search for extensions. if not set current contect will be use. + Context where direct pickup search for extensions. if not set current context will be use. diff --git a/sccpManTraits/ajaxHelper.php b/sccpManTraits/ajaxHelper.php index e8485b1..33e2620 100644 --- a/sccpManTraits/ajaxHelper.php +++ b/sccpManTraits/ajaxHelper.php @@ -10,8 +10,8 @@ trait ajaxHelper { switch ($req) { case 'backupsettings': case 'savesettings': - case 'save_hardware': - case 'save_sip_hardware': + case 'save_device': + case 'save_sip_device': case 'save_ruser': case 'save_dialplan_template': case 'delete_hardware': @@ -62,8 +62,8 @@ trait ajaxHelper { // !TODO!: It is necessary in the future to check, and replace all server responses on correct messages. Use _(msg) return array('status' => true, 'message' => $msg, 'reload' => true); break; - case 'save_sip_hardware': - case 'save_hardware': + case 'save_sip_device': + case 'save_device': $this->saveSccpDevice($request); return array('status' => true, 'search' => '?display=sccp_phone', 'hash' => 'sccpdevice'); diff --git a/views/form.adddevice.php b/views/form.adddevice.php index 2b91823..09bb2dc 100644 --- a/views/form.adddevice.php +++ b/views/form.adddevice.php @@ -70,14 +70,14 @@ if (!empty($_REQUEST['id'])) { } } //print_r($db_res); - + if (!empty($device_warning)) { - ?> + ?>

Warning in the SCCP Device

-
+
$value) { echo '

'.$key.'

'; @@ -115,8 +115,9 @@ if (!empty($device_warning)) { 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_pickup', 1, 'sccp_hw', $def_val); This are line properties and does not exist! echo $this->showGroup('sccp_hw_dev_conference', 1, 'sccp_hw', $def_val); + echo $this->showGroup('sccp_dev_vendor_conf', 1, 'sccp_hw', $def_val, true); echo $this->showGroup('sccp_hw_dev_network', 1, 'sccp_hw', $def_val); - ?> + ?> diff --git a/views/formShow.php b/views/formShow.php index 66e9fdf..9ed3fd8 100644 --- a/views/formShow.php +++ b/views/formShow.php @@ -376,6 +376,11 @@ foreach ($items as $child) { $opt_hide .= ' data-vshow="'.$child->option_show.'" data-clshow="'.$child->option_show['class'].'" '; } foreach ($child->xpath('button') as $value) { + if (!$inherit) { + if ($value == 'Inherit') { + continue; + } + } $val_check = strtolower((string)$value[@value]); if ($val_check == strtolower($res_v)) { $val_check = " checked"; diff --git a/views/server.advanced.php b/views/server.advanced.php index e263154..0bb48bd 100644 --- a/views/server.advanced.php +++ b/views/server.advanced.php @@ -9,12 +9,12 @@
- + showGroup('sccp_srst', 1); - echo $this->showGroup('sccp_advant', 1); + echo $this->showGroup('sccp_dev_vendor_conf', 1,'sccp',null,false); // echo $this->showGroup('sccp_dev_time',1); -?> +?>