Commit 701cfbd87142b804762d4635d72e147489c17768
Exists in
master
Merge branch 'devel-unb' of https://github.com/i-educar-unb/ieducar into devel-unb
Showing
2 changed files
with
76 additions
and
0 deletions
Show diff stats
ieducar/intranet/educar_acervo_colecao_cad.php
@@ -79,6 +79,16 @@ class indice extends clsCadastro | @@ -79,6 +79,16 @@ class indice extends clsCadastro | ||
79 | foreach( $registro AS $campo => $val ) // passa todos os valores obtidos no registro para atributos do objeto | 79 | foreach( $registro AS $campo => $val ) // passa todos os valores obtidos no registro para atributos do objeto |
80 | $this->$campo = $val; | 80 | $this->$campo = $val; |
81 | 81 | ||
82 | + $obj_obra = new clsPmieducarAcervoColecao($this->cod_acervo_colecao); | ||
83 | + $det_obra = $obj_obra->detalhe(); | ||
84 | + | ||
85 | + $obj_biblioteca = new clsPmieducarBiblioteca($det_obra["ref_cod_biblioteca"]); | ||
86 | + $obj_det = $obj_biblioteca->detalhe(); | ||
87 | + | ||
88 | + $this->ref_cod_instituicao = $obj_det["ref_cod_instituicao"]; | ||
89 | + $this->ref_cod_escola = $obj_det["ref_cod_escola"]; | ||
90 | + $this->ref_cod_biblioteca = $obj_det["cod_biblioteca"]; | ||
91 | + | ||
82 | $obj_permissoes = new clsPermissoes(); | 92 | $obj_permissoes = new clsPermissoes(); |
83 | if( $obj_permissoes->permissao_excluir( 593, $this->pessoa_logada, 11 ) ) | 93 | if( $obj_permissoes->permissao_excluir( 593, $this->pessoa_logada, 11 ) ) |
84 | { | 94 | { |
ieducar/intranet/educar_acervo_colecao_det.php
@@ -69,17 +69,82 @@ class indice extends clsDetalhe | @@ -69,17 +69,82 @@ class indice extends clsDetalhe | ||
69 | 69 | ||
70 | $tmp_obj = new clsPmieducarAcervoColecao( $this->cod_acervo_colecao ); | 70 | $tmp_obj = new clsPmieducarAcervoColecao( $this->cod_acervo_colecao ); |
71 | $registro = $tmp_obj->detalhe(); | 71 | $registro = $tmp_obj->detalhe(); |
72 | + | ||
73 | + if( class_exists( "clsPmieducarBiblioteca" ) ) | ||
74 | + { | ||
75 | + $obj_ref_cod_biblioteca = new clsPmieducarBiblioteca( $registro["ref_cod_biblioteca"] ); | ||
76 | + $det_ref_cod_biblioteca = $obj_ref_cod_biblioteca->detalhe(); | ||
77 | + $registro["ref_cod_biblioteca"] = $det_ref_cod_biblioteca["nm_biblioteca"]; | ||
78 | + if( class_exists( "clsPmieducarInstituicao" ) ) | ||
79 | + { | ||
80 | + $registro["ref_cod_instituicao"] = $det_ref_cod_biblioteca["ref_cod_instituicao"]; | ||
81 | + $obj_ref_cod_instituicao = new clsPmieducarInstituicao( $registro["ref_cod_instituicao"] ); | ||
82 | + $det_ref_cod_instituicao = $obj_ref_cod_instituicao->detalhe(); | ||
83 | + $registro["ref_cod_instituicao"] = $det_ref_cod_instituicao["nm_instituicao"]; | ||
84 | + } | ||
85 | + else | ||
86 | + { | ||
87 | + $registro["ref_cod_instituicao"] = "Erro na geracao"; | ||
88 | + echo "<!--\nErro\nClasse nao existente: clsPmieducarInstituicao\n-->"; | ||
89 | + } | ||
90 | + } | ||
91 | + | ||
92 | + if( class_exists( "clsPmieducarEscola" ) ) | ||
93 | + { | ||
94 | + $registro["ref_cod_escola"] = $det_ref_cod_biblioteca["ref_cod_escola"]; | ||
95 | + $obj_ref_cod_escola = new clsPmieducarEscola( $registro["ref_cod_escola"] ); | ||
96 | + $det_ref_cod_escola = $obj_ref_cod_escola->detalhe(); | ||
97 | + $idpes = $det_ref_cod_escola["ref_idpes"]; | ||
98 | + if ($idpes) | ||
99 | + { | ||
100 | + $obj_escola = new clsPessoaJuridica( $idpes ); | ||
101 | + $obj_escola_det = $obj_escola->detalhe(); | ||
102 | + $registro["ref_cod_escola"] = $obj_escola_det["fantasia"]; | ||
103 | + } | ||
104 | + else | ||
105 | + { | ||
106 | + $obj_escola = new clsPmieducarEscolaComplemento( $registro["ref_cod_escola"] ); | ||
107 | + $obj_escola_det = $obj_escola->detalhe(); | ||
108 | + $registro["ref_cod_escola"] = $obj_escola_det["nm_escola"]; | ||
109 | + } | ||
110 | + } | ||
111 | + | ||
112 | + $obj_permissoes = new clsPermissoes(); | ||
113 | + $nivel_usuario = $obj_permissoes->nivel_acesso($this->pessoa_logada); | ||
114 | + | ||
72 | 115 | ||
73 | if( ! $registro ) | 116 | if( ! $registro ) |
74 | { | 117 | { |
75 | header( "location: educar_acervo_colecao_lst.php" ); | 118 | header( "location: educar_acervo_colecao_lst.php" ); |
76 | die(); | 119 | die(); |
77 | } | 120 | } |
121 | + | ||
122 | + if ($nivel_usuario == 1) | ||
123 | + { | ||
124 | + if( $registro["ref_cod_instituicao"] ) | ||
125 | + { | ||
126 | + $this->addDetalhe( array( "Instituição", "{$registro["ref_cod_instituicao"]}") ); | ||
127 | + } | ||
128 | + } | ||
129 | + | ||
130 | + if ($nivel_usuario == 1 || $nivel_usuario == 2) | ||
131 | + { | ||
132 | + if( $registro["ref_cod_escola"] ) | ||
133 | + { | ||
134 | + $this->addDetalhe( array( "Escola", "{$registro["ref_cod_escola"]}") ); | ||
135 | + } | ||
136 | + } | ||
78 | 137 | ||
138 | + if( $registro["ref_cod_biblioteca"] ) | ||
139 | + { | ||
140 | + $this->addDetalhe( array( "Biblioteca", "{$registro["ref_cod_biblioteca"]}") ); | ||
141 | + } | ||
142 | + | ||
79 | if( $registro["cod_acervo_colecao"] ) | 143 | if( $registro["cod_acervo_colecao"] ) |
80 | { | 144 | { |
81 | $this->addDetalhe( array( "Código Coleção", "{$registro["cod_acervo_colecao"]}") ); | 145 | $this->addDetalhe( array( "Código Coleção", "{$registro["cod_acervo_colecao"]}") ); |
82 | } | 146 | } |
147 | + | ||
83 | if( $registro["nm_colecao"] ) | 148 | if( $registro["nm_colecao"] ) |
84 | { | 149 | { |
85 | $this->addDetalhe( array( "Coleção", "{$registro["nm_colecao"]}") ); | 150 | $this->addDetalhe( array( "Coleção", "{$registro["nm_colecao"]}") ); |
@@ -88,6 +153,7 @@ class indice extends clsDetalhe | @@ -88,6 +153,7 @@ class indice extends clsDetalhe | ||
88 | { | 153 | { |
89 | $this->addDetalhe( array( "Descrição", "{$registro["descricao"]}") ); | 154 | $this->addDetalhe( array( "Descrição", "{$registro["descricao"]}") ); |
90 | } | 155 | } |
156 | + | ||
91 | 157 | ||
92 | $obj_permissoes = new clsPermissoes(); | 158 | $obj_permissoes = new clsPermissoes(); |
93 | if( $obj_permissoes->permissao_cadastra( 593, $this->pessoa_logada, 11 ) ) | 159 | if( $obj_permissoes->permissao_cadastra( 593, $this->pessoa_logada, 11 ) ) |