diff --git a/app/calls_active/calls_active.php b/app/calls_active/calls_active.php index ea7f057aea..39a85d0915 100644 --- a/app/calls_active/calls_active.php +++ b/app/calls_active/calls_active.php @@ -17,7 +17,7 @@ The Initial Developer of the Original Code is Mark J Crane - Portions created by the Initial Developer are Copyright (C) 2008-2023 + Portions created by the Initial Developer are Copyright (C) 2008-2025 the Initial Developer. All Rights Reserved. Contributor(s): @@ -78,7 +78,12 @@ $.ajax({ url: url, success: function(response){ - $("#ajax_reponse").html(response); + $("#ajax_response").html(response); + const table = document.getElementById('calls_active'); + var row_count = table.rows.length; + if (row_count > 0) { row_count = row_count - 1; } + const calls_active_count = document.getElementById('calls_active_count'); + calls_active_count.innerHTML = row_count; } }); timer_id = setTimeout(ajax_get, refresh); @@ -132,19 +137,70 @@ \n"; -echo "\n"; -echo "\n"; -echo "


"; +//create token + $object = new token; + $token = $object->create('/app/calls_active/calls_active_inc.php'); + $_SESSION['app']['calls_active']['token']['name'] = $token['name']; + $_SESSION['app']['calls_active']['token']['hash'] = $token['hash']; -require_once "resources/footer.php"; +//show the content header + echo "
\n"; + echo "
".$text['title']."
".number_format($num_rows)."
\n"; + echo "
\n"; + echo " ".button::create(['type'=>'button','title'=>$text['label-refresh_pause'],'icon'=>'sync-alt fa-spin','onclick'=>'refresh_stop()']).""; + if (permission_exists('call_active_eavesdrop') && !empty($user['extensions'])) { + if (sizeof($user['extensions']) > 1) { + echo " \n"; + echo " \n"; + echo " \n"; + } + else if (sizeof($user['extensions']) == 1) { + echo " \n"; + } + } + if (permission_exists('call_active_hangup') && $rows) { + echo button::create(['type'=>'button','label'=>$text['label-hangup'],'icon'=>'phone-slash','id'=>'btn_delete','onclick'=>"refresh_stop(); modal_open('modal-hangup','btn_hangup');"]); + } + if (permission_exists('call_active_all')) { + if ($show == "all") { + echo button::create(['type'=>'button','label'=>$text['button-back'],'icon'=>$theme_button_icon_back,'link'=>'calls_active.php','onmouseover'=>'refresh_stop()','onmouseout'=>'refresh_start()']); + } + else { + echo button::create(['type'=>'button','label'=>$text['button-show_all'],'icon'=>$theme_button_icon_all,'link'=>'calls_active.php?show=all','onmouseover'=>'refresh_stop()','onmouseout'=>'refresh_start()']); + } + } + echo "
\n"; + echo "
\n"; + echo "
\n"; + + if (permission_exists('call_active_hangup') && $rows) { + echo modal::create(['id'=>'modal-hangup','type'=>'general','message'=>$text['confirm-hangups'],'actions'=>button::create(['type'=>'button','label'=>$text['label-hangup'],'icon'=>'check','id'=>'btn_hangup','style'=>'float: right; margin-left: 15px;','collapse'=>'never','onclick'=>"modal_close(); list_action_set('hangup'); list_form_submit('form_list');"])]); + } + + echo $text['description']."\n"; + echo "

\n"; + +//show the content body + echo "
\n"; + echo "\n"; + echo "\n"; + echo "


"; + +//show the footer + require_once "resources/footer.php"; /* // deprecated functions for this page diff --git a/app/calls_active/calls_active_inc.php b/app/calls_active/calls_active_inc.php index 6bca3648dc..7a14d5dc93 100644 --- a/app/calls_active/calls_active_inc.php +++ b/app/calls_active/calls_active_inc.php @@ -17,7 +17,7 @@ The Initial Developer of the Original Code is Mark J Crane - Portions created by the Initial Developer are Copyright (C) 2008-2023 + Portions created by the Initial Developer are Copyright (C) 2008-2025 the Initial Developer. All Rights Reserved. Contributor(s): @@ -119,10 +119,6 @@ return; } -//create token - $object = new token; - $token = $object->create('/app/calls_active/calls_active_inc.php'); - //add the style echo "\n"; -//show the content - echo "
\n"; - echo "
".$text['title']."
".number_format($num_rows)."
\n"; - echo "
\n"; - echo " ".button::create(['type'=>'button','title'=>$text['label-refresh_pause'],'icon'=>'sync-alt fa-spin','onclick'=>'refresh_stop()']).""; - if (permission_exists('call_active_eavesdrop') && !empty($user['extensions'])) { - if (sizeof($user['extensions']) > 1) { - echo " \n"; - echo " \n"; - echo " \n"; - } - else if (sizeof($user['extensions']) == 1) { - echo " \n"; - } - } - if (permission_exists('call_active_hangup') && $rows) { - echo button::create(['type'=>'button','label'=>$text['label-hangup'],'icon'=>'phone-slash','id'=>'btn_delete','onclick'=>"refresh_stop(); modal_open('modal-hangup','btn_hangup');"]); - } - if (permission_exists('call_active_all')) { - if ($show == "all") { - echo button::create(['type'=>'button','label'=>$text['button-back'],'icon'=>$theme_button_icon_back,'link'=>'calls_active.php','onmouseover'=>'refresh_stop()','onmouseout'=>'refresh_start()']); - } - else { - echo button::create(['type'=>'button','label'=>$text['button-show_all'],'icon'=>$theme_button_icon_all,'link'=>'calls_active.php?show=all','onmouseover'=>'refresh_stop()','onmouseout'=>'refresh_start()']); - } - } - echo "
\n"; - echo "
\n"; - echo "
\n"; - - if (permission_exists('call_active_hangup') && $rows) { - echo modal::create(['id'=>'modal-hangup','type'=>'general','message'=>$text['confirm-hangups'],'actions'=>button::create(['type'=>'button','label'=>$text['label-hangup'],'icon'=>'check','id'=>'btn_hangup','style'=>'float: right; margin-left: 15px;','collapse'=>'never','onclick'=>"modal_close(); list_action_set('hangup'); list_form_submit('form_list');"])]); - } - - echo $text['description']."\n"; - echo "

\n"; - //show the results echo "
\n"; @@ -191,7 +144,7 @@ echo "\n"; echo "
\n"; - echo " \n"; + echo "
\n"; echo " \n"; if (permission_exists('call_active_hangup')) { echo "
\n"; @@ -320,7 +273,7 @@ echo "
\n"; echo "
\n"; - echo "\n"; + echo "\n"; echo "\n"; ?>