Browse Source

Limpar dados da tela do agente(agentert) quando muda de empresa

1.9
bruno 3 months ago
parent
commit
725b182b7a
  1. 4
      agente/agentert.php
  2. 4
      agente/funcoesAgente.php
  3. 32
      ajaxPhp.php
  4. 2
      include/util/funcoesApl.php

4
agente/agentert.php

@ -1637,14 +1637,14 @@ function DesConectaAgenteRt($db, $type = '', $org_id)
* Se o agente estiver em pausa é removido antes de deslogar. * Se o agente estiver em pausa é removido antes de deslogar.
*/ */
if ($_SESSION[SS_PAUSA_AGENTE]) { if ($_SESSION[SS_PAUSA_AGENTE]) {
@SairPausa($db, $org_id); SairPausa($db, $org_id);
} }
/* /*
* Se o tipo de atendimento for manual remove agente da fila. * Se o tipo de atendimento for manual remove agente da fila.
*/ */
if ($_SESSION[SS_MODO_ATENDIMENTO_COD] == ATENDIMENTO_MANUAL) { if ($_SESSION[SS_MODO_ATENDIMENTO_COD] == ATENDIMENTO_MANUAL) {
@GetUrl(AST_REM_FILA); GetUrl(AST_REM_FILA);
} }
/* /*

4
agente/funcoesAgente.php

@ -445,6 +445,8 @@ function GetAgenteDisponivelFila()
function DesconectarDac() function DesconectarDac()
{ {
$org_id = $_SESSION['SSEmpresaPadrao'];
/* /*
* Verifica se o usuário clicou no botao desconectar. * Verifica se o usuário clicou no botao desconectar.
*/ */
@ -455,7 +457,7 @@ function DesconectarDac()
* Retorna true se o usuário estiver conectado. * Retorna true se o usuário estiver conectado.
*/ */
$matricula = GetMatricula(); $matricula = GetMatricula();
$query = "select count(*) from pbx_supervisor_agentes where matricula = '$matricula' "; $query = "select count(*) from pbx_supervisor_agentes where matricula = '$matricula' and org_id = $org_id";
$result = pg_query($query); $result = pg_query($query);
$row = @pg_fetch_row($result); $row = @pg_fetch_row($result);
return $row[0]; return $row[0];

32
ajaxPhp.php

@ -25,11 +25,41 @@ if (isset($_GET['GetUser'])) {
if (isset($_GET['org_id'])) { if (isset($_GET['org_id'])) {
$organizacao = GetAllOrganizacao(); $organizacao = GetAllOrganizacao();
foreach ($organizacao as $v) { foreach ($organizacao as $v) {
if ($v['id'] == $_GET['org_id']) { if ($v['id'] == $_GET['org_id']) {
$_SESSION['SSEmpresaPadrao'] = $v['id']; $_SESSION['SSEmpresaPadrao'] = $v['id']; /* defini nova empresa Session da nova empresa*/
clearInfoOrganization();
GetParametros($dbcon); GetParametros($dbcon);
break; break;
} }
} }
} }
/* \brief Limpar valores $SESSION e cookie quando troca de empresa.
*
* Apenas o administrador e o Admin(simplesip) poderá trocar de empresa
*
*/
function clearInfoOrganization(){
/* informação do agente */
SetCookieApl(RAMAL_MONITOR_AUDIO, "");
SetCookieApl(CANAL_MONITOR_AUDIO, "");
SetCookieApl(RAMAL_MONITOR_SUPERVISOR, "");
SetCookieApl(CANAL_MONITOR_SUPERVISOR, "");
SetCookieApl(RAMAL_MONITOR_AGENTE, "");
SetCookieApl(CANAL_MONITOR_AGENTE, "") ;
$_SESSION[RAMAL_MONITOR_AGENTE] = "";
$_SESSION[CANAL_MONITOR_AGENTE] = "";
$_SESSION[SS_DAC_CODIGO] = 0;
$_SESSION[RAMAL_DESTINO] = 0;
$_SESSION[SS_STATUS_AGENTE] = 'OFF';
$_SESSION[SS_PAUSA_AGENTE] = 0;
$_SESSION[AGT_NUM_DISC] = "";
$_SESSION[AGT_CHANNEL_TRANSF] = NULL;
$_SESSION[SS_AGT_CHANNEL_AGENTE] = NULL;
$_SESSION[SS_PAUSA_AGENTE_MOTIVO] = NULL;
$_SESSION[AGT_CHANNEL_TRCONSULTA] = NULL;
}

2
include/util/funcoesApl.php

@ -3785,7 +3785,7 @@ function ConfigRamalMonitorar() {
* Ramal invélido retorna falso. * Ramal invélido retorna falso.
*/ */
if ($canalMonitorar === false) { if ($canalMonitorar === false) {
GeraExcept("Erro;Ramal invélido!"); GeraExcept("Erro;Ramal inválido!");
} }
if (!SetCookieApl($nomeRamalMonitorar, $ramalMonitorar)) { if (!SetCookieApl($nomeRamalMonitorar, $ramalMonitorar)) {

Loading…
Cancel
Save