add ring groups option to call block (#6285)
* add ring groups option to call block * add ring groups option to call block * add ring groups option to call block * add ring groups option to call block * add ring groups option to call block
This commit is contained in:
@@ -283,6 +283,17 @@ if (permission_exists('call_block_all') || permission_exists('call_block_ivr'))
|
||||
$ivrs = $database->select($sql, $parameters);
|
||||
}
|
||||
|
||||
//get the ring groups
|
||||
if (permission_exists('call_block_all') || permission_exists('call_block_ivr')) {
|
||||
$sql = "select ring_group_uuid,ring_group_name, ring_group_extension, ring_group_description from v_ring_groups ";
|
||||
$sql .= "where domain_uuid = :domain_uuid ";
|
||||
// $sql .= "and ring_group_enabled = 'true' ";
|
||||
$sql .= "order by ring_group_extension asc ";
|
||||
$parameters['domain_uuid'] = $_SESSION['domain_uuid'];
|
||||
$database = new database;
|
||||
$ring_groups = $database->select($sql, $parameters);
|
||||
}
|
||||
|
||||
//get the voicemails
|
||||
$sql = "select voicemail_uuid, voicemail_id, voicemail_description ";
|
||||
$sql .= "from v_voicemails ";
|
||||
@@ -448,6 +459,16 @@ if (permission_exists('call_block_all') || permission_exists('call_block_ivr'))
|
||||
echo " </optgroup>\n";
|
||||
}
|
||||
}
|
||||
if (permission_exists('call_block_ring_groups')) {
|
||||
if (is_array($ring_groups) && sizeof($ring_groups) != 0) {
|
||||
echo " <optgroup label='".$text['label-ring_groups']."'>\n";
|
||||
foreach ($ring_groups as &$row) {
|
||||
$selected = ($call_block_app == 'ring_group' && $call_block_data == $row['ring_group_extension']) ? "selected='selected'" : null;
|
||||
echo " <option value='ring_group:".urlencode($row["ring_group_extension"])."' ".$selected.">".escape($row['ring_group_name'])." ".escape($row['ring_group_extension'])."</option>\n";
|
||||
}
|
||||
echo " </optgroup>\n";
|
||||
}
|
||||
}
|
||||
if (permission_exists('call_block_voicemail')) {
|
||||
if (is_array($voicemails) && sizeof($voicemails) != 0) {
|
||||
echo " <optgroup label='".$text['label-voicemail']."'>\n";
|
||||
|
||||
Reference in New Issue
Block a user