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]['menu']['uuid'] = "eba3d07f-dd5c-6b7b-6880-493b44113ade";
$apps[$x]['permissions'][0]['groups'][] = "superadmin";
$apps[$x]['permissions'][0]['groups'][] = "admin";
$apps[$x]['permissions'][1]['name'] = "call_active_transfer";
$apps[$x]['permissions'][1]['groups'][] = "superadmin";
//$apps[$x]['permissions'][1]['name'] = "call_active_transfer";
//$apps[$x]['permissions'][1]['groups'][] = "superadmin";
$apps[$x]['permissions'][2]['name'] = "call_active_hangup";
$apps[$x]['permissions'][2]['groups'][] = "superadmin";
$apps[$x]['permissions'][2]['groups'][] = "admin";
$apps[$x]['permissions'][3]['name'] = "call_active_park";
$apps[$x]['permissions'][3]['groups'][] = "superadmin";
//$apps[$x]['permissions'][3]['name'] = "call_active_park";
//$apps[$x]['permissions'][3]['groups'][] = "superadmin";
$apps[$x]['permissions'][4]['name'] = "call_active_rec";
$apps[$x]['permissions'][4]['groups'][] = "superadmin";
//$apps[$x]['permissions'][4]['name'] = "call_active_rec";
//$apps[$x]['permissions'][4]['groups'][] = "superadmin";
$apps[$x]['permissions'][5]['name'] = "extension_active_view";
$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]['name'] = "call_active_all";
$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']['pt-pt'] = "Chamadas Ativas";
$text['title']['pt-br'] = "Configurações da Conta";
$text['title']['pl'] = "Ustawienia konta";
$text['title']['sv-se'] = "Aktiva samtal";
$text['title']['pl'] = "Aktywne Rozmowy";
$text['title']['sv-se'] = "Aktiva Samtal";
$text['label-time']['en-us'] = "Time";
$text['label-time']['es-cl'] = "Tiempo";
@ -56,6 +56,20 @@ $text['label-secure']['pt-br'] = "Seguro";
$text['label-secure']['pl'] = "Bezpieczny";
$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']['es-cl'] = "Perfil";
$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']['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']['es-cl'] = "Destino";
$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']['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']['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']['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']['pt-pt'] = "Utilize este menu para monitorizar e interagir com as chamadas activas.";
$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['confirm-socket']['en-us'] = "Connection to Event Socket failed.";
@ -197,7 +218,7 @@ $text['confirm-socket']['es-cl'] = "Conexión con socket fallida.";
$text['confirm-socket']['fr-fr'] = "la Connexion au Event Socket a échoué.";
$text['confirm-socket']['pt-pt'] = "A conexão ao Event Socket falhou.";
$text['confirm-socket']['pt-br'] = "A conexão ao evento socket falhou";
$text['confirm-socket']['pl'] = "Polaczenie do Event Socket nie powiodło się";
$text['confirm-socket']['pl'] = "Polaczenie do Event Socket nie powiodło się";
$text['confirm-socket']['sv-se'] = "Anslutning till 'Event Socket' misslyckades";
$text['confirm-hangup']['en-us'] = "Do you really want to hangup this call?";
@ -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']['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]['path'] = "/app/calls_active/calls_active.php";
$apps[$x]['menu'][0]['groups'][] = "superadmin";
$apps[$x]['menu'][0]['groups'][] = "admin";
?>

View File

@ -37,83 +37,112 @@ else {
$language = new text;
$text = $language->get();
$document['title'] = $text['title'];
require_once "resources/header.php";
?>
//get the HTTP values and set as variables
$show = trim($_REQUEST["show"]);
if ($show != "all") { $show = ''; }
<script type="text/javascript">
function loadXmlHttp(url, id) {
var f = this;
f.xmlHttp = null;
/*@cc_on @*/ // used here and below, limits try/catch to those IE browsers that both benefit from and support it
/*@if(@_jscript_version >= 5) // prevents errors in old browsers that barf on try/catch & problems in IE if Active X disabled
try {f.ie = window.ActiveXObject}catch(e){f.ie = false;}
@end @*/
if (window.XMLHttpRequest&&!f.ie||/^http/.test(window.location.href))
f.xmlHttp = new XMLHttpRequest(); // Firefox, Opera 8.0+, Safari, others, IE 7+ when live - this is the standard method
else if (/(object)|(function)/.test(typeof createRequest))
f.xmlHttp = createRequest(); // ICEBrowser, perhaps others
else {
f.xmlHttp = null;
// Internet Explorer 5 to 6, includes IE 7+ when local //
/*@cc_on @*/
/*@if(@_jscript_version >= 5)
try{f.xmlHttp=new ActiveXObject("Msxml2.XMLHTTP");}
catch (e){try{f.xmlHttp=new ActiveXObject("Microsoft.XMLHTTP");}catch(e){f.xmlHttp=null;}}
@end @*/
}
if(f.xmlHttp != null){
f.el = document.getElementById(id);
f.xmlHttp.open("GET",url,true);
f.xmlHttp.onreadystatechange = function(){f.stateChanged();};
f.xmlHttp.send(null);
}
}
//show the header
$document['title'] = $text['title'];
require_once "resources/header.php";
loadXmlHttp.prototype.stateChanged=function () {
if (this.xmlHttp.readyState == 4 && (this.xmlHttp.status == 200 || !/^http/.test(window.location.href)))
//this.el.innerHTML = this.xmlHttp.responseText;
document.getElementById('ajax_reponse').innerHTML = this.xmlHttp.responseText;
}
//ajax for refresh
?>
<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;
var requestTime = function() {
var url = 'calls_active_inc.php<?php if (isset($_REQUEST["debug"])) { echo "?debug"; }?>';
new loadXmlHttp(url, 'ajax_reponse');
setInterval(function(){new loadXmlHttp(url, 'ajax_reponse');}, 1500);
}
function loadXmlHttp(url, id) {
var f = this;
f.xmlHttp = null;
/*@cc_on @*/ // used here and below, limits try/catch to those IE browsers that both benefit from and support it
/*@if(@_jscript_version >= 5) // prevents errors in old browsers that barf on try/catch & problems in IE if Active X disabled
try {f.ie = window.ActiveXObject}catch(e){f.ie = false;}
@end @*/
if (window.XMLHttpRequest&&!f.ie||/^http/.test(window.location.href))
f.xmlHttp = new XMLHttpRequest(); // Firefox, Opera 8.0+, Safari, others, IE 7+ when live - this is the standard method
else if (/(object)|(function)/.test(typeof createRequest))
f.xmlHttp = createRequest(); // ICEBrowser, perhaps others
else {
f.xmlHttp = null;
// Internet Explorer 5 to 6, includes IE 7+ when local //
/*@cc_on @*/
/*@if(@_jscript_version >= 5)
try{f.xmlHttp=new ActiveXObject("Msxml2.XMLHTTP");}
catch (e){try{f.xmlHttp=new ActiveXObject("Microsoft.XMLHTTP");}catch(e){f.xmlHttp=null;}}
@end @*/
}
if(f.xmlHttp != null){
f.el = document.getElementById(id);
f.xmlHttp.open("GET",url,true);
f.xmlHttp.onreadystatechange = function(){f.stateChanged();};
f.xmlHttp.send(null);
}
}
if (window.addEventListener) {
window.addEventListener('load', requestTime, false);
}
else if (window.attachEvent) {
window.attachEvent('onload', requestTime);
}
loadXmlHttp.prototype.stateChanged=function () {
if (this.xmlHttp.readyState == 4 && (this.xmlHttp.status == 200 || !/^http/.test(window.location.href)))
//this.el.innerHTML = this.xmlHttp.responseText;
document.getElementById('ajax_reponse').innerHTML = this.xmlHttp.responseText;
}
function hangup(uuid) {
if (confirm("<?php echo $text['confirm-hangup']?>")) {
send_cmd('calls_exec.php?cmd=uuid_kill%20'+uuid);
}
}
var requestTime = function() {
var url = source_url;
new loadXmlHttp(url, 'ajax_reponse');
refresh_start();
}
function send_cmd(url) {
if (window.XMLHttpRequest) {// code for IE7+, Firefox, Chrome, Opera, Safari
xmlhttp=new XMLHttpRequest();
}
else {// code for IE6, IE5
xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");
}
xmlhttp.open("GET",url,false);
xmlhttp.send(null);
document.getElementById('cmd_reponse').innerHTML=xmlhttp.responseText;
}
</script>
if (window.addEventListener) {
window.addEventListener('load', requestTime, false);
}
else if (window.attachEvent) {
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) {
if (confirm("<?php echo $text['confirm-hangup']?>")) {
send_cmd('calls_exec.php?cmd=uuid_kill%20'+uuid);
}
}
function send_cmd(url) {
if (window.XMLHttpRequest) {// code for IE7+, Firefox, Chrome, Opera, Safari
xmlhttp=new XMLHttpRequest();
}
else {// code for IE6, IE5
xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");
}
xmlhttp.open("GET",url,false);
xmlhttp.send(null);
document.getElementById('cmd_reponse').innerHTML=xmlhttp.responseText;
}
</script>
<?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='time_stamp' style='visibility:hidden'>".date('Y-m-d-s')."</div>\n";
echo "<br><br><br>";

View File

@ -38,6 +38,10 @@ else {
$language = new text;
$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_once("themes/".$_SESSION['domain']['template']['name']."/config.php");
@ -67,6 +71,33 @@ else {
//set the array
$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
$c = 0;
$row_style["0"] = "row_style0";
@ -79,6 +110,9 @@ else {
echo "<tr>\n";
echo "<th>".$text['label-profile']."</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-cid-name']."</th>\n";
echo "<th>".$text['label-cid-number']."</th>\n";
@ -90,6 +124,14 @@ else {
echo "</tr>\n";
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
foreach ($row as $key => $value) {
$$key = $value;
@ -108,12 +150,32 @@ else {
$tmp_number = $temp_array[0];
$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
$cid_num = str_replace("+", "", $cid_num);
echo "<tr>\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";
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]."'>".$cid_name."&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);
}
var record_count = 0;
var destination;
//refresh controls
function refresh_stop() {
clearInterval(interval_timer_id);
@ -122,15 +119,10 @@ require_once "resources/check_auth.php";
</script>
<?php
echo "<table width='100%' border='0' cellpadding='0' cellspacing='2'>\n";
echo " <tr class='border'>\n";
echo " <td align=\"left\">\n";
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>";
<?php
echo "<div id='ajax_reponse'></div>\n";
echo "<div id='time_stamp' style='visibility:hidden'>".date('Y-m-d-s')."</div>\n";
echo "<br><br><br>";
//get the footer
require_once "resources/footer.php";

View File

@ -41,7 +41,7 @@ require_once "resources/check_auth.php";
$language = new text;
$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"]);
$show = trim($_REQUEST["show"]);
if ($show != "all") { $show = ''; }
@ -122,7 +122,7 @@ require_once "resources/check_auth.php";
}
//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 "<td width='100%'>\n";
echo " <b>".$text['header-registrations'].": ".count($registrations)."</b>\n";
@ -144,7 +144,7 @@ require_once "resources/check_auth.php";
echo "</table>\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 " <th>".$text['label-user']."</th>\n";
echo " <th>".$text['label-agent']."</th>\n";