Multilinguified Active Queues

This commit is contained in:
Nate Jones
2013-06-21 13:46:47 +00:00
parent aa3ff50c7e
commit 5a94de2769
5 changed files with 76 additions and 39 deletions

View File

@@ -0,0 +1,28 @@
<?php
$text['title-active_queues']['en-us'] = 'Active Queues';
$text['title-queue']['en-us'] = 'Queue';
$text['header-active_queues']['en-us'] = 'Active Queues';
$text['header-queue']['en-us'] = 'Queue';
$text['description-active_queues']['en-us'] = 'List all the queues that are currently active with one or more callers.';
$text['description-queue']['en-us'] = 'Use this page to monitor the queue activity.';
$text['label-name']['en-us'] = 'Name';
$text['label-consumer_count']['en-us'] = 'Consumer Count';
$text['label-caller_count']['en-us'] = 'Caller Count';
$text['label-waiting_count']['en-us'] = 'Waiting Count';
$text['label-importance']['en-us'] = 'Importance';
$text['label-view']['en-us'] = 'View';
$text['label-username']['en-us'] = 'Username';
$text['label-caller_id_name']['en-us'] = 'Caller ID Name';
$text['label-caller_id_number']['en-us'] = 'Caller ID Number';
$text['label-language']['en-us'] = 'Language';
$text['label-destination_number']['en-us'] = 'Destination Number';
$text['label-position']['en-us'] = 'Position';
$text['label-priority']['en-us'] = 'Priority';
$text['label-status']['en-us'] = 'Status';
$text['label-duration']['en-us'] = 'Duration';
?>

View File

@@ -34,6 +34,12 @@ else {
exit;
}
//add multi-lingual support
require_once "app_languages.php";
foreach($text as $key => $value) {
$text[$key] = $value[$_SESSION['domain']['language']['code']];
}
//get the fifo_name from http and set it to a php variable
$fifo_name = trim($_REQUEST["c"]);
@@ -52,6 +58,7 @@ else {
//show the header
require_once "includes/header.php";
$page["title"] = $text['title-queue'];
?>
<script type="text/javascript">
@@ -122,8 +129,8 @@ echo "<div align='center'>";
echo "<table width=\"100%\" border=\"0\" cellpadding=\"6\" cellspacing=\"0\">\n";
echo " <tr>\n";
echo " <td align='left'><b>Queues</b><br>\n";
echo " Use this to monitor queue activty for the <strong>$tmp_fifo_name</strong> queue.\n";
echo " <td align='left'><b>".$text['header-queue']."</b><br>\n";
echo " ".$text['description-queue']."\n";
echo " </td>\n";
echo " </tr>\n";
echo "</table>\n";

View File

@@ -34,6 +34,12 @@ else {
exit;
}
//add multi-lingual support
require_once "app_languages.php";
foreach($text as $key => $value) {
$text[$key] = $value[$_SESSION['domain']['language']['code']];
}
//set variables
$fifo_name = trim($_REQUEST["c"]);
@@ -49,7 +55,7 @@ else {
$switch_cmd = 'fifo list_verbose '.$fifo_name.'';
$fp = event_socket_create($_SESSION['event_socket_ip_address'], $_SESSION['event_socket_port'], $_SESSION['event_socket_password']);
if (!$fp) {
$msg = "<div align='center'>Connection to Event Socket failed.<br /></div>";
$msg = "<div align='center'>Connection to Event Socket failed.<br /></div>";
echo "<div align='center'>\n";
echo "<table width='40%'>\n";
echo "<tr>\n";
@@ -112,24 +118,15 @@ else {
*/
echo "<tr>\n";
echo "<th>Username</th>\n";
//echo "<th>Dialplan</th>\n";
echo "<th>Caller ID Name</th>\n";
echo "<th>Caller ID Number</th>\n";
echo "<th>Language</th>\n";
//echo "<th>ANI</th>\n";
//echo "<th>ANIII</th>\n";
//echo "<th>Network Addr</th>\n";
echo "<th>Destination Number</th>\n";
//echo "<th>RDNIS</th>\n";
//echo "<th>UUID</th>\n";
//echo "<th>Source</th>\n";
//echo "<th>Context</th>\n";
//echo "<th>Chan Name</th>\n";
echo "<th>Position</th>\n";
echo "<th>Priority</th>\n";
echo "<th>Status</th>\n";
echo "<th>Duration</th>\n";
echo "<th>".$text['label-username']."</th>\n";
echo "<th>".$text['label-caller_id_name']."</th>\n";
echo "<th>".$text['label-caller_id_number']."</th>\n";
echo "<th>".$text['label-language']."</th>\n";
echo "<th>".$text['label-destination_number']."</th>\n";
echo "<th>".$text['label-position']."</th>\n";
echo "<th>".$text['label-priority']."</th>\n";
echo "<th>".$text['label-status']."</th>\n";
echo "<th>".$text['label-duration']."</th>\n";
echo "</tr>\n";
foreach ($xml->fifo->callers->caller as $row) {
@@ -181,19 +178,10 @@ else {
echo "<tr>\n";
echo "<td valign='top' class='".$row_style[$c]."'>$username &nbsp;</td>\n";
//echo "<td valign='top' class='".$row_style[$c]."'>$dialplan &nbsp;</td>\n";
echo "<td valign='top' class='".$row_style[$c]."'>$caller_id_name &nbsp;</td>\n";
echo "<td valign='top' class='".$row_style[$c]."'>$caller_id_number &nbsp;</td>\n";
echo "<td valign='top' class='".$row_style[$c]."'>$default_language &nbsp;</td>\n";
//echo "<td valign='top' class='".$row_style[$c]."'>$ani &nbsp;</td>\n";
//echo "<td valign='top' class='".$row_style[$c]."'>$aniii &nbsp;</td>\n";
//echo "<td valign='top' class='".$row_style[$c]."'>$network_addr &nbsp;</td>\n";
echo "<td valign='top' class='".$row_style[$c]."'>$destination_number &nbsp;</td>\n";
//echo "<td valign='top' class='".$row_style[$c]."'>$rdnis &nbsp;</td>\n";
//echo "<td valign='top' class='".$row_style[$c]."'>$uuid &nbsp;</td>\n";
//echo "<td valign='top' class='".$row_style[$c]."'>$source &nbsp;</td>\n";
//echo "<td valign='top' class='".$row_style[$c]."'>$context &nbsp;</td>\n";
//echo "<td valign='top' class='".$row_style[$c]."'>$chan_name &nbsp;</td>\n";
echo "<td valign='top' class='".$row_style[$c]."'>$fifo_position &nbsp;</td>\n";
echo "<td valign='top' class='".$row_style[$c]."'>$fifo_priority &nbsp;</td>\n";
echo "<td valign='top' class='".$row_style[$c]."'>$fifo_status &nbsp;</td>\n";

View File

@@ -34,7 +34,15 @@ else {
exit;
}
//add multi-lingual support
require_once "app_languages.php";
foreach($text as $key => $value) {
$text[$key] = $value[$_SESSION['domain']['language']['code']];
}
require_once "includes/header.php";
$page["title"] = $text['title-active_queues'];
?><script type="text/javascript">
function loadXmlHttp(url, id) {
var f = this;
@@ -90,8 +98,8 @@ echo "<div align='center'>";
echo "<table width=\"100%\" border=\"0\" cellpadding=\"6\" cellspacing=\"0\">\n";
echo " <tr>\n";
echo " <td align='left'><b>Active Queues</b><br>\n";
echo " List all the queues that are currently active with one or more callers.\n";
echo " <td align='left'><b>".$text['header-active_queues']."</b><br>\n";
echo " ".$text['description-active_queues']."\n";
echo " </td>\n";
echo " </tr>\n";
echo "</table>\n";

View File

@@ -34,6 +34,12 @@ else {
exit;
}
//add multi-lingual support
require_once "app_languages.php";
foreach($text as $key => $value) {
$text[$key] = $value[$_SESSION['domain']['language']['code']];
}
$switch_cmd = 'fifo list';
$fp = event_socket_create($_SESSION['event_socket_ip_address'], $_SESSION['event_socket_port'], $_SESSION['event_socket_password']);
if ($fp) {
@@ -68,11 +74,11 @@ if ($fp) {
echo "<table width='100%' border='0' cellpadding='0' cellspacing='0'>\n";
echo "<tr>\n";
echo "<th>Name</th>\n";
echo "<th>Consumer Count</th>\n";
echo "<th>Caller Count</th>\n";
echo "<th>Waiting Count</th>\n";
echo "<th>Importance</th>\n";
echo "<th>".$text['label-name']."</th>\n";
echo "<th>".$text['label-consumer_count']."</th>\n";
echo "<th>".$text['label-caller_count']."</th>\n";
echo "<th>".$text['label-waiting_count']."</th>\n";
echo "<th>".$text['label-importance']."</th>\n";
echo "<th>&nbsp;</th>\n";
echo "</tr>\n";
@@ -96,7 +102,7 @@ if ($fp) {
echo "<td valign='top' class='".$row_style[$c]."'>".$caller_count."</td>\n";
echo "<td valign='top' class='".$row_style[$c]."'>".$waiting_count."</td>\n";
echo "<td valign='top' class='".$row_style[$c]."'>".$importance."</td>\n";
echo "<td valign='top' class='".$row_style[$c]."'><a href='fifo_interactive.php?c=".$name."'>view</a></td>\n";
echo "<td valign='top' class='".$row_style[$c]."'><a href='fifo_interactive.php?c=".$name."'>".$text['label-view']."</a></td>\n";
echo "</tr>\n";
}
else {
@@ -108,7 +114,7 @@ if ($fp) {
echo "<td valign='top' class='".$row_style[$c]."'>".$caller_count."</td>\n";
echo "<td valign='top' class='".$row_style[$c]."'>".$waiting_count."</td>\n";
echo "<td valign='top' class='".$row_style[$c]."'>".$importance."</td>\n";
echo "<td valign='top' class='".$row_style[$c]."'><a href='fifo_interactive.php?c=".$name."'>view</a></td>\n";
echo "<td valign='top' class='".$row_style[$c]."'><a href='fifo_interactive.php?c=".$name."'>".$text['label-view']."</a></td>\n";
echo "</tr>\n";
}
}