diff --git a/app/calls/call_edit.php b/app/calls/call_edit.php
index 4df91412c6..211e6703b7 100644
--- a/app/calls/call_edit.php
+++ b/app/calls/call_edit.php
@@ -526,26 +526,29 @@ if (count($_POST)>0 && strlen($_POST["persistformvar"]) == 0) {
unset($on_click);
echo " ";
echo " \n";
- echo " ";
- $sql_forward = "select destination_uuid, destination_number, destination_description from v_destinations where domain_uuid = '$domain_uuid' and destination_type = 'inbound' order by destination_number asc ";
- $prep_statement_forward = $db->prepare(check_sql($sql_forward));
- $prep_statement_forward->execute();
- $result_forward = $prep_statement_forward->fetchAll(PDO::FETCH_ASSOC);
- if (count($result_forward) > 0) {
- echo " \n";
+ unset ($sql_forward, $prep_statement_forward, $result_forward, $row_forward);
}
- unset ($sql_forward, $prep_statement_forward, $result_forward, $row_forward);
echo "\n";
echo "\n";
@@ -594,26 +597,30 @@ if (count($_POST)>0 && strlen($_POST["persistformvar"]) == 0) {
echo " \n";
echo " \n";
unset($on_click);
- echo " ";
- $sql_follow_me = "select destination_uuid, destination_number, destination_description from v_destinations where domain_uuid = '$domain_uuid' and destination_type = 'inbound' order by destination_number asc ";
- $prep_statement_follow_me = $db->prepare(check_sql($sql_follow_me));
- $prep_statement_follow_me->execute();
- $result_follow_me = $prep_statement_follow_me->fetchAll(PDO::FETCH_ASSOC);
- if (count($result_follow_me) > 0) {
- echo " \n";
- echo " \n";
- foreach ($result_follow_me as &$row_follow_me) {
- $selected = $row_follow_me["destination_uuid"]==$follow_me_caller_id_uuid?"selected='selected' ":"";
- if (strlen($row_follow_me["dialplan_uuid"]) == 0) {
- echo " \n";
- }
- else {
- echo " \n";
+
+ if (permission_exists('follow_me_cid_set')) {
+ echo " ";
+ $sql_follow_me = "select destination_uuid, destination_number, destination_description from v_destinations where domain_uuid = '$domain_uuid' and destination_type = 'inbound' order by destination_number asc ";
+ $prep_statement_follow_me = $db->prepare(check_sql($sql_follow_me));
+ $prep_statement_follow_me->execute();
+ $result_follow_me = $prep_statement_follow_me->fetchAll(PDO::FETCH_ASSOC);
+ if (count($result_follow_me) > 0) {
+ echo " \n";
+ echo " \n";
+ foreach ($result_follow_me as &$row_follow_me) {
+ $selected = $row_follow_me["destination_uuid"]==$follow_me_caller_id_uuid?"selected='selected' ":"";
+ if (strlen($row_follow_me["dialplan_uuid"]) == 0) {
+ echo " \n";
+ }
+ else {
+ echo " \n";
+ }
}
+ echo " \n";
}
- echo " \n";
+ unset ($sql_follow_me, $prep_statement_follow_me, $result_follow_me, $row_follow_me);
}
- unset ($sql_follow_me, $prep_statement_follow_me, $result_follow_me, $row_follow_me);
+
echo "
\n";
echo "
\n";
echo "\n";
diff --git a/app/follow_me/app_config.php b/app/follow_me/app_config.php
index 0395365dec..d62dfffa62 100644
--- a/app/follow_me/app_config.php
+++ b/app/follow_me/app_config.php
@@ -75,6 +75,10 @@
$apps[$x]['permissions'][$y]['groups'][] = "admin";
$apps[$x]['permissions'][$y]['groups'][] = "user";
$y++;
+ $apps[$x]['permissions'][$y]['name'] = "follow_me_cid_set";
+ $apps[$x]['permissions'][$y]['groups'][] = "superadmin";
+ $apps[$x]['permissions'][$y]['groups'][] = "admin";
+ $y++;
//schema details
$y = 0; //table array index