Add vendorconfig data to Edit Device
Translate DB fields to formshow fields These field translations need to be simplified
This commit is contained in:
parent
b2ee6ad853
commit
790b5f7949
|
@ -568,7 +568,7 @@ class Sccp_manager extends \FreePBX_Helpers implements \BMO {
|
|||
dbug('Settings', $get_settings);
|
||||
$hdr_prefix = 'sccp_hw_';
|
||||
$hdr_arprefix = 'sccp_hw-ar_';
|
||||
$hdr_vendPrefix = 'sccp_hw_vendor';
|
||||
$hdr_vendPrefix = 'sccp_hw_vendorconfig';
|
||||
|
||||
$save_buttons = array();
|
||||
$save_settings = array();
|
||||
|
@ -625,6 +625,9 @@ class Sccp_manager extends \FreePBX_Helpers implements \BMO {
|
|||
if (!empty($get_settings[$hdr_prefix . $key])) {
|
||||
$value = $get_settings[$hdr_prefix . $key];
|
||||
}
|
||||
if (!empty($get_settings[$hdr_vendPrefix . $key])) {
|
||||
$value = $get_settings[$hdr_vendPrefix . $key];
|
||||
}
|
||||
if (!empty($get_settings[$hdr_arprefix . $key])) {
|
||||
$arr_data = '';
|
||||
$arr_clear = false;
|
||||
|
|
|
@ -588,103 +588,104 @@ and open the template in the editor. Base Version before all crash :-)
|
|||
</input>
|
||||
<help>Timeout in HH:MM format to automatically turn off phone display if outside the time specified by "daysDisplayNotActive", "displayOnTime" and "displayOnTimeout".</help>
|
||||
</item>
|
||||
|
||||
<item type="IS" id="6" seq="98">
|
||||
<name>vendorconfig_settingsaccess</name>
|
||||
<label>Settings Access</label>
|
||||
<default></default>
|
||||
<default>Inherit</default>
|
||||
<button value="">Inherit</button>
|
||||
<button value="0">Disabled</button>
|
||||
<button value="1">Enabled</button>
|
||||
<button value="off">Disabled</button>
|
||||
<button value="on">Enabled</button>
|
||||
<help>Whether a user can access the phone settings.</help>
|
||||
</item>
|
||||
<item type="IS" id="6" seq="98">
|
||||
<name>vendorconfig_videocapability</name>
|
||||
<label>Video Capability</label>
|
||||
<default></default>
|
||||
<default>Inherit</default>
|
||||
<button value="">Inherit</button>
|
||||
<button value="0">Disabled</button>
|
||||
<button value="1">Enabled</button>
|
||||
<button value="off">Disabled</button>
|
||||
<button value="on">Enabled</button>
|
||||
<help></help>
|
||||
</item>
|
||||
<item type="IS" id="6" seq="98">
|
||||
<name>vendorconfig_webaccess</name>
|
||||
<label>Web Access</label>
|
||||
<default></default>
|
||||
<default>Inherit</default>
|
||||
<button value="">Inherit</button>
|
||||
<button value="0">Disabled</button>
|
||||
<button value="1">Enabled</button>
|
||||
<button value="off">Disabled</button>
|
||||
<button value="on">Enabled</button>
|
||||
<help>Enable the phone's HTTP server.</help>
|
||||
</item>
|
||||
<item type="IS" id="6" seq="98">
|
||||
<name>vendorconfig_webadmin</name>
|
||||
<label>Web Admin</label>
|
||||
<default></default>
|
||||
<default>Inherit</default>
|
||||
<button value="">Inherit</button>
|
||||
<button value="0">Disabled</button>
|
||||
<button value="1">Enabled</button>
|
||||
<button value="off">Disabled</button>
|
||||
<button value="on">Enabled</button>
|
||||
<help>Enable remote administration using the phone's HTTP server. 8821 model only.</help>
|
||||
</item>
|
||||
<item type="IS" id="6" seq="98">
|
||||
<name>vendorconfig_pcport</name>
|
||||
<label>Pc Port</label>
|
||||
<default></default>
|
||||
<default>Inherit</default>
|
||||
<button value="">Inherit</button>
|
||||
<button value="1">Disabled</button>
|
||||
<button value="0">Enabled</button>
|
||||
<button value="off">Disabled</button>
|
||||
<button value="on">Enabled</button>
|
||||
<help>Disable the PC (computer) port</help>
|
||||
</item>
|
||||
<item type="IS" id="6" seq="98">
|
||||
<name>vendorconfig_spantopcport</name>
|
||||
<label>Span to PC Port</label>
|
||||
<default></default>
|
||||
<default>Inherit</default>
|
||||
<button value="">Inherit</button>
|
||||
<button value="1">Disabled</button>
|
||||
<button value="0">Enabled</button>
|
||||
<button value="off">Disabled</button>
|
||||
<button value="on">Enabled</button>
|
||||
<help>Forward packets sent and received on the SW (network) port to the PC (computer) port.</help>
|
||||
</item>
|
||||
<item type="IS" id="6" seq="98">
|
||||
<name>vendorconfig_voicevlanaccess</name>
|
||||
<label>Voice Vlan Access</label>
|
||||
<default></default>
|
||||
<default>Inherit</default>
|
||||
<button value="">Inherit</button>
|
||||
<button value="0">Disabled</button>
|
||||
<button value="1">Enabled</button>
|
||||
<button value="off">Disabled</button>
|
||||
<button value="on">Enabled</button>
|
||||
<help>Allow devices connected to the PC (computer) port to access the voice VLAN.</help>
|
||||
</item>
|
||||
<item type="IS" id="6" seq="98">
|
||||
<name>vendorconfig_enablecdpswport</name>
|
||||
<label>Cdp Sw Port</label>
|
||||
<default></default>
|
||||
<default>Inherit</default>
|
||||
<button value="">Inherit</button>
|
||||
<button value="0">Disabled</button>
|
||||
<button value="1">Enabled</button>
|
||||
<button value="off">Disabled</button>
|
||||
<button value="on">Enabled</button>
|
||||
<help>Enable Cisco Discovery Protocol on the SW (network) port.</help>
|
||||
</item>
|
||||
<item type="IS" id="6" seq="98">
|
||||
<name>vendorconfig_enablecdppcport</name>
|
||||
<label>Cdp PC Port</label>
|
||||
<default></default>
|
||||
<default>Inherit</default>
|
||||
<button value="">Inherit</button>
|
||||
<button value="0">Disabled</button>
|
||||
<button value="1">Enabled</button>
|
||||
<button value="off">Disabled</button>
|
||||
<button value="on">Enabled</button>
|
||||
<help>Enable Cisco Discovery Protocol on the PC (computer) port.</help>
|
||||
</item>
|
||||
<item type="IS" id="6" seq="98">
|
||||
<name>vendorconfig_enablelldpswport</name>
|
||||
<label>Link Layer Discovery Sw</label>
|
||||
<default></default>
|
||||
<default>Inherit</default>
|
||||
<button value="">Inherit</button>
|
||||
<button value="0">Disabled</button>
|
||||
<button value="1">Enabled</button>
|
||||
<button value="off">Disabled</button>
|
||||
<button value="on">Enabled</button>
|
||||
<help>Enable Link Layer Discovery Protocol on the SW (network) port.</help>
|
||||
</item>
|
||||
<item type="IS" id="6" seq="98">
|
||||
<name>vendorconfig_enablelldppcport</name>
|
||||
<label>Link Layer Discovery PC</label>
|
||||
<default></default>
|
||||
<default>Inherit</default>
|
||||
<button value="">Inherit</button>
|
||||
<button value="0">Disabled</button>
|
||||
<button value="1">Enabled</button>
|
||||
<button value="off">Disabled</button>
|
||||
<button value="on">Enabled</button>
|
||||
<help> Enable Link Layer Discovery Protocol on the PC (computer) port.</help>
|
||||
</item>
|
||||
</page_group>
|
||||
|
|
|
@ -26,10 +26,12 @@ if (!empty($_REQUEST['new_id'])) {
|
|||
}
|
||||
}
|
||||
|
||||
// Editing an existing Device
|
||||
if (!empty($_REQUEST['id'])) {
|
||||
$dev_id = $_REQUEST['id'];
|
||||
$dev_new = $dev_id;
|
||||
$db_res = $this->dbinterface->HWextension_db_SccpTableData('get_sccpdevice_byid', array("id" => $dev_id));
|
||||
dbug('db_res', $db_res);
|
||||
foreach ($db_res as $key => $val) {
|
||||
if (!empty($val)) {
|
||||
switch ($key) {
|
||||
|
@ -65,9 +67,32 @@ if (!empty($_REQUEST['id'])) {
|
|||
// $val = after('/', $val);
|
||||
// break;
|
||||
}
|
||||
$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'
|
||||
);
|
||||
if (array_key_exists($key,$translateFieldArray)) {
|
||||
$def_val[$translateFieldArray[$key]] = array("keyword" => $translateFieldArray[$key], "data" => $val, "seq" => "99");
|
||||
continue;
|
||||
}
|
||||
$def_val[$key] = array("keyword" => $key, "data" => $val, "seq" => "99");
|
||||
}
|
||||
}
|
||||
dbug('def_value', $def_val);
|
||||
|
||||
}
|
||||
//print_r($db_res);
|
||||
|
||||
|
|
Loading…
Reference in a new issue