From 50f7f0f22b674966cda43a6a93822c5ce37d18fa Mon Sep 17 00:00:00 2001 From: Mark Crane Date: Wed, 11 Sep 2013 19:31:40 +0000 Subject: [PATCH] Add FIFO Queues to use the same code as the dialplan. --- app/dialplan/app_languages.php | 3 +++ app/dialplan/dialplan_copy.php | 1 + app/dialplan/dialplan_delete.php | 1 + app/dialplan/dialplan_details_delete.php | 6 +++--- app/dialplan/dialplan_details_edit.php | 4 +++- app/dialplan/dialplan_edit.php | 2 ++ app/dialplan/dialplans.php | 18 ++++++++++++++++++ 7 files changed, 31 insertions(+), 4 deletions(-) diff --git a/app/dialplan/app_languages.php b/app/dialplan/app_languages.php index 6039191d44..a7e887372c 100644 --- a/app/dialplan/app_languages.php +++ b/app/dialplan/app_languages.php @@ -10,6 +10,7 @@ $text['title-dialplan_edit']['en-us'] = 'Dialplan Edit'; $text['title-dialplan_detail']['en-us'] = 'Dialplan Detail'; $text['title-default_dialplan']['en-us'] = 'Default Dialplan'; + $text['title-queues']['en-us'] = 'Queues'; $text['header-dialplan_manager']['en-us'] = 'Dialplan Manager'; $text['header-inbound_routes']['en-us'] = 'Inbound Routes'; @@ -20,6 +21,7 @@ $text['header-conditions_and_actions']['en-us'] = 'Conditions and Actions'; $text['header-dialplan_detail']['en-us'] = 'Dialplan Detail'; $text['header-default_dialplan']['en-us'] = 'Default Dialplan'; + $text['header-queues']['en-us'] = 'Queues'; $text['description-dialplan_manager']['en-us'] = 'The dialplan provides a view of some of the feature codes, as well as the IVR Menu, Conferences, Queues and other destinations.'; $text['description-dialplan_manager-superadmin']['en-us'] = 'The 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.'; @@ -29,6 +31,7 @@ $text['description-dialplan-edit']['en-us'] = 'Dialplan include general settings.'; $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 that it is given. Use as many conditions, actions or anti-actions as needed.'; $text['description-default_dialplan']['en-us'] = '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.'; + $text['description-queues']['en-us'] = 'Queues are used to setup waiting lines for callers. Also known as FIFO Queues.'; $text['label-name']['en-us'] = 'Name'; $text['label-condition_1']['en-us'] = 'Condition 1'; diff --git a/app/dialplan/dialplan_copy.php b/app/dialplan/dialplan_copy.php index 7399993f2b..e54a20b972 100644 --- a/app/dialplan/dialplan_copy.php +++ b/app/dialplan/dialplan_copy.php @@ -30,6 +30,7 @@ require_once "resources/paging.php"; if (permission_exists('dialplan_add') || permission_exists('inbound_route_add') || permission_exists('outbound_route_add') + || permission_exists('fifo_add') || permission_exists('time_conditions_add')) { //access granted } diff --git a/app/dialplan/dialplan_delete.php b/app/dialplan/dialplan_delete.php index 732ae18733..a9e085e8b8 100644 --- a/app/dialplan/dialplan_delete.php +++ b/app/dialplan/dialplan_delete.php @@ -29,6 +29,7 @@ require_once "resources/check_auth.php"; if (permission_exists('dialplan_delete') || permission_exists('inbound_route_delete') || permission_exists('outbound_route_delete') + || permission_exists('fifo_delete') || permission_exists('time_conditions_delete')) { //access granted } diff --git a/app/dialplan/dialplan_details_delete.php b/app/dialplan/dialplan_details_delete.php index cd285809bb..afe28f0808 100644 --- a/app/dialplan/dialplan_details_delete.php +++ b/app/dialplan/dialplan_details_delete.php @@ -17,7 +17,7 @@ The Initial Developer of the Original Code is Mark J Crane - Portions created by the Initial Developer are Copyright (C) 2008-2012 + Portions created by the Initial Developer are Copyright (C) 2008-2013 the Initial Developer. All Rights Reserved. Contributor(s): @@ -29,6 +29,7 @@ require_once "resources/check_auth.php"; if (permission_exists('dialplan_delete') || permission_exists('inbound_route_delete') || permission_exists('outbound_route_delete') + || permission_exists('fifo_delete') || permission_exists('time_conditions_delete')) { //access granted } @@ -51,8 +52,7 @@ if (count($_GET)>0) { if (strlen($id)>0) { //delete child data - $sql = ""; - $sql .= "delete from v_dialplan_details "; + $sql = "delete from v_dialplan_details "; $sql .= "where domain_uuid = '$domain_uuid' "; $sql .= "and dialplan_detail_uuid = '$id' "; $sql .= "and dialplan_uuid = '$dialplan_uuid' "; diff --git a/app/dialplan/dialplan_details_edit.php b/app/dialplan/dialplan_details_edit.php index a27573cdfc..53c4053202 100644 --- a/app/dialplan/dialplan_details_edit.php +++ b/app/dialplan/dialplan_details_edit.php @@ -17,7 +17,7 @@ The Initial Developer of the Original Code is Mark J Crane - Portions created by the Initial Developer are Copyright (C) 2008-2012 + Portions created by the Initial Developer are Copyright (C) 2008-2013 the Initial Developer. All Rights Reserved. Contributor(s): @@ -32,6 +32,8 @@ if (permission_exists('dialplan_add') || permission_exists('inbound_route_edit') || permission_exists('outbound_route_add') || permission_exists('outbound_route_edit') + || permission_exists('fifo_edit') + || permission_exists('fifo_add') || permission_exists('time_conditions_add') || permission_exists('time_conditions_edit')) { //access granted diff --git a/app/dialplan/dialplan_edit.php b/app/dialplan/dialplan_edit.php index 6066790bd1..8a1a0236aa 100644 --- a/app/dialplan/dialplan_edit.php +++ b/app/dialplan/dialplan_edit.php @@ -33,6 +33,8 @@ if (permission_exists('dialplan_add') || permission_exists('inbound_route_edit') || permission_exists('outbound_route_add') || permission_exists('outbound_route_edit') + || permission_exists('fifo_edit') + || permission_exists('fifo_add') || permission_exists('time_conditions_add') || permission_exists('time_conditions_edit')) { //access granted diff --git a/app/dialplan/dialplans.php b/app/dialplan/dialplans.php index 16206e4f34..eb48c01976 100644 --- a/app/dialplan/dialplans.php +++ b/app/dialplan/dialplans.php @@ -200,6 +200,11 @@ else { echo " $v_link_label_add\n"; } } + elseif ($app_uuid == "16589224-c876-aeb3-f59f-523a1c0801f7") { + if (permission_exists('fifo_add')) { + 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"; @@ -264,6 +269,14 @@ else { echo " $v_link_label_delete\n"; } } + elseif ($app_uuid == "16589224-c876-aeb3-f59f-523a1c0801f7") { + if (permission_exists('fifo_edit')) { + echo " $v_link_label_edit\n"; + } + if (permission_exists('fifo_delete')) { + 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"; @@ -305,6 +318,11 @@ else { echo " $v_link_label_add\n"; } } + elseif ($app_uuid == "16589224-c876-aeb3-f59f-523a1c0801f7") { + if (permission_exists('fifo_add')) { + 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";