Browse Source

O admin global não terá dac padrão.

1.9
bruno 3 months ago
parent
commit
0b8a82670f
  1. 4
      agente/agentert.php
  2. 9
      contacteFunc.php

4
agente/agentert.php

@ -150,6 +150,9 @@ $alertaAgente = array();
$matricula = GetMatricula();
$clasAtende = '';
/*
* Definir DAC (fila)
*/
if (AgenteON()) {
$dac = $_SESSION[SS_DAC_CODIGO];
} else if (IsPostBack()) {
@ -167,6 +170,7 @@ if (!$dac) {
$_SESSION[SS_DAC_CODIGO] = $dac;
}
$ufForm = "";
/*
* Mostra erros na aplicação

9
contacteFunc.php

@ -190,11 +190,8 @@ function GetDacAgente($dbcon, $idUser, $codDac, $disableb = "", $getDac = 0)
function GetIdDacPadrao($dbcon, $idUser)
{
$isAdm = (strtolower(GetLoginFromId($dbcon, $idUser)) == 'admin') && IsAdmin();
if ($isAdm) {
$query = "select d.id, d.nome
from pbx_dacs d
where d.status = 'A' limit 1";
if (IsAdmin()) {
return ;
} else {
$query = "select dac_padrao from pbx_usuarios where id = $idUser";
}
@ -326,7 +323,7 @@ function GetDacPadraoAgente($dbcon, $getId = true)
{
$idUser = GetIdUser();
if (IsAdmin())
$query = "SELECT * FROM pbx_dacs a WHERE a.status = 'A' AND EXISTS(SELECT '' FROM pbx_fila_grupos WHERE id = a.id) ORDER BY 1 LIMIT 1";
return 0;
else
$query = "SELECT dac_padrao AS id_dac, b.nome FROM pbx_usuarios a, pbx_dacs b WHERE b.id = a.dac_padrao AND a.id = $idUser ";
//echo $query;

Loading…
Cancel
Save