Commit 70dd6f626591a6c0a64c750da562d854fe067268

Authored by Fabiana Ofugi
2 parents 2f28baa3 c92f6c78
Exists in master

Merge branch 'devel-unb' of https://github.com/i-educar-unb/ieducar into devel-unb

ieducar/intranet/educar_acervo_assunto_det.php
@@ -70,12 +70,75 @@ class indice extends clsDetalhe @@ -70,12 +70,75 @@ class indice extends clsDetalhe
70 70
71 $tmp_obj = new clsPmieducarAcervoAssunto( $this->cod_acervo_assunto ); 71 $tmp_obj = new clsPmieducarAcervoAssunto( $this->cod_acervo_assunto );
72 $registro = $tmp_obj->detalhe(); 72 $registro = $tmp_obj->detalhe();
  73 +
  74 + if( class_exists( "clsPmieducarBiblioteca" ) )
  75 + {
  76 + $obj_ref_cod_biblioteca = new clsPmieducarBiblioteca( $registro["ref_cod_biblioteca"] );
  77 + $det_ref_cod_biblioteca = $obj_ref_cod_biblioteca->detalhe();
  78 + $registro["ref_cod_biblioteca"] = $det_ref_cod_biblioteca["nm_biblioteca"];
  79 + if( class_exists( "clsPmieducarInstituicao" ) )
  80 + {
  81 + $registro["ref_cod_instituicao"] = $det_ref_cod_biblioteca["ref_cod_instituicao"];
  82 + $obj_ref_cod_instituicao = new clsPmieducarInstituicao( $registro["ref_cod_instituicao"] );
  83 + $det_ref_cod_instituicao = $obj_ref_cod_instituicao->detalhe();
  84 + $registro["ref_cod_instituicao"] = $det_ref_cod_instituicao["nm_instituicao"];
  85 + }
  86 + else
  87 + {
  88 + $registro["ref_cod_instituicao"] = "Erro na geracao";
  89 + echo "<!--\nErro\nClasse nao existente: clsPmieducarInstituicao\n-->";
  90 + }
  91 + }
  92 +
  93 + if( class_exists( "clsPmieducarEscola" ) )
  94 + {
  95 + $registro["ref_cod_escola"] = $det_ref_cod_biblioteca["ref_cod_escola"];
  96 + $obj_ref_cod_escola = new clsPmieducarEscola( $registro["ref_cod_escola"] );
  97 + $det_ref_cod_escola = $obj_ref_cod_escola->detalhe();
  98 + $idpes = $det_ref_cod_escola["ref_idpes"];
  99 + if ($idpes)
  100 + {
  101 + $obj_escola = new clsPessoaJuridica( $idpes );
  102 + $obj_escola_det = $obj_escola->detalhe();
  103 + $registro["ref_cod_escola"] = $obj_escola_det["fantasia"];
  104 + }
  105 + else
  106 + {
  107 + $obj_escola = new clsPmieducarEscolaComplemento( $registro["ref_cod_escola"] );
  108 + $obj_escola_det = $obj_escola->detalhe();
  109 + $registro["ref_cod_escola"] = $obj_escola_det["nm_escola"];
  110 + }
  111 + }
73 112
  113 + $obj_permissoes = new clsPermissoes();
  114 + $nivel_usuario = $obj_permissoes->nivel_acesso($this->pessoa_logada);
  115 +
74 if( ! $registro ) 116 if( ! $registro )
75 { 117 {
76 header( "location: educar_acervo_assunto_lst.php" ); 118 header( "location: educar_acervo_assunto_lst.php" );
77 die(); 119 die();
78 } 120 }
  121 +
  122 + if ($nivel_usuario == 1)
  123 + {
  124 + if( $registro["ref_cod_instituicao"] )
  125 + {
  126 + $this->addDetalhe( array( "Institui&ccedil;&atilde;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 + }
  137 +
  138 + if( $registro["ref_cod_biblioteca"] )
  139 + {
  140 + $this->addDetalhe( array( "Biblioteca", "{$registro["ref_cod_biblioteca"]}") );
  141 + }
79 142
80 if( $registro["nm_assunto"] ) 143 if( $registro["nm_assunto"] )
81 { 144 {
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&ccedil;&atilde;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&oacute;digo Cole&ccedil;&atilde;o", "{$registro["cod_acervo_colecao"]}") ); 145 $this->addDetalhe( array( "C&oacute;digo Cole&ccedil;&atilde;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&ccedil;&atilde;o", "{$registro["nm_colecao"]}") ); 150 $this->addDetalhe( array( "Cole&ccedil;&atilde;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&ccedil;&atilde;o", "{$registro["descricao"]}") ); 154 $this->addDetalhe( array( "Descri&ccedil;&atilde;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 ) )
ieducar/intranet/educar_acervo_editora_det.php
@@ -77,6 +77,49 @@ class indice extends clsDetalhe @@ -77,6 +77,49 @@ class indice extends clsDetalhe
77 77
78 $tmp_obj = new clsPmieducarAcervoEditora( $this->cod_acervo_editora ); 78 $tmp_obj = new clsPmieducarAcervoEditora( $this->cod_acervo_editora );
79 $registro = $tmp_obj->detalhe(); 79 $registro = $tmp_obj->detalhe();
  80 +
  81 + if( class_exists( "clsPmieducarBiblioteca" ) )
  82 + {
  83 + $obj_ref_cod_biblioteca = new clsPmieducarBiblioteca( $registro["ref_cod_biblioteca"] );
  84 + $det_ref_cod_biblioteca = $obj_ref_cod_biblioteca->detalhe();
  85 + $registro["ref_cod_biblioteca"] = $det_ref_cod_biblioteca["nm_biblioteca"];
  86 + if( class_exists( "clsPmieducarInstituicao" ) )
  87 + {
  88 + $registro["ref_cod_instituicao"] = $det_ref_cod_biblioteca["ref_cod_instituicao"];
  89 + $obj_ref_cod_instituicao = new clsPmieducarInstituicao( $registro["ref_cod_instituicao"] );
  90 + $det_ref_cod_instituicao = $obj_ref_cod_instituicao->detalhe();
  91 + $registro["ref_cod_instituicao"] = $det_ref_cod_instituicao["nm_instituicao"];
  92 + }
  93 + else
  94 + {
  95 + $registro["ref_cod_instituicao"] = "Erro na geracao";
  96 + echo "<!--\nErro\nClasse nao existente: clsPmieducarInstituicao\n-->";
  97 + }
  98 + }
  99 +
  100 + if( class_exists( "clsPmieducarEscola" ) )
  101 + {
  102 + $registro["ref_cod_escola"] = $det_ref_cod_biblioteca["ref_cod_escola"];
  103 + $obj_ref_cod_escola = new clsPmieducarEscola( $registro["ref_cod_escola"] );
  104 + $det_ref_cod_escola = $obj_ref_cod_escola->detalhe();
  105 + $idpes = $det_ref_cod_escola["ref_idpes"];
  106 + if ($idpes)
  107 + {
  108 + $obj_escola = new clsPessoaJuridica( $idpes );
  109 + $obj_escola_det = $obj_escola->detalhe();
  110 + $registro["ref_cod_escola"] = $obj_escola_det["fantasia"];
  111 + }
  112 + else
  113 + {
  114 + $obj_escola = new clsPmieducarEscolaComplemento( $registro["ref_cod_escola"] );
  115 + $obj_escola_det = $obj_escola->detalhe();
  116 + $registro["ref_cod_escola"] = $obj_escola_det["nm_escola"];
  117 + }
  118 + }
  119 +
  120 + $obj_permissoes = new clsPermissoes();
  121 + $nivel_usuario = $obj_permissoes->nivel_acesso($this->pessoa_logada);
  122 +
80 123
81 if( ! $registro ) 124 if( ! $registro )
82 { 125 {
@@ -112,6 +155,28 @@ class indice extends clsDetalhe @@ -112,6 +155,28 @@ class indice extends clsDetalhe
112 { 155 {
113 $this->addDetalhe( array( "Editora", "{$registro["nm_editora"]}") ); 156 $this->addDetalhe( array( "Editora", "{$registro["nm_editora"]}") );
114 } 157 }
  158 +
  159 + if ($nivel_usuario == 1)
  160 + {
  161 + if( $registro["ref_cod_instituicao"] )
  162 + {
  163 + $this->addDetalhe( array( "Institui&ccedil;&atilde;o", "{$registro["ref_cod_instituicao"]}") );
  164 + }
  165 + }
  166 +
  167 + if ($nivel_usuario == 1 || $nivel_usuario == 2)
  168 + {
  169 + if( $registro["ref_cod_escola"] )
  170 + {
  171 + $this->addDetalhe( array( "Escola", "{$registro["ref_cod_escola"]}") );
  172 + }
  173 + }
  174 +
  175 + if( $registro["ref_cod_biblioteca"] )
  176 + {
  177 + $this->addDetalhe( array( "Biblioteca", "{$registro["ref_cod_biblioteca"]}") );
  178 + }
  179 +
115 if( $registro["cep"] ) 180 if( $registro["cep"] )
116 { 181 {
117 $registro["cep"] = int2CEP($registro["cep"]); 182 $registro["cep"] = int2CEP($registro["cep"]);
ieducar/intranet/educar_biblioteca_dados_det.php
@@ -75,10 +75,49 @@ class indice extends clsDetalhe @@ -75,10 +75,49 @@ class indice extends clsDetalhe
75 75
76 $tmp_obj = new clsPmieducarBiblioteca( $this->cod_biblioteca ); 76 $tmp_obj = new clsPmieducarBiblioteca( $this->cod_biblioteca );
77 $registro = $tmp_obj->detalhe(); 77 $registro = $tmp_obj->detalhe();
  78 +
  79 + if( class_exists( "clsPmieducarInstituicao" ) )
  80 + {
  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 + }
78 90
  91 + if( class_exists( "clsPmieducarEscola" ) )
  92 + {
  93 + $obj_ref_cod_escola = new clsPmieducarEscola( $registro["ref_cod_escola"] );
  94 + $det_ref_cod_escola = $obj_ref_cod_escola->detalhe();
  95 + $idpes = $det_ref_cod_escola["ref_idpes"];
  96 + if ($idpes)
  97 + {
  98 + $obj_escola = new clsPessoaJuridica( $idpes );
  99 + $obj_escola_det = $obj_escola->detalhe();
  100 + $registro["ref_cod_escola"] = $obj_escola_det["fantasia"];
  101 + }
  102 + else
  103 + {
  104 + $obj_escola = new clsPmieducarEscolaComplemento( $registro["ref_cod_escola"] );
  105 + $obj_escola_det = $obj_escola->detalhe();
  106 + $registro["ref_cod_escola"] = $obj_escola_det["nm_escola"];
  107 + }
  108 + }
  109 + else
  110 + {
  111 + $registro["ref_cod_escola"] = "Erro na geracao";
  112 + echo "<!--\nErro\nClasse nao existente: clsPmieducarEscola\n-->";
  113 + }
  114 +
79 $obj_permissoes = new clsPermissoes(); 115 $obj_permissoes = new clsPermissoes();
80 $nivel_usuario = $obj_permissoes->nivel_acesso($this->pessoa_logada); 116 $nivel_usuario = $obj_permissoes->nivel_acesso($this->pessoa_logada);
81 - if($nivel_usuario <= 3) 117 +
  118 +
  119 +
  120 + if($nivel_usuario <= 3)
82 $permitido = true; 121 $permitido = true;
83 else{ 122 else{
84 $obj_usuario_bib = new clsPmieducarBibliotecaUsuario(); 123 $obj_usuario_bib = new clsPmieducarBibliotecaUsuario();
@@ -100,6 +139,22 @@ class indice extends clsDetalhe @@ -100,6 +139,22 @@ class indice extends clsDetalhe
100 header( "location: educar_biblioteca_dados_lst.php" ); 139 header( "location: educar_biblioteca_dados_lst.php" );
101 die(); 140 die();
102 } 141 }
  142 +
  143 + if ($nivel_usuario == 1)
  144 + {
  145 + if( $registro["ref_cod_instituicao"] )
  146 + {
  147 + $this->addDetalhe( array( "Institui&ccedil;&atilde;o", "{$registro["ref_cod_instituicao"]}") );
  148 + }
  149 + }
  150 +
  151 + if ($nivel_usuario == 1 || $nivel_usuario == 2)
  152 + {
  153 + if( $registro["ref_cod_escola"] )
  154 + {
  155 + $this->addDetalhe( array( "Escola", "{$registro["ref_cod_escola"]}") );
  156 + }
  157 + }
103 158
104 if( $registro["nm_biblioteca"] ) 159 if( $registro["nm_biblioteca"] )
105 { 160 {
ieducar/intranet/educar_fonte_det.php
@@ -70,17 +70,83 @@ class indice extends clsDetalhe @@ -70,17 +70,83 @@ class indice extends clsDetalhe
70 $tmp_obj = new clsPmieducarFonte( $this->cod_fonte ); 70 $tmp_obj = new clsPmieducarFonte( $this->cod_fonte );
71 $registro = $tmp_obj->detalhe(); 71 $registro = $tmp_obj->detalhe();
72 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 +
  115 +
  116 + if ($nivel_usuario == 1)
  117 + {
  118 + if( $registro["ref_cod_instituicao"] )
  119 + {
  120 + $this->addDetalhe( array( "Institui&ccedil;&atilde;o", "{$registro["ref_cod_instituicao"]}") );
  121 + }
  122 + }
  123 +
  124 + if ($nivel_usuario == 1 || $nivel_usuario == 2)
  125 + {
  126 + if( $registro["ref_cod_escola"] )
  127 + {
  128 + $this->addDetalhe( array( "Escola", "{$registro["ref_cod_escola"]}") );
  129 + }
  130 + }
  131 +
  132 + if( $registro["ref_cod_biblioteca"] )
  133 + {
  134 + $this->addDetalhe( array( "Biblioteca", "{$registro["ref_cod_biblioteca"]}") );
  135 + }
  136 +
73 if( ! $registro ) 137 if( ! $registro )
74 { 138 {
75 header( "location: educar_fonte_lst.php" ); 139 header( "location: educar_fonte_lst.php" );
76 die(); 140 die();
77 } 141 }
78 142
79 - 143 + /*
80 if( $registro["cod_fonte"] ) 144 if( $registro["cod_fonte"] )
81 { 145 {
82 $this->addDetalhe( array( "Código Fonte", "{$registro["cod_fonte"]}") ); 146 $this->addDetalhe( array( "Código Fonte", "{$registro["cod_fonte"]}") );
83 } 147 }
  148 + */
  149 +
84 if( $registro["nm_fonte"] ) 150 if( $registro["nm_fonte"] )
85 { 151 {
86 $this->addDetalhe( array( "Fonte", "{$registro["nm_fonte"]}") ); 152 $this->addDetalhe( array( "Fonte", "{$registro["nm_fonte"]}") );
ieducar/intranet/educar_motivo_baixa_det.php
@@ -70,11 +70,75 @@ class indice extends clsDetalhe @@ -70,11 +70,75 @@ class indice extends clsDetalhe
70 $tmp_obj = new clsPmieducarMotivoBaixa( $this->cod_motivo_baixa ); 70 $tmp_obj = new clsPmieducarMotivoBaixa( $this->cod_motivo_baixa );
71 $registro = $tmp_obj->detalhe(); 71 $registro = $tmp_obj->detalhe();
72 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 +
  115 +
73 if( ! $registro ) 116 if( ! $registro )
74 { 117 {
75 header( "location: educar_motivo_baixa_lst.php" ); 118 header( "location: educar_motivo_baixa_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&ccedil;&atilde;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 + }
  137 +
  138 + if( $registro["ref_cod_biblioteca"] )
  139 + {
  140 + $this->addDetalhe( array( "Biblioteca", "{$registro["ref_cod_biblioteca"]}") );
  141 + }
78 142
79 if( $registro["nm_motivo_baixa"] ) 143 if( $registro["nm_motivo_baixa"] )
80 { 144 {
ieducar/intranet/educar_motivo_suspensao_det.php
@@ -69,6 +69,69 @@ class indice extends clsDetalhe @@ -69,6 +69,69 @@ class indice extends clsDetalhe
69 69
70 $tmp_obj = new clsPmieducarMotivoSuspensao( $this->cod_motivo_suspensao ); 70 $tmp_obj = new clsPmieducarMotivoSuspensao( $this->cod_motivo_suspensao );
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 +
  115 + if ($nivel_usuario == 1)
  116 + {
  117 + if( $registro["ref_cod_instituicao"] )
  118 + {
  119 + $this->addDetalhe( array( "Institui&ccedil;&atilde;o", "{$registro["ref_cod_instituicao"]}") );
  120 + }
  121 + }
  122 +
  123 + if ($nivel_usuario == 1 || $nivel_usuario == 2)
  124 + {
  125 + if( $registro["ref_cod_escola"] )
  126 + {
  127 + $this->addDetalhe( array( "Escola", "{$registro["ref_cod_escola"]}") );
  128 + }
  129 + }
  130 +
  131 + if( $registro["ref_cod_biblioteca"] )
  132 + {
  133 + $this->addDetalhe( array( "Biblioteca", "{$registro["ref_cod_biblioteca"]}") );
  134 + }
72 135
73 if( ! $registro ) 136 if( ! $registro )
74 { 137 {