Fix SQL in Install Rename

Change SQL in Installer rename column
Change TFTP variable name for better clarity
This commit is contained in:
steve-lad 2021-06-25 06:35:51 +02:00
parent 97c4c93fb6
commit fb9ea64134
5 changed files with 24 additions and 30 deletions

View file

@ -885,7 +885,7 @@ class Sccp_manager extends \FreePBX_Helpers implements \BMO {
'asterisk' => $this->sccpvalues['asterisk_etc_path']['data'],
'tftp_path' => $this->sccpvalues['tftp_path']['data'],
'tftp_templates' => $this->sccpvalues['tftp_templates']['data'],
'tftp_path_store' => $this->sccpvalues['tftp_path_store']['data'],
'tftp_store_path' => $this->sccpvalues['tftp_store_path']['data'],
'tftp_lang_path' => $this->sccpvalues['tftp_lang_path']['data'],
'tftp_firmware_path' => $this->sccpvalues['tftp_firmware_path']['data'],
'tftp_dialplan' => $this->sccpvalues['tftp_dialplan']['data'],
@ -1044,7 +1044,7 @@ class Sccp_manager extends \FreePBX_Helpers implements \BMO {
$lang_data = $this->extconfigs->getExtConfig('sccp_lang');
$data_value['tftp_path'] = $this->sccppath["tftp_path"];
$this->xmlinterface->create_default_XML($this->sccppath["tftp_path_store"], $data_value, $model_information, $lang_data);
$this->xmlinterface->create_default_XML($this->sccppath["tftp_store_path"], $data_value, $model_information, $lang_data);
}
/*
@ -1121,7 +1121,7 @@ class Sccp_manager extends \FreePBX_Helpers implements \BMO {
$lang_data = $this->extconfigs->getExtConfig('sccp_lang');
if (!$sccp_native) {
return $this->xmlinterface->create_SEP_SIP_XML($this->sccppath["tftp_path_store"], $data_value, $dev_config, $dev_id, $lang_data);
return $this->xmlinterface->create_SEP_SIP_XML($this->sccppath["tftp_store_path"], $data_value, $dev_config, $dev_id, $lang_data);
}
return $this->xmlinterface->create_SEP_XML($this->sccppath["tftp_templates"], $data_value, $dev_config, $dev_id, $lang_data);
}
@ -1131,17 +1131,17 @@ class Sccp_manager extends \FreePBX_Helpers implements \BMO {
return false;
}
if ($dev_id == 'all') {
$xml_name = $this->sccppath["tftp_path_store"] . '/SEP*.cnf.xml';
$xml_name = $this->sccppath["tftp_store_path"] . '/SEP*.cnf.xml';
array_map("unlink", glob($xml_name));
$xml_name = $this->sccppath["tftp_path_store"] . '/ATA*.cnf.xml';
$xml_name = $this->sccppath["tftp_store_path"] . '/ATA*.cnf.xml';
array_map("unlink", glob($xml_name));
$xml_name = $this->sccppath["tftp_path_store"] . '/VG*.cnf.xml';
$xml_name = $this->sccppath["tftp_store_path"] . '/VG*.cnf.xml';
array_map("unlink", glob($xml_name));
} else {
if (!strpos($dev_id, 'SEP')) {
return false;
}
$xml_name = $this->sccppath["tftp_path_store"] . '/' . $dev_id . '.cnf.xml';
$xml_name = $this->sccppath["tftp_store_path"] . '/' . $dev_id . '.cnf.xml';
if (file_exists($xml_name)) {
unlink($xml_name);
}

View file

@ -429,7 +429,7 @@ function InstallDB_updateSchema($db_config)
}
} else {
if (!empty($row_data['rename'])) {
$sql_modify .= "CHANGE COLUMN {$row_fld} {$row_data['rename']} {$row_data['create']}, ";
$sql_modify .= "RENAME COLUMN {$row_fld} TO {$row_data['rename']}, ";
$count_modify ++;
}
$row_data['fieldModified'] = FALSE;

View file

@ -271,7 +271,7 @@ class extconfigs
);
$base_tree = array('tftp_templates' => 'templates',
'tftp_path_store' => 'settings',
'tftp_store_path' => 'settings',
'tftp_lang_path' => 'languages',
'tftp_firmware_path' => 'firmware',
'tftp_dialplan' => 'dialplan',

View file

@ -272,7 +272,6 @@
return "File not found<br /> " + value ;
}
return value;
}
function SetRowColor(row, index) {

View file

@ -91,7 +91,6 @@ if (!empty($_REQUEST['ru_id'])) {
</div></div>
<?php
for ($line_id = 0; $line_id <=$max_buttons; $line_id ++) {
// print_r($db_buttons[$line_id]);
$show_form_mode = '';
$defaul_tv = (empty($db_buttons[$line_id])) ? "empty": $db_buttons[$line_id]['buttontype'];
$defaul_btn = (empty($db_buttons[$line_id])) ? "": $db_buttons[$line_id]['name'];
@ -143,13 +142,9 @@ if (!empty($_REQUEST['ru_id'])) {
}
}
}
// print_r($def_hint_btn);
// print_r($defaul_opt);
echo '<!-- Begin button :'.$line_id.' -->';
echo '<div class="line_button element-container" '.(($line_id < $show_buttons)?"":"hidden ").'data-id="'.$line_id.'">';
// echo 'Mode : '.$show_form_mode. ' opt: ';
// print_r( $defaul_opt);
?>
<div class="row"> <div class="form-group">