From d968e73f077d25ee277b79953e507abd1d578fc2 Mon Sep 17 00:00:00 2001 From: Mark Crane Date: Wed, 6 Nov 2013 15:50:57 +0000 Subject: [PATCH] Hide destination caller_id_name and caller_id_number if outbound_caller_id_select permission is not set. --- app/destinations/destination_edit.php | 60 +++++++++++++++------------ 1 file changed, 34 insertions(+), 26 deletions(-) diff --git a/app/destinations/destination_edit.php b/app/destinations/destination_edit.php index 2ccb0c0835..e16bfd1234 100644 --- a/app/destinations/destination_edit.php +++ b/app/destinations/destination_edit.php @@ -103,8 +103,10 @@ if (count($_POST)>0 && strlen($_POST["persistformvar"]) == 0) { $sql .= "destination_uuid, "; $sql .= "destination_type, "; $sql .= "destination_number, "; - $sql .= "destination_caller_id_name, "; - $sql .= "destination_caller_id_number, "; + if (permission_exists('outbound_caller_id_select')) { + $sql .= "destination_caller_id_name, "; + $sql .= "destination_caller_id_number, "; + } $sql .= "destination_context, "; if (strlen($fax_uuid) > 0) { $sql .= "fax_uuid, "; @@ -121,8 +123,10 @@ if (count($_POST)>0 && strlen($_POST["persistformvar"]) == 0) { $sql .= "'".uuid()."', "; $sql .= "'$destination_type', "; $sql .= "'$destination_number', "; - $sql .= "'$destination_caller_id_name', "; - $sql .= "'$destination_caller_id_number', "; + if (permission_exists('outbound_caller_id_select')) { + $sql .= "'$destination_caller_id_name', "; + $sql .= "'$destination_caller_id_number', "; + } $sql .= "'$destination_context', "; if (strlen($fax_uuid) > 0) { $sql .= "'$fax_uuid', "; @@ -149,8 +153,10 @@ if (count($_POST)>0 && strlen($_POST["persistformvar"]) == 0) { } $sql .= "destination_type = '$destination_type', "; $sql .= "destination_number = '$destination_number', "; - $sql .= "destination_caller_id_name = '$destination_caller_id_name', "; - $sql .= "destination_caller_id_number = '$destination_caller_id_number', "; + if (permission_exists('outbound_caller_id_select')) { + $sql .= "destination_caller_id_name = '$destination_caller_id_name', "; + $sql .= "destination_caller_id_number = '$destination_caller_id_number', "; + } $sql .= "destination_context = '$destination_context', "; if (strlen($fax_uuid) > 0) { $sql .= "fax_uuid = '$fax_uuid', "; @@ -267,27 +273,29 @@ if (count($_POST)>0 && strlen($_POST["persistformvar"]) == 0) { echo "\n"; echo "\n"; - echo "\n"; - echo "\n"; - echo " ".$text['label-destination_caller_id_name'].":\n"; - echo "\n"; - echo "\n"; - echo " \n"; - echo "
\n"; - echo $text['description-destination_caller_id_name']."\n"; - echo "\n"; - echo "\n"; + if (permission_exists('outbound_caller_id_select')) { + echo "\n"; + echo "\n"; + echo " ".$text['label-destination_caller_id_name'].":\n"; + echo "\n"; + echo "\n"; + echo " \n"; + echo "
\n"; + echo $text['description-destination_caller_id_name']."\n"; + echo "\n"; + echo "\n"; - echo "\n"; - echo "\n"; - echo " ".$text['label-destination_caller_id_number'].":\n"; - echo "\n"; - echo "\n"; - echo " \n"; - echo "
\n"; - echo $text['description-destination_caller_id_number']."\n"; - echo "\n"; - echo "\n"; + echo "\n"; + echo "\n"; + echo " ".$text['label-destination_caller_id_number'].":\n"; + echo "\n"; + echo "\n"; + echo " \n"; + echo "
\n"; + echo $text['description-destination_caller_id_number']."\n"; + echo "\n"; + echo "\n"; + } echo "\n"; echo "\n";