diff --git a/app/destinations/app_languages.php b/app/destinations/app_languages.php new file mode 100644 index 0000000000..f2e25b1abf --- /dev/null +++ b/app/destinations/app_languages.php @@ -0,0 +1,116 @@ + \ No newline at end of file diff --git a/app/destinations/destinations.php b/app/destinations/destinations.php index d363e8a511..07834a8094 100644 --- a/app/destinations/destinations.php +++ b/app/destinations/destinations.php @@ -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-destinations']; + require_once "includes/paging.php"; //get variables used to control the order @@ -49,12 +58,12 @@ require_once "includes/paging.php"; echo "\n"; echo " \n"; - echo " \n"; + echo " \n"; echo " \n"; echo " \n"; echo " \n"; echo " \n"; echo " \n"; echo "
Destinations".$text['header-destinations']." 
\n"; - echo " Inbound destinations are the DID/DDI, DNIS or Alias for inbound calls.

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

\n"; echo "
\n"; @@ -79,9 +88,9 @@ require_once "includes/paging.php"; $rows_per_page = 150; $param = ""; $page = $_GET['page']; - if (strlen($page) == 0) { $page = 0; $_GET['page'] = 0; } - list($paging_controls, $rows_per_page, $var3) = 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, $var3) = paging($num_rows, $param, $rows_per_page); + $offset = $rows_per_page * $page; //get the list $sql = "select * from v_destinations "; @@ -101,13 +110,13 @@ require_once "includes/paging.php"; echo "
\n"; echo "\n"; echo "\n"; - echo th_order_by('destination_type', 'Type', $order_by, $order); - echo th_order_by('destination_number', 'Destination', $order_by, $order); - echo th_order_by('destination_context', 'Context', $order_by, $order); - echo th_order_by('destination_enabled', 'Enabled', $order_by, $order); - echo th_order_by('destination_description', 'Description', $order_by, $order); + echo th_order_by('destination_type', $text['label-destination_type'], $order_by, $order); + echo th_order_by('destination_number', $text['label-destination_number'], $order_by, $order); + echo th_order_by('destination_context', $text['label-destination_context'], $order_by, $order); + echo th_order_by('destination_enabled', $text['label-destination_enabled'], $order_by, $order); + echo th_order_by('destination_description', $text['label-destination_description'], $order_by, $order); echo "\n"; echo "\n"; if ($result_count > 0) { @@ -119,8 +128,8 @@ require_once "includes/paging.php"; echo " \n"; echo " \n"; echo " \n"; echo "\n"; if ($c==0) { $c=1; } else { $c=0; } @@ -135,7 +144,7 @@ require_once "includes/paging.php"; echo " \n"; echo " \n"; echo " \n"; echo " \n"; echo "
\n"; - echo " $v_link_label_add\n"; + echo " $v_link_label_add\n"; echo "
".$row['destination_enabled']." ".$row['destination_description']." \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/destinations/destinations_delete.php b/app/destinations/destinations_delete.php index 2e8ccc858a..7d0b59fa90 100644 --- a/app/destinations/destinations_delete.php +++ b/app/destinations/destinations_delete.php @@ -26,7 +26,7 @@ require_once "root.php"; require_once "includes/require.php"; require_once "includes/checkauth.php"; -if (if_group("admin") || if_group("superadmin")) { +if (permission_exists('destination_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 = check_str($_GET["id"]); } @@ -52,7 +58,7 @@ if (count($_GET)>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/destinations/destinations_edit.php b/app/destinations/destinations_edit.php index 1fb172b7d2..aa91656830 100644 --- a/app/destinations/destinations_edit.php +++ b/app/destinations/destinations_edit.php @@ -26,7 +26,7 @@ require_once "root.php"; require_once "includes/require.php"; require_once "includes/checkauth.php"; -if (if_group("admin") || if_group("superadmin")) { +if (permission_exists('destination_add') || permission_exists('destination_edit')) { //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']]; + } + //action add or update if (isset($_REQUEST["id"])) { $action = "update"; @@ -130,7 +136,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; @@ -159,12 +165,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 @@ -197,6 +203,13 @@ if (count($_POST)>0 && strlen($_POST["persistformvar"]) == 0) { //show the header require_once "includes/header.php"; + if ($action == "update") { + $page["title"] = $text['title-destination-edit']; + } + else if ($action == "add") { + $page["title"] = $text['title-destination-add']; + } + //show the content echo "
"; @@ -209,87 +222,87 @@ if (count($_POST)>0 && strlen($_POST["persistformvar"]) == 0) { echo "
\n"; echo "\n"; echo "\n"; - echo "\n"; - echo "\n"; + if ($action == "add") { + echo "\n"; + } + if ($action == "update") { + 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"; @@ -355,7 +364,7 @@ if (count($_POST)>0 && strlen($_POST["persistformvar"]) == 0) { echo " \n"; echo " \n"; } - echo " \n"; + echo " \n"; echo " \n"; echo " "; echo "
Destination".$text['header-destination-add']."".$text['header-destination-edit']."
\n"; - echo "An alias for a call destination. The destination will use the dialplan to find it its target.

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

\n"; echo "
\n"; - echo " Type:\n"; + echo " ".$text['label-destination_type'].":\n"; echo "\n"; echo " \n"; echo "
\n"; - echo "Select the type.\n"; + echo $text['description-destination_type']."\n"; echo "
\n"; - echo " Destination:\n"; + echo " ".$text['label-destination_number'].":\n"; echo "\n"; echo " \n"; echo "
\n"; - echo "Enter the destination.\n"; + echo $text['description-destination_number']."\n"; echo "
\n"; - echo " Caller ID Name:\n"; + echo " ".$text['label-destination_caller_id_name'].":\n"; echo "\n"; echo " \n"; echo "
\n"; - echo "Enter the caller id name.\n"; + echo $text['description-destination_caller_id_name']."\n"; echo "
\n"; - echo " Caller ID Number:\n"; + echo " ".$text['label-destination_caller_id_number'].":\n"; echo "\n"; echo " \n"; echo "
\n"; - echo "Enter the caller id number.\n"; + echo $text['description-destination_caller_id_number']."\n"; echo "
\n"; - echo " Context:\n"; + echo " ".$text['label-destination_context'].":\n"; echo "\n"; echo " \n"; echo "
\n"; - echo "Enter the context.\n"; + echo $text['description-destination_context']."\n"; echo "
\n"; - echo " Fax Destination:\n"; + echo " ".$text['label-fax_uuid'].":\n"; echo "\n"; $sql = "select * from v_fax "; @@ -311,42 +324,38 @@ if (count($_POST)>0 && strlen($_POST["persistformvar"]) == 0) { echo " \n"; unset ($prep_statement, $extension); echo "
\n"; - echo " Select the fax destination to enable fax detection.\n"; + echo " ".$text['description-fax_uuid']."\n"; echo "
\n"; - echo " Enabled:\n"; + echo " ".$text['label-destination_enabled'].":\n"; echo "\n"; echo " \n"; echo "
\n"; + echo $text['description-destination_enabled']."\n"; echo "
\n"; - echo " Description:\n"; + echo " ".$text['label-destination_description'].":\n"; echo "\n"; echo " \n"; echo "
\n"; - echo "Enter the description.\n"; + echo $text['description-destination_description']."\n"; echo "
";