From e46e4fc89440e73d1297f28a5313b5f30c39fb89 Mon Sep 17 00:00:00 2001 From: Nate Jones Date: Thu, 30 May 2013 00:51:49 +0000 Subject: [PATCH] Multilinguified Hunt Groups. Fixed Copy functionality, and added JS extension prompt on Copy. --- app/hunt_groups/app_languages.php | 97 ++++++++ app/hunt_groups/hunt_group_call_forward.php | 28 ++- .../hunt_group_call_forward_edit.php | 40 ++-- app/hunt_groups/hunt_group_copy.php | 34 ++- app/hunt_groups/hunt_group_delete.php | 20 +- .../hunt_group_destination_delete.php | 8 +- .../hunt_group_destination_edit.php | 94 ++++---- app/hunt_groups/hunt_group_edit.php | 221 +++++++++--------- app/hunt_groups/hunt_groups.php | 47 ++-- 9 files changed, 371 insertions(+), 218 deletions(-) create mode 100644 app/hunt_groups/app_languages.php diff --git a/app/hunt_groups/app_languages.php b/app/hunt_groups/app_languages.php new file mode 100644 index 0000000000..24f435da9c --- /dev/null +++ b/app/hunt_groups/app_languages.php @@ -0,0 +1,97 @@ + \ No newline at end of file diff --git a/app/hunt_groups/hunt_group_call_forward.php b/app/hunt_groups/hunt_group_call_forward.php index 6d76240bb4..4273107615 100644 --- a/app/hunt_groups/hunt_group_call_forward.php +++ b/app/hunt_groups/hunt_group_call_forward.php @@ -26,11 +26,22 @@ include "root.php"; require_once "includes/require.php"; require_once "includes/checkauth.php"; -require_once "includes/header.php"; -require_once "includes/paging.php"; //check permissions if (permission_exists('hunt_group_call_forward')) { + + require_once "includes/header.php"; + $page["title"] = $text['title-hunt-group_call_forward']; + + 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']]; + } + $order_by = $_GET["order_by"]; $order = $_GET["order"]; @@ -43,9 +54,8 @@ if (permission_exists('hunt_group_call_forward')) { echo "
"; echo " \n"; echo " \n"; - echo " \n"; echo " \n"; echo "
Hunt Group Call Forward
\n"; - echo " Use the links to configure hunt group call forward.\n"; - echo " The following hunt groups have been assigned to this user account. \n"; + echo "
".$text['header-hunt-group_call_forward']."
\n"; + echo " ".$text['description-hunt_group_call_forward']."\n"; echo "
\n"; @@ -83,9 +93,9 @@ if (permission_exists('hunt_group_call_forward')) { else { echo "\n"; echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; echo "\n"; } @@ -94,7 +104,7 @@ if (permission_exists('hunt_group_call_forward')) { echo "\n"; echo " \n"; echo " \n"; echo " \n"; echo "\n"; diff --git a/app/hunt_groups/hunt_group_call_forward_edit.php b/app/hunt_groups/hunt_group_call_forward_edit.php index fcc41b288c..750392a066 100644 --- a/app/hunt_groups/hunt_group_call_forward_edit.php +++ b/app/hunt_groups/hunt_group_call_forward_edit.php @@ -36,6 +36,12 @@ require_once "includes/checkauth.php"; exit; } + //add multi-lingual support + require_once "app_languages.php"; + foreach($text as $key => $value) { + $text[$key] = $value[$_SESSION['domain']['language']['code']]; + } + function destination_select($select_name, $select_value, $select_default) { if (strlen($select_value) == 0) { $select_value = $select_default; } echo "
Hunt Group ExtensionToolsDescription".$text['label-extension']."".$text['label-tools']."".$text['label-description']."
".$row['hunt_group_extension']."\n"; - echo " Call Forward \n"; + echo " ".$text['label-call_forward']." \n"; echo " ".$row['hunt_group_description']." 
\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"; @@ -475,7 +479,7 @@ if (count($_POST)>0 && strlen($_POST["persistformvar"]) == 0) { if ($action == "update") { echo " \n"; } - echo " \n"; + echo " \n"; echo " \n"; echo " "; echo "
\n"; - echo " Hunt Group Call Forward\n"; + echo " ".$text['header-hunt-group_call_forward']."\n"; echo "\n"; - echo " \n"; + echo " \n"; echo "
\n"; - echo " Directs incoming calls for extension $hunt_group_extension.

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

\n"; echo "
\n"; - echo " Call Forward:\n"; + echo " ".$text['label-call_forward'].":\n"; echo "\n"; if ($call_forward_enabled == "true") { - echo " Enabled \n"; + echo " ".$text['option-enabled']." \n"; } else { - echo " Enable \n"; + echo " ".$text['option-enabled']." \n"; } if ($call_forward_enabled == "false" || $call_forward_enabled == "") { - echo " Disabled \n"; + echo " ".$text['option-disabled']." \n"; } else { - echo " Disable \n"; + echo " ".$text['option-disabled']." \n"; } echo "
\n"; echo "
\n"; - //echo "Enable or disable call forward.\n"; echo "
\n"; - echo " Number:\n"; + echo " ".$text['label-number'].":\n"; echo "\n"; echo " \n"; echo "
\n"; - //echo "Enter the call forward number.\n"; echo "
"; diff --git a/app/hunt_groups/hunt_group_copy.php b/app/hunt_groups/hunt_group_copy.php index 59b3f43ec6..8183c0f9fc 100644 --- a/app/hunt_groups/hunt_group_copy.php +++ b/app/hunt_groups/hunt_group_copy.php @@ -37,12 +37,19 @@ require_once "includes/paging.php"; 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"])) { $hunt_group_uuid = check_str($_REQUEST["id"]); + $hunt_group_extension_new = check_str($_REQUEST["ext"]); } -//get the v_hunt_group data +//get the v_hunt_group data $sql = "select * from v_hunt_groups "; $sql .= "where hunt_group_uuid = '$hunt_group_uuid' "; $sql .= "and domain_uuid = '$domain_uuid' "; @@ -51,7 +58,7 @@ require_once "includes/paging.php"; $result = $prep_statement->fetchAll(PDO::FETCH_NAMED); foreach ($result as &$row) { $hunt_group_extension = $row["hunt_group_extension"]; - $hunt_group_name = $row["hunt_group_name"]; + $hunt_group_name = $row["hunt_group_name"]."_copy"; $hunt_group_type = $row["hunt_group_type"]; $hunt_group_context = $row["hunt_group_context"]; $hunt_group_timeout = $row["hunt_group_timeout"]; @@ -61,6 +68,7 @@ require_once "includes/paging.php"; $hunt_group_cid_name_prefix = $row["hunt_group_cid_name_prefix"]; $hunt_group_pin = $row["hunt_group_pin"]; $hunt_group_caller_announce = $row["hunt_group_caller_announce"]; + $hunt_group_user_list = $row["hunt_group_user_list"]; $hunt_group_enabled = $row["hunt_group_enabled"]; $hunt_group_description = "copy: ".$row["hunt_group_description"]; break; //limit to 1 row @@ -68,10 +76,11 @@ require_once "includes/paging.php"; unset ($prep_statement); //copy the hunt group + $hunt_group_uuid_new = uuid(); $sql = "insert into v_hunt_groups "; $sql .= "("; - $sql .= "domain_uuid, "; $sql .= "hunt_group_uuid, "; + $sql .= "domain_uuid, "; $sql .= "hunt_group_extension, "; $sql .= "hunt_group_name, "; $sql .= "hunt_group_type, "; @@ -83,14 +92,15 @@ require_once "includes/paging.php"; $sql .= "hunt_group_cid_name_prefix, "; $sql .= "hunt_group_pin, "; $sql .= "hunt_group_caller_announce, "; + $sql .= "hunt_group_user_list, "; $sql .= "hunt_group_enabled, "; $sql .= "hunt_group_description "; $sql .= ")"; $sql .= "values "; $sql .= "("; + $sql .= "'$hunt_group_uuid_new', "; $sql .= "'$domain_uuid', "; - $sql .= "'$hunt_group_uuid', "; - $sql .= "'$hunt_group_extension', "; + $sql .= "'$hunt_group_extension_new', "; $sql .= "'$hunt_group_name', "; $sql .= "'$hunt_group_type', "; $sql .= "'$hunt_group_context', "; @@ -101,6 +111,7 @@ require_once "includes/paging.php"; $sql .= "'$hunt_group_cid_name_prefix', "; $sql .= "'$hunt_group_pin', "; $sql .= "'$hunt_group_caller_announce', "; + $sql .= "'$hunt_group_user_list', "; $sql .= "'$hunt_group_enabled', "; $sql .= "'$hunt_group_description' "; $sql .= ")"; @@ -115,11 +126,12 @@ require_once "includes/paging.php"; $prep_statement->execute(); $result = $prep_statement->fetchAll(PDO::FETCH_NAMED); foreach ($result as &$row) { - $hunt_group_uuid = $row["hunt_group_uuid"]; $destination_data = $row["destination_data"]; $destination_type = $row["destination_type"]; $destination_profile = $row["destination_profile"]; + $destination_timeout = $row["destination_timeout"]; $destination_order = $row["destination_order"]; + $destination_enabled = $row["destination_enabled"]; $destination_description = $row["destination_description"]; //copy the hunt group destinations @@ -132,21 +144,27 @@ require_once "includes/paging.php"; $sql .= "destination_data, "; $sql .= "destination_type, "; $sql .= "destination_profile, "; + $sql .= "destination_timeout, "; $sql .= "destination_order, "; + $sql .= "destination_enabled, "; $sql .= "destination_description "; $sql .= ")"; $sql .= "values "; $sql .= "("; $sql .= "'$domain_uuid', "; - $sql .= "'$db_hunt_group_uuid', "; + $sql .= "'$hunt_group_uuid_new', "; $sql .= "'$hunt_group_destination_uuid', "; $sql .= "'$destination_data', "; $sql .= "'$destination_type', "; $sql .= "'$destination_profile', "; + $sql .= "'$destination_timeout', "; $sql .= "'$destination_order', "; + $sql .= "'$destination_enabled', "; $sql .= "'$destination_description' "; $sql .= ")"; $db->exec(check_sql($sql)); + //echo $sql."

"; + //exit(); unset($sql); } unset ($prep_statement); @@ -158,7 +176,7 @@ require_once "includes/paging.php"; require_once "includes/header.php"; echo "\n"; echo "
\n"; - echo "Copy Complete\n"; + echo $text['message-copy']."\n"; echo "
\n"; require_once "includes/footer.php"; return; diff --git a/app/hunt_groups/hunt_group_delete.php b/app/hunt_groups/hunt_group_delete.php index f07a6958d1..82549de221 100644 --- a/app/hunt_groups/hunt_group_delete.php +++ b/app/hunt_groups/hunt_group_delete.php @@ -28,12 +28,18 @@ require_once "includes/require.php"; require_once "includes/checkauth.php"; //check permissions - if (permission_exists('hunt_group_delete')) { - //access granted - } - else { - echo "access denied"; - exit; +if (permission_exists('hunt_group_delete')) { + //access granted +} +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']]; } if (count($_GET)>0) { @@ -104,7 +110,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"; return; diff --git a/app/hunt_groups/hunt_group_destination_delete.php b/app/hunt_groups/hunt_group_destination_delete.php index a9b4285e9a..3f01a8775a 100644 --- a/app/hunt_groups/hunt_group_destination_delete.php +++ b/app/hunt_groups/hunt_group_destination_delete.php @@ -36,6 +36,12 @@ require_once "includes/checkauth.php"; 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"]; $hunt_group_uuid = check_str($_REQUEST["id2"]); @@ -58,7 +64,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"; return; diff --git a/app/hunt_groups/hunt_group_destination_edit.php b/app/hunt_groups/hunt_group_destination_edit.php index cb1b8b35f9..dd06e060b2 100644 --- a/app/hunt_groups/hunt_group_destination_edit.php +++ b/app/hunt_groups/hunt_group_destination_edit.php @@ -36,6 +36,12 @@ require_once "includes/checkauth.php"; 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"; @@ -70,13 +76,13 @@ 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($destination_data) == 0) { $msg .= "Please provide: Destination
\n"; } - if (strlen($destination_type) == 0) { $msg .= "Please provide: Type
\n"; } - //if (strlen($destination_timeout) == 0) { $msg .= "Please provide: Timeout
\n"; } - //if (strlen($destination_order) == 0) { $msg .= "Please provide: Order
\n"; } - //if (strlen($destination_enabled) == 0) { $msg .= "Please provide: Enabled
\n"; } - //if (strlen($destination_description) == 0) { $msg .= "Please provide: Description
\n"; } + if (strlen($domain_uuid) == 0) { $msg .= $text['message-required']."domain_uuid
\n"; } + if (strlen($destination_data) == 0) { $msg .= $text['message-required'].$text['label-destination']."
\n"; } + if (strlen($destination_type) == 0) { $msg .= $text['message-required'].$text['label-type']."
\n"; } + //if (strlen($destination_timeout) == 0) { $msg .= $text['message-required'].$text['label-timeout']."
\n"; } + //if (strlen($destination_order) == 0) { $msg .= $text['message-required'].$text['label-order']."
\n"; } + //if (strlen($destination_enabled) == 0) { $msg .= $text['message-required'].$text['label-enabled']."
\n"; } + //if (strlen($destination_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"; @@ -127,7 +133,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; @@ -153,7 +159,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; @@ -185,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-hunt_group_destination_add']; + } + if ($action == "update") { + $page["title"] = $text['title-hunt_group_destination_edit']; + } //show the content echo "
"; @@ -201,54 +213,55 @@ if (count($_POST)>0 && strlen($_POST["persistformvar"]) == 0) { echo "\n"; if ($action == "add") { - echo "Destination Add\n"; + echo "".$text['header-hunt_group_destination_add']."\n"; } if ($action == "update") { - echo "Destination Edit\n"; + echo "".$text['header-hunt_group_destination_edit']."\n"; } - echo "\n"; + echo "\n"; echo "\n"; echo "\n"; echo "\n"; - echo " Destination:\n"; + echo " ".$text['label-destination'].":\n"; echo "\n"; echo "\n"; echo " \n"; echo "
\n"; - echo "extension: 1001
\n"; - echo "voicemail: 1001
\n"; - echo "sip uri (voicemail): sofia/internal/*98@\${domain}
\n"; - echo "sip uri (external number): sofia/gateway/gatewayname/12081231234
\n"; - echo "sip uri (auto attendant): sofia/internal/5002@\${domain}
\n"; - echo "sip uri (user): /user/1001@\${domain}\n"; + echo "".$text['description-destination_examples']."...
\n"; + echo $text['description-destination_example_extension'].": 1001
\n"; + echo $text['description-destination_example_voicemail'].": 1001
\n"; + echo $text['description-destination_example_sip_uri_voicemail'].": sofia/internal/*98@\${domain}
\n"; + echo $text['description-destination_example_sip_uri_external_number'].": sofia/gateway/gatewayname/12081231234
\n"; + echo $text['description-destination_example_sip_uri_auto_attendant'].": sofia/internal/5002@\${domain}
\n"; + echo $text['description-destination_example_sip_uri_user'].": /user/1001@\${domain}\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; - echo " Type:\n"; + echo " ".$text['label-type'].":\n"; echo "\n"; echo "\n"; echo " \n"; echo "
\n"; @@ -258,7 +271,7 @@ if (count($_POST)>0 && strlen($_POST["persistformvar"]) == 0) { echo "\n"; echo "\n"; - echo " Timeout:\n"; + echo " ".$text['label-timeout'].":\n"; echo "\n"; echo "\n"; echo " \n"; echo "
\n"; - echo "Select the destination timeout in seconds. \n"; + echo $text['description-destination_timeout']."\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; - echo " Order:\n"; + echo " ".$text['label-order'].":\n"; echo "\n"; echo "\n"; echo " \n"; echo "
\n"; - echo "Processing of each destination is determined by this order. \n"; + echo $text['description-destination_order']."\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; - echo " Enabled:\n"; + echo " ".$text['label-enabled'].":\n"; echo "\n"; echo "\n"; echo " \n"; echo "
\n"; @@ -333,12 +345,12 @@ if (count($_POST)>0 && strlen($_POST["persistformvar"]) == 0) { echo "\n"; echo "\n"; - echo " Description:\n"; + echo " ".$text['label-description'].":\n"; echo "\n"; echo "\n"; echo " \n"; echo "
\n"; - echo "You may enter a description here for your reference (not parsed).\n"; + echo $text['description-description']."\n"; echo "\n"; echo "\n"; @@ -348,7 +360,7 @@ if (count($_POST)>0 && strlen($_POST["persistformvar"]) == 0) { if ($action == "update") { echo " \n"; } - echo " \n"; + echo " \n"; echo " \n"; echo " "; echo ""; diff --git a/app/hunt_groups/hunt_group_edit.php b/app/hunt_groups/hunt_group_edit.php index 137fc99b88..82dbd02916 100644 --- a/app/hunt_groups/hunt_group_edit.php +++ b/app/hunt_groups/hunt_group_edit.php @@ -37,6 +37,12 @@ require_once "includes/paging.php"; exit; } +//add multi-lingual support + require_once "app_languages.php"; + foreach($text as $key => $value) { + $text[$key] = $value[$_SESSION['domain']['language']['code']]; + } + //action add or update if (isset($_REQUEST["id"])) { $action = "update"; @@ -52,7 +58,6 @@ require_once "includes/paging.php"; $hunt_group_extension = check_str($_POST["hunt_group_extension"]); $hunt_group_name = check_str($_POST["hunt_group_name"]); $hunt_group_type = check_str($_POST["hunt_group_type"]); - //$hunt_group_context = check_str($_POST["hunt_group_context"]); $hunt_group_timeout = check_str($_POST["hunt_group_timeout"]); $hunt_group_timeout_destination = check_str($_POST["hunt_group_timeout_destination"]); $hunt_group_timeout_type = check_str($_POST["hunt_group_timeout_type"]); @@ -100,21 +105,20 @@ 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($hunt_group_extension) == 0) { $msg .= "Please provide: Extension
\n"; } - if (strlen($hunt_group_name) == 0) { $msg .= "Please provide: Hunt Group Name
\n"; } - if (strlen($hunt_group_type) == 0) { $msg .= "Please provide: Type
\n"; } - //if (strlen($hunt_group_context) == 0) { $msg .= "Please provide: Context
\n"; } - if (strlen($hunt_group_timeout) == 0) { $msg .= "Please provide: Timeout
\n"; } - if (strlen($hunt_group_timeout_destination) == 0) { $msg .= "Please provide: Timeout Destination
\n"; } - if (strlen($hunt_group_timeout_type) == 0) { $msg .= "Please provide: Timeout Type
\n"; } - //if (strlen($hunt_group_ringback) == 0) { $msg .= "Please provide: Ring Back
\n"; } - //if (strlen($hunt_group_cid_name_prefix) == 0) { $msg .= "Please provide: CID Prefix
\n"; } - //if (strlen($hunt_group_pin) == 0) { $msg .= "Please provide: PIN
\n"; } - if (strlen($hunt_group_caller_announce) == 0) { $msg .= "Please provide: Caller Announce
\n"; } - //if (strlen($hunt_group_user_list) == 0) { $msg .= "Please provide: User List
\n"; } - //if (strlen($hunt_group_enabled) == 0) { $msg .= "Please provide: Enabled
\n"; } - //if (strlen($hunt_group_description) == 0) { $msg .= "Please provide: Description
\n"; } + if (strlen($domain_uuid) == 0) { $msg .= $text['message-required']."domain_uuid
\n"; } + if (strlen($hunt_group_extension) == 0) { $msg .= $text['message-required'].$text['label-extension']."
\n"; } + if (strlen($hunt_group_name) == 0) { $msg .= $text['message-required'].$text['label-name']."
\n"; } + if (strlen($hunt_group_type) == 0) { $msg .= $text['message-required'].$text['label-strategy']."
\n"; } + if (strlen($hunt_group_timeout) == 0) { $msg .= $text['message-required'].$text['label-timeout']."
\n"; } + if (strlen($hunt_group_timeout_destination) == 0) { $msg .= $text['message-required'].$text['label-timeout_destination']."
\n"; } + if (strlen($hunt_group_timeout_type) == 0) { $msg .= $text['message-required'].$text['label-timeout_type']."
\n"; } + //if (strlen($hunt_group_ringback) == 0) { $msg .= $text['message-required'].$text['label-ring_back']."
\n"; } + //if (strlen($hunt_group_cid_name_prefix) == 0) { $msg .= $text['message-required'].$text['label-caller_id_name_prefix']."
\n"; } + //if (strlen($hunt_group_pin) == 0) { $msg .= $text['message-required'].$text['label-pin_number']."
\n"; } + if (strlen($hunt_group_caller_announce) == 0) { $msg .= $text['message-required'].$text['label-caller_announce']."
\n"; } + //if (strlen($hunt_group_user_list) == 0) { $msg .= $text['message-required'].$text['label-user_list']."
\n"; } + //if (strlen($hunt_group_enabled) == 0) { $msg .= $text['message-required'].$text['label-enabled']."
\n"; } + //if (strlen($hunt_group_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"; @@ -184,7 +188,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; @@ -265,7 +269,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; @@ -288,7 +292,6 @@ if (count($_POST)>0 && strlen($_POST["persistformvar"]) == 0) { $hunt_group_extension = $row["hunt_group_extension"]; $hunt_group_name = $row["hunt_group_name"]; $hunt_group_type = $row["hunt_group_type"]; - //$hunt_group_context = $row["hunt_group_context"]; $hunt_group_timeout = $row["hunt_group_timeout"]; $hunt_group_timeout_destination = $row["hunt_group_timeout_destination"]; $hunt_group_timeout_type = $row["hunt_group_timeout_type"]; @@ -306,6 +309,8 @@ if (count($_POST)>0 && strlen($_POST["persistformvar"]) == 0) { //show the header require_once "includes/header.php"; + $page["title"] = $text['title-hunt_group']; + //show the content echo "
"; @@ -324,18 +329,20 @@ if (count($_POST)>0 && strlen($_POST["persistformvar"]) == 0) { echo "\n"; echo "\n"; echo " \n"; - echo " Hunt Group
\n"; + echo " ".$text['header-hunt_group']."
\n"; echo "
\n"; echo "\n"; echo "\n"; - echo " \n"; - echo " \n"; + if ($action != "add") { + echo " \n"; + } + echo " \n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; - echo " A Hunt Group is a list of destinations that can be called in sequence or simultaneously. \n"; + echo " ".$text['description-hunt_group']."\n"; echo "
\n"; echo "
\n"; echo "\n"; @@ -347,69 +354,45 @@ if (count($_POST)>0 && strlen($_POST["persistformvar"]) == 0) { echo "\n"; echo "\n"; - echo " Hunt Group Name:\n"; + echo " ".$text['label-name'].":\n"; echo "\n"; echo "\n"; echo " \n"; echo "
\n"; - echo "\n"; + echo $text['description-name']."\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; - echo " Extension:\n"; + echo " ".$text['label-extension'].":\n"; echo "\n"; echo "\n"; echo " \n"; echo "
\n"; - echo "example: 7002\n"; + echo $text['description-extension']."\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; - echo " Type:\n"; + echo " ".$text['label-strategy'].":\n"; echo "\n"; echo "\n"; echo " \n"; echo "
\n"; echo "\n"; @@ -418,65 +401,65 @@ if (count($_POST)>0 && strlen($_POST["persistformvar"]) == 0) { echo "\n"; echo "\n"; - echo " Timeout:\n"; + echo " ".$text['label-timeout'].":\n"; echo "\n"; echo "\n"; echo " \n"; echo "
\n"; - echo "The timeout sets the time in seconds to continue to call before timing out. \n"; + echo $text['description-timeout']."\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; - echo " Timeout Destination:\n"; + echo " ".$text['label-timeout_destination'].":\n"; echo "\n"; echo "\n"; echo " \n"; echo "
\n"; - echo "Destination. example: 1001\n"; + echo $text['description-timeout_destination']."\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; - echo " Timeout Type:\n"; + echo " ".$text['label-timeout_type'].":\n"; echo "\n"; echo "\n"; echo " \n"; echo "
\n"; - echo "\n"; + echo $text['description-timeout_type']."\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; - echo " Ring Back:\n"; + echo " ".$text['label-ring_back'].":\n"; echo "\n"; echo "\n"; $select_options = ""; - if ($hunt_group_ringback == "\${us-ring}" || $hunt_group_ringback == "us-ring") { + if ($hunt_group_ringback == "\${us-ring}" || $hunt_group_ringback == "us-ring") { $select_options .= " \n"; } else { @@ -488,13 +471,13 @@ if (count($_POST)>0 && strlen($_POST["persistformvar"]) == 0) { else { $select_options .= " \n"; } - if ($hunt_group_ringback == "\${uk-ring}" || $hunt_group_ringback == "uk-ring") { + if ($hunt_group_ringback == "\${uk-ring}" || $hunt_group_ringback == "uk-ring") { $select_options .= " \n"; } else { $select_options .= " \n"; } - if ($hunt_group_ringback == "\${rs-ring}" || $hunt_group_ringback == "rs-ring") { + if ($hunt_group_ringback == "\${rs-ring}" || $hunt_group_ringback == "rs-ring") { $select_options .= " \n"; } else { @@ -508,29 +491,29 @@ if (count($_POST)>0 && strlen($_POST["persistformvar"]) == 0) { echo $moh->select(); echo "
\n"; - echo "Defines what the caller will hear while the destination is being called. The choices are music (music on hold) ring (ring tone.) default: music \n"; + echo $text['description-ring_back']."\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; - echo " CID Prefix:\n"; + echo " ".$text['label-caller_id_name_prefix'].":\n"; echo "\n"; echo "\n"; echo " \n"; echo "
\n"; - echo "Set a prefix on the caller ID name.\n"; + echo $text['description-caller_id_name_prefix']."\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; - echo " PIN:\n"; + echo " ".$text['label-pin_number'].":\n"; echo "\n"; echo "\n"; echo " \n"; echo "
\n"; - echo "If this is provided then the caller will be required to enter the PIN number.\n"; + echo $text['description-pin_number']."\n"; echo "\n"; echo "\n"; @@ -540,22 +523,22 @@ if (count($_POST)>0 && strlen($_POST["persistformvar"]) == 0) { if (switch_module_is_running($fp, 'mod_spidermonkey')) { echo "\n"; echo "\n"; - echo " Caller Announce:\n"; + echo " ".$text['label-caller_announce'].":\n"; echo "\n"; echo "\n"; echo " \n"; echo "
\n"; @@ -567,14 +550,14 @@ if (count($_POST)>0 && strlen($_POST["persistformvar"]) == 0) { if (if_group("admin") || if_group("superadmin")) { echo "\n"; echo "\n"; - echo " User List:\n"; + echo " ".$text['label-user_list'].":\n"; echo "\n"; echo "\n"; $onchange = "document.getElementById('hunt_group_user_list').value += document.getElementById('username').value + '\\n';"; $table_name = 'v_users'; $field_name = 'username'; $field_current_value = ''; $sql_where_optional = "where domain_uuid = '$domain_uuid' and user_enabled = 'true' "; echo html_select_on_change($db, $table_name, $field_name, $sql_where_optional, $field_current_value, $onchange); echo "
\n"; - echo "Use the select list to add users to the user list. This will assign users to this extension.\n"; + echo $text['description-user_list_select']."\n"; echo "
\n"; echo "
\n"; //replace the vertical bar with a line feed to display in the textarea @@ -586,7 +569,7 @@ if (count($_POST)>0 && strlen($_POST["persistformvar"]) == 0) { } echo " \n"; echo "
\n"; - echo "Assign the users that are can manage this hunt group extension.\n"; + echo $text['description-user_list_textarea']."\n"; echo "
\n"; echo "\n"; echo "\n"; @@ -594,37 +577,37 @@ if (count($_POST)>0 && strlen($_POST["persistformvar"]) == 0) { echo "\n"; echo "\n"; - echo " Enabled:\n"; + echo " ".$text['label-enabled'].":\n"; echo "\n"; echo "\n"; echo " \n"; echo "
\n"; - echo "\n"; + echo $text['description-enabled']."\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; - echo " Description:\n"; + echo " ".$text['label-description'].":\n"; echo "\n"; echo "\n"; echo " \n"; echo "
\n"; - echo "You may enter a description here for your reference (not parsed). \n"; + echo $text['description-description']."\n"; echo "\n"; echo "\n"; echo " \n"; @@ -633,7 +616,7 @@ if (count($_POST)>0 && strlen($_POST["persistformvar"]) == 0) { echo " \n"; echo " \n"; } - echo " \n"; + echo " \n"; echo " \n"; echo " "; echo ""; @@ -657,10 +640,8 @@ if (count($_POST)>0 && strlen($_POST["persistformvar"]) == 0) { echo "\n"; echo " \n"; echo " \n"; echo " \n"; echo "

\n"; - echo " \n"; - echo " Destinations
\n"; - echo "
\n"; - echo " The following destinations will be called.\n"; + echo " ".$text['header-hunt_group_destinations']."
\n"; + echo " ".$text['description-hunt_group_destinations']."\n"; echo "

\n"; @@ -685,14 +666,14 @@ 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"; @@ -701,16 +682,22 @@ if (count($_POST)>0 && strlen($_POST["persistformvar"]) == 0) { foreach($result as $row) { echo "\n"; echo " \n"; - echo " \n"; + echo " \n"; echo " \n"; echo " \n"; echo " \n"; echo " \n"; echo "\n"; @@ -727,7 +714,7 @@ if (count($_POST)>0 && strlen($_POST["persistformvar"]) == 0) { echo " \n"; echo " \n"; echo " \n"; diff --git a/app/hunt_groups/hunt_groups.php b/app/hunt_groups/hunt_groups.php index 7ee8735928..5fd6755768 100644 --- a/app/hunt_groups/hunt_groups.php +++ b/app/hunt_groups/hunt_groups.php @@ -36,7 +36,15 @@ require_once "includes/checkauth.php"; 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-hunt_groups']; + require_once "includes/paging.php"; $order_by = $_GET["order_by"]; @@ -50,10 +58,8 @@ echo "
"; echo "
DestinationTypeProfileOrderDescription".$text['label-destination']."".$text['label-type']."".$text['label-profile']."".$text['label-order']."".$text['label-description']."\n"; if (permission_exists('hunt_group_add')) { - echo " $v_link_label_add\n"; + echo " $v_link_label_add\n"; } echo "
  ".$row['destination_data']."  ".$row['destination_type']."  "; + switch($row['destination_type']) { + case "extension" : echo $text['option-extension']; break; + case "voicemail" : echo $text['option-voicemail']; break; + case "sip uri" : echo $text['option-sip_uri']; break; + } + echo "  ".$row['destination_profile']."  ".$row['destination_order']."".$row['destination_description']." \n"; if (permission_exists('hunt_group_edit')) { - echo " $v_link_label_edit\n"; + echo " $v_link_label_edit\n"; } if (permission_exists('hunt_group_delete')) { - echo " $v_link_label_delete\n"; + echo " $v_link_label_delete\n"; } echo "
$paging_controls\n"; if (permission_exists('hunt_group_add')) { - echo " $v_link_label_add\n"; + echo " $v_link_label_add\n"; } echo "
\n"; echo "\n"; -echo " \n"; +echo " \n"; echo "\n"; echo "

Hunt Group
\n"; -echo "
\n"; -echo " A Hunt Group is a list of destinations that can be called in sequence or simultaneously.\n"; -echo "

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

\n"; echo "
\n"; @@ -68,7 +74,7 @@ if ($prep_statement) { if ($row['num_rows'] > 0) { $num_rows = $row['num_rows']; } - else { + else { $num_rows = '0'; } } @@ -78,9 +84,9 @@ unset($prep_statement, $result); $rows_per_page = 150; $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); -$offset = $rows_per_page * $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 hunt group list $sql = "select * from v_hunt_groups "; @@ -105,13 +111,13 @@ $row_style["1"] = "row_style1"; echo "
\n"; echo "\n"; echo "\n"; -echo th_order_by('hunt_group_extension', 'Extension', $order_by, $order); -echo th_order_by('hunt_group_name', 'Hunt Group Name', $order_by, $order); -echo th_order_by('hunt_group_name', 'Enabled', $order_by, $order); -echo th_order_by('hunt_group_description', 'Description', $order_by, $order); +echo th_order_by('hunt_group_extension', $text['label-extension'], $order_by, $order); +echo th_order_by('hunt_group_name', $text['label-name'], $order_by, $order); +echo th_order_by('hunt_group_name', $text['label-enabled'], $order_by, $order); +echo th_order_by('hunt_group_description', $text['label-description'], $order_by, $order); echo "\n"; echo "\n"; @@ -121,14 +127,21 @@ if ($result_count > 0) { echo "\n"; echo " \n"; echo " \n"; - echo " \n"; + echo " \n"; echo " \n"; echo " \n"; echo "\n"; @@ -145,7 +158,7 @@ echo " \n"; echo " \n"; echo " \n"; echo " \n";
\n"; if (permission_exists('hunt_group_add')) { - echo " $v_link_label_add\n"; + echo " $v_link_label_add\n"; } echo "
".$row['hunt_group_extension']."".$row['hunt_group_name']."".$row['hunt_group_enabled'].""; + if ($row['hunt_group_enabled'] == "true") { + echo $text['option-true']; + } + else if ($row['hunt_group_enabled'] == "false") { + echo $text['option-false']; + } + echo "".$row['hunt_group_description']." \n"; if (permission_exists('hunt_group_edit')) { - echo " $v_link_label_edit\n"; + echo " $v_link_label_edit\n"; } if (permission_exists('hunt_group_delete')) { - echo " $v_link_label_delete\n"; + echo " $v_link_label_delete\n"; } echo "
 $paging_controls\n"; if (permission_exists('hunt_group_add')) { - echo " $v_link_label_add\n"; + echo " $v_link_label_add\n"; } echo "