Begin resample Sccp_manager

Create seporated interface to Xml
    Bug fix: Line ID
This commit is contained in:
PhantomVl 2017-11-02 16:10:23 +03:00
parent 4b6ebea984
commit d218d10bf3
3 changed files with 8 additions and 8 deletions

View file

@ -932,7 +932,7 @@ class Sccp_manager extends \FreePBX_Helpers implements \BMO {
case 'monitor':
$btn_t = 'speeddial';
$btn_opt = (string) $get_settings['button' . $it . '_line'];
$db_res = $this-> dbinterface->get_db_SccpTableData('SccpExtension', array('id' => $btn_opt));
$db_res = $this-> dbinterface->get_db_SccpTableData('SccpExtension', array('name' => $btn_opt));
$btn_n = $db_res[0]['label'];
$btn_opt .= ',' . $btn_opt . $this->hint_context;
break;

View file

@ -26,11 +26,11 @@ class dbinterface {
}
switch ($dataid) {
case "SccpExtension":
if (empty($data['id'])) {
$sql = "SELECT * FROM `sccpline` ORDER BY `id`";
if (empty($data['name'])) {
$sql = "SELECT * FROM `sccpline` ORDER BY `name`";
$raw_settings = sql($sql, "getAll", DB_FETCHMODE_ASSOC);
} else {
$sql = "SELECT * FROM `sccpline` WHERE `id`=" . $data['id'];
$sql = "SELECT * FROM `sccpline` WHERE `name`=" . $data['name'];
$raw_settings = sql($sql, "getAll", DB_FETCHMODE_ASSOC);
}
break;

View file

@ -159,8 +159,8 @@ if (!empty($_REQUEST['new_id'])) {
<select class ="form-control lineselect_<?php echo $line_id.(($show_form_mode=='line' || $show_form_mode=='adv.line')?'':' hidden');?>" name="<?php echo $forminfo[1]['name'].$line_id.'_line';?>" >
<?php
foreach ($lines_list as $data){
$select = (($data['id']==$defaul_btn)?"selected":"");
echo '<option value="'.$data['id'].'" '.$select.' >'.$data['id'].' / '.$data['label'].'</option>';
$select = (($data['name']==$defaul_btn)?"selected":"");
echo '<option value="'.$data['name'].'" '.$select.' >'.$data['name'].' / '.$data['label'].'</option>';
}
?>
</select>
@ -187,8 +187,8 @@ if (!empty($_REQUEST['new_id'])) {
echo '<select class="form-control" name="'.$forminfo[1]['name'].$line_id.'_hline" >';
foreach ($hint_list as $data){
$select = (($data['id']==$defaul_btn)?"selected":"");
echo '<option value="'.$data['id'].'" '.$select.' >'.$data['id'].' / '.$data['label'].'</option>';
$select = (($data['name']==$defaul_btn)?"selected":"");
echo '<option value="'.$data['name'].'" '.$select.' >'.$data['name'].' / '.$data['label'].'</option>';
}
echo '</select>';
echo '</div>';