From 4b68118d3e10639560c3249d73cc193bbc06a8d2 Mon Sep 17 00:00:00 2001 From: FusionPBX Date: Tue, 14 Dec 2021 16:23:47 -0700 Subject: [PATCH] Add group select --- app/destinations/destination_edit.php | 38 +++++++++++++++++++++++++++ 1 file changed, 38 insertions(+) diff --git a/app/destinations/destination_edit.php b/app/destinations/destination_edit.php index 325bd408f3..96d0b6a22b 100644 --- a/app/destinations/destination_edit.php +++ b/app/destinations/destination_edit.php @@ -102,6 +102,7 @@ $fax_uuid = $_POST["fax_uuid"]; $provider_uuid = $_POST["provider_uuid"]; $user_uuid = $_POST["user_uuid"]; + $group_uuid = $_POST["group_uuid"]; $destination_order= $_POST["destination_order"]; $destination_enabled = $_POST["destination_enabled"]; $destination_description = $_POST["destination_description"]; @@ -712,6 +713,9 @@ if (permission_exists('user_edit')) { $array['destinations'][$x]["user_uuid"] = $user_uuid; } + if (permission_exists('group_edit')) { + $array['destinations'][$x]["group_uuid"] = $group_uuid; + } $array['destinations'][$x]["destination_type"] = $destination_type; if (permission_exists('destination_condition_field')) { $array['destinations'][$x]["destination_condition_field"] = $destination_condition_field; @@ -896,6 +900,7 @@ $fax_uuid = $row["fax_uuid"]; $provider_uuid = $row["provider_uuid"]; $user_uuid = $row["user_uuid"]; + $group_uuid = $row["group_uuid"]; $currency = $row["currency"]; $destination_sell = $row["destination_sell"]; $destination_buy = $row["destination_buy"]; @@ -998,6 +1003,17 @@ unset($sql, $parameters); } +//get the groups list + if (permission_exists('group_edit')) { + $sql = "select group_uuid, domain_uuid, group_name, group_description from v_groups "; + $sql .= "where (domain_uuid is null or domain_uuid = :domain_uuid) "; + $sql .= "order by group_name asc "; + $parameters['domain_uuid'] = $domain_uuid; + $database = new database; + $groups = $database->select($sql, $parameters, 'all'); + unset($sql, $parameters); + } + //create token $object = new token; $token = $object->create($_SERVER['PHP_SELF']); @@ -1306,6 +1322,28 @@ unset($users); echo "
\n"; echo " ".$text['description-user']."\n"; + echo "\n"; + echo "\n"; + } + + if (permission_exists('group_edit')) { + echo "\n"; + echo "\n"; + echo " ".$text['label-group']."\n"; + echo "\n"; + echo "\n"; + echo " "; + unset($groups); + echo "
\n"; + echo " ".$text['description-group']."\n"; + echo "\n"; + echo "\n"; } echo "\n";