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': case 'monitor':
$btn_t = 'speeddial'; $btn_t = 'speeddial';
$btn_opt = (string) $get_settings['button' . $it . '_line']; $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_n = $db_res[0]['label'];
$btn_opt .= ',' . $btn_opt . $this->hint_context; $btn_opt .= ',' . $btn_opt . $this->hint_context;
break; break;

View file

@ -26,11 +26,11 @@ class dbinterface {
} }
switch ($dataid) { switch ($dataid) {
case "SccpExtension": case "SccpExtension":
if (empty($data['id'])) { if (empty($data['name'])) {
$sql = "SELECT * FROM `sccpline` ORDER BY `id`"; $sql = "SELECT * FROM `sccpline` ORDER BY `name`";
$raw_settings = sql($sql, "getAll", DB_FETCHMODE_ASSOC); $raw_settings = sql($sql, "getAll", DB_FETCHMODE_ASSOC);
} else { } 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); $raw_settings = sql($sql, "getAll", DB_FETCHMODE_ASSOC);
} }
break; 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';?>" > <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 <?php
foreach ($lines_list as $data){ foreach ($lines_list as $data){
$select = (($data['id']==$defaul_btn)?"selected":""); $select = (($data['name']==$defaul_btn)?"selected":"");
echo '<option value="'.$data['id'].'" '.$select.' >'.$data['id'].' / '.$data['label'].'</option>'; echo '<option value="'.$data['name'].'" '.$select.' >'.$data['name'].' / '.$data['label'].'</option>';
} }
?> ?>
</select> </select>
@ -187,8 +187,8 @@ if (!empty($_REQUEST['new_id'])) {
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['id']==$defaul_btn)?"selected":""); $select = (($data['name']==$defaul_btn)?"selected":"");
echo '<option value="'.$data['id'].'" '.$select.' >'.$data['id'].' / '.$data['label'].'</option>'; echo '<option value="'.$data['name'].'" '.$select.' >'.$data['name'].' / '.$data['label'].'</option>';
} }
echo '</select>'; echo '</select>';
echo '</div>'; echo '</div>';