Added sccpline fields
WIP Still have issue with def_modify in installer
This commit is contained in:
parent
afe3382aed
commit
efdf2d0469
29
install.php
29
install.php
|
@ -116,10 +116,10 @@ function Get_DB_config($sccp_compatible)
|
|||
'earlyrtp' => array('create' => "ENUM('immediate','offHook','dialing','ringout','progress','none') NOT NULL default 'none'",
|
||||
'modify' => "ENUM('immediate','offHook','dialing','ringout','progress','none')"),
|
||||
'monitor' => array('create' => "enum('on','off') NOT NULL default 'off'", 'modify' => "enum('on','off')"),
|
||||
'audio_tos' => array('def_modify' => "0xB8"),
|
||||
'audio_cos' => array('def_modify' => "6"),
|
||||
'video_tos' => array('def_modify' => "0x88"),
|
||||
'video_cos' => array('def_modify' => "5"),
|
||||
'audio_tos' => array('create' => "VARCHAR(11) NOT NULL default '0xB8'",'modify' => "0xB8"),
|
||||
'audio_cos' => array('create' => "VARCHAR(11) NOT NULL default '0x6'",'modify' => "0x6"),
|
||||
'video_tos' => array('create' => "VARCHAR(11) NOT NULL default '0x88'",'modify' => "0x88"),
|
||||
'video_cos' => array('create' => "VARCHAR(11) NOT NULL default '0x5'",'modify' => "0x5"),
|
||||
'trustphoneip' => array('drop' => "yes"),
|
||||
'transfer_on_hangup' => array('create' => "enum('on','off') NOT NULL DEFAULT 'off'", 'modify' => "enum('on','off')"),
|
||||
'phonecodepage' => array('create' => 'VARCHAR(50) NULL DEFAULT NULL', 'modify' => "VARCHAR(50)"),
|
||||
|
@ -242,10 +242,22 @@ function Get_DB_config($sccp_compatible)
|
|||
'_remotehangup_tone' => array('create' => "VARCHAR(20) NULL default null", 'modify' => "VARCHAR(20)"),
|
||||
'_transfer_tone' => array('create' => "VARCHAR(20) NULL default null", 'modify' => "VARCHAR(20)"),
|
||||
'_callwaiting_tone' => array('create' => "VARCHAR(20) NULL default null", 'modify' => "VARCHAR(20)"),
|
||||
'_callanswerorder' => array('create' => 'create' => "enum('oldestfirst','latestfirst') NOT NULL default 'latestfirst'",
|
||||
'_callanswerorder' => array('create' => "enum('oldestfirst','latestfirst') NOT NULL default 'latestfirst'",
|
||||
'modify' => "enum('oldestfirst','latestfirst')"),
|
||||
'_echocancel' => array('create' => "enum('on','off') NOT NULL default 'off'", 'modify' => "enum('on','off')"),
|
||||
'_silencesuppression' => array('create' => "VARCHAR(20) NULL default null", 'modify' => "VARCHAR(20)")
|
||||
'_silencesuppression' => array('create' => "VARCHAR(20) NULL default null", 'modify' => "VARCHAR(20)"),
|
||||
'_sccp_tos' => array('create' => "VARCHAR(11) NOT NULL default '0x68'", 'modify' => "VARCHAR(11)"),
|
||||
'_sccp_cos' => array('create' => "VARCHAR(11) NOT NULL default '0x4'", 'modify' => "VARCHAR(11)")
|
||||
),
|
||||
'sccpline' => array (
|
||||
'_regcontext' => array('create' => "VARCHAR(20) NULL default 'sccpregistration'", 'modify' => "VARCHAR(20)"),
|
||||
'_pickupgroup' => array('create' => "VARCHAR(50) NULL default null", 'modify' => "VARCHAR(50)"),
|
||||
'_transfer_on_hangup' => array('create' => "enum('on','off') NOT NULL default 'off'", 'modify' => "enum('on','off')"),
|
||||
'_autoselectline_enabled' => array('create' => "enum('on','off') NOT NULL default 'off'", 'modify' => "enum('on','off')"),
|
||||
'_autocall_select' => array('create' => "enum('on','off') NOT NULL default 'off'", 'modify' => "enum('on','off')"),
|
||||
'_backgroundImageAccess' => array('create' => "enum('on','off') NOT NULL default 'off'", 'modify' => "enum('on','off')"),
|
||||
'_phonePersonalization' => array('create' => "enum('on','off') NOT NULL default 'off'", 'modify' => "enum('on','off')"),
|
||||
'_callLogBlfEnabled' => array('create' => "enum('on','off') NOT NULL default 'off'", 'modify' => "enum('on','off')")
|
||||
)
|
||||
);
|
||||
|
||||
|
@ -257,6 +269,7 @@ function Get_DB_config($sccp_compatible)
|
|||
// If integrated into chan-sccp, the version number will change
|
||||
if ($sccp_compatible >= 433) {
|
||||
$db_config_v4['sccpdevice'] = array_merge($db_config_v4['sccpdevice'],$db_config_v5['sccpdevice']);
|
||||
$db_config_v4['sccpline'] = array_merge($db_config_v4['sccpline'],$db_config_v5['sccpline']);
|
||||
}
|
||||
return $db_config_v4;
|
||||
}
|
||||
|
@ -435,10 +448,10 @@ function InstallDB_updateSchema($db_config)
|
|||
|
||||
if (!empty($sql_create)) {
|
||||
outn("<li>" . _("Adding new FILTER_VALIDATE_INT") . "</li>");
|
||||
$sql_create = "ALTER TABLE `" . $tabl_name . "` " . substr($sql_create, 0, -2);
|
||||
$sql_create = "ALTER TABLE {$tabl_name} " .substr($sql_create, 0, -2);
|
||||
$check = $db->query($sql_create);
|
||||
if (DB::IsError($check)) {
|
||||
die_freepbx("Can not create " . $tabl_name . " table sql: " . $sql_create . "n");
|
||||
die_freepbx("Can not create {$tabl_name}. SQL: {$sql_create} \n");
|
||||
}
|
||||
}
|
||||
if (!empty($sql_modify)) {
|
||||
|
|
|
@ -109,6 +109,9 @@ class dbinterface
|
|||
case 'get_columns_sccpuser':
|
||||
$stmts = $dbh->prepare('DESCRIBE sccpuser');
|
||||
break;
|
||||
case 'get_columns_sccpline':
|
||||
$stmts = $dbh->prepare('DESCRIBE sccpuser');
|
||||
break;
|
||||
case 'get_sccpdevice_byid':
|
||||
$stmt = $dbh->prepare('SELECT t1.*, types.dns, types.buttons, types.loadimage, types.nametemplate as nametemplate,
|
||||
addon.buttons as addon_buttons FROM sccpdevice AS t1
|
||||
|
|
|
@ -67,7 +67,6 @@ trait ajaxHelper {
|
|||
case 'save_device':
|
||||
$this->saveSccpDevice($request);
|
||||
return array('status' => true, 'search' => '?display=sccp_phone', 'hash' => 'sccpdevice');
|
||||
|
||||
break;
|
||||
case 'save_ruser':
|
||||
//$res = $request;
|
||||
|
@ -388,6 +387,7 @@ trait ajaxHelper {
|
|||
}
|
||||
|
||||
}
|
||||
|
||||
function handleSubmit($get_settings, $validateonly = false) {
|
||||
$hdr_prefix = 'sccp_';
|
||||
$hdr_arprefix = 'sccp-ar_';
|
||||
|
@ -407,7 +407,7 @@ trait ajaxHelper {
|
|||
// There will be some exceptions to be handled where there should be no underscore
|
||||
// Handle at db write
|
||||
// Have default to be saved to db sccpdevice
|
||||
$dev_def = $this->getDeviceDefaults();
|
||||
$dev_def = $this->getTableDefaults('sccpdevice');
|
||||
if (!array_key_exists($key, $dev_def)) {
|
||||
// This key needs to be prefixed with underscore
|
||||
$key = '_'.$key;
|
||||
|
|
|
@ -69,11 +69,12 @@ trait helperfunctions {
|
|||
}
|
||||
return FALSE;
|
||||
}
|
||||
private function getDeviceDefaults() {
|
||||
private function getTableDefaults($table) {
|
||||
$def_val = array();
|
||||
$sccpDeviceDesc = $this->dbinterface->HWextension_db_SccpTableData('get_columns_sccpdevice');
|
||||
// TODO: This is ugly and overkill - needs to be cleaned up in dbinterface
|
||||
$sccpTableDesc = $this->dbinterface->HWextension_db_SccpTableData("get_columns_{$table}");
|
||||
|
||||
foreach ($sccpDeviceDesc as $data) {
|
||||
foreach ($sccpTableDesc as $data) {
|
||||
$key = (string) $data['Field'];
|
||||
$def_val[$key] = array("keyword" => $key, "data" => $data['Default'], "seq" => "99");
|
||||
}
|
||||
|
|
|
@ -38,7 +38,7 @@ if (!empty($_REQUEST['new_id'])) {
|
|||
}
|
||||
if (empty($_REQUEST['id'])) {
|
||||
// Adding new device to database. Get default values
|
||||
$def_val = $this->getDeviceDefaults();
|
||||
$def_val = $this->getTableDefaults('sccpdevice');
|
||||
} else {
|
||||
// Editing an existing Device
|
||||
$dev_id = $_REQUEST['id'];
|
||||
|
|
|
@ -14,7 +14,7 @@
|
|||
|
||||
// originally, this was populated by sccpgeneral.xml but that should be static
|
||||
// now will populate from the db defaults.
|
||||
$defaultVals = $this->getDeviceDefaults();
|
||||
$defaultVals = $this->getTableDefaults('sccpdevice');
|
||||
|
||||
echo $this->showGroup('sccp_srst', 1);
|
||||
echo $this->showGroup('sccp_dev_vendor_conf', 1,'vendorconfig',$defaultVals,false);
|
||||
|
|
|
@ -11,8 +11,11 @@
|
|||
<input type="hidden" name="category" value="deviceform">
|
||||
<input type="hidden" name="Submit" value="Submit">
|
||||
<?php
|
||||
|
||||
$def_val_line = $this->getTableDefaults('sccpline');
|
||||
$def_val_device = $this->getTableDefaults('sccpdevice');
|
||||
echo $this->showGroup('sccp_dev_config', 1, 'sccpdevice');
|
||||
echo $this->showGroup('sccp_dev_group_config', 1,);
|
||||
echo $this->showGroup('sccp_dev_group_config', 1, 'sccpline');
|
||||
echo $this->showGroup('sccp_dev_advconfig', 1, 'sccpdevice');
|
||||
echo $this->showGroup('sccp_dev_softkey', 1, 'sccpdevice');
|
||||
echo $this->showGroup('sccp_hotline_config', 1, 'sccpdevice');
|
||||
|
|
|
@ -26,7 +26,7 @@
|
|||
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_qos_config', 1, 'sccpdevice');
|
||||
echo $this->showGroup('sccp_extpath_config', 1);
|
||||
|
||||
?>
|
||||
|
@ -56,4 +56,3 @@
|
|||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
|
Loading…
Reference in a new issue