Skip to content

Instantly share code, notes, and snippets.

@rogeriolino
rogeriolino / novosga_migrate_pgsql.sql
Last active January 2, 2016 00:49
Novo SGA: Migração de banco versão 0.7.x para 1.0.0 (Postgres)
-- drop views
DROP VIEW view_historico_atend_codif;
DROP VIEW view_historico_atendimentos;
-- atend_codif
ALTER TABLE atend_codif RENAME id_atend TO atendimento_id;
ALTER TABLE atend_codif RENAME id_serv TO servico_id;
DROP TABLE atend_status CASCADE;
@rogeriolino
rogeriolino / jquery.winscroll.js
Created January 16, 2015 16:30
jQuery window scroll helper
(function($) {
$.winscroll = function(fn, restrictions) {
restrictions = $.extend({ minY: 0, minX: 0, maxY: Infinity, maxX: Infinity }, restrictions);
$(window).on('scroll', function() {
var y = $(document).scrollTop(),
x = $(document).scrollLeft();
if (y >= restrictions.minY && y <= restrictions.maxY && x >= restrictions.minX && x <= restrictions.maxX)
@rogeriolino
rogeriolino / novosga_migrate_mssql.sql
Created January 22, 2015 10:07
Novo SGA: Migração de banco versão 0.7.x para 1.0.0 (Microsoft SQL Server)
-- procedures
DROP PROCEDURE sp_acumular_atendimentos;
DROP PROCEDURE sp_acumular_atendimentos_unidade;
-- drop views
DROP VIEW view_historico_atend_codif;
DROP VIEW view_historico_atendimentos;
-- atend_codif
@rogeriolino
rogeriolino / vetor-panel-admin-install.md
Last active August 10, 2022 13:26
Instalação Vetor Panel Admin

Vetor Panel Admin

Móulo de administração do layout Vetor Panel

Requisitos

  • Novo SGA v1.3 até v1.5 (NÃO É COMPATÍVEL COM A v2.0)
  • Permisão de escrita no diretório modules
  • Extensão php-zip instalada
  • Extensão php-xml instalada
@rogeriolino
rogeriolino / vetor-panel-theme-install.md
Last active August 10, 2022 13:26
Instalação Vetor Panel Theme

Vetor Panel Theme

Vetor Panel é um tema do Painel-Web com suporte a mídias. Para poder funcionar é necessário possuir o módulo Vetor Panel Admin instalado no Novo SGA.

Mídias suportadas

  • Imagem
  • Vídeo (mp4)
  • Youtube
@rogeriolino
rogeriolino / vetor-printer-install.md
Last active August 24, 2018 14:16
Instalação Vetor Printer

Vetor Printer

Módulo de configuração avançada da impressão de senha

Requisitos

  • Novo SGA v1.3 até v1.5 (NÃO É COMPATÍVEL COM A v2.0)
  • Permisão de escrita no diretório modules
  • Extensão php-zip instalada
  • Linux com CUPS instalado (NÃO COMPATÍVEL COM WINDOWS)
CREATE FUNCTION fixUtf8(str VARCHAR(255)) RETURNS VARCHAR(255)
RETURN CONVERT(CAST(CONVERT(str USING latin1) AS BINARY) USING utf8);
-- fixUtf8 function required https://gist.github.com/rogeriolino/22d911fbe25538838bb3
-- IMPORTANT: don't run more than 1 time!
UPDATE unidades SET nome = fixUtf8(nome);
UPDATE prioridades SET nome = fixUtf8(nome), descricao = fixUtf8(descricao);
UPDATE grupos SET nome = fixUtf8(nome), descricao = fixUtf8(descricao);
UPDATE cargos SET nome = fixUtf8(nome), descricao = fixUtf8(descricao);
UPDATE locais SET nome = fixUtf8(nome);
UPDATE atendimentos SET nm_cli = fixUtf8(nm_cli), ident_cli = fixUtf8(ident_cli);
UPDATE historico_atendimentos SET nm_cli = fixUtf8(nm_cli), ident_cli = fixUtf8(ident_cli);
@rogeriolino
rogeriolino / painelweb-temas.md
Last active April 24, 2020 11:49
Instalação de tema no Painel-Web

Instalação de tema no Painel-Web

Antes de começar é necessário que tenha o Painel-Web instalado e funcionando corretamente.

O Tema

Extrair os arquivos do tema dentro da pasta "themes" do Painel-Web. Depois abra as Configurações do Painel e no campo "Tema" preencha com o nome da pasta do tema dentro da pasta themes (a pasta que acabou de criar).

Ex:

@rogeriolino
rogeriolino / novosga.conf
Created August 24, 2016 01:25
NovoSGA Nginx
server {
listen 80;
root /var/www/novosga/;
index index.php index.html index.htm;
server_name localhost;
location / {
try_files $uri $uri/ /public/index.php?$query_string;