|
|
|
|
<?php
|
|
|
|
|
|
|
|
|
|
/*
|
|
|
|
|
*
|
|
|
|
|
* ---------------------------------------
|
|
|
|
|
* | KEY | DESCRICAO |
|
|
|
|
|
* ---------------------------------------
|
|
|
|
|
* | $opcao | An<EFBFBD>ncios |
|
|
|
|
|
* | callback | CallBack |
|
|
|
|
|
* | conferencia | Confer<EFBFBD>ncias |
|
|
|
|
|
* | desligar | Desligar |
|
|
|
|
|
* | disa | Disa |
|
|
|
|
|
* | filas | Fila |
|
|
|
|
|
* | horarios | Hor<EFBFBD>rios |
|
|
|
|
|
* | integativa | Integra<EFBFBD><EFBFBD>o Ativa |
|
|
|
|
|
* | ramal | Ramal |
|
|
|
|
|
* | repetir | Repetir |
|
|
|
|
|
* | ura | URA |
|
|
|
|
|
* | voice | VoiceMail |
|
|
|
|
|
* ---------------------------------------
|
|
|
|
|
*/
|
|
|
|
|
$tpLayout = 1;
|
|
|
|
|
$nomeTpl = 'listaDependenciasOpcaoAcao.tpl';
|
|
|
|
|
$opcao = $_REQUEST['opcao'];
|
|
|
|
|
$acao = ($opcao == 'voice') ? sprintf("%s/%%", $_REQUEST['acao']) : $_REQUEST['acao'];
|
|
|
|
|
$nomeRecurso = $_REQUEST['nomeRecurso'];
|
|
|
|
|
$recursoTipo = $_REQUEST['recursoTipo'];
|
|
|
|
|
|
|
|
|
|
$query = "select 'AN<EFBFBD>NCIOS' as opcao, NOME as acao from pbx_anuncios where opcao = '$opcao' and acao like '$acao'
|
|
|
|
|
union
|
|
|
|
|
select 'CALLBACK CASO COMBINE' as opcao, DESCRICAO as acao from pbx_callback where opcao = '$opcao' and acao like '$acao'
|
|
|
|
|
union
|
|
|
|
|
select 'CALLBACK CASO N<EFBFBD>O COMBINE' as opcao, DESCRICAO as acao from pbx_callback where opcao1 = '$opcao' and acao1 = '$acao'
|
|
|
|
|
union
|
|
|
|
|
select 'CALLBACK RAMAL-SAIDA' as opcao, RAMAL_SAIDA as acao from pbx_disa where ramal_saida = '$acao'
|
|
|
|
|
union
|
|
|
|
|
select 'CONTEXTOS' as opcao, NOME as acao from pbx_contextos where opcao = '$opcao' and acao like '$acao'
|
|
|
|
|
union
|
|
|
|
|
select 'CONTEXTOS' as opcao, a.NOME as acao from pbx_contextos a, pbx_contextos_opcoes b where b.id_contexto = a.id and b.opcao = '$opcao' and b.acao like '$acao'
|
|
|
|
|
union
|
|
|
|
|
select 'DISA' as opcao, DESCRICAO as acao from pbx_disa where opcao = '$opcao' and acao like '$acao'
|
|
|
|
|
union
|
|
|
|
|
select 'DISA RAMAL-SAIDA' as opcao, RAMAL_SAIDA as acao from pbx_disa where ramal_saida = '$acao'
|
|
|
|
|
union
|
|
|
|
|
select 'GRUPOS' as opcao, DESCRICAO as acao from pbx_grupos where opcao = '$opcao' and acao like '$acao'
|
|
|
|
|
union
|
|
|
|
|
select 'HORARIOS' as opcao, NOME as acao from pbx_horarios where opcao_nao = '$opcao' and acao_nao like '$acao'
|
|
|
|
|
union
|
|
|
|
|
select 'HORARIOS' as opcao, a.nome as acao from pbx_horarios a, pbx_horarios_itens b where b.id_horario = a.id and b.opcao = '$opcao' and b.acao like '$acao'
|
|
|
|
|
union
|
|
|
|
|
select 'INTEGRA<EFBFBD><EFBFBD>O' as opcao, ITGC_NOME as acao from pbx_integracao_configuracao where opcao = '$opcao' and acao like '$acao'
|
|
|
|
|
union
|
|
|
|
|
select 'LISTA NEGRA' as opcao, NOME as acao from pbx_listanegra where opcao = '$opcao' and acao like '$acao'
|
|
|
|
|
union
|
|
|
|
|
select 'FILA' as opcao, NOME as acao from pbx_queues_grupos where opcao = '$opcao' and acao like '$acao'
|
|
|
|
|
union
|
|
|
|
|
select 'FILA MEMBRO-STATICO' as opcao, b.nome as acao from pbx_queues_membros a, pbx_dacs b, pbx_ramais c where a.id_fila = b.id and c.dispositivo = a.dispositivo and c.nome = '$acao'
|
|
|
|
|
union
|
|
|
|
|
select 'ROTA DE ENTRADA' as opcao, NOME as acao from pbx_rotas_entrada where opcao = '$opcao' and acao like '$acao'
|
|
|
|
|
union
|
|
|
|
|
select 'URA' as opcao, NOME as acao from pbx_ura where opcao = '$opcao' and acao like '$acao'
|
|
|
|
|
union
|
|
|
|
|
select 'URA' as opcao, a.NOME as acao from pbx_ura a, pbx_ura_destino b where b.id_ura = a.id and b.tipo = '$opcao' and b.comando like '$acao'
|
|
|
|
|
union
|
|
|
|
|
select 'CAMPANHA' as opcao, cmp_descricao as acao from pbx_campanha a, pbx_dacs b where a.id_dac = b.id and b.numero = '$acao' and cmp_status in (1,2)
|
|
|
|
|
union
|
|
|
|
|
select 'PESQUISA' as opcao, pp_nome as acao from pbx_pesquisa_liberacao a, pbx_pesquisa_liberacao_dacs b, pbx_dacs c, pbx_pesquisa d where a.pl_id = b.pl_id and b.id_dac = c.id and d.pp_id = a.pp_id and c.numero = '$acao'";
|
|
|
|
|
|
|
|
|
|
if($opcao == 'ramal'){
|
|
|
|
|
$query .= "union
|
|
|
|
|
select 'FACILIDADES' as opcao, 'RAMAIS SELECIONADOS' as acao from pbx_monitoramento_ramais where ramal = '$acao'
|
|
|
|
|
union
|
|
|
|
|
select 'VOICEMAIL' as opcao, NOME as acao from pbx_voicemail_usuarios where numero_ramal = '$acao'
|
|
|
|
|
union
|
|
|
|
|
select 'CENTRO DE CUSTOS' as opcao, b.cc_descricao as acao from pbx_pbx_centro_custo_ramais a, pbx_centro_custo b where b.cc_id = a.cc_id and a.ramal = '$acao'
|
|
|
|
|
union
|
|
|
|
|
select 'GRUPO DE CAPTURA' as opcao, a.nome as acao from pbx_grupos_atendimento a, pbx_grupos_atendimento_ramais b where id_grupo = a.id and b.ramal = '$acao'
|
|
|
|
|
union
|
|
|
|
|
select 'GRUPOS DIGIVOICE' as opcao, signalling as acao from pbx_digivoice_ramais_fxs a, pbx_digivoice_grupos b where b.group = a.id_grupo and ramal = '$acao' ";
|
|
|
|
|
}
|
|
|
|
|
if($opcao == 'contextos'){
|
|
|
|
|
$query .= "union
|
|
|
|
|
select 'FILA' as opcao, nome as acao from pbx_queues_grupos where context = '$acao'
|
|
|
|
|
union
|
|
|
|
|
select 'RAMAL-' || tipo_ramal as opcao, nome as acao from pbx_ramais where contexto = '$acao'
|
|
|
|
|
union
|
|
|
|
|
select 'TRONCOS-' || tipo as opcao, nome as acao from pbx_troncos where context = '$acao'";
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if($opcao == 'troncos'){
|
|
|
|
|
$query .= "union
|
|
|
|
|
select 'ROTA DE ENTRADA-TRONCOS-' || b.tipo as opcao, NOME as acao from pbx_rotas_entrada a, pbx_rotas_entrada_troncos b where b.id_rota = a.id and id_tronco = '$acao'
|
|
|
|
|
union
|
|
|
|
|
select 'ROTAS DE SAIDA-TRONCOS-' || c.tipo as opcao, a.nome as acao from pbx_rotas_saida a, pbx_rotas_saida_canais b, pbx_troncos c where b.id_rota = a.id and c.nome = b.canal and c.id = '$acao'
|
|
|
|
|
union
|
|
|
|
|
select 'CONTEXTOS-TRONCOS-' || b.tipo as opcao, b.nome as acao from pbx_contextos_canais a, pbx_troncos b, pbx_contextos c where a.canal = b.nome and a.id_contexto = c.id and b.id = '$acao' ";
|
|
|
|
|
}
|
|
|
|
|
$query .= " ORDER BY 1 ";
|
|
|
|
|
|
|
|
|
|
//echo $query; exit;
|
|
|
|
|
|
|
|
|
|
try {
|
|
|
|
|
$linhas = '';
|
|
|
|
|
$result = pg_query($query);
|
|
|
|
|
while ($dados = pg_fetch_array($result, null, PGSQL_ASSOC)) {
|
|
|
|
|
$linhas .= "<tr><td>{$dados['opcao']}</td><td>{$dados['acao']}</td></tr>\n";
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
$smarty->assign('linhas', $linhas);
|
|
|
|
|
$smarty->assign('recursoTipo', $recursoTipo);
|
|
|
|
|
$smarty->assign('nomeRecurso', $nomeRecurso);
|
|
|
|
|
$smarty->assign('opcao', ucwords($opcao));
|
|
|
|
|
GetTemplate($smarty, $nomeTpl);
|
|
|
|
|
} catch (Exception $exc) {
|
|
|
|
|
echo $exc->getMessageg();
|
|
|
|
|
}
|