Commit ef3a70c3002a118afc0e432a464a8e10d4949ad6
1 parent
02304574
Exists in
master
Atualizada funcionalidade "Turma Detalhes" para buscar os componentes através da…
… API de {{{App_Model_IedFinder}}}
Showing
1 changed file
with
24 additions
and
74 deletions
Show diff stats
ieducar/intranet/educar_turma_det.php
@@ -33,6 +33,8 @@ require_once 'include/clsDetalhe.inc.php'; | @@ -33,6 +33,8 @@ require_once 'include/clsDetalhe.inc.php'; | ||
33 | require_once 'include/clsBanco.inc.php'; | 33 | require_once 'include/clsBanco.inc.php'; |
34 | require_once 'include/pmieducar/geral.inc.php'; | 34 | require_once 'include/pmieducar/geral.inc.php'; |
35 | 35 | ||
36 | +require_once 'App/Model/IedFinder.php'; | ||
37 | + | ||
36 | /** | 38 | /** |
37 | * clsIndexBase class. | 39 | * clsIndexBase class. |
38 | * | 40 | * |
@@ -384,83 +386,31 @@ class indice extends clsDetalhe | @@ -384,83 +386,31 @@ class indice extends clsDetalhe | ||
384 | } | 386 | } |
385 | } | 387 | } |
386 | 388 | ||
387 | - if ($this->ref_ref_cod_escola && $this->ref_ref_cod_serie) { | ||
388 | - $obj = new clsPmieducarEscolaSerieDisciplina(); | ||
389 | - $lst = $obj->lista($this->ref_ref_cod_serie, $this->ref_ref_cod_escola, NULL, 1); | ||
390 | - | ||
391 | - if ($lst) { | ||
392 | - $tabela3 = ' | ||
393 | - <table> | ||
394 | - <tr align="center"> | ||
395 | - <td bgcolor="#A1B3BD"><b>Nome</b></td> | ||
396 | - </tr>'; | ||
397 | - | ||
398 | - $cont = 0; | ||
399 | - foreach ($lst as $valor) { | ||
400 | - if (($cont % 2) == 0) { | ||
401 | - $color = ' bgcolor="#E4E9ED" '; | ||
402 | - } | ||
403 | - else { | ||
404 | - $color = ' bgcolor="#FFFFFF" '; | ||
405 | - } | ||
406 | - | ||
407 | - $obj_disciplina = new clsPmieducarDisciplina($valor['ref_cod_disciplina']); | ||
408 | - $obj_disciplina->setOrderby('nm_disciplina ASC'); | ||
409 | - $obj_disciplina_det = $obj_disciplina->detalhe(); | ||
410 | - $nm_disciplina = $obj_disciplina_det['nm_disciplina']; | ||
411 | - | ||
412 | - $tabela3 .= sprintf(' | ||
413 | - <tr> | ||
414 | - <td %s align=left>%s</td> | ||
415 | - </tr>', | ||
416 | - $color, $nm_disciplina | ||
417 | - ); | ||
418 | - | ||
419 | - $cont++; | ||
420 | - } | ||
421 | - $tabela3 .= '</table>'; | ||
422 | - } | ||
423 | - } | ||
424 | - else { | ||
425 | - $obj = new clsPmieducarDisciplina(); | ||
426 | - $lst = $obj->lista(NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, | ||
427 | - NULL, NULL, NULL, NULL, NULL, $this->ref_cod_curso, | ||
428 | - $this->ref_cod_instituicao); | ||
429 | - | ||
430 | - if ($lst) { | ||
431 | - $tabela3 = ' | ||
432 | - <table> | ||
433 | - <tr align="center"> | ||
434 | - <td bgcolor="#A1B3BD"><b>Nome</b></td> | ||
435 | - </tr>'; | ||
436 | - | ||
437 | - $cont = 0; | ||
438 | - | ||
439 | - foreach ($lst as $valor) { | ||
440 | - if (($cont % 2) == 0) { | ||
441 | - $color = ' bgcolor="#E4E9ED" '; | ||
442 | - } | ||
443 | - else { | ||
444 | - $color = ' bgcolor="#FFFFFF" '; | ||
445 | - } | ||
446 | - | ||
447 | - $tabela3 .= sprintf(' | ||
448 | - <tr> | ||
449 | - <td %s align=left>%s</TD> | ||
450 | - </tr>', | ||
451 | - $color, $valor['nm_disciplina'] | ||
452 | - ); | ||
453 | - | ||
454 | - $cont++; | ||
455 | - } | 389 | + // Recupera os componentes curriculares da turma |
390 | + $componentes = App_Model_IedFinder::getComponentesTurma( | ||
391 | + $this->ref_ref_cod_serie, $this->ref_ref_cod_escola, $this->cod_turma | ||
392 | + ); | ||
456 | 393 | ||
457 | - $tabela3 .= '</table>'; | ||
458 | - } | 394 | + $tabela3 = ' |
395 | + <table> | ||
396 | + <tr align="center"> | ||
397 | + <td bgcolor="#A1B3BD"><b>Nome</b></td> | ||
398 | + </tr>'; | ||
399 | + | ||
400 | + $cont = 0; | ||
401 | + foreach ($componentes as $componente) { | ||
402 | + $color = ($cont++ % 2 == 0) ? ' bgcolor="#E4E9ED" ' : ' bgcolor="#FFFFFF" '; | ||
403 | + | ||
404 | + $tabela3 .= sprintf(' | ||
405 | + <tr> | ||
406 | + <td %s align=left>%s</td> | ||
407 | + </tr>', | ||
408 | + $color, $componente | ||
409 | + ); | ||
459 | } | 410 | } |
460 | 411 | ||
461 | - if ($tabela3) { | ||
462 | - $this->addDetalhe(array('Disciplina', $tabela3)); | ||
463 | - } | 412 | + $tabela3 .= '</table>'; |
413 | + $this->addDetalhe(array('Componentes curriculares', $tabela3)); | ||
464 | 414 | ||
465 | if ($obj_permissoes->permissao_cadastra(586, $this->pessoa_logada, 7)) { | 415 | if ($obj_permissoes->permissao_cadastra(586, $this->pessoa_logada, 7)) { |
466 | $this->url_novo = 'educar_turma_cad.php'; | 416 | $this->url_novo = 'educar_turma_cad.php'; |