• Suporte
  • configurar triagem com 2 letras

Preciso colocar a triagem com 2 letras pois onde trabalho vários setores tem as mesmas iniciais.
fiz as seguintes alterações:

  • Modifiquei o script: /var/www/html/novosga/src/Novosga/Install/sql/create/pgsql.sql e nas tabelas que eu encontrei o campo sigla_senha eu modifiquei de varchar(1) para varchar(2).

  • Modifiquei o arquivo: /var/www/html/novosga/modules/sga/unidade/views/index.html.twig com as seguintes informações:

    • size="2"
    • maxlength="2"
  • Modifiquei o arquivo /var/www/html/novosga/src/Novosga/Model/Util/Senha.php e onde tem:

public function setSigla($sigla)
{
if (is_string($sigla) && strlen($sigla) == 1 <- (aqui você substitui o "1" pela quantidade de caracteres que você definiu no pgsql.sql, no meu caso foi 2.)
  • Por ultimo Limpei todos os caches em com o comando /var/www/html/novosga/var/cache, entrei nesse diretorio e executei o comando rm -r *

O problema é : eu consigo inserir as duas letras porem ele n salva .

@fielcomunista pode me ajudar ?

3 meses depois

Eu alterei os seguintes arquivos (Necessitava de 3 letras na senha):

src/Novosga/Model/ServicoUnidade.php
[ALTERAR] @Column(type="string", name="sigla", length=1, nullable=false) [PARA length=3]"

src/Novosga/Model/Util/Senha.php
[ALTERAR] if (is_string($sigla) && strlen($sigla) == 1)[PARA ($sigla) == 3]"

modules/sga/unidade/views/index.html.twig
[ALTERAR] size=1 e maxlength=1 [PARA size=3 e maxlength=3]"

ALTERAÇÕES NAS TABELAS

ALTER TABLE atendimentos ALTER COLUMN sigla_senha TYPE varchar(3);
ALTER TABLE painel_senha ALTER COLUMN sig_senha TYPE varchar(3);
ALTER TABLE uni_serv ALTER COLUMN sigla TYPE character varying(3);

DROP TABLE historico_atendimentos CASCADE;

CREATE TABLE public.historico_atendimentos
(
  id bigint NOT NULL,
  unidade_id integer,
  usuario_id integer,
  usuario_tri_id integer NOT NULL,
  servico_id integer NOT NULL,
  prioridade_id integer NOT NULL,
  atendimento_id bigint,
  status integer NOT NULL,
  sigla_senha character varying(3) NOT NULL,
  num_senha integer NOT NULL,
  num_senha_serv integer NOT NULL,
  nm_cli character varying(100) DEFAULT NULL::character varying,
  num_local smallint NOT NULL,
  dt_cheg timestamp(0) without time zone NOT NULL,
  dt_cha timestamp(0) without time zone,
  dt_ini timestamp(0) without time zone,
  dt_fim timestamp(0) without time zone,
  ident_cli character varying(11) DEFAULT NULL::character varying,
  CONSTRAINT historico_atendimentos_pkey PRIMARY KEY (id),
  CONSTRAINT historico_atendimentos_ibfk_1 FOREIGN KEY (prioridade_id)
      REFERENCES public.prioridades (id) MATCH SIMPLE
      ON UPDATE RESTRICT ON DELETE RESTRICT,
  CONSTRAINT historico_atendimentos_ibfk_2 FOREIGN KEY (unidade_id, servico_id)
      REFERENCES public.uni_serv (unidade_id, servico_id) MATCH SIMPLE
      ON UPDATE RESTRICT ON DELETE RESTRICT,
  CONSTRAINT historico_atendimentos_ibfk_4 FOREIGN KEY (usuario_id)
      REFERENCES public.usuarios (id) MATCH SIMPLE
      ON UPDATE RESTRICT ON DELETE RESTRICT,
  CONSTRAINT historico_atendimentos_ibfk_5 FOREIGN KEY (usuario_tri_id)
      REFERENCES public.usuarios (id) MATCH SIMPLE
      ON UPDATE RESTRICT ON DELETE RESTRICT,
  CONSTRAINT historico_atendimentos_ibfk_6 FOREIGN KEY (atendimento_id)
      REFERENCES public.historico_atendimentos (id) MATCH SIMPLE
      ON UPDATE RESTRICT ON DELETE RESTRICT
)
WITH (
  OIDS=FALSE
);
ALTER TABLE public.historico_atendimentos
  OWNER TO novosga;

Acho que era isso!

    3 meses depois

    @fielcomunista essa parte de "alterações nas tabelas" é inserida dentro do caminho /var/www/html/novosga/src/Novosga/Install/sql/create/pgsql.sql?

    fiz os procedimentos do @geanbessa , consigo até colocar mais letras nas siglas, porém quando vou na triagem continua com 1 char...

    estou usando a versão 1.5 no debian 8.9

      um mês depois
      6 meses depois

      Eu fiz alteração no código do Senha.php para poder usar com 1 ou 3 letras, essa era um necessidade minha mas caso mais alguém precise esta ai a dica.

      src/Novosga/Model/Util/Senha.php

       public function setSigla($sigla)
          {
              if (is_string($sigla) && (strlen($sigla) == 1 || strlen($sigla) == 3)) {
                  $this->sigla = $sigla;
              } else {
                  throw new \Exception(_('A sigla da senha deve ser um char'));

      O restante das alterações no Banco de dados e igual.

      3 meses depois