Commit 21e45027bac46b2a06ecb141a8a45e8d20a6fef6

Authored by Lucas D'Avila
1 parent d8a2aa3e
Exists in master

Permitido que usuário com nível de acesso a escola e com permissão para cadastra…

…r escola, possa editar o cadastro da sua escola. Adicionado limite tamanho maximo ao campo sigla escola. closes #7
ieducar/intranet/educar_escola_cad.php
@@ -118,7 +118,7 @@ class indice extends clsCadastro @@ -118,7 +118,7 @@ class indice extends clsCadastro
118 @session_write_close(); 118 @session_write_close();
119 119
120 $obj_permissoes = new clsPermissoes(); 120 $obj_permissoes = new clsPermissoes();
121 - $obj_permissoes->permissao_cadastra( 561, $this->pessoa_logada, 3, "educar_escola_lst.php" ); 121 + $obj_permissoes->permissao_cadastra( 561, $this->pessoa_logada, 7, "educar_escola_lst.php" );
122 122
123 $this->cod_escola = $_GET["cod_escola"]; 123 $this->cod_escola = $_GET["cod_escola"];
124 124
@@ -617,7 +617,7 @@ class indice extends clsCadastro @@ -617,7 +617,7 @@ class indice extends clsCadastro
617 617
618 // text 618 // text
619 $this->campoTexto( "fantasia", "Escola", $this->fantasia, 30, 255, true ); 619 $this->campoTexto( "fantasia", "Escola", $this->fantasia, 30, 255, true );
620 - $this->campoTexto( "sigla", "Sigla", $this->sigla, 30, 255, true ); 620 + $this->campoTexto( "sigla", "Sigla", $this->sigla, 30, 20, true );
621 621
622 // foreign keys 622 // foreign keys
623 $nivel = $obj_permissoes->nivel_acesso($this->pessoa_logada); 623 $nivel = $obj_permissoes->nivel_acesso($this->pessoa_logada);
@@ -1161,7 +1161,7 @@ if(!$this->isEnderecoExterno){ @@ -1161,7 +1161,7 @@ if(!$this->isEnderecoExterno){
1161 @session_write_close(); 1161 @session_write_close();
1162 1162
1163 $obj_permissoes = new clsPermissoes(); 1163 $obj_permissoes = new clsPermissoes();
1164 - $obj_permissoes->permissao_cadastra( 561, $this->pessoa_logada, 3, "educar_escola_lst.php" ); 1164 + $obj_permissoes->permissao_cadastra( 561, $this->pessoa_logada, 7, "educar_escola_lst.php" );
1165 1165
1166 $this->bloquear_lancamento_diario_anos_letivos_encerrados = is_null($this->bloquear_lancamento_diario_anos_letivos_encerrados) ? 0 : 1; 1166 $this->bloquear_lancamento_diario_anos_letivos_encerrados = is_null($this->bloquear_lancamento_diario_anos_letivos_encerrados) ? 0 : 1;
1167 1167
ieducar/intranet/educar_escola_det.php
@@ -107,7 +107,7 @@ class indice extends clsDetalhe @@ -107,7 +107,7 @@ class indice extends clsDetalhe
107 $tipo = 1; 107 $tipo = 1;
108 $endereco_lst = $obj_endereco->lista($registro["ref_idpes"]); 108 $endereco_lst = $obj_endereco->lista($registro["ref_idpes"]);
109 if ( $endereco_lst ) 109 if ( $endereco_lst )
110 - { 110 + {
111 foreach ($endereco_lst as $endereco) 111 foreach ($endereco_lst as $endereco)
112 { 112 {
113 $cep = $endereco["cep"]->cep; 113 $cep = $endereco["cep"]->cep;
@@ -392,7 +392,7 @@ class indice extends clsDetalhe @@ -392,7 +392,7 @@ class indice extends clsDetalhe
392 { 392 {
393 $this->addDetalhe( array( "Fax", "{$telefone_fax}") ); 393 $this->addDetalhe( array( "Fax", "{$telefone_fax}") );
394 } 394 }
395 - 395 +
396 } 396 }
397 else if ($tipo == 3) 397 else if ($tipo == 3)
398 { 398 {
@@ -477,25 +477,26 @@ class indice extends clsDetalhe @@ -477,25 +477,26 @@ class indice extends clsDetalhe
477 $this->addDetalhe( array( "Curso", "{$tabela}") ); 477 $this->addDetalhe( array( "Curso", "{$tabela}") );
478 } 478 }
479 479
480 - if( $tabela = $this->listaAnos() )  
481 - { 480 + if( $tabela = $this->listaAnos() ) {
482 $this->addDetalhe( array( "-", "{$tabela}") ); 481 $this->addDetalhe( array( "-", "{$tabela}") );
483 } 482 }
  483 +
484 $obj_permissoes = new clsPermissoes(); 484 $obj_permissoes = new clsPermissoes();
485 - if( $obj_permissoes->permissao_cadastra( 561, $this->pessoa_logada, 3 ) )  
486 - { 485 +
  486 + $canCreate = $obj_permissoes->permissao_cadastra( 561, $this->pessoa_logada, 3 );
  487 + $canEdit = $obj_permissoes->permissao_cadastra( 561, $this->pessoa_logada, 7 );
  488 +
  489 + if($canCreate)
487 $this->url_novo = "educar_escola_cad.php"; 490 $this->url_novo = "educar_escola_cad.php";
488 - $this->url_editar = "educar_escola_cad.php?cod_escola={$registro["cod_escola"]}";  
489 491
490 - }  
491 - if( $obj_permissoes->permissao_cadastra( 561, $this->pessoa_logada, 7 ) )  
492 - {  
493 - $this->array_botao = array ("Definir Ano Letivo"); 492 + if($canEdit) {
  493 + $this->url_editar = "educar_escola_cad.php?cod_escola={$registro["cod_escola"]}";
  494 + $this->array_botao = array ("Definir Ano Letivo");
494 $this->array_botao_url = array ("educar_escola_ano_letivo_cad.php?cod_escola={$registro["cod_escola"]}"); 495 $this->array_botao_url = array ("educar_escola_ano_letivo_cad.php?cod_escola={$registro["cod_escola"]}");
495 } 496 }
496 - $this->url_cancelar = "educar_escola_lst.php";  
497 497
498 - $this->largura = "100%"; 498 + $this->url_cancelar = "educar_escola_lst.php";
  499 + $this->largura = "100%";
499 } 500 }
500 501
501 //*** 502 //***