From 21e45027bac46b2a06ecb141a8a45e8d20a6fef6 Mon Sep 17 00:00:00 2001 From: Lucas D'Avila Date: Wed, 27 Feb 2013 15:56:49 -0300 Subject: [PATCH] Permitido que usuário com nível de acesso a escola e com permissão para cadastrar escola, possa editar o cadastro da sua escola. Adicionado limite tamanho maximo ao campo sigla escola. closes #7 --- ieducar/intranet/educar_escola_cad.php | 6 +++--- ieducar/intranet/educar_escola_det.php | 27 ++++++++++++++------------- 2 files changed, 17 insertions(+), 16 deletions(-) diff --git a/ieducar/intranet/educar_escola_cad.php b/ieducar/intranet/educar_escola_cad.php index 0afe4f5..134d4e6 100644 --- a/ieducar/intranet/educar_escola_cad.php +++ b/ieducar/intranet/educar_escola_cad.php @@ -118,7 +118,7 @@ class indice extends clsCadastro @session_write_close(); $obj_permissoes = new clsPermissoes(); - $obj_permissoes->permissao_cadastra( 561, $this->pessoa_logada, 3, "educar_escola_lst.php" ); + $obj_permissoes->permissao_cadastra( 561, $this->pessoa_logada, 7, "educar_escola_lst.php" ); $this->cod_escola = $_GET["cod_escola"]; @@ -617,7 +617,7 @@ class indice extends clsCadastro // text $this->campoTexto( "fantasia", "Escola", $this->fantasia, 30, 255, true ); - $this->campoTexto( "sigla", "Sigla", $this->sigla, 30, 255, true ); + $this->campoTexto( "sigla", "Sigla", $this->sigla, 30, 20, true ); // foreign keys $nivel = $obj_permissoes->nivel_acesso($this->pessoa_logada); @@ -1161,7 +1161,7 @@ if(!$this->isEnderecoExterno){ @session_write_close(); $obj_permissoes = new clsPermissoes(); - $obj_permissoes->permissao_cadastra( 561, $this->pessoa_logada, 3, "educar_escola_lst.php" ); + $obj_permissoes->permissao_cadastra( 561, $this->pessoa_logada, 7, "educar_escola_lst.php" ); $this->bloquear_lancamento_diario_anos_letivos_encerrados = is_null($this->bloquear_lancamento_diario_anos_letivos_encerrados) ? 0 : 1; diff --git a/ieducar/intranet/educar_escola_det.php b/ieducar/intranet/educar_escola_det.php index 705a173..3db5cc6 100644 --- a/ieducar/intranet/educar_escola_det.php +++ b/ieducar/intranet/educar_escola_det.php @@ -107,7 +107,7 @@ class indice extends clsDetalhe $tipo = 1; $endereco_lst = $obj_endereco->lista($registro["ref_idpes"]); if ( $endereco_lst ) - { + { foreach ($endereco_lst as $endereco) { $cep = $endereco["cep"]->cep; @@ -392,7 +392,7 @@ class indice extends clsDetalhe { $this->addDetalhe( array( "Fax", "{$telefone_fax}") ); } - + } else if ($tipo == 3) { @@ -477,25 +477,26 @@ class indice extends clsDetalhe $this->addDetalhe( array( "Curso", "{$tabela}") ); } - if( $tabela = $this->listaAnos() ) - { + if( $tabela = $this->listaAnos() ) { $this->addDetalhe( array( "-", "{$tabela}") ); } + $obj_permissoes = new clsPermissoes(); - if( $obj_permissoes->permissao_cadastra( 561, $this->pessoa_logada, 3 ) ) - { + + $canCreate = $obj_permissoes->permissao_cadastra( 561, $this->pessoa_logada, 3 ); + $canEdit = $obj_permissoes->permissao_cadastra( 561, $this->pessoa_logada, 7 ); + + if($canCreate) $this->url_novo = "educar_escola_cad.php"; - $this->url_editar = "educar_escola_cad.php?cod_escola={$registro["cod_escola"]}"; - } - if( $obj_permissoes->permissao_cadastra( 561, $this->pessoa_logada, 7 ) ) - { - $this->array_botao = array ("Definir Ano Letivo"); + if($canEdit) { + $this->url_editar = "educar_escola_cad.php?cod_escola={$registro["cod_escola"]}"; + $this->array_botao = array ("Definir Ano Letivo"); $this->array_botao_url = array ("educar_escola_ano_letivo_cad.php?cod_escola={$registro["cod_escola"]}"); } - $this->url_cancelar = "educar_escola_lst.php"; - $this->largura = "100%"; + $this->url_cancelar = "educar_escola_lst.php"; + $this->largura = "100%"; } //*** -- libgit2 0.21.2