From ef3a70c3002a118afc0e432a464a8e10d4949ad6 Mon Sep 17 00:00:00 2001 From: Eriksen Costa Date: Thu, 22 Jul 2010 19:34:43 -0300 Subject: [PATCH] Atualizada funcionalidade "Turma Detalhes" para buscar os componentes através da API de {{{App_Model_IedFinder}}} --- ieducar/intranet/educar_turma_det.php | 98 ++++++++++++++++++++++++-------------------------------------------------------------------------- 1 file changed, 24 insertions(+), 74 deletions(-) diff --git a/ieducar/intranet/educar_turma_det.php b/ieducar/intranet/educar_turma_det.php index ca93aad..d5b16e8 100644 --- a/ieducar/intranet/educar_turma_det.php +++ b/ieducar/intranet/educar_turma_det.php @@ -33,6 +33,8 @@ require_once 'include/clsDetalhe.inc.php'; require_once 'include/clsBanco.inc.php'; require_once 'include/pmieducar/geral.inc.php'; +require_once 'App/Model/IedFinder.php'; + /** * clsIndexBase class. * @@ -384,83 +386,31 @@ class indice extends clsDetalhe } } - if ($this->ref_ref_cod_escola && $this->ref_ref_cod_serie) { - $obj = new clsPmieducarEscolaSerieDisciplina(); - $lst = $obj->lista($this->ref_ref_cod_serie, $this->ref_ref_cod_escola, NULL, 1); - - if ($lst) { - $tabela3 = ' - - - - '; - - $cont = 0; - foreach ($lst as $valor) { - if (($cont % 2) == 0) { - $color = ' bgcolor="#E4E9ED" '; - } - else { - $color = ' bgcolor="#FFFFFF" '; - } - - $obj_disciplina = new clsPmieducarDisciplina($valor['ref_cod_disciplina']); - $obj_disciplina->setOrderby('nm_disciplina ASC'); - $obj_disciplina_det = $obj_disciplina->detalhe(); - $nm_disciplina = $obj_disciplina_det['nm_disciplina']; - - $tabela3 .= sprintf(' - - - ', - $color, $nm_disciplina - ); - - $cont++; - } - $tabela3 .= '
Nome
%s
'; - } - } - else { - $obj = new clsPmieducarDisciplina(); - $lst = $obj->lista(NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, - NULL, NULL, NULL, NULL, NULL, $this->ref_cod_curso, - $this->ref_cod_instituicao); - - if ($lst) { - $tabela3 = ' - - - - '; - - $cont = 0; - - foreach ($lst as $valor) { - if (($cont % 2) == 0) { - $color = ' bgcolor="#E4E9ED" '; - } - else { - $color = ' bgcolor="#FFFFFF" '; - } - - $tabela3 .= sprintf(' - - - ', - $color, $valor['nm_disciplina'] - ); - - $cont++; - } + // Recupera os componentes curriculares da turma + $componentes = App_Model_IedFinder::getComponentesTurma( + $this->ref_ref_cod_serie, $this->ref_ref_cod_escola, $this->cod_turma + ); - $tabela3 .= '
Nome
%s
'; - } + $tabela3 = ' + + + + '; + + $cont = 0; + foreach ($componentes as $componente) { + $color = ($cont++ % 2 == 0) ? ' bgcolor="#E4E9ED" ' : ' bgcolor="#FFFFFF" '; + + $tabela3 .= sprintf(' + + + ', + $color, $componente + ); } - if ($tabela3) { - $this->addDetalhe(array('Disciplina', $tabela3)); - } + $tabela3 .= '
Nome
%s
'; + $this->addDetalhe(array('Componentes curriculares', $tabela3)); if ($obj_permissoes->permissao_cadastra(586, $this->pessoa_logada, 7)) { $this->url_novo = 'educar_turma_cad.php'; -- libgit2 0.21.2