Prerelease 29.09.2017

Add Avanced function of Shared lines
This commit is contained in:
PhantomVl 2017-09-29 15:50:29 +03:00
parent a4ab6b208a
commit 0dc0ef3e3c
4 changed files with 49 additions and 7 deletions

View file

@ -24,8 +24,8 @@
* + Change Installer ?? (test )
* + DND Mode
* - suport kvstore ?????
* - Shared Line ????
* - bug Fix
* + Shared Line
* - bug Fix ...(K no w bug? no fix)
*
*/
@ -888,6 +888,13 @@ class Sccp_manager extends \FreePBX_Helpers implements \BMO {
}
}
}
break;
case 'adv.line':
$btn_t = 'line';
$btn_n = (string) $get_settings['button' . $it . '_line'];
$btn_n .= '@'.(string)$get_settings['button' . $it . '_advline'];
$btn_opt = (string) $get_settings['button' . $it . '_advopt'];
break;
case 'line':
case 'silent':

View file

@ -218,6 +218,7 @@ $(document).ready(function () {
case 'silent':
case 'monitor':
case 'line':
case 'adv.line':
$(this).removeClass('hidden');
break;
case 'service':
@ -238,6 +239,7 @@ $(document).ready(function () {
case 'silent':
case 'monitor':
case 'empty':
case 'adv.line':
case 'line':
$(this).addClass('hidden');
break;
@ -248,6 +250,7 @@ $(document).ready(function () {
case 'feature':
$(this).removeClass('hidden');
break;
case 'adv.line':
case 'service':
case 'speeddial':
case 'silent':
@ -258,6 +261,13 @@ $(document).ready(function () {
break;
}
});
$('.lineadv_' + kid).each(function () {
if (kval == 'adv.line') {
$(this).removeClass('hidden');
} else {
$(this).addClass('hidden');
}
});
$('.linespeed_' + kid).each(function () {
if (kval == 'speeddial') {
$(this).removeClass('hidden');

View file

@ -330,7 +330,9 @@ if (!empty($version)) {
FOR EACH ROW
BEGIN
IF NEW.`type` = 'line' THEN
IF (SELECT COUNT(*) FROM `sccpline` WHERE `sccpline`.`name` = SUBSTRING_INDEX(NEW.`name`,'!',1)) = 0
SET @line_x = SUBSTRING_INDEX(NEW.`name`,'!',1);
SET @line_x = SUBSTRING_INDEX(@line_x,'@',1);
IF (SELECT COUNT(*) FROM `sccpline` WHERE `sccpline`.`name` = @line_x ) = 0
THEN
UPDATE `Foreign key contraint violated: line does not exist in sccpline` SET x=1;
END IF;

View file

@ -11,7 +11,7 @@ $forminfo =array(
);
//$buttons_type= array("empty","line","service","feature","speeddial");
// "feature","service" -- Add leter !
$buttons_type= array("empty","line","silent","monitor","speeddial","feature");
$buttons_type= array("empty","line","silent","monitor","speeddial","feature","adv.line");
$feature_list= array('parkinglot'=>'Park Slots','monitor'=> "Record Calls",'devstate'=> "Change Status");
$lines_list = $this->get_db_SccpTableData('SccpExtension');
@ -76,6 +76,13 @@ if (!empty($_REQUEST['id'])) {
$show_form_mode = $defaul_tv;
$def_hint = '';
$def_silent = '';
$defaul_advline = '';
if (strpos($defaul_btn,'@') >0) {
$defaul_tv = 'adv.line';
$show_form_mode = 'adv.line';
$defaul_btn = strtok($defaul_btn,'@');
$defaul_advline = strtok('@');
}
if ($line_id == 0) {
$show_form_mode = 'line';
}
@ -101,6 +108,9 @@ if (!empty($_REQUEST['id'])) {
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">
<div class="col-sm-2">
@ -133,7 +143,7 @@ if (!empty($_REQUEST['id'])) {
?>
</select>
<!-- if Line Type = line Show SCCP Num -->
<select class ="form-control lineselect_<?php echo $line_id.(($show_form_mode=='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
foreach ($lines_list as $data){
$select = (($data['id']==$defaul_btn)?"selected":"");
@ -179,11 +189,24 @@ if (!empty($_REQUEST['id'])) {
</div>
<div class="col-xs-5">
<?php
echo '<input class="form-control" type="text" id="'.$forminfo[1]['name'].$line_id.'_fvalue" name="'.$forminfo[1]['name'].$line_id.'_fvalue" placeholder="code" value="'.$defaul_fcod.'" >';
echo '<input class="form-control" type="text" id="'.$forminfo[1]['name'].$line_id.'_fvalue" name="'.$forminfo[1]['name'].$line_id.'_fvalue" placeholder="code" value="'.$defaul_opt.'" >';
?>
</div>
</div>
<!-- if Line Type = Advanced Show Hint line -->
<div class="lineadv_<?php echo $line_id.(($show_form_mode=='adv.line')? '':' hidden');?>" name="<?php echo $forminfo[1]['name'].$line_id.'_hint';?>">
<div class="col-xs-5">
<?php
echo '<input class="form-control" type="text" id="'.$forminfo[1]['name'].$line_id.'_advline" name="'.$forminfo[1]['name'].$line_id.'_advline" placeholder="[+=][01]:[cidname]" value="'.$defaul_advline.'" >';
?>
</div>
<div class="col-xs-5">
<?php
echo '<input class="form-control" type="text" id="'.$forminfo[1]['name'].$line_id.'_advopt" name="'.$forminfo[1]['name'].$line_id.'_advopt" placeholder="ButtonLabel,Options" value="'.$db_butons[$line_id]['options'].'" >';
?>
</div>
</div>
</div>