diff --git a/Sccp_manager.class.php b/Sccp_manager.class.php index 610201d..0e81458 100644 --- a/Sccp_manager.class.php +++ b/Sccp_manager.class.php @@ -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': diff --git a/assets/js/sccp_manager.js b/assets/js/sccp_manager.js index 67a55ba..d1ad65f 100644 --- a/assets/js/sccp_manager.js +++ b/assets/js/sccp_manager.js @@ -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'); diff --git a/install.php b/install.php index 976bc00..b3de5c6 100644 --- a/install.php +++ b/install.php @@ -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; diff --git a/views/form.buttons.php b/views/form.buttons.php index 1eb11de..3c3d8be 100644 --- a/views/form.buttons.php +++ b/views/form.buttons.php @@ -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 ''; echo '
'; +// echo 'Mode : '.$show_form_mode. ' opt: '; +// print_r( $defaul_opt); + ?>
@@ -133,7 +143,7 @@ if (!empty($_REQUEST['id'])) { ?> -
'; + echo ''; + ?> +
+
+ + +
+
+ '; + ?> +
+
+ '; ?>
-