Commit 130457ff2cf5487eb23f2ec8d010224585d82dfd
1 parent
cdf0c23a
Exists in
master
Alterado CRUDs de aluno e servidor para exibir os códigos Inep (caso estejam map…
…eados em {{{Educacenso_Model_CodigoReferencia}}})
Showing
4 changed files
with
104 additions
and
0 deletions
Show diff stats
ieducar/intranet/educar_aluno_cad.php
... | ... | @@ -35,6 +35,7 @@ require_once 'include/pmieducar/geral.inc.php'; |
35 | 35 | |
36 | 36 | require_once 'App/Model/SimNao.php'; |
37 | 37 | require_once 'App/Model/ZonaLocalizacao.php'; |
38 | +require_once 'Educacenso/Model/AlunoDataMapper.php'; | |
38 | 39 | require_once 'Transporte/Model/AlunoDataMapper.php'; |
39 | 40 | require_once 'Transporte/Model/Responsavel.php'; |
40 | 41 | |
... | ... | @@ -1235,6 +1236,30 @@ class indice extends clsCadastro |
1235 | 1236 | $this->campoTexto('secao_tit_eleitor', 'Seção', $this->secao_tit_eleitor, |
1236 | 1237 | '10', '10', FALSE); |
1237 | 1238 | |
1239 | + // Adiciona uma aba com dados do Inep/Educacenso caso aluno tenha código Inep. | |
1240 | + if (isset($this->cod_aluno)) { | |
1241 | + $alunoMapper = new Educacenso_Model_AlunoDataMapper(); | |
1242 | + | |
1243 | + $alunoInep = NULL; | |
1244 | + try { | |
1245 | + $alunoInep = $alunoMapper->find(array('aluno' => $this->cod_aluno)); | |
1246 | + } | |
1247 | + catch(Exception $e) { | |
1248 | + } | |
1249 | + | |
1250 | + if ($alunoInep) { | |
1251 | + $this->campoAdicionaTab('Educacenso/Inep', $this->tab_habilitado); | |
1252 | + | |
1253 | + $this->campoRotulo('_inep_cod_aluno', 'Código do aluno no Educacenso/Inep', | |
1254 | + $alunoInep->alunoInep); | |
1255 | + | |
1256 | + if (isset($alunoInep->nomeInep)) { | |
1257 | + $this->campoRotulo('_inep_nome_aluno', 'Nome do aluno no Educacenso/Inep', | |
1258 | + $alunoInep->nomeInep); | |
1259 | + } | |
1260 | + } | |
1261 | + } | |
1262 | + | |
1238 | 1263 | $this->campoTabFim(); |
1239 | 1264 | } |
1240 | 1265 | ... | ... |
ieducar/intranet/educar_aluno_det.php
... | ... | @@ -34,6 +34,7 @@ require_once 'include/clsBanco.inc.php'; |
34 | 34 | require_once 'include/pmieducar/geral.inc.php'; |
35 | 35 | |
36 | 36 | require_once 'App/Model/ZonaLocalizacao.php'; |
37 | +require_once 'Educacenso/Model/AlunoDataMapper.php'; | |
37 | 38 | require_once 'Transporte/Model/AlunoDataMapper.php'; |
38 | 39 | |
39 | 40 | /** |
... | ... | @@ -625,6 +626,26 @@ class indice extends clsDetalhe |
625 | 626 | $this->addDetalhe(array('Responsável transporte', $transporteAluno->responsavel)); |
626 | 627 | } |
627 | 628 | |
629 | + // Adiciona uma aba com dados do Inep/Educacenso caso aluno tenha código Inep. | |
630 | + if (isset($this->cod_aluno)) { | |
631 | + $alunoMapper = new Educacenso_Model_AlunoDataMapper(); | |
632 | + | |
633 | + $alunoInep = NULL; | |
634 | + try { | |
635 | + $alunoInep = $alunoMapper->find(array('aluno' => $this->cod_aluno)); | |
636 | + } | |
637 | + catch(Exception $e) { | |
638 | + } | |
639 | + | |
640 | + if ($alunoInep) { | |
641 | + $this->addDetalhe(array('Código do aluno no Educacenso/Inep', $alunoInep->alunoInep)); | |
642 | + | |
643 | + if (isset($alunoInep->nomeInep)) { | |
644 | + $this->addDetalhe(array('Nome do aluno no Educacenso/Inep', $alunoInep->nomeInep)); | |
645 | + } | |
646 | + } | |
647 | + } | |
648 | + | |
628 | 649 | $this->addDetalhe(array('Matrícula', $this->montaTabelaMatricula())); |
629 | 650 | |
630 | 651 | // Verificação de permissão para cadastro. | ... | ... |
ieducar/intranet/educar_servidor_cad.php
... | ... | @@ -33,6 +33,8 @@ require_once 'include/clsCadastro.inc.php'; |
33 | 33 | require_once 'include/clsBanco.inc.php'; |
34 | 34 | require_once 'include/pmieducar/geral.inc.php'; |
35 | 35 | |
36 | +require_once 'Educacenso/Model/DocenteDataMapper.php'; | |
37 | + | |
36 | 38 | /** |
37 | 39 | * clsIndexBase class. |
38 | 40 | * |
... | ... | @@ -79,6 +81,9 @@ class indice extends clsCadastro |
79 | 81 | |
80 | 82 | var $total_horas_alocadas; |
81 | 83 | |
84 | + // Determina se o servidor é um docente para buscar código Educacenso/Inep. | |
85 | + var $docente = FALSE; | |
86 | + | |
82 | 87 | function Inicializar() |
83 | 88 | { |
84 | 89 | $retorno = 'Novo'; |
... | ... | @@ -148,6 +153,10 @@ class indice extends clsCadastro |
148 | 153 | $det_funcao = $obj_funcao->detalhe(); |
149 | 154 | |
150 | 155 | $this->ref_cod_funcao[] = array($funcao['ref_cod_funcao'] . '-' . $det_funcao['professor']); |
156 | + | |
157 | + if (FALSE == $this->docente && (bool) $det_funcao['professor']) { | |
158 | + $this->docente = TRUE; | |
159 | + } | |
151 | 160 | } |
152 | 161 | } |
153 | 162 | |
... | ... | @@ -312,6 +321,28 @@ class indice extends clsCadastro |
312 | 321 | |
313 | 322 | $this->campoHora('carga_horaria', 'Carga Horária', $hora_formatada, TRUE, |
314 | 323 | 'Número de horas deve ser maior que horas alocadas'); |
324 | + | |
325 | + // Dados do docente no Inep/Educacenso. | |
326 | + if ($this->docente) { | |
327 | + $docenteMapper = new Educacenso_Model_DocenteDataMapper(); | |
328 | + | |
329 | + $docenteInep = NULL; | |
330 | + try { | |
331 | + $docenteInep = $docenteMapper->find(array('docente' => $this->cod_servidor)); | |
332 | + } | |
333 | + catch (Exception $e) { | |
334 | + } | |
335 | + | |
336 | + if (isset($docenteInep)) { | |
337 | + $this->campoRotulo('_inep_cod_docente', 'Código do docente no Educacenso/Inep', | |
338 | + $docenteInep->docenteInep); | |
339 | + | |
340 | + if (isset($docenteInep->nomeInep)) { | |
341 | + $this->campoRotulo('_inep_nome_docente', 'Nome do docente no Educacenso/Inep', | |
342 | + $docenteInep->nomeInep); | |
343 | + } | |
344 | + } | |
345 | + } | |
315 | 346 | } |
316 | 347 | |
317 | 348 | function Novo() | ... | ... |
ieducar/intranet/educar_servidor_det.php
... | ... | @@ -32,7 +32,9 @@ require_once 'include/clsBase.inc.php'; |
32 | 32 | require_once 'include/clsDetalhe.inc.php'; |
33 | 33 | require_once 'include/clsBanco.inc.php'; |
34 | 34 | require_once 'include/pmieducar/geral.inc.php'; |
35 | + | |
35 | 36 | require_once 'ComponenteCurricular/Model/ComponenteDataMapper.php'; |
37 | +require_once 'Educacenso/Model/DocenteDataMapper.php'; | |
36 | 38 | |
37 | 39 | /** |
38 | 40 | * clsIndexBase class. |
... | ... | @@ -196,6 +198,9 @@ class indice extends clsDetalhe |
196 | 198 | $obj_funcao = new clsPmieducarServidorFuncao(); |
197 | 199 | $lst_funcao = $obj_funcao->lista($this->ref_cod_instituicao, $this->cod_servidor); |
198 | 200 | |
201 | + // Inep. | |
202 | + $docente = false; | |
203 | + | |
199 | 204 | if ($lst_funcao) { |
200 | 205 | $tabela .= " |
201 | 206 | <table cellspacing='0' cellpadding='0' border='0'> |
... | ... | @@ -273,6 +278,8 @@ class indice extends clsDetalhe |
273 | 278 | <td><b>{$det_funcao['nm_funcao']}</b></td> |
274 | 279 | </tr>"; |
275 | 280 | |
281 | + $docente = (bool) $det_funcao['professor']; | |
282 | + | |
276 | 283 | $class = $class == "formlttd" ? "formmdtd" : "formlttd" ; |
277 | 284 | } |
278 | 285 | |
... | ... | @@ -407,6 +414,26 @@ class indice extends clsDetalhe |
407 | 414 | )); |
408 | 415 | } |
409 | 416 | |
417 | + // Dados do docente no Educacenso/Inep. | |
418 | + if ($docente) { | |
419 | + $docenteMapper = new Educacenso_Model_DocenteDataMapper(); | |
420 | + | |
421 | + $docenteInep = NULL; | |
422 | + try { | |
423 | + $docenteInep = $docenteMapper->find(array('docente' => $registro['cod_servidor'])); | |
424 | + } | |
425 | + catch (Exception $e) { | |
426 | + } | |
427 | + | |
428 | + if (isset($docenteInep)) { | |
429 | + $this->addDetalhe(array('Código do docente no Educacenso/Inep', $docenteInep->docenteInep)); | |
430 | + | |
431 | + if (isset($docenteInep->nomeInep)) { | |
432 | + $this->addDetalhe(array('Nome do docente no Educacenso/Inep', $docenteInep->nomeInep)); | |
433 | + } | |
434 | + } | |
435 | + } | |
436 | + | |
410 | 437 | $obj_permissoes = new clsPermissoes(); |
411 | 438 | |
412 | 439 | if ($obj_permissoes->permissao_cadastra(635, $this->pessoa_logada, 7)) { | ... | ... |