From 815b7dbd2a9ee68e0b1a693386ba3f1689cd2876 Mon Sep 17 00:00:00 2001 From: steve-lad <72376554+steve-lad@users.noreply.github.com> Date: Wed, 16 Jun 2021 13:21:44 +0200 Subject: [PATCH] Update Vendor defaults from db Use db default values instead of xml as these are dynamic. --- views/server.advanced.php | 32 +++++++++++++++++++++++++++++++- 1 file changed, 31 insertions(+), 1 deletion(-) diff --git a/views/server.advanced.php b/views/server.advanced.php index 0bb48bd..67145ed 100644 --- a/views/server.advanced.php +++ b/views/server.advanced.php @@ -12,8 +12,38 @@ dbinterface->HWextension_db_SccpTableData('get_columns_sccpdevice'); + + $translateFieldArray = array('_logserver' => 'vendorconfig_logserver', + '_daysdisplaynotactive' => 'vendorconfig_daysdisplaynotactive', + '_displayontime' => 'vendorconfig_displayontime', + '_displayonduration' => 'vendorconfig_displayonduration', + '_displayidletimeout' => 'vendorconfig_displayidletimeout', + '_settingsaccess' => 'vendorconfig_settingsaccess', + '_videocapability' => 'vendorconfig_videocapability', + '_webaccess' => 'vendorconfig_webaccess', + '_webadmin' => 'vendorconfig_webadmin', + '_pcport' => 'vendorconfig_pcport', + '_spantopcport' => 'vendorconfig_spantopcport', + '_voicevlanaccess' => 'vendorconfig_voicevlanaccess', + '_enablecdpswport' => 'vendorconfig_enablecdpswport', + '_enablecdppcport' => 'vendorconfig_enablecdppcport', + '_enablelldpswport' => 'vendorconfig_enablelldpswport', + '_enablelldppcport' => 'vendorconfig_enablelldppcport' + ); + + foreach ($sccpDeviceDesc as $data) { + $key = (string) $data['Field']; + if (array_key_exists($key, $translateFieldArray)) { + $defaultVal[$translateFieldArray[$key]] = array("keyword" => $translateFieldArray[$key], "data" => $data['Default'], "seq" => "99"); + } + } + echo $this->showGroup('sccp_srst', 1); - echo $this->showGroup('sccp_dev_vendor_conf', 1,'sccp',null,false); + echo $this->showGroup('sccp_dev_vendor_conf', 1,'sccp',$defaultVal,false); // echo $this->showGroup('sccp_dev_time',1); ?>