diff --git a/app/extensions/app_config.php b/app/extensions/app_config.php index 2ead680b06..2067e7439b 100644 --- a/app/extensions/app_config.php +++ b/app/extensions/app_config.php @@ -56,6 +56,10 @@ $apps[$x]['permissions'][4]['name'] = 'extension_toll'; $apps[$x]['permissions'][4]['groups'][] = 'superadmin'; + $apps[$x]['permissions'][5]['name'] = 'outbound_caller_id_select'; + //$apps[$x]['permissions'][3]['groups'][] = 'admin'; + //$apps[$x]['permissions'][3]['groups'][] = 'superadmin'; + //schema details $y = 0; //table array index $z = 0; //field array index diff --git a/app/extensions/v_extensions_edit.php b/app/extensions/v_extensions_edit.php index bbc72dca16..b3a44eb730 100644 --- a/app/extensions/v_extensions_edit.php +++ b/app/extensions/v_extensions_edit.php @@ -785,9 +785,37 @@ if (count($_POST)>0 && strlen($_POST["persistformvar"]) == 0) { echo " Outbound Caller ID Name:\n"; echo "\n"; echo "\n"; - echo " \n"; - echo "
\n"; - echo "Enter the external caller id name here.\n"; + if (permission_exists('outbound_caller_id_select')) { + $sql = "select * from v_destinations "; + $sql .= "where domain_uuid = '$domain_uuid' "; + $sql .= "and destination_type = 'inbound' "; + $sql .= "order by destination_number asc "; + $prep_statement = $db->prepare(check_sql($sql)); + $prep_statement->execute(); + $result = $prep_statement->fetchAll(PDO::FETCH_ASSOC); + if (count($result) > 0) { + echo " \n"; + echo "
\n"; + echo "Select the external caller id name.\n"; + } + else { + echo " \n"; + } + unset ($prep_statement); + } + else { + echo " \n"; + } echo "\n"; echo "\n"; @@ -796,7 +824,37 @@ if (count($_POST)>0 && strlen($_POST["persistformvar"]) == 0) { echo " Outbound Caller ID Number:\n"; echo "\n"; echo "\n"; - echo " \n"; + if (permission_exists('outbound_caller_id_select')) { + $sql = "select * from v_destinations "; + $sql .= "where domain_uuid = '$domain_uuid' "; + $sql .= "and destination_type = 'inbound' "; + $sql .= "order by destination_number asc "; + $prep_statement = $db->prepare(check_sql($sql)); + $prep_statement->execute(); + $result = $prep_statement->fetchAll(PDO::FETCH_ASSOC); + if (count($result) > 0) { + echo " \n"; + echo "
\n"; + echo "Select the inbound destination number.\n"; + } + else { + echo " \n"; + } + unset ($prep_statement); + } + else { + echo " \n"; + } echo "
\n"; echo "Enter the external caller id number here.\n"; echo "\n";