Active Calls: Add Show All feature for Superadmin, basic view for Admin, refresh activity icon.

Registrations: Minor visual adjustments.
This commit is contained in:
Nate Jones 2015-05-01 06:35:40 +00:00
parent d4a84948ae
commit 68a347724b
9 changed files with 216 additions and 127 deletions

View File

@ -23,51 +23,22 @@
$apps[$x]['permissions'][0]['name'] = "call_active_view"; $apps[$x]['permissions'][0]['name'] = "call_active_view";
$apps[$x]['permissions'][0]['menu']['uuid'] = "eba3d07f-dd5c-6b7b-6880-493b44113ade"; $apps[$x]['permissions'][0]['menu']['uuid'] = "eba3d07f-dd5c-6b7b-6880-493b44113ade";
$apps[$x]['permissions'][0]['groups'][] = "superadmin"; $apps[$x]['permissions'][0]['groups'][] = "superadmin";
$apps[$x]['permissions'][0]['groups'][] = "admin";
$apps[$x]['permissions'][1]['name'] = "call_active_transfer"; //$apps[$x]['permissions'][1]['name'] = "call_active_transfer";
$apps[$x]['permissions'][1]['groups'][] = "superadmin"; //$apps[$x]['permissions'][1]['groups'][] = "superadmin";
$apps[$x]['permissions'][2]['name'] = "call_active_hangup"; $apps[$x]['permissions'][2]['name'] = "call_active_hangup";
$apps[$x]['permissions'][2]['groups'][] = "superadmin"; $apps[$x]['permissions'][2]['groups'][] = "superadmin";
$apps[$x]['permissions'][2]['groups'][] = "admin";
$apps[$x]['permissions'][3]['name'] = "call_active_park"; //$apps[$x]['permissions'][3]['name'] = "call_active_park";
$apps[$x]['permissions'][3]['groups'][] = "superadmin"; //$apps[$x]['permissions'][3]['groups'][] = "superadmin";
$apps[$x]['permissions'][4]['name'] = "call_active_rec"; //$apps[$x]['permissions'][4]['name'] = "call_active_rec";
$apps[$x]['permissions'][4]['groups'][] = "superadmin"; //$apps[$x]['permissions'][4]['groups'][] = "superadmin";
$apps[$x]['permissions'][5]['name'] = "extension_active_view"; $apps[$x]['permissions'][5]['name'] = "call_active_all";
$apps[$x]['permissions'][0]['menu']['uuid'] = "6dd85c19-cb6b-5cca-bf32-499bbe936f79";
//$apps[$x]['permissions'][5]['groups'][] = "user";
$apps[$x]['permissions'][5]['groups'][] = "admin";
$apps[$x]['permissions'][5]['groups'][] = "superadmin"; $apps[$x]['permissions'][5]['groups'][] = "superadmin";
$apps[$x]['permissions'][6]['name'] = "extension_active_transfer";
$apps[$x]['permissions'][6]['groups'][] = "admin";
$apps[$x]['permissions'][6]['groups'][] = "superadmin";
$apps[$x]['permissions'][7]['name'] = "extension_active_hangup";
$apps[$x]['permissions'][7]['groups'][] = "admin";
$apps[$x]['permissions'][7]['groups'][] = "superadmin";
$apps[$x]['permissions'][8]['name'] = "extension_active_park";
$apps[$x]['permissions'][8]['groups'][] = "admin";
$apps[$x]['permissions'][8]['groups'][] = "superadmin";
$apps[$x]['permissions'][9]['name'] = "extension_active_rec";
$apps[$x]['permissions'][9]['groups'][] = "admin";
$apps[$x]['permissions'][9]['groups'][] = "superadmin";
$apps[$x]['permissions'][10]['name'] = "extension_active_list_view";
$apps[$x]['permissions'][10]['menu']['uuid'] = "6dd85c19-cb6b-5cca-bf32-499bbe936f79";
//$apps[$x]['permissions'][10]['groups'][] = "user";
$apps[$x]['permissions'][10]['groups'][] = "admin";
$apps[$x]['permissions'][10]['groups'][] = "superadmin";
$apps[$x]['permissions'][11]['name'] = "extension_active_assigned_view";
$apps[$x]['permissions'][11]['menu']['uuid'] = "6dd85c19-cb6b-5cca-bf32-499bbe936f79";
//$apps[$x]['permissions'][11]['groups'][] = "user";
$apps[$x]['permissions'][11]['groups'][] = "admin";
$apps[$x]['permissions'][11]['groups'][] = "superadmin";
?> ?>

View File

@ -13,8 +13,8 @@ $text['title']['es-cl'] = "Llamadas Activas";
$text['title']['fr-fr'] = "Communications Actives"; $text['title']['fr-fr'] = "Communications Actives";
$text['title']['pt-pt'] = "Chamadas Ativas"; $text['title']['pt-pt'] = "Chamadas Ativas";
$text['title']['pt-br'] = "Configurações da Conta"; $text['title']['pt-br'] = "Configurações da Conta";
$text['title']['pl'] = "Ustawienia konta"; $text['title']['pl'] = "Aktywne Rozmowy";
$text['title']['sv-se'] = "Aktiva samtal"; $text['title']['sv-se'] = "Aktiva Samtal";
$text['label-time']['en-us'] = "Time"; $text['label-time']['en-us'] = "Time";
$text['label-time']['es-cl'] = "Tiempo"; $text['label-time']['es-cl'] = "Tiempo";
@ -56,6 +56,20 @@ $text['label-secure']['pt-br'] = "Seguro";
$text['label-secure']['pl'] = "Bezpieczny"; $text['label-secure']['pl'] = "Bezpieczny";
$text['label-secure']['sv-se'] = "Skydda"; $text['label-secure']['sv-se'] = "Skydda";
$text['label-refresh_pause']['en-us'] = "Pause Refresh";
$text['label-refresh_pause']['es-cl'] = "Actualizar Pausa";
$text['label-refresh_pause']['pt-pt'] = "Pausa Atualizar";
$text['label-refresh_pause']['fr-fr'] = "Pause Actualiser";
$text['label-refresh_pause']['pt-br'] = "Pausar atualização";
$text['label-refresh_pause']['pl'] = "Pauzuj odÅwieżanie";
$text['label-refresh_enable']['en-us'] = "Enable Refresh";
$text['label-refresh_enable']['es-cl'] = "Activar Actualizar";
$text['label-refresh_enable']['pt-pt'] = "Habilitar Atualização";
$text['label-refresh_enable']['fr-fr'] = "Activer Actualiser";
$text['label-refresh_enable']['pt-br'] = "Habilitar atualização";
$text['label-refresh_enable']['pl'] = "Ä…cz odÅwieżanie";
$text['label-profile']['en-us'] = "Profile"; $text['label-profile']['en-us'] = "Profile";
$text['label-profile']['es-cl'] = "Perfil"; $text['label-profile']['es-cl'] = "Perfil";
$text['label-profile']['fr-fr'] = "Profile"; $text['label-profile']['fr-fr'] = "Profile";
@ -128,6 +142,13 @@ $text['label-ext']['pt-br'] = "Extensão";
$text['label-ext']['pl'] = "Numer wewnętrzny"; $text['label-ext']['pl'] = "Numer wewnętrzny";
$text['label-ext']['sv-se'] = "Ank"; $text['label-ext']['sv-se'] = "Ank";
$text['label-domain']['en-us'] = "Domain";
$text['label-domain']['es-cl'] = "Dominio";
$text['label-domain']['pt-pt'] = "Domínio";
$text['label-domain']['fr-fr'] = "Domaine";
$text['label-domain']['pt-br'] = "Dominio";
$text['label-domain']['pl'] = "Domena";
$text['label-destination']['en-us'] = "Dest"; $text['label-destination']['en-us'] = "Dest";
$text['label-destination']['es-cl'] = "Destino"; $text['label-destination']['es-cl'] = "Destino";
$text['label-destination']['fr-fr'] = "Dest"; $text['label-destination']['fr-fr'] = "Dest";
@ -181,7 +202,7 @@ $text['description-2']['es-cl'] = "Utilice este menú para ver todas las extensi
$text['description-2']['fr-fr'] = "Voir toutes les extensions, superviser et interagir avec les Communications Actives."; $text['description-2']['fr-fr'] = "Voir toutes les extensions, superviser et interagir avec les Communications Actives.";
$text['description-2']['pt-pt'] = "Utilize este menu para ver todas as extensões, monitorizar e interagir com as chamadas activas."; $text['description-2']['pt-pt'] = "Utilize este menu para ver todas as extensões, monitorizar e interagir com as chamadas activas.";
$text['description-2']['pt-br'] = "A informação contem a origem, destino, duração e outros detalhes úteis da chamada."; $text['description-2']['pt-br'] = "A informação contem a origem, destino, duração e outros detalhes úteis da chamada.";
$text['description-2']['pl'] = "Użyj tej opcji, aby zobaczyć wszystkie numery wewnętrzne i monitorować interakcję z aktywnymi połączeniami."; $text['description-2']['pl'] = "Użyj tej opcji, aby zobaczyć wszystkie numery wewnętrzne i monitorować interakcję z aktywnymi rozmowami.";
$text['description-2']['sv-se'] = "Använd detta för att se alla anknytningar och monitorera och hantera aktiva samtal."; $text['description-2']['sv-se'] = "Använd detta för att se alla anknytningar och monitorera och hantera aktiva samtal.";
$text['description']['en-us'] = "Use this to monitor and interact with the active calls."; $text['description']['en-us'] = "Use this to monitor and interact with the active calls.";
@ -189,7 +210,7 @@ $text['description']['es-cl'] = "Utilice este menú para monitorear e interactua
$text['description']['fr-fr'] = "Superviser et interagir avec les Communications Actives."; $text['description']['fr-fr'] = "Superviser et interagir avec les Communications Actives.";
$text['description']['pt-pt'] = "Utilize este menu para monitorizar e interagir com as chamadas activas."; $text['description']['pt-pt'] = "Utilize este menu para monitorizar e interagir com as chamadas activas.";
$text['description']['pt-br'] = "Editar informações da conta."; $text['description']['pt-br'] = "Editar informações da conta.";
$text['description']['pl'] = "Użyć tej opcji do monitorowania i interakcji z aktywnymi połączeniami."; $text['description']['pl'] = "Użyć tej opcji do monitorowania i interakcji z aktywnymi rozmowami.";
$text['description']['sv-se'] = "Använd detta för att monitorera och hantera aktiva samtal."; $text['description']['sv-se'] = "Använd detta för att monitorera och hantera aktiva samtal.";
$text['confirm-socket']['en-us'] = "Connection to Event Socket failed."; $text['confirm-socket']['en-us'] = "Connection to Event Socket failed.";
@ -248,4 +269,17 @@ $text['check-available-on-demand-status']['pt-br'] = "Disponível (A pedido)";
$text['check-available-on-demand-status']['pl'] = "Dostępny (na żądanie)"; $text['check-available-on-demand-status']['pl'] = "Dostępny (na żądanie)";
$text['check-available-on-demand-status']['sv-se'] = "Anträffbar (På Begäran) "; $text['check-available-on-demand-status']['sv-se'] = "Anträffbar (På Begäran) ";
$text['button-show_all']['en-us'] = "Show All";
$text['button-show_all']['es-cl'] = "Mostrar Todos";
$text['button-show_all']['pt-pt'] = "Mostrar Todos";
$text['button-show_all']['fr-fr'] = "Montrer Tout";
$text['button-show_all']['pt-br'] = "Mostrar Todos";
$text['button-show_all']['pl'] = "Pokaż Wszystkie";
$text['button-back']['en-us'] = "Back";
$text['button-back']['es-cl'] = "Volver";
$text['button-back']['pt-pt'] = "Voltar";
$text['button-back']['fr-fr'] = "Retour";
$text['button-back']['pt-br'] = "Voltar";
$text['button-back']['pl'] = "Wróć";
?> ?>

View File

@ -12,5 +12,6 @@ $apps[$x]['menu'][0]['parent_uuid'] = "0438b504-8613-7887-c420-c837ffb20cb1";
$apps[$x]['menu'][0]['category'] = "internal"; $apps[$x]['menu'][0]['category'] = "internal";
$apps[$x]['menu'][0]['path'] = "/app/calls_active/calls_active.php"; $apps[$x]['menu'][0]['path'] = "/app/calls_active/calls_active.php";
$apps[$x]['menu'][0]['groups'][] = "superadmin"; $apps[$x]['menu'][0]['groups'][] = "superadmin";
$apps[$x]['menu'][0]['groups'][] = "admin";
?> ?>

View File

@ -37,11 +37,29 @@ else {
$language = new text; $language = new text;
$text = $language->get(); $text = $language->get();
//get the HTTP values and set as variables
$show = trim($_REQUEST["show"]);
if ($show != "all") { $show = ''; }
//show the header
$document['title'] = $text['title']; $document['title'] = $text['title'];
require_once "resources/header.php"; require_once "resources/header.php";
?>
//ajax for refresh
?>
<script type="text/javascript"> <script type="text/javascript">
var refresh = 1500;
var source_url = 'calls_active_inc.php?';
<?php
if ($show == 'all') {
echo "source_url = source_url + '&show=all';";
}
if (isset($_REQUEST["debug"])) {
echo "source_url = source_url + '&debug';";
}
?>
var interval_timer_id;
function loadXmlHttp(url, id) { function loadXmlHttp(url, id) {
var f = this; var f = this;
f.xmlHttp = null; f.xmlHttp = null;
@ -77,9 +95,9 @@ if (this.xmlHttp.readyState == 4 && (this.xmlHttp.status == 200 || !/^http/.test
} }
var requestTime = function() { var requestTime = function() {
var url = 'calls_active_inc.php<?php if (isset($_REQUEST["debug"])) { echo "?debug"; }?>'; var url = source_url;
new loadXmlHttp(url, 'ajax_reponse'); new loadXmlHttp(url, 'ajax_reponse');
setInterval(function(){new loadXmlHttp(url, 'ajax_reponse');}, 1500); refresh_start();
} }
if (window.addEventListener) { if (window.addEventListener) {
@ -89,6 +107,21 @@ else if (window.attachEvent) {
window.attachEvent('onload', requestTime); window.attachEvent('onload', requestTime);
} }
//refresh controls
function refresh_stop() {
clearInterval(interval_timer_id);
document.getElementById('refresh_state').innerHTML = "<img src='resources/images/refresh_paused.png' style='width: 16px; height: 16px; border: none; margin-top: 1px; cursor: pointer;' onclick='refresh_start();' alt=\"<?php echo $text['label-refresh_enable']?>\" title=\"<?php echo $text['label-refresh_enable']?>\">";
}
function refresh_start() {
if (document.getElementById('refresh_state')) { document.getElementById('refresh_state').innerHTML = "<img src='resources/images/refresh_active.gif' style='width: 16px; height: 16px; border: none; margin-top: 3px; cursor: pointer;' alt=\"<?php echo $text['label-refresh_pause']?>\" title=\"<?php echo $text['label-refresh_pause']?>\">"; }
interval_timer_id = setInterval( function() {
url = source_url;
new loadXmlHttp(url, 'ajax_reponse');
}, refresh);
}
//call controls
function hangup(uuid) { function hangup(uuid) {
if (confirm("<?php echo $text['confirm-hangup']?>")) { if (confirm("<?php echo $text['confirm-hangup']?>")) {
send_cmd('calls_exec.php?cmd=uuid_kill%20'+uuid); send_cmd('calls_exec.php?cmd=uuid_kill%20'+uuid);
@ -106,14 +139,10 @@ function send_cmd(url) {
xmlhttp.send(null); xmlhttp.send(null);
document.getElementById('cmd_reponse').innerHTML=xmlhttp.responseText; document.getElementById('cmd_reponse').innerHTML=xmlhttp.responseText;
} }
</script> </script>
<?php <?php
echo "<b>".$text['title']."</b>";
echo "<br><br>\n";
echo $text['description']."\n";
echo "<br><br>\n";
echo "<div id='ajax_reponse'></div>\n"; echo "<div id='ajax_reponse'></div>\n";
echo "<div id='time_stamp' style='visibility:hidden'>".date('Y-m-d-s')."</div>\n"; echo "<div id='time_stamp' style='visibility:hidden'>".date('Y-m-d-s')."</div>\n";
echo "<br><br><br>"; echo "<br><br><br>";

View File

@ -38,6 +38,10 @@ else {
$language = new text; $language = new text;
$text = $language->get(); $text = $language->get();
//get the HTTP values and set as variables
$show = trim($_REQUEST["show"]);
if ($show != "all") { $show = ''; }
//include theme config for button images //include theme config for button images
include_once("themes/".$_SESSION['domain']['template']['name']."/config.php"); include_once("themes/".$_SESSION['domain']['template']['name']."/config.php");
@ -67,6 +71,33 @@ else {
//set the array //set the array
$results = json_decode($json, "true"); $results = json_decode($json, "true");
//define js function call var
$onhover_pause_refresh = " onmouseover='refresh_stop();' onmouseout='refresh_start();'";
//show content
echo "<table cellpadding='0' cellspacing='0' border='0' align='right'>";
echo " <tr>";
echo " <td valign='middle' nowrap='nowrap' style='padding-right: 15px' id='refresh_state'>";
echo " <img src='resources/images/refresh_active.gif' style='width: 16px; height: 16px; border: none; margin-top: 3px; cursor: pointer;' onclick='refresh_stop();' alt=\"".$text['label-refresh_pause']."\" title=\"".$text['label-refresh_pause']."\">";
echo " </td>";
echo " <td valign='top' nowrap='nowrap'>";
if (permission_exists('call_active_all')) {
if ($show == "all") {
echo " <input type='button' class='btn' name='' alt='".$text['button-back']."' onclick=\"document.location='calls_active.php';\" value='".$text['button-back']."' ".$onhover_pause_refresh.">\n";
}
else {
echo " <input type='button' class='btn' name='' alt='".$text['button-show_all']."' onclick=\"document.location='calls_active.php?show=all';\" value='".$text['button-show_all']."' ".$onhover_pause_refresh.">\n";
}
}
echo " </td>";
echo " </tr>";
echo "</table>";
echo "<b>".$text['title']."</b>";
echo "<br><br>\n";
echo $text['description']."\n";
echo "<br><br>\n";
//set the alternating color for each row //set the alternating color for each row
$c = 0; $c = 0;
$row_style["0"] = "row_style0"; $row_style["0"] = "row_style0";
@ -79,6 +110,9 @@ else {
echo "<tr>\n"; echo "<tr>\n";
echo "<th>".$text['label-profile']."</th>\n"; echo "<th>".$text['label-profile']."</th>\n";
echo "<th>".$text['label-created']."</th>\n"; echo "<th>".$text['label-created']."</th>\n";
if ($show == 'all') {
echo "<th>".$text['label-domain']."</th>\n";
}
echo "<th>".$text['label-number']."</th>\n"; echo "<th>".$text['label-number']."</th>\n";
echo "<th>".$text['label-cid-name']."</th>\n"; echo "<th>".$text['label-cid-name']."</th>\n";
echo "<th>".$text['label-cid-number']."</th>\n"; echo "<th>".$text['label-cid-number']."</th>\n";
@ -90,6 +124,14 @@ else {
echo "</tr>\n"; echo "</tr>\n";
foreach ($results["rows"] as $row) { foreach ($results["rows"] as $row) {
//determine show all
if (!($show == 'all' && permission_exists('call_active_all'))) {
$foreign_call = true;
foreach ($row as $key => $value) {
if (substr_count($value, $_SESSION['domain_name']) > 0) { $foreign_call = false; }
}
if ($foreign_call) { continue; }
}
//set the php variables //set the php variables
foreach ($row as $key => $value) { foreach ($row as $key => $value) {
$$key = $value; $$key = $value;
@ -108,12 +150,32 @@ else {
$tmp_number = $temp_array[0]; $tmp_number = $temp_array[0];
$tmp_number = str_replace("sip:", "", $tmp_number); $tmp_number = str_replace("sip:", "", $tmp_number);
//get the domain
if ($show == 'all') {
if (substr_count($presence_id, '@') > 0) {
$presence_id_array = explode('@', $presence_id);
$domain_name = $presence_id_array[1];
}
else if ($context != '') {
if (substr_count($context, '@') > 0) {
$context_array = explode('@', $context);
$domain_name = $context_array[1];
}
else {
$domain_name = $context;
}
}
}
//remove the '+' because it breaks the call recording //remove the '+' because it breaks the call recording
$cid_num = str_replace("+", "", $cid_num); $cid_num = str_replace("+", "", $cid_num);
echo "<tr>\n"; echo "<tr>\n";
echo "<td valign='top' class='".$row_style[$c]."'>".$sip_profile."&nbsp;</td>\n"; echo "<td valign='top' class='".$row_style[$c]."'>".$sip_profile."&nbsp;</td>\n";
echo "<td valign='top' class='".$row_style[$c]."'>".$created."&nbsp;</td>\n"; echo "<td valign='top' class='".$row_style[$c]."'>".$created."&nbsp;</td>\n";
if ($show == 'all') {
echo "<td valign='top' class='".$row_style[$c]."'>".$domain_name."&nbsp;</td>\n";
}
echo "<td valign='top' class='".$row_style[$c]."'>".$tmp_number."&nbsp;</td>\n"; echo "<td valign='top' class='".$row_style[$c]."'>".$tmp_number."&nbsp;</td>\n";
echo "<td valign='top' class='".$row_style[$c]."'>".$cid_name."&nbsp;</td>\n"; echo "<td valign='top' class='".$row_style[$c]."'>".$cid_name."&nbsp;</td>\n";
echo "<td valign='top' class='".$row_style[$c]."'>".$cid_num."&nbsp;</td>\n"; echo "<td valign='top' class='".$row_style[$c]."'>".$cid_num."&nbsp;</td>\n";

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 501 B

View File

@ -103,9 +103,6 @@ require_once "resources/check_auth.php";
window.attachEvent('onload', requestTime); window.attachEvent('onload', requestTime);
} }
var record_count = 0;
var destination;
//refresh controls //refresh controls
function refresh_stop() { function refresh_stop() {
clearInterval(interval_timer_id); clearInterval(interval_timer_id);
@ -123,14 +120,9 @@ require_once "resources/check_auth.php";
</script> </script>
<?php <?php
echo "<table width='100%' border='0' cellpadding='0' cellspacing='2'>\n"; echo "<div id='ajax_reponse'></div>\n";
echo " <tr class='border'>\n"; echo "<div id='time_stamp' style='visibility:hidden'>".date('Y-m-d-s')."</div>\n";
echo " <td align=\"left\">\n"; echo "<br><br><br>";
echo " <div id=\"ajax_reponse\"></div>\n";
echo " <div id=\"time_stamp\" style=\"visibility:hidden\">".date('Y-m-d-s')."</div>\n";
echo " </td>";
echo " </tr>";
echo "</table>";
//get the footer //get the footer
require_once "resources/footer.php"; require_once "resources/footer.php";

View File

@ -41,7 +41,7 @@ require_once "resources/check_auth.php";
$language = new text; $language = new text;
$text = $language->get(); $text = $language->get();
//get the HTTP values asn set as variables //get the HTTP values and set as variables
$sip_profile_name = trim($_REQUEST["profile"]); $sip_profile_name = trim($_REQUEST["profile"]);
$show = trim($_REQUEST["show"]); $show = trim($_REQUEST["show"]);
if ($show != "all") { $show = ''; } if ($show != "all") { $show = ''; }
@ -122,7 +122,7 @@ require_once "resources/check_auth.php";
} }
//show the registrations //show the registrations
echo "<table width='100%' border='0' cellspacing='0' cellpadding='5'>\n"; echo "<table width='100%' border='0' cellspacing='0' cellpadding='0'>\n";
echo "<tr>\n"; echo "<tr>\n";
echo "<td width='100%'>\n"; echo "<td width='100%'>\n";
echo " <b>".$text['header-registrations'].": ".count($registrations)."</b>\n"; echo " <b>".$text['header-registrations'].": ".count($registrations)."</b>\n";
@ -144,7 +144,7 @@ require_once "resources/check_auth.php";
echo "</table>\n"; echo "</table>\n";
echo "<br />\n"; echo "<br />\n";
echo "<table width='100%' border='0' cellspacing='0' cellpadding='5'>\n"; echo "<table width='100%' border='0' cellspacing='0' cellpadding='0'>\n";
echo "<tr>\n"; echo "<tr>\n";
echo " <th>".$text['label-user']."</th>\n"; echo " <th>".$text['label-user']."</th>\n";
echo " <th>".$text['label-agent']."</th>\n"; echo " <th>".$text['label-agent']."</th>\n";