Commit 20d0edc0797ce9f525dae02cbb199af3a96844bd

Authored by Caroline Salib
1 parent 57d9c92c
Exists in master

Ajustado coluna lateral e conexão com banco;

portabilis/ieducar#167
docker-compose.yml
@@ -7,14 +7,14 @@ ieducar_1204: @@ -7,14 +7,14 @@ ieducar_1204:
7 volumes: 7 volumes:
8 - .:/home/ieducar/ieducar 8 - .:/home/ieducar/ieducar
9 links: 9 links:
10 - - postgres 10 + - postgres95
11 container_name: ieducar_1204 11 container_name: ieducar_1204
12 12
13 -postgres: 13 +postgres95:
14 volumes: 14 volumes:
15 - /var/lib/postgresql/data 15 - /var/lib/postgresql/data
16 image: postgres:9.5 16 image: postgres:9.5
17 environment: 17 environment:
18 - POSTGRES_PASSWORD=postgres 18 - POSTGRES_PASSWORD=postgres
19 ports: 19 ports:
20 - - "5433:5432" 20 + - "5430:5432"
ieducar/configuration/ieducar.ini
@@ -54,7 +54,7 @@ @@ -54,7 +54,7 @@
54 ; Configurações de banco de dados 54 ; Configurações de banco de dados
55 app.database.dbname = ieducar 55 app.database.dbname = ieducar
56 app.database.username = ieducar 56 app.database.username = ieducar
57 -app.database.hostname = postgres_95 57 +app.database.hostname = postgres95
58 app.database.password = ieducar 58 app.database.password = ieducar
59 app.database.port = 5433 59 app.database.port = 5433
60 60
ieducar/intranet/banner_lst.php
@@ -51,10 +51,10 @@ class indice extends clsListagem @@ -51,10 +51,10 @@ class indice extends clsListagem
51 51
52 $db = new clsBanco(); 52 $db = new clsBanco();
53 53
54 - $soma_lateral = $db->UnicoCampo( "SELECT SUM(prioridade) FROM portal_banner WHERE lateral=1" );  
55 - $soma_centro = $db->UnicoCampo( "SELECT SUM(prioridade) FROM portal_banner WHERE lateral=0" ); 54 + $soma_lateral = $db->UnicoCampo( "SELECT SUM(prioridade) FROM portal_banner WHERE lateral_=1" );
  55 + $soma_centro = $db->UnicoCampo( "SELECT SUM(prioridade) FROM portal_banner WHERE lateral_=0" );
56 56
57 - $db->Consulta( "SELECT cod_portal_banner, caminho, title, prioridade, link, lateral FROM portal_banner ORDER BY prioridade, title" ); 57 + $db->Consulta( "SELECT cod_portal_banner, caminho, title, prioridade, link, lateral_ FROM portal_banner ORDER BY prioridade, title" );
58 while ($db->ProximoRegistro()) 58 while ($db->ProximoRegistro())
59 { 59 {
60 list ($cod_portal_banner, $caminho, $title, $prioridade, $link, $lateral) = $db->Tupla(); 60 list ($cod_portal_banner, $caminho, $title, $prioridade, $link, $lateral) = $db->Tupla();
ieducar/intranet/include/clsBase.inc.php
@@ -624,7 +624,7 @@ class clsBase extends clsConfig @@ -624,7 +624,7 @@ class clsBase extends clsConfig
624 { 624 {
625 $retorno = ''; 625 $retorno = '';
626 $listaBanners = array(); 626 $listaBanners = array();
627 - $this->db()->Consulta("SELECT caminho, title, prioridade, link FROM portal_banner WHERE lateral=1 ORDER BY prioridade, title"); 627 + $this->db()->Consulta("SELECT caminho, title, prioridade, link FROM portal_banner WHERE lateral_=1 ORDER BY prioridade, title");
628 628
629 while ($this->db()->ProximoRegistro()) { 629 while ($this->db()->ProximoRegistro()) {
630 list($caminho, $title, $prioridade, $link) = $this->db()->Tupla(); 630 list($caminho, $title, $prioridade, $link) = $this->db()->Tupla();
ieducar/misc/database/migrations/20170312151236_atualiza_portal_banner_para_nova_versao_banco.php 0 → 100644
@@ -0,0 +1,24 @@ @@ -0,0 +1,24 @@
  1 +<?php
  2 +
  3 +use Phinx\Migration\AbstractMigration;
  4 +
  5 +class AtualizaPortalBannerParaNovaVersaoBanco extends AbstractMigration
  6 +{
  7 + public function change()
  8 + {
  9 + $this->execute("CREATE SEQUENCE portal_banner_cod_portal_banner_seq
  10 + START WITH 1
  11 + INCREMENT BY 1
  12 + NO MAXVALUE
  13 + MINVALUE 0
  14 + CACHE 1;
  15 + CREATE TABLE portal_banner (
  16 + cod_portal_banner integer DEFAULT nextval('portal_banner_cod_portal_banner_seq'::regclass) NOT NULL,
  17 + ref_ref_cod_pessoa_fj integer DEFAULT 0 NOT NULL,
  18 + caminho character varying(255) DEFAULT ''::character varying NOT NULL,
  19 + title character varying(255),
  20 + prioridade integer DEFAULT 0 NOT NULL,
  21 + link character varying(255) DEFAULT ''::character varying NOT NULL,
  22 + lateral_ smallint DEFAULT (1)::smallint NOT NULL);");
  23 + }
  24 +}
@@ -10,6 +10,5 @@ environments: @@ -10,6 +10,5 @@ environments:
10 name: ieducar 10 name: ieducar
11 user: ieducar 11 user: ieducar
12 pass: 'ieducar' 12 pass: 'ieducar'
13 - port: 5433  
14 - charset: latin1  
15 - 13 + port: 5430
  14 + charset: utf8