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'], 'asterisk' => $this->sccpvalues['asterisk_etc_path']['data'],
'tftp_path' => $this->sccpvalues['tftp_path']['data'], 'tftp_path' => $this->sccpvalues['tftp_path']['data'],
'tftp_templates' => $this->sccpvalues['tftp_templates']['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_lang_path' => $this->sccpvalues['tftp_lang_path']['data'],
'tftp_firmware_path' => $this->sccpvalues['tftp_firmware_path']['data'], 'tftp_firmware_path' => $this->sccpvalues['tftp_firmware_path']['data'],
'tftp_dialplan' => $this->sccpvalues['tftp_dialplan']['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'); $lang_data = $this->extconfigs->getExtConfig('sccp_lang');
$data_value['tftp_path'] = $this->sccppath["tftp_path"]; $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'); $lang_data = $this->extconfigs->getExtConfig('sccp_lang');
if (!$sccp_native) { 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); 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; return false;
} }
if ($dev_id == 'all') { 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)); 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)); 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)); array_map("unlink", glob($xml_name));
} else { } else {
if (!strpos($dev_id, 'SEP')) { if (!strpos($dev_id, 'SEP')) {
return false; 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)) { if (file_exists($xml_name)) {
unlink($xml_name); unlink($xml_name);
} }

View file

@ -429,7 +429,7 @@ function InstallDB_updateSchema($db_config)
} }
} else { } else {
if (!empty($row_data['rename'])) { 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 ++; $count_modify ++;
} }
$row_data['fieldModified'] = FALSE; $row_data['fieldModified'] = FALSE;

View file

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

View file

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

View file

@ -66,7 +66,7 @@ if (!empty($_REQUEST['ru_id'])) {
<h3><i class="fa fa-minus"></i><?php echo _($forminfo[0]['label']) ?></h3> <h3><i class="fa fa-minus"></i><?php echo _($forminfo[0]['label']) ?></h3>
</div> </div>
<div class="section" data-id="<?php echo $forminfo[0]['name'];?>"> <div class="section" data-id="<?php echo $forminfo[0]['name'];?>">
<div class="row"> <div class="form-group"> <div class="row"> <div class="form-group">
<div class="col-sm-2"> <div class="col-sm-2">
<label class="control-label">Help</label> <label class="control-label">Help</label>
<i class="fa fa-question-circle fpbx-help-icon" data-for="frmbuttons"></i> <i class="fa fa-question-circle fpbx-help-icon" data-for="frmbuttons"></i>
@ -87,11 +87,10 @@ if (!empty($_REQUEST['ru_id'])) {
hold = To be implemented</li><li>transfer = To be implemented</li><li>multiblink = To be implemented</li><li>mobility = To be implemented</li><li>conference = To be implemented</li> hold = To be implemented</li><li>transfer = To be implemented</li><li>multiblink = To be implemented</li><li>mobility = To be implemented</li><li>conference = To be implemented</li>
</ui></ui>");?></span> </ui></ui>");?></span>
</div> </div>
</div></div> </div></div>
<?php <?php
for ($line_id = 0; $line_id <=$max_buttons; $line_id ++) { for ($line_id = 0; $line_id <=$max_buttons; $line_id ++) {
// print_r($db_buttons[$line_id]);
$show_form_mode = ''; $show_form_mode = '';
$defaul_tv = (empty($db_buttons[$line_id])) ? "empty": $db_buttons[$line_id]['buttontype']; $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']; $defaul_btn = (empty($db_buttons[$line_id])) ? "": $db_buttons[$line_id]['name'];
@ -143,16 +142,12 @@ if (!empty($_REQUEST['ru_id'])) {
} }
} }
} }
// print_r($def_hint_btn);
// print_r($defaul_opt);
echo '<!-- Begin button :'.$line_id.' -->'; echo '<!-- Begin button :'.$line_id.' -->';
echo '<div class="line_button element-container" '.(($line_id < $show_buttons)?"":"hidden ").'data-id="'.$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"> <div class="row"> <div class="form-group">
<div class="col-sm-2"> <div class="col-sm-2">
<label class="control-label" for="<?php echo $forminfo[1]['name'].$line_id; ?> "><?php echo _($forminfo[1]['label'].$line_id).(($line_id =="0")?' Default ':''); ?></label> <label class="control-label" for="<?php echo $forminfo[1]['name'].$line_id; ?> "><?php echo _($forminfo[1]['label'].$line_id).(($line_id =="0")?' Default ':''); ?></label>
</div> </div>
@ -212,7 +207,7 @@ if (!empty($_REQUEST['ru_id'])) {
echo '</div><div class="col-xs-5">'; echo '</div><div class="col-xs-5">';
echo '<select class="form-control" name="'.$forminfo[1]['name'].$line_id.'_hline" >'; echo '<select class="form-control" name="'.$forminfo[1]['name'].$line_id.'_hline" >';
foreach ($hint_list as $data) { foreach ($hint_list as $data) {
$select = (($data['key']==$def_hint_btn)?"selected":""); $select = (($data['key']==$def_hint_btn)?"selected":"");
echo '<option value="'.$data['key'].'" '.$select.' >'.$data['exten'].' / '.$data['label'].'</option>'; echo '<option value="'.$data['key'].'" '.$select.' >'.$data['exten'].' / '.$data['label'].'</option>';
@ -221,7 +216,7 @@ if (!empty($_REQUEST['ru_id'])) {
echo '</div>'; echo '</div>';
?> ?>
</div> </div>
<!-- if Line Type = feature Show Futures Park --> <!-- if Line Type = feature Show Futures Park -->
<div data-type='feature' class="lineid_<?php echo $line_id.(($show_form_mode=='feature')? '':' hidden');?>" name="<?php echo $forminfo[1]['name'].$line_id.'_hint';?>"> <div data-type='feature' class="lineid_<?php echo $line_id.(($show_form_mode=='feature')? '':' hidden');?>" name="<?php echo $forminfo[1]['name'].$line_id.'_hint';?>">
<div class="col-xs-4"> <div class="col-xs-4">
<?php <?php
@ -248,7 +243,7 @@ if (!empty($_REQUEST['ru_id'])) {
?> ?>
</div> </div>
</div> </div>
<!-- if Line Type = feature Show Futures Park --> <!-- if Line Type = feature Show Futures Park -->
<div data-type='featurep' class="lineid_<?php echo $line_id.(($show_form_mode=='feature')? (($defaul_ftr=='parkinglot')? ' ':' hidden'):' hidden');?>" name="<?php echo $forminfo[1]['name'].$line_id.'_park';?>"> <div data-type='featurep' class="lineid_<?php echo $line_id.(($show_form_mode=='feature')? (($defaul_ftr=='parkinglot')? ' ':' hidden'):' hidden');?>" name="<?php echo $forminfo[1]['name'].$line_id.'_park';?>">
<div class="col-xs-4"> <div class="col-xs-4">
<div class="radioset" data-toggle="buttons"> <div class="radioset" data-toggle="buttons">
@ -267,12 +262,12 @@ if (!empty($_REQUEST['ru_id'])) {
<?php <?php
echo '<!-- End button :'.$line_id.' -->'; echo '<!-- End button :'.$line_id.' -->';
} }
?> ?>
</div> </div>
</form> </form>
<div class="section-butom" data-for="<?php echo $forminfo[0]['name'];?>"> <div class="section-butom" data-for="<?php echo $forminfo[0]['name'];?>">
<h3></h3> <h3></h3>