Multilinguified Queues (FIFO). Fixed permission issue in fifo_detail_delete.php. Fixed JS issue in fifo_detail_edit.php.

This commit is contained in:
Nate Jones
2013-06-09 05:44:19 +00:00
parent 3723001194
commit 10b852cdbc
7 changed files with 258 additions and 166 deletions

View File

@@ -0,0 +1,70 @@
<?php
// queues
$text['title-queues']['en-us'] = 'Queues';
$text['title-queue_add']['en-us'] = 'Queue Add';
$text['title-queue_edit']['en-us'] = 'Queue Edit';
$text['title-queue_detail_add']['en-us'] = 'Queue Detail Add';
$text['title-queue_detail_edit']['en-us'] = 'Queue Detail Edit';
$text['header-queues']['en-us'] = 'Queues';
$text['header-queue_add']['en-us'] = 'Queue Add';
$text['header-queue_edit']['en-us'] = 'Queue Edit';
$text['header-agent_details']['en-us'] = 'Agent Details';
$text['header-conditions_and_actions']['en-us'] = 'Conditions and Actions';
$text['header-queue_detail_add']['en-us'] = 'Queue Detail Add';
$text['header-queue_detail_edit']['en-us'] = 'Queue Detail Edit';
$text['header-additional_information']['en-us'] = 'Additional Information';
$text['description-queues']['en-us'] = 'Queues are used to setup waiting lines for callers. Also known as FIFO Queues.';
$text['description-queue_add']['en-us'] = 'In simple terms queues are holding patterns for callers to wait until someone is available to take the call. Also known as FIFO Queues.';
$text['description-queue_edit']['en-us'] = 'Queues are used to setup waiting lines for callers. Also known as FIFO Queues.';
$text['description-conditions_and_actions']['en-us'] = 'The following conditions, actions and anti-actions are used in the dialplan to direct call flow. Each is processed in order until you reach the action dialplan_detail_tag which tells what action to perform. You are not limited to only one condition or action dialplan_detail_tag for a given extension.';
$text['label-name']['en-us'] = 'Name';
$text['label-extension']['en-us'] = 'Extension';
$text['label-order']['en-us'] = 'Order';
$text['label-continue']['en-us'] = 'Continue';
$text['label-enabled']['en-us'] = 'Enabled';
$text['label-description']['en-us'] = 'Description';
$text['label-agent_queue_extension']['en-us'] = 'Queue Extension Number';
$text['label-agent_loginout_extension']['en-us'] = 'Login/Logout Extension Number';
$text['label-tag']['en-us'] = 'Tag';
$text['label-type']['en-us'] = 'Type';
$text['label-data']['en-us'] = 'Data';
$text['label-order']['en-us'] = 'Order';
$text['label-field']['en-us'] = 'Field';
$text['label-expression']['en-us'] = 'Expression';
$text['label-application']['en-us'] = 'Application';
$text['label-data']['en-us'] = 'Data';
$text['label-value']['en-us'] = 'Value';
$text['description-name']['en-us'] = 'The name the queue will be assigned.';
$text['description-extension']['en-us'] = 'The number that will be assigned to the queue.';
$text['description-agent_queue_extension']['en-us'] = 'The extension number for the Agent FIFO Queue. This is the holding pattern for agents wating to service calls in the caller FIFO queue.';
$text['description-agent_loginout_extension']['en-us'] = 'Agents use this extension number to login or logout of the Queue. After logging into the agent will be ready to receive calls from the Queue.';
$text['description-continue']['en-us'] = 'Continue in most cases should be set to false.';
$text['option-true']['en-us'] = 'True';
$text['option-false']['en-us'] = 'False';
$text['option-condition']['en-us'] = 'Condition';
$text['option-action']['en-us'] = 'Action';
$text['option-anti-action']['en-us'] = 'Anti-Action';
$text['option-parameter']['en-us'] = 'Parameter';
$text['button-add']['en-us'] = 'Add';
$text['button-edit']['en-us'] = 'Edit';
$text['button-delete']['en-us'] = 'Delete';
$text['button-back']['en-us'] = 'Back';
$text['button-save']['en-us'] = 'Save';
$text['confirm-delete']['en-us'] = 'Do you really want to delete this?';
$text['message-add']['en-us'] = 'Add Completed';
$text['message-update']['en-us'] = 'Update Completed';
$text['message-delete']['en-us'] = 'Delete Completed';
$text['message-required']['en-us'] = 'Please provide: ';
?>

View File

@@ -33,7 +33,16 @@ else {
echo "access denied";
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-queues'];
require_once "includes/paging.php";
//get http values and set them as variables
@@ -49,9 +58,7 @@ require_once "includes/paging.php";
echo " <table width=\"100%\" border=\"0\" cellpadding=\"0\" cellspacing=\"0\">\n";
echo " <tr>\n";
echo " <td align='left'><span class=\"vexpl\"><span class=\"red\"><strong>Queues\n";
echo " </strong></span></span>\n";
echo " </td>\n";
echo " <td align='left'><span class=\"vexpl\"><strong>".$text['header-queues']."</strong></span></td>\n";
echo " <td align='right'>\n";
//echo " <input type='button' class='btn' value='advanced' onclick=\"document.location.href='fifo.php';\">\n";
echo " </td>\n";
@@ -59,7 +66,7 @@ require_once "includes/paging.php";
echo " <tr>\n";
echo " <td align='left' colspan='2'>\n";
echo " <span class=\"vexpl\">\n";
echo " Queues are used to setup waiting lines for callers. Also known as FIFO Queues.\n";
echo " ".$text['description-queues']."\n";
echo " </span>\n";
echo " </td>\n";
echo "\n";
@@ -88,12 +95,12 @@ require_once "includes/paging.php";
}
unset($prep_statement, $result);
//paging prep
//paging prep
$rows_per_page = 20;
$param = "";
$page = $_GET['page'];
if (strlen($page) == 0) { $page = 0; $_GET['page'] = 0; }
list($paging_controls, $rows_per_page, $var_3) = paging($num_rows, $param, $rows_per_page);
if (strlen($page) == 0) { $page = 0; $_GET['page'] = 0; }
list($paging_controls, $rows_per_page, $var_3) = paging($num_rows, $param, $rows_per_page);
$offset = $rows_per_page * $page;
//get the dialplans
@@ -116,13 +123,13 @@ require_once "includes/paging.php";
echo "<div align='center'>\n";
echo "<table width='100%' border='0' cellpadding='0' cellspacing='0'>\n";
echo "<tr>\n";
echo th_order_by('dialplan_name', 'Extension Name', $order_by, $order);
echo th_order_by('dialplan_order', 'Order', $order_by, $order);
echo th_order_by('dialplan_enabled', 'Enabled', $order_by, $order);
echo th_order_by('dialplan_description', 'Description', $order_by, $order);
echo th_order_by('dialplan_name', $text['label-name'], $order_by, $order);
echo th_order_by('dialplan_order', $text['label-order'], $order_by, $order);
echo th_order_by('dialplan_enabled', $text['label-enabled'], $order_by, $order);
echo th_order_by('dialplan_description', $text['label-description'], $order_by, $order);
echo "<td align='right' width='42'>\n";
if (permission_exists('fifo_add')) {
echo " <a href='fifo_add.php' alt='add'>$v_link_label_add</a>\n";
echo " <a href='fifo_add.php' alt='".$text['button-add']."'>$v_link_label_add</a>\n";
}
echo "</td>\n";
echo "<tr>\n";
@@ -132,14 +139,21 @@ require_once "includes/paging.php";
echo "<tr >\n";
echo " <td valign='top' class='".$row_style[$c]."'>&nbsp;&nbsp;".$row['dialplan_name']."</td>\n";
echo " <td valign='top' class='".$row_style[$c]."'>&nbsp;&nbsp;".$row['dialplan_order']."</td>\n";
echo " <td valign='top' class='".$row_style[$c]."'>&nbsp;&nbsp;".$row['dialplan_enabled']."</td>\n";
echo " <td valign='top' class='".$row_style[$c]."'>&nbsp;&nbsp;";
if ($row['dialplan_enabled'] == 'true') {
echo $text['option-true'];
}
else {
echo $text['option-false'];
}
echo "</td>\n";
echo " <td valign='top' class='row_stylebg' width='30%'>".$row['dialplan_description']."&nbsp;</td>\n";
echo " <td valign='top' align='right'>\n";
if (permission_exists('fifo_edit')) {
echo " <a href='fifo_edit.php?id=".$row['dialplan_uuid']."' alt='edit'>$v_link_label_edit</a>\n";
echo " <a href='fifo_edit.php?id=".$row['dialplan_uuid']."' alt='".$text['button-edit']."'>$v_link_label_edit</a>\n";
}
if (permission_exists('fifo_delete')) {
echo " <a href='fifo_delete.php?id=".$row['dialplan_uuid']."' alt='delete' onclick=\"return confirm('Do you really want to delete this?')\">$v_link_label_delete</a>\n";
echo " <a href='fifo_delete.php?id=".$row['dialplan_uuid']."' alt='".$text['button-delete']."' onclick=\"return confirm('".$text['confirm-delete']."')\">$v_link_label_delete</a>\n";
}
echo " </td>\n";
echo "</tr>\n";
@@ -156,7 +170,7 @@ require_once "includes/paging.php";
echo " <td width='33.3%' align='center' nowrap>$paging_controls</td>\n";
echo " <td width='33.3%' align='right'>\n";
if (permission_exists('fifo_add')) {
echo " <a href='fifo_add.php' alt='add'>$v_link_label_add</a>\n";
echo " <a href='fifo_add.php' alt='".$text['button-add']."'>$v_link_label_add</a>\n";
}
echo " </td>\n";
echo " </tr>\n";

View File

@@ -33,7 +33,16 @@ else {
echo "access denied";
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-queue_add'];
require_once "includes/paging.php";
//get http values and set them as variables
@@ -43,7 +52,7 @@ require_once "includes/paging.php";
$extension_name = check_str($_POST["extension_name"]);
$queue_extension_number = check_str($_POST["queue_extension_number"]);
$agent_queue_extension_number = check_str($_POST["agent_queue_extension_number"]);
$agent_login_logout_extension_number = check_str($_POST["agent_login_logout_extension_number"]);
$agent_login_logout_extension_number = check_str($_POST["agent_login_logout_extension_number"]);
$dialplan_order = check_str($_POST["dialplan_order"]);
$pin_number = check_str($_POST["pin_number"]);
$profile = check_str($_POST["profile"]);
@@ -55,16 +64,9 @@ require_once "includes/paging.php";
if (count($_POST)>0 && strlen($_POST["persistformvar"]) == 0) {
//check for all required data
if (strlen($domain_uuid) == 0) { $msg .= "Please provide: domain_uuid<br>\n"; }
if (strlen($extension_name) == 0) { $msg .= "Please provide: Extension Name<br>\n"; }
if (strlen($queue_extension_number) == 0) { $msg .= "Please provide: Extension Number 1<br>\n"; }
//if (strlen($agent_queue_extension_number) == 0) { $msg .= "Please provide: Queue Extension Number<br>\n"; }
//if (strlen($agent_queue_extension_number) == 0) { $msg .= "Please provide: Agent Login Logout Extension Number<br>\n"; }
//if (strlen($pin_number) == 0) { $msg .= "Please provide: PIN Number<br>\n"; }
//if (strlen($profile) == 0) { $msg .= "Please provide: profile<br>\n"; }
//if (strlen($flags) == 0) { $msg .= "Please provide: Flags<br>\n"; }
//if (strlen($dialplan_enabled) == 0) { $msg .= "Please provide: Enabled True or False<br>\n"; }
//if (strlen($dialplan_description) == 0) { $msg .= "Please provide: Description<br>\n"; }
if (strlen($domain_uuid) == 0) { $msg .= $text['message-required']."domain_uuid<br>\n"; }
if (strlen($extension_name) == 0) { $msg .= $text['message-required'].$text['label-name']."<br>\n"; }
if (strlen($queue_extension_number) == 0) { $msg .= $text['message-required'].$text['label-extension']."<br>\n"; }
if (strlen($msg) > 0 && strlen($_POST["persistformvar"]) == 0) {
require_once "includes/header.php";
require_once "includes/persistformvar.php";
@@ -258,7 +260,7 @@ if (count($_POST)>0 && strlen($_POST["persistformvar"]) == 0) {
require_once "includes/header.php";
echo "<meta http-equiv=\"refresh\" content=\"2;url=fifo.php\">\n";
echo "<div align='center'>\n";
echo "Update Complete\n";
echo $text['message-update']."\n";
echo "</div>\n";
require_once "includes/footer.php";
return;
@@ -275,18 +277,15 @@ if (count($_POST)>0 && strlen($_POST["persistformvar"]) == 0) {
echo "<form method='post' name='frm' action=''>\n";
echo " <table width=\"100%\" border=\"0\" cellpadding=\"0\" cellspacing=\"0\">\n";
echo " <tr>\n";
echo " <td align='left'><span class=\"vexpl\"><span class=\"red\">\n";
echo " <strong>Queues</strong>\n";
echo " </span></span>\n";
echo " </td>\n";
echo " <td align='left'><span class=\"vexpl\"><strong>".$text['header-queue_add']."</strong></span></td>\n";
echo " <td align='right'>\n";
echo " <input type='button' class='btn' name='' alt='back' onclick=\"window.location='fifo.php'\" value='Back'>\n";
echo " <input type='button' class='btn' name='' alt='".$text['button-back']."' onclick=\"window.location='fifo.php'\" value='".$text['button-back']."'>\n";
echo " </td>\n";
echo " </tr>\n";
echo " <tr>\n";
echo " <td align='left' colspan='2'>\n";
echo " <span class=\"vexpl\">\n";
echo " In simple terms queues are holding patterns for callers to wait until someone is available to take the call. Also known as FIFO Queues.\n";
echo " ".$text['description-queue_add']."\n";
echo " </span>\n";
echo " </td>\n";
echo " </tr>\n";
@@ -298,29 +297,29 @@ if (count($_POST)>0 && strlen($_POST["persistformvar"]) == 0) {
echo " <table width='100%' border='0' cellpadding='6' cellspacing='0'>\n";
echo " <tr>\n";
echo " <td class='vncellreq' valign='top' align='left' nowrap>\n";
echo " Queue Name:\n";
echo " ".$text['label-name'].":\n";
echo " </td>\n";
echo " <td class='vtable' align='left'>\n";
echo " <input class='formfld' style='width: 60%;' type='text' name='extension_name' maxlength='255' value=\"$extension_name\">\n";
echo " <br />\n";
echo " The name the queue will be assigned.\n";
echo " ".$text['description-name']."\n";
echo " </td>\n";
echo " </tr>\n";
echo " <tr>\n";
echo " <td class='vncellreq' valign='top' align='left' nowrap>\n";
echo " Extension Number:\n";
echo " ".$text['label-extension'].":\n";
echo " </td>\n";
echo " <td class='vtable' align='left'>\n";
echo " <input class='formfld' style='width: 60%;' type='text' name='queue_extension_number' maxlength='255' value=\"$queue_extension_number\">\n";
echo " <br />\n";
echo " The number that will be assigned to the queue.\n";
echo " ".$text['description-extension']."\n";
echo " </td>\n";
echo " </tr>\n";
echo "<tr>\n";
echo "<td class='vncellreq' valign='top' align='left' nowrap>\n";
echo " Order:\n";
echo " ".$text['label-order'].":\n";
echo "</td>\n";
echo "<td class='vtable' align='left'>\n";
echo " <select name='dialplan_order' class='formfld' style='width: 60%;'>\n";
@@ -342,21 +341,21 @@ if (count($_POST)>0 && strlen($_POST["persistformvar"]) == 0) {
echo "<tr>\n";
echo "<td class='vncellreq' valign='top' align='left' nowrap>\n";
echo " Enabled:\n";
echo " ".$text['label-enabled'].":\n";
echo "</td>\n";
echo "<td class='vtable' align='left'>\n";
echo " <select class='formfld' name='dialplan_enabled' style='width: 60%;'>\n";
if ($dialplan_enabled == "true") {
echo " <option value='true' selected='selected' >true</option>\n";
if ($dialplan_enabled == "true") {
echo " <option value='true' selected='selected' >".$text['option-true']."</option>\n";
}
else {
echo " <option value='true'>true</option>\n";
echo " <option value='true'>".$text['option-true']."</option>\n";
}
if ($dialplan_enabled == "false") {
echo " <option value='false' selected='selected' >false</option>\n";
if ($dialplan_enabled == "false") {
echo " <option value='false' selected='selected' >".$text['option-false']."</option>\n";
}
else {
echo " <option value='false'>false</option>\n";
echo " <option value='false'>".$text['option-false']."</option>\n";
}
echo " </select>\n";
echo "<br />\n";
@@ -366,7 +365,7 @@ if (count($_POST)>0 && strlen($_POST["persistformvar"]) == 0) {
echo "<tr>\n";
echo "<td class='vncell' valign='top' align='left' nowrap>\n";
echo " Description:\n";
echo " ".$text['label-description'].":\n";
echo "</td>\n";
echo "<td colspan='4' class='vtable' align='left'>\n";
echo " <input class='formfld' style='width: 60%;' type='text' name='dialplan_description' maxlength='255' value=\"$dialplan_description\">\n";
@@ -378,7 +377,7 @@ if (count($_POST)>0 && strlen($_POST["persistformvar"]) == 0) {
echo "<tr>\n";
echo "<td class='vtable' valign='top' align='left' nowrap>\n";
echo " <br /><br />\n";
echo " <b>Agent Details</b>\n";
echo " <b>".$text['header-agent_details']."</b>\n";
echo "</td>\n";
echo "<td class='vtable' align='left'>\n";
echo " &nbsp\n";
@@ -387,23 +386,23 @@ if (count($_POST)>0 && strlen($_POST["persistformvar"]) == 0) {
echo "<tr>\n";
echo "<td width='30%' class='vncell' valign='top' align='left' nowrap>\n";
echo " Queue Extension Number:\n";
echo " ".$text['label-agent_queue_extension'].":\n";
echo "</td>\n";
echo "<td class='vtable' align='left'>\n";
echo " <input class='formfld' style='width: 60%;' type='text' name='agent_queue_extension_number' maxlength='255' value=\"$agent_queue_extension_number\">\n";
echo "<br />\n";
echo "The extension number for the Agent FIFO Queue. This is the holding pattern for agents wating to service calls in the caller FIFO queue.\n";
echo $text['description-agent_queue_extension']."\n";
echo "</td>\n";
echo "</tr>\n";
echo "<tr>\n";
echo "<td class='vncell' valign='top' align='left' nowrap>\n";
echo " Login/Logout Extension Number:\n";
echo " ".$text['label-agent_loginout_extension'].":\n";
echo "</td>\n";
echo "<td class='vtable' align='left'>\n";
echo " <input class='formfld' style='width: 60%;' type='text' name='agent_login_logout_extension_number' maxlength='255' value=\"$agent_login_logout_extension_number\">\n";
echo "<br />\n";
echo "Agents use this extension number to login or logout of the Queue. After logging into the agent will be ready to receive calls from the Queue. \n";
echo $text['description-agent_loginout_extension']."\n";
echo "</td>\n";
echo "</tr>\n";
echo "</table>\n";
@@ -415,7 +414,7 @@ if (count($_POST)>0 && strlen($_POST["persistformvar"]) == 0) {
if ($action == "update") {
echo " <input type='hidden' name='dialplan_uuid' value='$dialplan_uuid'>\n";
}
echo " <input type='submit' name='submit' class='btn' value='Save'>\n";
echo " <input type='submit' name='submit' class='btn' value='".$text['button-save']."'>\n";
echo " </td>\n";
echo "</tr>";
echo "</table>";

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 id
if (count($_GET)>0) {
$id = $_GET["id"];
@@ -80,7 +86,7 @@ if (strlen($id)>0) {
require_once "includes/header.php";
echo "<meta http-equiv=\"refresh\" content=\"2;url=fifo.php\">\n";
echo "<div align='center'>\n";
echo "Delete Complete\n";
echo $text['message-delete']."\n";
echo "</div>\n";
require_once "includes/footer.php";
return;

View File

@@ -26,7 +26,7 @@
include "root.php";
require_once "includes/require.php";
require_once "includes/checkauth.php";
if (if_group("fifo_delete")) {
if (permission_exists("fifo_delete")) {
//access granted
}
else {
@@ -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']];
}
if (count($_GET)>0) {
$id = $_GET["id"];
$dialplan_uuid = check_str($_REQUEST["id2"]);
@@ -63,7 +69,7 @@ if (strlen($id)>0) {
require_once "includes/header.php";
echo "<meta http-equiv=\"refresh\" content=\"2;url=fifo_edit.php?id=".$dialplan_uuid."\">\n";
echo "<div align='center'>\n";
echo "Delete Complete\n";
echo $text['message-delete']."\n";
echo "</div>\n";
//show the footer

View File

@@ -33,7 +33,12 @@ else {
echo "access denied";
exit;
}
//if (permission_exists('fifo_add')) {
//add multi-lingual support
require_once "app_languages.php";
foreach($text as $key => $value) {
$text[$key] = $value[$_SESSION['domain']['language']['code']];
}
//set the action as an add or an update
if (isset($_REQUEST["id"])) {
@@ -67,11 +72,9 @@ if (count($_POST)>0 && strlen($_POST["persistformvar"]) == 0) {
}
//check for all required data
if (strlen($domain_uuid) == 0) { $msg .= "Please provide: domain_uuid<br>\n"; }
if (strlen($dialplan_detail_tag) == 0) { $msg .= "Please provide: Tag<br>\n"; }
if (strlen($dialplan_detail_order) == 0) { $msg .= "Please provide: Order<br>\n"; }
//if (strlen($dialplan_detail_type) == 0) { $msg .= "Please provide: Type<br>\n"; }
//if (strlen($dialplan_detail_data) == 0) { $msg .= "Please provide: Data<br>\n"; }
if (strlen($domain_uuid) == 0) { $msg .= $text['message-required']."domain_uuid<br>\n"; }
if (strlen($dialplan_detail_tag) == 0) { $msg .= $text['message-required'].$text['label-tag']."<br>\n"; }
if (strlen($dialplan_detail_order) == 0) { $msg .= $text['message-required'].$text['label-order']."<br>\n"; }
if (strlen($msg) > 0 && strlen($_POST["persistformvar"]) == 0) {
require_once "includes/header.php";
require_once "includes/persistformvar.php";
@@ -125,7 +128,7 @@ if (count($_POST)>0 && strlen($_POST["persistformvar"]) == 0) {
require_once "includes/header.php";
echo "<meta http-equiv=\"refresh\" content=\"2;url=fifo_edit.php?id=".$dialplan_uuid."\">\n";
echo "<div align='center'>\n";
echo "Add Complete\n";
echo $text['message-add']."\n";
echo "</div>\n";
require_once "includes/footer.php";
return;
@@ -157,7 +160,7 @@ if (count($_POST)>0 && strlen($_POST["persistformvar"]) == 0) {
require_once "includes/header.php";
echo "<meta http-equiv=\"refresh\" content=\"2;url=fifo_edit.php?id=".$dialplan_uuid."\">\n";
echo "<div align='center'>\n";
echo "Update Complete\n";
echo $text['message-update']."\n";
echo "</div>\n";
require_once "includes/footer.php";
return;
@@ -188,6 +191,12 @@ if (count($_POST)>0 && strlen($_POST["persistformvar"]) == 0) {
//show the header
require_once "includes/header.php";
if ($action == "add") {
$page["title"] = $text['title-queue_detail_add'];
}
if ($action == "update") {
$page["title"] = $text['title-queue_detail_edit'];
}
//show the content
echo "<div align='center'>";
@@ -201,12 +210,12 @@ if (count($_POST)>0 && strlen($_POST["persistformvar"]) == 0) {
echo "<table width='100%' border='0' cellpadding='6' cellspacing='0'>\n";
echo "<tr>\n";
if ($action == "add") {
echo "<td align='left' width='30%' nowrap><b>Queue Detail Add</b></td>\n";
echo "<td align='left' width='30%' nowrap><b>".$text['header-queue_detail_add']."</b></td>\n";
}
if ($action == "update") {
echo "<td align='left' width='30%' nowrap><b>Queue Detail Update</b></td>\n";
echo "<td align='left' width='30%' nowrap><b>".$text['header-queue_detail_edit']."</b></td>\n";
}
echo "<td width='70%' align='right'><input type='button' class='btn' name='' alt='back' onclick=\"window.location='fifo_edit.php?id=".$dialplan_uuid."'\" value='Back'></td>\n";
echo "<td width='70%' align='right'><input type='button' class='btn' name='' alt='".$text['button-back']."' onclick=\"window.location='fifo_edit.php?id=".$dialplan_uuid."'\" value='".$text['button-back']."'></td>\n";
echo "</tr>\n";
?>
@@ -214,65 +223,65 @@ if (count($_POST)>0 && strlen($_POST["persistformvar"]) == 0) {
function public_include_details_tag_onchange() {
var dialplan_detail_tag = document.getElementById("form_tag").value;
if (dialplan_detail_tag == "condition") {
document.getElementById("label_field_type").innerHTML = "Field";
document.getElementById("label_field_data").innerHTML = "Expression";
document.getElementById("label_field_type").innerHTML = "<?=$text['label-field']?>";
document.getElementById("label_field_data").innerHTML = "<?=$text['label-expression']?>";
}
else if (dialplan_detail_tag == "action") {
document.getElementById("label_field_type").innerHTML = "Application";
document.getElementById("label_field_data").innerHTML = "Data";
document.getElementById("label_field_type").innerHTML = "<?=$text['label-application']?>";
document.getElementById("label_field_data").innerHTML = "<?=$text['label-data']?>";
}
else if (dialplan_detail_tag == "anti-action") {
document.getElementById("label_field_type").innerHTML = "Application";
document.getElementById("label_field_data").innerHTML = "Data";
document.getElementById("label_field_type").innerHTML = "<?=$text['label-application']?>";
document.getElementById("label_field_data").innerHTML = "<?=$text['label-data']?>";
}
else if (dialplan_detail_tag == "param") {
document.getElementById("label_field_type").innerHTML = "Name";
document.getElementById("label_field_data").innerHTML = "Value";
document.getElementById("label_field_type").innerHTML = "<?=$text['label-name']?>";
document.getElementById("label_field_data").innerHTML = "<?=$text['label-value']?>";
}
if (dialplan_detail_tag == "") {
document.getElementById("label_field_type").innerHTML = "Type";
document.getElementById("label_field_data").innerHTML = "Data";
document.getElementById("label_field_type").innerHTML = "<?=$text['label-type']?>";
document.getElementById("label_field_data").innerHTML = "<?=$text['label-data']?>";
}
}
</script>
<?php
echo "<tr>\n";
echo "<td class='vncellreq' valign='top' align='left' nowrap>\n";
echo " Tag:\n";
echo " ".$text['label-tag'].":\n";
echo "</td>\n";
echo "<td class='vtable' align='left'>\n";
echo " <select name='dialplan_detail_tag' class='formfld' id='form_tag' onchange='public_include_details_tag_onchange();'>\n";
echo " <option></option>\n";
switch (htmlspecialchars($dialplan_detail_tag)) {
case "condition":
echo " <option selected='yes'>condition</option>\n";
echo " <option>action</option>\n";
echo " <option>anti-action</option>\n";
//echo " <option>param</option>\n";
echo " <option value='condition' selected='yes'>".$text['option-condition']."</option>\n";
echo " <option value='action'>".$text['option-action']."</option>\n";
echo " <option value='anti-action'>".$text['option-anti-action']."</option>\n";
//echo " <option value='param'>".$text['option-parameter']."</option>\n";
break;
case "action":
echo " <option>condition</option>\n";
echo " <option selected='yes'>action</option>\n";
echo " <option>anti-action</option>\n";
//echo " <option>param</option>\n";
echo " <option value='condition'>".$text['option-condition']."</option>\n";
echo " <option value='action' selected='yes'>".$text['option-action']."</option>\n";
echo " <option value='anti-action'>".$text['option-anti-action']."</option>\n";
//echo " <option value='param'>".$text['option-parameter']."</option>\n";
break;
case "anti-action":
echo " <option>condition</option>\n";
echo " <option>action</option>\n";
echo " <option selected='yes'>anti-action</option>\n";
//echo " <option>param</option>\n";
echo " <option value='condition'>".$text['option-condition']."</option>\n";
echo " <option value='action'>".$text['option-action']."</option>\n";
echo " <option value='anti-action' selected='yes'>".$text['option-anti-action']."</option>\n";
//echo " <option value='param'>".$text['option-parameter']."</option>\n";
break;
case "param":
echo " <option>condition</option>\n";
echo " <option>action</option>\n";
echo " <option>anti-action</option>\n";
//echo " <option selected='yes'>param</option>\n";
echo " <option value='condition'>".$text['option-condition']."</option>\n";
echo " <option value='action'>".$text['option-action']."</option>\n";
echo " <option value='anti-action'>".$text['option-anti-action']."</option>\n";
//echo " <option value='param' selected='yes'>".$text['option-parameter']."</option>\n";
break;
default:
echo " <option>condition</option>\n";
echo " <option>action</option>\n";
echo " <option>anti-action</option>\n";
//echo " <option>param</option>\n";
echo " <option value='condition'>".$text['option-condition']."</option>\n";
echo " <option value='action'>".$text['option-action']."</option>\n";
echo " <option value='anti-action'>".$text['option-anti-action']."</option>\n";
//echo " <option value='param'>".$text['option-parameter']."</option>\n";
}
echo " </select>\n";
@@ -295,7 +304,7 @@ if (count($_POST)>0 && strlen($_POST["persistformvar"]) == 0) {
echo "<tr>\n";
echo "<td class='vncellreq' valign='top' align='left' nowrap>\n";
echo " Order:\n";
echo " ".$text['label-order'].":\n";
echo "</td>\n";
echo "<td class='vtable' align='left'>\n";
echo " <select name='dialplan_detail_order' class='formfld'>\n";
@@ -324,8 +333,8 @@ if (count($_POST)>0 && strlen($_POST["persistformvar"]) == 0) {
echo "</tr>\n";
echo "<tr>\n";
echo "<td class='vncell' valign='top' align='left' nowrap>\n";
echo " Type:\n";
echo "<td class='vncell' valign='top' align='left' nowrap id='label_field_type'>\n";
echo " ".$text['label-type'].":\n";
echo "</td>\n";
echo "<td class='vtable' align='left'>\n";
echo " <input class='formfld' type='text' name='dialplan_detail_type' maxlength='255' value=\"$dialplan_detail_type\">\n";
@@ -335,8 +344,8 @@ if (count($_POST)>0 && strlen($_POST["persistformvar"]) == 0) {
echo "</tr>\n";
echo "<tr>\n";
echo "<td class='vncell' valign='top' align='left' nowrap>\n";
echo " Data:\n";
echo "<td class='vncell' valign='top' align='left' nowrap id='label_field_data'>\n";
echo " ".$text['label-data'].":\n";
echo "</td>\n";
echo "<td class='vtable' align='left'>\n";
echo " <input class='formfld' type='text' name='dialplan_detail_data' maxlength='255' value=\"$dialplan_detail_data\">\n";
@@ -350,7 +359,7 @@ if (count($_POST)>0 && strlen($_POST["persistformvar"]) == 0) {
if ($action == "update") {
echo " <input type='hidden' name='dialplan_detail_uuid' value='$dialplan_detail_uuid'>\n";
}
echo " <input type='submit' name='submit' class='btn' value='Save'>\n";
echo " <input type='submit' name='submit' class='btn' value='".$text['button-save']."'>\n";
echo " </td>\n";
echo " </tr>";
echo "</table>";
@@ -364,7 +373,7 @@ if (count($_POST)>0 && strlen($_POST["persistformvar"]) == 0) {
if ($v_path_show) {
echo "<br />\n";
echo "<br />\n";
echo "<b>Additional Information</b>\n";
echo "<b>".$text['header-additional_information']."</b>\n";
echo "<br />\n";
echo "<br />\n";

View File

@@ -35,6 +35,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 the action to an add or an update
if (isset($_REQUEST["id"])) {
$action = "update";
@@ -63,12 +69,10 @@ if (count($_POST)>0 && strlen($_POST["persistformvar"]) == 0) {
}
//check for all required data
if (strlen($domain_uuid) == 0) { $msg .= "Please provide: domain_uuid<br>\n"; }
if (strlen($dialplan_name) == 0) { $msg .= "Please provide: Extension Name<br>\n"; }
if (strlen($dialplan_order) == 0) { $msg .= "Please provide: Order<br>\n"; }
//if (strlen($dialplan_context) == 0) { $msg .= "Please provide: Context<br>\n"; }
if (strlen($dialplan_enabled) == 0) { $msg .= "Please provide: Enabled<br>\n"; }
//if (strlen($dialplan_description) == 0) { $msg .= "Please provide: Description<br>\n"; }
if (strlen($domain_uuid) == 0) { $msg .= $text['message-required']."domain_uuid<br>\n"; }
if (strlen($dialplan_name) == 0) { $msg .= $text['message-required'].$text['label-name']."<br>\n"; }
if (strlen($dialplan_order) == 0) { $msg .= $text['message-required'].$text['label-order']."<br>\n"; }
if (strlen($dialplan_enabled) == 0) { $msg .= $text['message-required'].$text['label-enabled']."<br>\n"; }
if (strlen($msg) > 0 && strlen($_POST["persistformvar"]) == 0) {
require_once "includes/header.php";
require_once "includes/persistformvar.php";
@@ -130,7 +134,7 @@ if (count($_POST)>0 && strlen($_POST["persistformvar"]) == 0) {
require_once "includes/header.php";
echo "<meta http-equiv=\"refresh\" content=\"2;url=fifo.php\">\n";
echo "<div align='center'>\n";
echo "Add Complete\n";
echo $text['message-add']."\n";
echo "</div>\n";
require_once "includes/footer.php";
return;
@@ -163,7 +167,7 @@ if (count($_POST)>0 && strlen($_POST["persistformvar"]) == 0) {
require_once "includes/header.php";
echo "<meta http-equiv=\"refresh\" content=\"2;url=fifo.php\">\n";
echo "<div align='center'>\n";
echo "Update Complete\n";
echo $text['message-update']."\n";
echo "</div>\n";
require_once "includes/footer.php";
return;
@@ -195,6 +199,7 @@ if (count($_POST)>0 && strlen($_POST["persistformvar"]) == 0) {
//show the header
require_once "includes/header.php";
$page["title"] = $text['title-queue_edit'];
//show the content
echo "<div align='center'>";
@@ -208,15 +213,12 @@ if (count($_POST)>0 && strlen($_POST["persistformvar"]) == 0) {
echo "<table width=\"100%\" border=\"0\" cellpadding=\"1\" cellspacing=\"0\">\n";
echo " <tr>\n";
echo " <td align='left' width='30%'><p><span class=\"vexpl\"><span class=\"red\">\n";
echo " <strong>Queues</strong><br />\n";
echo " </span>\n";
echo " </td>\n";
echo " <td width='70%' align='right'><input type='button' class='btn' name='' alt='back' onclick=\"window.location='fifo.php'\" value='Back'></td>\n";
echo " <td align='left' width='30%'><p><span class=\"vexpl\"><strong>".$text['header-queue_edit']."</strong></td>\n";
echo " <td width='70%' align='right'><input type='button' class='btn' name='' alt='".$text['button-back']."' onclick=\"window.location='fifo.php'\" value='".$text['button-back']."'></td>\n";
echo " </tr>\n";
echo " <tr>\n";
echo " <td align='left' colspan='2'>\n";
echo " Queues are used to setup waiting lines for callers. Also known as FIFO Queues.\n";
echo " ".$text['description-queue_edit']."\n";
echo " </span></p>\n";
echo " </td>\n";
echo " </tr>\n";
@@ -227,7 +229,7 @@ if (count($_POST)>0 && strlen($_POST["persistformvar"]) == 0) {
echo "<tr>\n";
echo "<td class='vncellreq' valign='top' align='left' nowrap>\n";
echo " Name:\n";
echo " ".$text['label-name'].":\n";
echo "</td>\n";
echo "<td class='vtable' align='left'>\n";
echo " <input class='formfld' type='text' name='dialplan_name' maxlength='255' value=\"$dialplan_name\">\n";
@@ -238,7 +240,7 @@ if (count($_POST)>0 && strlen($_POST["persistformvar"]) == 0) {
echo "<tr>\n";
echo "<td class='vncellreq' valign='top' align='left' nowrap>\n";
echo " Order:\n";
echo " ".$text['label-order'].":\n";
echo "</td>\n";
echo "<td class='vtable' align='left'>\n";
echo " <select name='dialplan_order' class='formfld'>\n";
@@ -267,60 +269,49 @@ if (count($_POST)>0 && strlen($_POST["persistformvar"]) == 0) {
echo "</td>\n";
echo "</tr>\n";
//echo "<tr>\n";
//echo "<td class='vncell' valign='top' align='left' nowrap>\n";
//echo " Context:\n";
//echo "</td>\n";
//echo "<td class='vtable' align='left'>\n";
//echo " <input class='formfld' type='text' name='dialplan_context' maxlength='255' value=\"$dialplan_context\">\n";
//echo "<br />\n";
//echo "\n";
//echo "</td>\n";
//echo "</tr>\n";
echo "<tr>\n";
echo "<td class='vncell' valign='top' align='left' nowrap>\n";
echo " Continue:\n";
echo " ".$text['label-continue'].":\n";
echo "</td>\n";
echo "<td class='vtable' align='left'>\n";
echo " <select class='formfld' name='dialplan_continue'>\n";
echo " <option value=''></option>\n";
if ($dialplan_continue == "true") {
echo " <option value='true' SELECTED >true</option>\n";
if ($dialplan_continue == "true") {
echo " <option value='true' SELECTED >".$text['option-true']."</option>\n";
}
else {
echo " <option value='true'>true</option>\n";
echo " <option value='true'>".$text['option-true']."</option>\n";
}
if ($dialplan_continue == "false") {
echo " <option value='false' SELECTED >false</option>\n";
if ($dialplan_continue == "false") {
echo " <option value='false' SELECTED >".$text['option-false']."</option>\n";
}
else {
echo " <option value='false'>false</option>\n";
echo " <option value='false'>".$text['option-false']."</option>\n";
}
echo " </select>\n";
echo "<br />\n";
echo "Extension Continue in most cases is false.\n";
echo $text['description-continue']."\n";
echo "</td>\n";
echo "</tr>\n";
echo "<tr>\n";
echo "<td class='vncellreq' valign='top' align='left' nowrap>\n";
echo " Enabled:\n";
echo " ".$text['label-enabled'].":\n";
echo "</td>\n";
echo "<td class='vtable' align='left'>\n";
echo " <select class='formfld' name='dialplan_enabled'>\n";
echo " <option value=''></option>\n";
if ($dialplan_enabled == "true") {
echo " <option value='true' SELECTED >true</option>\n";
if ($dialplan_enabled == "true") {
echo " <option value='true' SELECTED >".$text['option-true']."</option>\n";
}
else {
echo " <option value='true'>true</option>\n";
echo " <option value='true'>".$text['option-true']."</option>\n";
}
if ($dialplan_enabled == "false") {
echo " <option value='false' SELECTED >false</option>\n";
if ($dialplan_enabled == "false") {
echo " <option value='false' SELECTED >".$text['option-false']."</option>\n";
}
else {
echo " <option value='false'>false</option>\n";
echo " <option value='false'>".$text['option-false']."</option>\n";
}
echo " </select>\n";
echo "<br />\n";
@@ -330,7 +321,7 @@ if (count($_POST)>0 && strlen($_POST["persistformvar"]) == 0) {
echo "<tr>\n";
echo "<td class='vncell' valign='top' align='left' nowrap>\n";
echo " Description:\n";
echo " ".$text['label-description'].":\n";
echo "</td>\n";
echo "<td class='vtable' align='left'>\n";
echo " <textarea class='formfld' name='dialplan_description' rows='4'>$dialplan_description</textarea>\n";
@@ -343,7 +334,7 @@ if (count($_POST)>0 && strlen($_POST["persistformvar"]) == 0) {
if ($action == "update") {
echo " <input type='hidden' name='dialplan_uuid' value='$dialplan_uuid'>\n";
}
echo " <input type='submit' name='submit' class='btn' value='Save'>\n";
echo " <input type='submit' name='submit' class='btn' value='".$text['button-save']."'>\n";
echo " </td>\n";
echo " </tr>";
echo "</table>";
@@ -365,11 +356,8 @@ if (count($_POST)>0 && strlen($_POST["persistformvar"]) == 0) {
echo "<table width=\"100%\" border=\"0\" cellpadding=\"6\" cellspacing=\"0\">\n";
echo " <tr>\n";
echo " <td align='left'><p><span class=\"vexpl\"><span class=\"red\"><strong>Conditions and Actions<br />\n";
echo " </strong></span>\n";
echo " The following conditions, actions and anti-actions are used in the dialplan to direct \n";
echo " call flow. Each is processed in order until you reach the action dialplan_detail_tag which tells what action to perform. \n";
echo " You are not limited to only one condition or action dialplan_detail_tag for a given extension.\n";
echo " <td align='left'><p><span class=\"vexpl\"><strong>".$text['header-conditions_and_actions']."</strong></span><br>\n";
echo " ".$text['description-conditions_and_actions']."\n";
echo " </span></p></td>\n";
echo " </tr>\n";
echo "</table>";
@@ -395,13 +383,13 @@ if (count($_POST)>0 && strlen($_POST["persistformvar"]) == 0) {
echo "<table width='100%' border='0' cellpadding='0' cellspacing='0'>\n";
echo "<tr>\n";
echo "<th align='center'>Tag</th>\n";
echo "<th align='center'>Type</th>\n";
echo "<th align='center'>Data</th>\n";
echo "<th align='center'>Order</th>\n";
echo "<th align='center'>".$text['label-tag']."</th>\n";
echo "<th align='center'>".$text['label-type']."</th>\n";
echo "<th align='center'>".$text['label-data']."</th>\n";
echo "<th align='center'>".$text['label-order']."</th>\n";
echo "<td align='right' width='42'>\n";
if (permission_exists('fifo_add')) {
echo " <a href='fifo_detail_edit.php?id2=".$dialplan_uuid."' alt='add'>$v_link_label_add</a>\n";
echo " <a href='fifo_detail_edit.php?id2=".$dialplan_uuid."' alt='".$text['button-add']."'>$v_link_label_add</a>\n";
}
echo "</td>\n";
echo "<tr>\n";
@@ -415,10 +403,10 @@ if (count($_POST)>0 && strlen($_POST["persistformvar"]) == 0) {
echo " <td valign='top' class='".$row_style[$c]."'>&nbsp;&nbsp;".$row[dialplan_detail_order]."</td>\n";
echo " <td valign='top' align='right'>\n";
if (permission_exists('fifo_edit')) {
echo " <a href='fifo_detail_edit.php?id=".$row[dialplan_detail_uuid]."&id2=".$dialplan_uuid."' alt='edit'>$v_link_label_edit</a>\n";
echo " <a href='fifo_detail_edit.php?id=".$row[dialplan_detail_uuid]."&id2=".$dialplan_uuid."' alt='".$text['button-edit']."'>$v_link_label_edit</a>\n";
}
if (permission_exists('fifo_delete')) {
echo " <a href='fifo_detail_delete.php?id=".$row[dialplan_detail_uuid]."&id2=".$dialplan_uuid."' alt='delete' onclick=\"return confirm('Do you really want to delete this?')\">$v_link_label_delete</a>\n";
echo " <a href='fifo_detail_delete.php?id=".$row[dialplan_detail_uuid]."&id2=".$dialplan_uuid."' alt='".$text['button-delete']."' onclick=\"return confirm('".$text['confirm-delete']."')\">$v_link_label_delete</a>\n";
}
echo " </td>\n";
echo "</tr>\n";
@@ -448,10 +436,10 @@ if (count($_POST)>0 && strlen($_POST["persistformvar"]) == 0) {
echo " <td valign='top' class='".$row_style[$c]."'>&nbsp;&nbsp;".$row[dialplan_detail_order]."</td>\n";
echo " <td valign='top' align='right'>\n";
if (permission_exists('fifo_edit')) {
echo " <a href='fifo_detail_edit.php?id=".$row[dialplan_detail_uuid]."&id2=".$dialplan_uuid."' alt='edit'>$v_link_label_edit</a>\n";
echo " <a href='fifo_detail_edit.php?id=".$row[dialplan_detail_uuid]."&id2=".$dialplan_uuid."' alt='".$text['button-edit']."'>$v_link_label_edit</a>\n";
}
if (permission_exists('fifo_delete')) {
echo " <a href='fifo_detail_delete.php?id=".$row[dialplan_detail_uuid]."&id2=".$dialplan_uuid."' alt='delete' onclick=\"return confirm('Do you really want to delete this?')\">$v_link_label_delete</a>\n";
echo " <a href='fifo_detail_delete.php?id=".$row[dialplan_detail_uuid]."&id2=".$dialplan_uuid."' alt='".$text['button-delete']."' onclick=\"return confirm('".$text['confirm-delete']."')\">$v_link_label_delete</a>\n";
}
echo " </td>\n";
echo "</tr>\n";
@@ -484,10 +472,10 @@ if (count($_POST)>0 && strlen($_POST["persistformvar"]) == 0) {
echo " <td valign='top' class='".$row_style[$c]."'>&nbsp;&nbsp;".$row[dialplan_detail_order]."</td>\n";
echo " <td valign='top' align='right'>\n";
if (permission_exists('fifo_edit')) {
echo " <a href='fifo_detail_edit.php?id=".$row[dialplan_detail_uuid]."&id2=".$dialplan_uuid."' alt='edit'>$v_link_label_edit</a>\n";
echo " <a href='fifo_detail_edit.php?id=".$row[dialplan_detail_uuid]."&id2=".$dialplan_uuid."' alt='".$text['button-edit']."'>$v_link_label_edit</a>\n";
}
if (permission_exists('fifo_delete')) {
echo " <a href='fifo_detail_delete.php?id=".$row[dialplan_detail_uuid]."&id2=".$dialplan_uuid."' alt='delete' onclick=\"return confirm('Do you really want to delete this?')\">$v_link_label_delete</a>\n";
echo " <a href='fifo_detail_delete.php?id=".$row[dialplan_detail_uuid]."&id2=".$dialplan_uuid."' alt='".$text['button-delete']."' onclick=\"return confirm('".$text['confirm-delete']."')\">$v_link_label_delete</a>\n";
}
echo " </td>\n";
echo "</tr>\n";
@@ -504,7 +492,7 @@ if (count($_POST)>0 && strlen($_POST["persistformvar"]) == 0) {
echo " <td width='33.3%' align='center' nowrap>$paging_controls</td>\n";
echo " <td width='33.3%' align='right'>\n";
if (permission_exists('fifo_add')) {
echo " <a href='fifo_details_edit.php?id2=".$dialplan_uuid."' alt='add'>$v_link_label_add</a>\n";
echo " <a href='fifo_details_edit.php?id2=".$dialplan_uuid."' alt='".$text['button-add']."'>$v_link_label_add</a>\n";
}
echo " </td>\n";
echo " </tr>\n";