From a4bf02d015271f1aaab0197b591a59cf23fab3c0 Mon Sep 17 00:00:00 2001 From: Nate Jones Date: Wed, 29 May 2013 04:34:28 +0000 Subject: [PATCH] Multilinguified Dialplan Manager, tweaked Inbound and Outbound Routes --- app/dialplan/app_languages.php | 110 +++++++ app/dialplan/dialplan_add.php | 272 ++++++------------ app/dialplan/dialplan_advanced.php | 25 +- app/dialplan/dialplan_copy.php | 16 +- app/dialplan/dialplan_delete.php | 10 +- app/dialplan/dialplan_details_delete.php | 12 +- app/dialplan/dialplan_details_edit.php | 189 ++++++------ app/dialplan/dialplan_edit.php | 128 ++++----- app/dialplan/dialplans.php | 112 ++++---- app/dialplan_inbound/app_languages.php | 45 ++- app/dialplan_inbound/dialplan_inbound_add.php | 84 +++--- app/dialplan_outbound/app_languages.php | 74 ++--- .../dialplan_outbound_add.php | 10 +- 13 files changed, 592 insertions(+), 495 deletions(-) create mode 100644 app/dialplan/app_languages.php diff --git a/app/dialplan/app_languages.php b/app/dialplan/app_languages.php new file mode 100644 index 0000000000..42c4898a68 --- /dev/null +++ b/app/dialplan/app_languages.php @@ -0,0 +1,110 @@ + \ No newline at end of file diff --git a/app/dialplan/dialplan_add.php b/app/dialplan/dialplan_add.php index 00dea0f2f8..cce161f79b 100644 --- a/app/dialplan/dialplan_add.php +++ b/app/dialplan/dialplan_add.php @@ -33,7 +33,15 @@ 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-dialplan_add']; require_once "includes/paging.php"; $order_by = $_GET["order_by"]; @@ -73,13 +81,13 @@ $order = $_GET["order"]; if (count($_POST)>0 && strlen($_POST["persistformvar"]) == 0) { //check for all required data - if (strlen($domain_uuid) == 0) { $msg .= "Please provide: domain_uuid
\n"; } - if (strlen($dialplan_name) == 0) { $msg .= "Please provide: Extension Name
\n"; } - if (strlen($condition_field_1) == 0) { $msg .= "Please provide: Condition Field
\n"; } - if (strlen($condition_expression_1) == 0) { $msg .= "Please provide: Condition Expression
\n"; } - if (strlen($action_application_1) == 0) { $msg .= "Please provide: Action Application
\n"; } - //if (strlen($dialplan_enabled) == 0) { $msg .= "Please provide: Enabled True or False
\n"; } - //if (strlen($dialplan_description) == 0) { $msg .= "Please provide: Description
\n"; } + if (strlen($domain_uuid) == 0) { $msg .= $text['message-required']."domain_uuid
\n"; } + if (strlen($dialplan_name) == 0) { $msg .= $text['message-required'].$text['label-name']."
\n"; } + if (strlen($condition_field_1) == 0) { $msg .= $text['message-required'].$text['label-condition_1']." ".$text['label-field']."
\n"; } + if (strlen($condition_expression_1) == 0) { $msg .= $text['message-required'].$text['label-condition_1']." ".$text['label-expression']."
\n"; } + if (strlen($action_application_1) == 0) { $msg .= $text['message-required'].$text['label-action_1']."
\n"; } + //if (strlen($dialplan_enabled) == 0) { $msg .= $text['message-required'].$text['label-enabled']."
\n"; } + //if (strlen($dialplan_description) == 0) { $msg .= $text['message-required'].$text['label-description']."
\n"; } if (strlen($msg) > 0 && strlen($_POST["persistformvar"]) == 0) { require_once "includes/header.php"; require_once "includes/persistformvar.php"; @@ -251,7 +259,7 @@ if (count($_POST)>0 && strlen($_POST["persistformvar"]) == 0) { require_once "includes/header.php"; echo "\n"; echo "
\n"; - echo "Update Complete\n"; + echo $text['message-update']."\n"; echo "
\n"; require_once "includes/footer.php"; return; @@ -299,32 +307,26 @@ echo "
\n"; echo " \n"; echo " \n"; -echo " \n"; echo " \n"; echo " \n"; echo " \n"; echo " \n"; echo " \n"; echo "
Dialplan\n"; -echo " \n"; +echo " \n"; +echo " ".$text['header-dial_plan-add']."\n"; echo " \n"; -echo " \n"; +echo " \n"; echo "
\n"; -echo " \n"; -echo " The dialplan is used to setup call destinations based on conditions and context.\n"; -echo " You can use the dialplan to send calls to gateways, auto attendants, external numbers,\n"; -echo " to scripts, or any destination.\n"; -echo " \n"; +echo "
".$text['description-dialplan_manager-superadmin']."\n"; echo "
"; - -echo "
\n"; echo "
\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; //echo "\n"; echo "\n"; echo "\n"; echo "\n"; -echo " \n"; +echo " \n"; echo " \n"; -echo " \n"; +echo " \n"; echo " \n"; @@ -447,14 +449,14 @@ echo "\n"; echo "\n"; echo "\n"; echo "
\n"; -echo " Name:\n"; +echo " ".$text['label-name'].":\n"; echo "\n"; echo " \n"; @@ -340,13 +342,13 @@ echo "
\n"; //echo "
\n"; -echo " Condition 1:\n"; +echo " ".$text['label-condition_1'].":\n"; echo "\n"; ?> @@ -397,7 +399,7 @@ function Replace_condition_field_1(obj){ \n"; echo "
Field:".$text['label-field'].":\n"; echo " \n"; -echo " \n"; +echo " \n"; echo "
\n"; echo "
  Expression:  ".$text['label-expression'].":\n"; echo " \n"; echo "
\n"; -echo " Condition 2:\n"; +echo " ".$text['label-condition_2'].":\n"; echo "\n"; echo " \n"; echo " \n"; echo " \n"; echo " \n"; echo " \n"; echo " \n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; @@ -601,66 +556,19 @@ echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo ""; diff --git a/app/dialplan/dialplan_advanced.php b/app/dialplan/dialplan_advanced.php index 2a93da3a77..85b71d14fe 100644 --- a/app/dialplan/dialplan_advanced.php +++ b/app/dialplan/dialplan_advanced.php @@ -33,7 +33,15 @@ 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-default_dialplan']; if ($_GET['a'] == "default" && permission_exists('dialplan_advanced_edit')) { //create the dialplan/default.xml for single tenant or dialplan/domain.xml @@ -55,7 +63,7 @@ if ($_POST['a'] == "save" && permission_exists('dialplan_advanced_edit')) { } fwrite($fd, $v_content); fclose($fd); - $savemsg = "Saved"; + $savemsg = $text['message-update']; } if (file_exists($_SESSION['switch']['dialplan']['dir']."/".$_SESSION['domain_name'].".xml")) { @@ -81,7 +89,7 @@ function sf() { document.forms[0].savetopath.focus(); } ,start_highlight: true ,allow_toggle: false ,language: "en" - ,syntax: "html" + ,syntax: "html" ,toolbar: "search, go_to_line,|, fullscreen, |, undo, redo, |, select_font, |, syntax_selection, |, change_smooth_selection, highlight, reset_highlight, |, help" ,syntax_selection_allow: "css,html,js,php,xml,c,cpp,sql" ,show_line_colors: true @@ -92,17 +100,20 @@ function sf() { document.forms[0].savetopath.focus(); }
\n"; -echo " Field:\n"; +echo " ".$text['label-field'].":\n"; echo " \n"; ?> @@ -495,38 +497,38 @@ if (strlen($condition_field_2) > 0) { echo " \n"; } echo " \n"; -echo " \n"; -echo " \n"; -echo " \n"; -echo " \n"; -echo " \n"; -echo " \n"; -echo " \n"; -echo " \n"; -echo " \n"; -echo " \n"; -echo " \n"; -echo " \n"; -echo " \n"; +echo " \n"; +echo " \n"; +echo " \n"; +echo " \n"; +echo " \n"; +echo " \n"; +echo " \n"; +echo " \n"; +echo " \n"; +echo " \n"; +echo " \n"; +echo " \n"; +echo " \n"; echo " \n"; echo " \n"; -echo " \n"; -echo " \n"; -echo " \n"; -echo " \n"; -echo " \n"; -echo " \n"; -echo " \n"; -echo " \n"; -echo " \n"; -echo " \n"; +echo " \n"; +echo " \n"; +echo " \n"; +echo " \n"; +echo " \n"; +echo " \n"; +echo " \n"; +echo " \n"; +echo " \n"; +echo " \n"; echo " \n"; echo " \n"; -echo " \n"; +echo " \n"; echo "
\n"; echo "
\n"; -echo "   Expression:\n"; +echo "   ".$text['label-expression'].":\n"; echo " \n"; echo " \n"; @@ -539,60 +541,13 @@ echo "
\n"; -echo " Action 1:\n"; +echo " ".$text['label-action_1'].":\n"; echo "\n"; //switch_select_destination(select_type, select_label, select_name, select_value, select_style, action); switch_select_destination("dialplan", "", "action_1", $action_1, "width: 60%;", ""); -/* -echo " \n"; -echo " \n"; -echo " \n"; -echo " \n"; -echo " \n"; -echo " \n"; -echo " \n"; -echo "
Application: \n"; -echo "
\n"; -echo "
\n"; -echo "   Data: \n"; -echo " \n"; -echo " \n"; -echo "
\n"; -echo "
\n"; -*/ echo "
\n"; -echo " Action 2:\n"; +echo " ".$text['label-action_2'].":\n"; echo "\n"; //switch_select_destination(select_type, select_label, select_name, select_value, select_style, action); switch_select_destination("dialplan", "", "action_2", $action_2, "width: 60%;", ""); -/* -echo " \n"; -echo " \n"; -echo " \n"; -echo " \n"; -echo " \n"; -echo " \n"; -echo " \n"; -echo "
Application: \n"; -echo "
\n"; -echo "
\n"; -echo "   Data: \n"; -echo " \n"; -echo " \n"; -echo "
\n"; -echo "
\n"; -*/ echo "
\n"; -echo " Order:\n"; +echo " ".$text['label-order'].":\n"; echo "\n"; echo "
\n"; -echo " Enabled:\n"; +echo " ".$text['label-enabled'].":\n"; echo "\n"; echo " \n"; echo "
\n"; @@ -708,10 +615,9 @@ echo "
\n"; -echo " Description:\n"; +echo " ".$text['label-description'].":\n"; echo "\n"; -//echo " \n"; echo " \n"; echo "
\n"; echo "\n"; @@ -723,7 +629,7 @@ echo "
\n"; if ($action == "update") { echo " \n"; } -echo " \n"; +echo " \n"; echo "
+
- - + diff --git a/app/dialplan/dialplan_copy.php b/app/dialplan/dialplan_copy.php index ef5e38b96d..892400af09 100644 --- a/app/dialplan/dialplan_copy.php +++ b/app/dialplan/dialplan_copy.php @@ -27,9 +27,9 @@ include "root.php"; require_once "includes/require.php"; require_once "includes/checkauth.php"; require_once "includes/paging.php"; -if (permission_exists('dialplan_add') - || permission_exists('inbound_route_add') - || permission_exists('outbound_route_add') +if (permission_exists('dialplan_add') + || permission_exists('inbound_route_add') + || permission_exists('outbound_route_add') || permission_exists('time_conditions_add')) { //access granted } @@ -38,12 +38,18 @@ 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 http get/post variable(s) to a php variable if (isset($_REQUEST["id"])) { $dialplan_uuid = check_str($_REQUEST["id"]); } -//get the dialplan data +//get the dialplan data $dialplan_uuid = $_GET["id"]; $sql = "select * from v_dialplans "; $sql .= "where domain_uuid = '".$_SESSION['domain_uuid']."' "; @@ -163,7 +169,7 @@ else { break; } echo "
\n"; - echo "Copy Complete\n"; + echo $text['message-copy']."\n"; echo "
\n"; require_once "includes/footer.php"; return; diff --git a/app/dialplan/dialplan_delete.php b/app/dialplan/dialplan_delete.php index 0388c63ffe..0d7ce84581 100644 --- a/app/dialplan/dialplan_delete.php +++ b/app/dialplan/dialplan_delete.php @@ -26,7 +26,7 @@ include "root.php"; require_once "includes/require.php"; require_once "includes/checkauth.php"; -if (permission_exists('dialplan_delete') +if (permission_exists('dialplan_delete') || permission_exists('inbound_route_delete') || permission_exists('outbound_route_delete') || permission_exists('time_conditions_delete')) { @@ -37,6 +37,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) { $dialplan_uuid = check_str($_GET["id"]); } @@ -107,7 +113,7 @@ if (strlen($dialplan_uuid)>0) { break; } echo "
\n"; - echo "Delete Complete\n"; + echo $text['message-delete']."\n"; echo "
\n"; require_once "includes/footer.php"; return; diff --git a/app/dialplan/dialplan_details_delete.php b/app/dialplan/dialplan_details_delete.php index f86714560e..a38729e6d7 100644 --- a/app/dialplan/dialplan_details_delete.php +++ b/app/dialplan/dialplan_details_delete.php @@ -26,8 +26,8 @@ include "root.php"; require_once "includes/require.php"; require_once "includes/checkauth.php"; -if (permission_exists('dialplan_delete') - || permission_exists('inbound_route_delete') +if (permission_exists('dialplan_delete') + || permission_exists('inbound_route_delete') || permission_exists('outbound_route_delete') || permission_exists('time_conditions_delete')) { //access granted @@ -37,6 +37,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"]); @@ -68,7 +74,7 @@ if (strlen($id)>0) { require_once "includes/header.php"; echo "\n"; echo "
\n"; - echo "Delete Complete\n"; + echo $text['message-delete']."\n"; echo "
\n"; require_once "includes/footer.php"; diff --git a/app/dialplan/dialplan_details_edit.php b/app/dialplan/dialplan_details_edit.php index 038b70decb..7c827f6a91 100644 --- a/app/dialplan/dialplan_details_edit.php +++ b/app/dialplan/dialplan_details_edit.php @@ -26,13 +26,13 @@ include "root.php"; require_once "includes/require.php"; require_once "includes/checkauth.php"; -if (permission_exists('dialplan_add') - || permission_exists('dialplan_edit') - || permission_exists('inbound_route_add') - || permission_exists('inbound_route_edit') - || permission_exists('outbound_route_add') - || permission_exists('outbound_route_edit') - || permission_exists('time_conditions_add') +if (permission_exists('dialplan_add') + || permission_exists('dialplan_edit') + || permission_exists('inbound_route_add') + || permission_exists('inbound_route_edit') + || permission_exists('outbound_route_add') + || permission_exists('outbound_route_edit') + || permission_exists('time_conditions_add') || permission_exists('time_conditions_edit')) { //access granted } @@ -41,6 +41,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 as an add or update if (isset($_REQUEST["id"])) { $action = "update"; @@ -76,10 +82,10 @@ if (count($_POST)>0 && strlen($_POST["persistformvar"]) == 0) { } //check for all required data - if (strlen($dialplan_detail_tag) == 0) { $msg .= "Please provide: Tag
\n"; } - if (strlen($dialplan_detail_order) == 0) { $msg .= "Please provide: Order
\n"; } - //if (strlen($dialplan_detail_type) == 0) { $msg .= "Please provide: Type
\n"; } - //if (strlen($dialplan_detail_data) == 0) { $msg .= "Please provide: Data
\n"; } + if (strlen($dialplan_detail_tag) == 0) { $msg .= $text['message-required'].$text['label-tag']."
\n"; } + if (strlen($dialplan_detail_order) == 0) { $msg .= $text['message-required'].$text['label-order']."
\n"; } + //if (strlen($dialplan_detail_type) == 0) { $msg .= $text['message-required'].$text['label-type']."
\n"; } + //if (strlen($dialplan_detail_data) == 0) { $msg .= $text['message-required'].$text['label-data']."
\n"; } if (strlen($msg) > 0 && strlen($_POST["persistformvar"]) == 0) { require_once "includes/header.php"; require_once "includes/persistformvar.php"; @@ -144,7 +150,7 @@ if (count($_POST)>0 && strlen($_POST["persistformvar"]) == 0) { require_once "includes/header.php"; echo "\n"; echo "
\n"; - echo "Add Complete\n"; + echo $text['message-add']."\n"; echo "
\n"; require_once "includes/footer.php"; return; @@ -183,12 +189,12 @@ if (count($_POST)>0 && strlen($_POST["persistformvar"]) == 0) { require_once "includes/header.php"; echo "\n"; echo "
\n"; - echo "Update Complete\n"; + echo $text['message-update']."\n"; echo "
\n"; require_once "includes/footer.php"; return; } //if ($action == "update") - } //if ($_POST["persistformvar"] != "true") { + } //if ($_POST["persistformvar"] != "true") { } //(count($_POST)>0 && strlen($_POST["persistformvar"]) == 0) //pre-populate the form @@ -216,6 +222,7 @@ if (count($_POST)>0 && strlen($_POST["persistformvar"]) == 0) { //show the header require_once "includes/header.php"; + $page["title"] = $text['title-dialplan_detail']; //show the content echo "
"; @@ -228,8 +235,8 @@ if (count($_POST)>0 && strlen($_POST["persistformvar"]) == 0) { echo "
\n"; echo "
Default Dialplan
+


- The default dialplan is used to setup call destinations based on conditions and context. - You can use the dialplan to send calls to gateways, auto attendants, external numbers, to scripts, or any destination. +

+ ' onclick="window.location='dialplans.php'" value=''> + ' /> +
@@ -124,7 +135,7 @@ function sf() { document.forms[0].savetopath.focus(); } "; + echo ""; } ?>
\n"; echo "\n"; - echo "\n"; - echo "\n"; + echo "\n"; + echo "\n"; echo "\n"; ?> @@ -237,28 +244,28 @@ 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 = ""; + document.getElementById("label_field_data").innerHTML = ""; } else if (dialplan_detail_tag == "regex") { - document.getElementById("label_field_type").innerHTML = "Field"; - document.getElementById("label_field_data").innerHTML = "Expression"; + document.getElementById("label_field_type").innerHTML = ""; + document.getElementById("label_field_data").innerHTML = ""; } 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 = ""; + document.getElementById("label_field_data").innerHTML = ""; } 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 = ""; + document.getElementById("label_field_data").innerHTML = ""; } 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 = ""; + document.getElementById("label_field_data").innerHTML = ""; } if (dialplan_detail_tag == "") { - document.getElementById("label_field_type").innerHTML = "Type"; - document.getElementById("label_field_data").innerHTML = "Data"; + document.getElementById("label_field_type").innerHTML = ""; + document.getElementById("label_field_data").innerHTML = ""; } } @@ -266,53 +273,47 @@ if (count($_POST)>0 && strlen($_POST["persistformvar"]) == 0) { echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo " "; echo "
Dialplan Detail".$text['header-dial_plan_detail']."
\n"; - echo " Tag:\n"; + echo " ".$text['label-tag'].":\n"; echo "\n"; echo " \n"; @@ -335,7 +336,7 @@ if (count($_POST)>0 && strlen($_POST["persistformvar"]) == 0) { echo "
\n"; - echo " Order:\n"; + echo " ".$text['label-order'].":\n"; echo "\n"; echo " \n"; - echo " Type:\n"; + echo " ".$text['label-type'].":\n"; echo "\n"; echo "\n"; + echo "\n"; echo "
\n"; - echo " Data:\n"; + echo " ".$text['label-data'].":\n"; echo "\n"; echo " \n"; @@ -468,7 +469,7 @@ function Replaceivr_menu_option_param(obj){ echo "
\n"; - echo " Group:\n"; + echo " ".$text['label-group'].":\n"; echo "\n"; echo "
\n"; - echo " Break:\n"; + echo " ".$text['label-break'].":\n"; echo "\n"; echo " \n"; echo "
\n"; @@ -530,22 +531,22 @@ function Replaceivr_menu_option_param(obj){ if ($dialplan_detail_tag == "action") { echo "
\n"; - echo " Inline:\n"; + echo " ".$text['label-inline'].":\n"; echo "\n"; echo " \n"; echo "
\n"; @@ -561,7 +562,7 @@ function Replaceivr_menu_option_param(obj){ if ($action == "update") { echo " \n"; } - echo " \n"; + echo " \n"; echo "
"; diff --git a/app/dialplan/dialplan_edit.php b/app/dialplan/dialplan_edit.php index f3a8cb2528..4444ae213a 100644 --- a/app/dialplan/dialplan_edit.php +++ b/app/dialplan/dialplan_edit.php @@ -27,13 +27,13 @@ include "root.php"; require_once "includes/require.php"; require_once "includes/checkauth.php"; require_once "includes/paging.php"; -if (permission_exists('dialplan_add') - || permission_exists('dialplan_edit') - || permission_exists('inbound_route_add') +if (permission_exists('dialplan_add') + || permission_exists('dialplan_edit') + || permission_exists('inbound_route_add') || permission_exists('inbound_route_edit') - || permission_exists('outbound_route_add') + || permission_exists('outbound_route_add') || permission_exists('outbound_route_edit') - || permission_exists('time_conditions_add') + || permission_exists('time_conditions_add') || permission_exists('time_conditions_edit')) { //access granted } @@ -42,6 +42,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 as an add or an update if (isset($_REQUEST["id"])) { $action = "update"; @@ -74,12 +80,12 @@ if (count($_POST)>0 && strlen($_POST["persistformvar"]) == 0) { } //check for all required data - if (strlen($dialplan_name) == 0) { $msg .= "Please provide: Extension Name
\n"; } - if (strlen($dialplan_order) == 0) { $msg .= "Please provide: Order
\n"; } - if (strlen($dialplan_continue) == 0) { $msg .= "Please provide: Continue
\n"; } - if (strlen($dialplan_context) == 0) { $msg .= "Please provide: Context
\n"; } - if (strlen($dialplan_enabled) == 0) { $msg .= "Please provide: Enabled
\n"; } - //if (strlen($dialplan_description) == 0) { $msg .= "Please provide: Description
\n"; } + if (strlen($dialplan_name) == 0) { $msg .= $text['message-required'].$text['label-name']."
\n"; } + if (strlen($dialplan_order) == 0) { $msg .= $text['message-required'].$text['label-order']."
\n"; } + if (strlen($dialplan_continue) == 0) { $msg .= $text['message-required'].$text['label-continue']."
\n"; } + if (strlen($dialplan_context) == 0) { $msg .= $text['message-required'].$text['label-context']."
\n"; } + if (strlen($dialplan_enabled) == 0) { $msg .= $text['message-required'].$text['label-enabled']."
\n"; } + //if (strlen($dialplan_description) == 0) { $msg .= $text['message-required'].$text['label-description']."
\n"; } if (strlen($msg) > 0 && strlen($_POST["persistformvar"]) == 0) { require_once "includes/header.php"; require_once "includes/persistformvar.php"; @@ -155,7 +161,7 @@ if (count($_POST)>0 && strlen($_POST["persistformvar"]) == 0) { break; } echo "
\n"; - echo "Add Complete\n"; + echo $text['message-add']."\n"; echo "
\n"; require_once "includes/footer.php"; return; @@ -206,7 +212,7 @@ if (count($_POST)>0 && strlen($_POST["persistformvar"]) == 0) { break; } echo "
\n"; - echo "Update Complete\n"; + echo $text['message-update']."\n"; echo "
\n"; require_once "includes/footer.php"; return; @@ -238,6 +244,7 @@ if (count($_POST)>0 && strlen($_POST["persistformvar"]) == 0) { //show the header require_once "includes/header.php"; + $page["title"] = $text['title-dialplan_edit']; //show the content echo "
"; @@ -252,32 +259,32 @@ if (count($_POST)>0 && strlen($_POST["persistformvar"]) == 0) { echo "\n"; echo " \n"; echo " \n"; echo " \n"; echo " \n"; echo " \n"; echo " \n"; echo " \n"; @@ -287,7 +294,7 @@ if (count($_POST)>0 && strlen($_POST["persistformvar"]) == 0) { echo "
\n"; - echo" Dialplan
\n"; + echo" ".$text['title-dialplan_edit']."
\n"; echo "
\n"; - echo " \n"; + echo " \n"; switch ($app_uuid) { case "c03b422e-13a8-bd1b-e42b-b6b9b4d27ce4": //inbound routes - echo " \n"; + echo " \n"; break; case "8c914ec3-9fc0-8ab5-4cda-6c9288bdc9a3": //outbound routes - echo " \n"; + echo " \n"; break; case "4b821450-926b-175a-af93-a03c441818b1": //time conditions - echo " \n"; + echo " \n"; break; default: - echo " \n"; + echo " \n"; break; } echo "
\n"; - echo " Dialplan Include general settings. \n"; + echo " ".$text['description-dial_plan-edit']."\n"; echo " \n"; echo "
\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo " "; echo "
\n"; - echo " Name:\n"; + echo " ".$text['label-name'].":\n"; echo "\n"; echo " \n"; @@ -298,7 +305,7 @@ if (count($_POST)>0 && strlen($_POST["persistformvar"]) == 0) { echo "
\n"; - echo " Number:\n"; + echo " ".$text['label-number'].":\n"; echo "\n"; echo " \n"; @@ -309,7 +316,7 @@ if (count($_POST)>0 && strlen($_POST["persistformvar"]) == 0) { echo "
\n"; - echo " Context:\n"; + echo " ".$text['label-context'].":\n"; echo "\n"; echo " \n"; @@ -320,22 +327,22 @@ if (count($_POST)>0 && strlen($_POST["persistformvar"]) == 0) { echo "
\n"; - echo " Continue:\n"; + echo " ".$text['label-continue'].":\n"; echo "\n"; echo " \n"; echo "
\n"; @@ -344,11 +351,10 @@ if (count($_POST)>0 && strlen($_POST["persistformvar"]) == 0) { echo "
\n"; - echo " Order:\n"; + echo " ".$text['label-order'].":\n"; echo "\n"; echo "
\n"; - echo " Enabled:\n"; + echo " ".$text['label-enabled'].":\n"; echo "\n"; echo " \n"; echo "
\n"; @@ -398,7 +404,7 @@ if (count($_POST)>0 && strlen($_POST["persistformvar"]) == 0) { echo "
\n"; - echo " Description:\n"; + echo " ".$text['label-description'].":\n"; echo "\n"; echo " \n"; @@ -411,7 +417,7 @@ if (count($_POST)>0 && strlen($_POST["persistformvar"]) == 0) { if ($action == "update") { echo " \n"; } - echo " \n"; + echo " \n"; echo "
"; @@ -431,12 +437,9 @@ if (count($_POST)>0 && strlen($_POST["persistformvar"]) == 0) { echo "\n"; echo " \n"; - echo " \n"; + echo " \n"; echo " \n"; echo "

Conditions and Actions
\n"; - echo "
\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 that it is given. \n"; - echo " Use as many conditions, actions or anti-actions as needed. \n"; - echo "

".$text['header-conditions_and_actions']."\n"; + echo "

\n"; + echo " ".$text['description-conditions_and_actions']."

"; echo "
\n"; @@ -505,13 +508,12 @@ if (count($_POST)>0 && strlen($_POST["persistformvar"]) == 0) { echo "
\n"; echo "\n"; echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - //echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; echo "\n"; echo "\n"; @@ -526,7 +528,7 @@ if (count($_POST)>0 && strlen($_POST["persistformvar"]) == 0) { echo " \n"; echo " \n"; echo " \n"; echo " \n"; echo "
TagTypeDataOrderGroup".$text['label-tag']."".$text['label-type']."".$text['label-data']."".$text['label-order']."\n"; - echo " $v_link_label_add\n"; + echo " $v_link_label_add\n"; echo "
 $paging_controls\n"; - echo " $v_link_label_add\n"; + echo " $v_link_label_add\n"; echo "
\n"; @@ -539,13 +541,12 @@ if (count($_POST)>0 && strlen($_POST["persistformvar"]) == 0) { echo "
\n"; echo "\n"; echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - //echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; echo "\n"; echo "\n"; } @@ -556,10 +557,9 @@ if (count($_POST)>0 && strlen($_POST["persistformvar"]) == 0) { echo " \n"; echo " \n"; echo " \n"; - //echo " \n"; echo " \n"; echo "\n"; } @@ -576,7 +576,7 @@ if (count($_POST)>0 && strlen($_POST["persistformvar"]) == 0) { echo " \n"; echo " \n"; echo " \n"; echo " \n"; echo "
TagTypeDataOrderGroup".$text['label-tag']."".$text['label-type']."".$text['label-data']."".$text['label-order']."\n"; - echo " $v_link_label_add\n"; + echo " $v_link_label_add\n"; echo "
  ".$row['dialplan_detail_type']."  ".wordwrap($row['dialplan_detail_data'],180,"
",1)."
  ".$row['dialplan_detail_order']."  ".$row['dialplan_detail_group']."\n"; - echo " $v_link_label_edit\n"; - echo " $v_link_label_delete\n"; + echo " $v_link_label_edit\n"; + echo " $v_link_label_delete\n"; echo "
 $paging_controls\n"; - echo " $v_link_label_add\n"; + echo " $v_link_label_add\n"; echo "
\n"; diff --git a/app/dialplan/dialplans.php b/app/dialplan/dialplans.php index 48d344fe87..fce8c4160c 100644 --- a/app/dialplan/dialplans.php +++ b/app/dialplan/dialplans.php @@ -34,9 +34,11 @@ else { exit; } -//includes - require_once "includes/header.php"; - require_once "includes/paging.php"; +//add multi-lingual support + require_once "app_languages.php"; + foreach($text as $key => $value) { + $text[$key] = $value[$_SESSION['domain']['language']['code']]; + } //set the http values as php variables $order_by = $_GET["order_by"]; @@ -44,6 +46,23 @@ else { $dialplan_context = $_GET["dialplan_context"]; $app_uuid = $_GET["app_uuid"]; +//includes + require_once "includes/header.php"; + if ($app_uuid == "c03b422e-13a8-bd1b-e42b-b6b9b4d27ce4") { + $page["title"] = $text['title-inbound_routes']; + } + elseif ($app_uuid == "8c914ec3-9fc0-8ab5-4cda-6c9288bdc9a3") { + $page["title"] = $text['title-outbound_routes']; + } + elseif ($app_uuid == "4b821450-926b-175a-af93-a03c441818b1") { + $page["title"] = $text['title-time_conditions']; + } + else { + $page["title"] = $text['title-dialplan_manager']; + } + + require_once "includes/paging.php"; + //show the content echo "
"; echo "\n"; @@ -56,23 +75,23 @@ else { echo " \n"; echo " \n"; echo " \n"; echo " \n"; echo " \n"; echo "
\n"; echo " \n"; if ($app_uuid == "c03b422e-13a8-bd1b-e42b-b6b9b4d27ce4") { - echo " Inbound Routes\n"; + echo " ".$text['header-inbound_routes']."\n"; } elseif ($app_uuid == "8c914ec3-9fc0-8ab5-4cda-6c9288bdc9a3") { - echo " Outbound Routes\n"; + echo " ".$text['header-outbound_routes']."\n"; } elseif ($app_uuid == "4b821450-926b-175a-af93-a03c441818b1") { - echo " Time Conditions\n"; + echo " ".$text['header-time_conditions']."\n"; } else { - echo " Dialplan\n"; + echo " ".$text['header-dialplan_manager']."\n"; } - + echo " \n"; echo " \n"; if (permission_exists('dialplan_advanced_view') && strlen($app_uuid) == 0) { - echo " \n"; + echo " \n"; } else { echo " \n"; @@ -81,44 +100,29 @@ else { echo "
\n"; - echo " \n"; + echo "
\n"; if ($app_uuid == "c03b422e-13a8-bd1b-e42b-b6b9b4d27ce4") { - //inbound routes - echo " Route incoming calls to destinations based on one \n"; - echo " or more conditions. It can send incoming calls to an IVR Menu, \n"; - echo " Call Group, Extension, External Number, Script. Order is important when an \n"; - echo " anti-action is used or when there are multiple conditions that match. \n"; + echo $text['description-inbound_routes']; } elseif ($app_uuid == "8c914ec3-9fc0-8ab5-4cda-6c9288bdc9a3") { - //outbound routes - echo " Route outbound calls to gateways, tdm, enum and more. \n"; - echo " When a call matches the conditions the call to outbound routes . \n"; + echo $text['description-outbound_routes']; } elseif ($app_uuid == "4b821450-926b-175a-af93-a03c441818b1") { - //time conditions - echo " Time conditions route calls based on time conditions. You can \n"; - echo " use time conditions to send calls to an IVR Menu, External numbers, \n"; - echo " Scripts, or other destinations. \n"; + echo $text['description-time_conditions']; } else { - //dialplan if (if_group("superadmin")) { - echo " The dialplan is used to setup call destinations based on conditions and context.\n"; - echo " You can use the dialplan to send calls to gateways, auto attendants, external numbers,\n"; - echo " to scripts, or any destination.\n"; + echo $text['description-dialplan_manager-superadmin']; } else { - echo " The dialplan provides a view of some of the feature codes, as well as the IVR Menu, \n"; - echo " Conferences, Queues and other destinations.\n"; + echo $text['description-dialplan_manager']; } } echo "
\n"; echo "
"; - - echo "
"; echo "
"; //get the number of rows in the dialplan @@ -150,8 +154,8 @@ else { $param = ""; if (strlen($app_uuid) > 0) { $param = "&app_uuid=".$app_uuid; } $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; $sql = "select * from v_dialplans "; @@ -180,30 +184,30 @@ else { echo "
\n"; echo "\n"; echo "\n"; - echo th_order_by('dialplan_name', 'Name', $order_by, $order); - echo th_order_by('dialplan_number', 'Number', $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_number', $text['label-number'], $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 "\n"; @@ -246,34 +250,34 @@ else { echo " \n"; @@ -288,27 +292,27 @@ else { echo "
\n"; if ($app_uuid == "c03b422e-13a8-bd1b-e42b-b6b9b4d27ce4") { if (permission_exists('inbound_route_add')) { - echo " $v_link_label_add\n"; + echo " $v_link_label_add\n"; } } elseif ($app_uuid == "8c914ec3-9fc0-8ab5-4cda-6c9288bdc9a3") { if (permission_exists('outbound_route_add')) { - echo " $v_link_label_add\n"; + echo " $v_link_label_add\n"; } } elseif ($app_uuid == "4b821450-926b-175a-af93-a03c441818b1") { if (permission_exists('time_conditions_add')) { - echo " $v_link_label_add\n"; + echo " $v_link_label_add\n"; } } else { if (permission_exists('dialplan_add')) { - echo " $v_link_label_add\n"; + echo " $v_link_label_add\n"; } } echo "\n"; if ($app_uuid == "c03b422e-13a8-bd1b-e42b-b6b9b4d27ce4") { if (permission_exists('inbound_route_edit')) { - echo " $v_link_label_edit\n"; + echo " $v_link_label_edit\n"; } if (permission_exists('inbound_route_delete')) { - echo " $v_link_label_delete\n"; + echo " $v_link_label_delete\n"; } } elseif ($app_uuid == "8c914ec3-9fc0-8ab5-4cda-6c9288bdc9a3") { if (permission_exists('outbound_route_edit')) { - echo " $v_link_label_edit\n"; + echo " $v_link_label_edit\n"; } if (permission_exists('outbound_route_delete')) { - echo " $v_link_label_delete\n"; + echo " $v_link_label_delete\n"; } } elseif ($app_uuid == "4b821450-926b-175a-af93-a03c441818b1") { if (permission_exists('time_conditions_edit')) { - echo " $v_link_label_edit\n"; + echo " $v_link_label_edit\n"; } if (permission_exists('time_conditions_delete')) { - echo " $v_link_label_delete\n"; + echo " $v_link_label_delete\n"; } } else { if (permission_exists('dialplan_edit')) { - echo " $v_link_label_edit\n"; + echo " $v_link_label_edit\n"; } if (permission_exists('dialplan_delete')) { - echo " $v_link_label_delete\n"; + echo " $v_link_label_delete\n"; } } echo "
\n"; echo " \n"; echo " \n"; - echo " \n"; + echo " \n"; echo " \n"; echo " \n"; echo " \n"; echo " \n"; @@ -703,7 +707,7 @@ if (count($_POST)>0 && strlen($_POST["persistformvar"]) == 0) { obj.parentNode.removeChild(obj); Replace_condition_field_1(this.objs); } - + function Replace_condition_field_1(obj){ obj[2].parentNode.insertBefore(obj[0],obj[2]); obj[0].parentNode.removeChild(obj[1]); @@ -722,21 +726,21 @@ if (count($_POST)>0 && strlen($_POST["persistformvar"]) == 0) { if (strlen($condition_field_1) > 0) { echo " \n"; } - echo " \n"; - echo " \n"; - echo " \n"; - echo " \n"; - echo " \n"; - echo " \n"; - echo " \n"; - echo " \n"; - echo " \n"; - echo " \n"; - echo " \n"; - echo " \n"; - echo " \n"; + echo " \n"; + echo " \n"; + echo " \n"; + echo " \n"; + echo " \n"; + echo " \n"; + echo " \n"; + echo " \n"; + echo " \n"; + echo " \n"; + echo " \n"; + echo " \n"; + echo " \n"; echo " \n"; - echo " \n"; + echo " \n"; echo "
\n"; echo " \n"; echo " \n"; @@ -784,7 +788,7 @@ if (count($_POST)>0 && strlen($_POST["persistformvar"]) == 0) { obj.parentNode.removeChild(obj); Replace_condition_field_2(this.objs); } - + function Replace_condition_field_2(obj){ obj[2].parentNode.insertBefore(obj[0],obj[2]); obj[0].parentNode.removeChild(obj[1]); @@ -798,21 +802,21 @@ if (count($_POST)>0 && strlen($_POST["persistformvar"]) == 0) { if (strlen($condition_field_2) > 0) { echo " \n"; } - echo " \n"; - echo " \n"; - echo " \n"; - echo " \n"; - echo " \n"; - echo " \n"; - echo " \n"; - echo " \n"; - echo " \n"; - echo " \n"; - echo " \n"; - echo " \n"; - echo " \n"; + echo " \n"; + echo " \n"; + echo " \n"; + echo " \n"; + echo " \n"; + echo " \n"; + echo " \n"; + echo " \n"; + echo " \n"; + echo " \n"; + echo " \n"; + echo " \n"; + echo " \n"; echo " \n"; - echo " \n"; + echo " \n"; echo "
\n"; echo " \n"; echo " \n"; echo "\n"; echo "
 $paging_controls".$paging_controls."\n"; echo "  "; if ($app_uuid == "c03b422e-13a8-bd1b-e42b-b6b9b4d27ce4") { if (permission_exists('inbound_route_add')) { - echo " $v_link_label_add\n"; + echo " $v_link_label_add\n"; } } elseif ($app_uuid == "8c914ec3-9fc0-8ab5-4cda-6c9288bdc9a3") { if (permission_exists('outbound_route_add')) { - echo " $v_link_label_add\n"; + echo " $v_link_label_add\n"; } } elseif ($app_uuid == "4b821450-926b-175a-af93-a03c441818b1") { if (permission_exists('time_conditions_add')) { - echo " $v_link_label_add\n"; + echo " $v_link_label_add\n"; } } else { if (permission_exists('dialplan_add')) { - echo " $v_link_label_add\n"; + echo " $v_link_label_add\n"; } } diff --git a/app/dialplan_inbound/app_languages.php b/app/dialplan_inbound/app_languages.php index 5ff743dbf5..54120afd54 100644 --- a/app/dialplan_inbound/app_languages.php +++ b/app/dialplan_inbound/app_languages.php @@ -1,4 +1,4 @@ - $value) { $text[$key] = $value[$_SESSION['domain']['language']['code']]; } +require_once "includes/header.php"; +$page["title"] = $text['title-dialplan-inbound-add']; + +require_once "includes/paging.php"; + + //get the http get values and set them as php variables $order_by = $_GET["order_by"]; $order = $_GET["order"]; @@ -97,7 +101,7 @@ foreach($text as $key => $value) { } else { if (strlen($condition_field_1) == 0) { $condition_field_1 = "destination_number"; } - if (is_numeric($condition_expression_1)) { + if (is_numeric($condition_expression_1)) { //the number is numeric $condition_expression_1 = str_replace("+", "\+", $condition_expression_1); $condition_expression_1 = '^('.$condition_expression_1.')$'; @@ -640,12 +644,12 @@ if (count($_POST)>0 && strlen($_POST["persistformvar"]) == 0) { echo " \n"; if (permission_exists("inbound_route_edit") && $action == "advanced") { - echo " \n"; + echo " \n"; } else { - echo " \n"; + echo " \n"; } - echo " \n"; + echo " \n"; echo "
  ".$text['label-expression'].":\n"; @@ -857,7 +861,7 @@ if (count($_POST)>0 && strlen($_POST["persistformvar"]) == 0) { echo "".$text['label-select-inbound-destination-number']."\n"; } else { - echo " \n"; + echo " \n"; } unset ($prep_statement); @@ -938,13 +942,13 @@ if (count($_POST)>0 && strlen($_POST["persistformvar"]) == 0) { echo "\n"; echo " \n"; - + if (if_group("superadmin")) { echo "