Commit 6cdc7e51c7523dcee8f83e5cbb15c2981aae0cdb

Authored by Eriksen Costa Paixão
1 parent 6dfd264a
Exists in master

Atualizado relatório '''Diário de Classe - Avaliações''' para usar classes do mó…

…dulo {{{ComponenteCurricular}}}
ieducar/intranet/educar_relatorio_diario_classe_avaliacao.php
@@ -140,20 +140,14 @@ class indice extends clsCadastro @@ -140,20 +140,14 @@ class indice extends clsCadastro
140 $this->ano = $ano_atual = date('Y'); 140 $this->ano = $ano_atual = date('Y');
141 $this->campoNumero('ano', 'Ano', $this->ano, 4, 4, TRUE); 141 $this->campoNumero('ano', 'Ano', $this->ano, 4, 4, TRUE);
142 142
143 - $this->campoRadio('tipo_relatorio', 'Tipo Relatório',  
144 - array(  
145 - 'c' => 'Conceitual',  
146 - 'p' => 'Padrão'  
147 - ), 'p');  
148 -  
149 $this->campoCheck('em_branco', 'Relatório em branco', ''); 143 $this->campoCheck('em_branco', 'Relatório em branco', '');
150 $this->campoNumero('numero_registros', 'Número de linhas', '', 3, 3); 144 $this->campoNumero('numero_registros', 'Número de linhas', '', 3, 3);
151 145
152 - $get_escola = true;  
153 - $obrigatorio = true;  
154 - $exibe_nm_escola = true;  
155 - $get_curso = true;  
156 - $get_escola_curso_serie = true; 146 + $get_escola = TRUE;
  147 + $obrigatorio = TRUE;
  148 + $exibe_nm_escola = TRUE;
  149 + $get_curso = TRUE;
  150 + $get_escola_curso_serie = TRUE;
157 151
158 include 'include/pmieducar/educar_campo_lista.php'; 152 include 'include/pmieducar/educar_campo_lista.php';
159 153
@@ -264,13 +258,6 @@ function acao2() @@ -264,13 +258,6 @@ function acao2()
264 258
265 document.formcadastro.target = 'miolo_' + (DOM_divs.length - 1); 259 document.formcadastro.target = 'miolo_' + (DOM_divs.length - 1);
266 260
267 - if (document.formcadastro.tipo_relatorio[0].checked) {  
268 - document.formcadastro.action = 'educar_relatorio_diario_classe_avaliacao_conceitual_proc.php';  
269 - }  
270 - else {  
271 - document.formcadastro.action = 'educar_relatorio_diario_classe_avaliacao_proc.php';  
272 - }  
273 -  
274 document.formcadastro.submit(); 261 document.formcadastro.submit();
275 } 262 }
276 263
@@ -316,4 +303,6 @@ document.getElementById('ano').onchange = function() @@ -316,4 +303,6 @@ document.getElementById('ano').onchange = function()
316 { 303 {
317 getModulos(); 304 getModulos();
318 } 305 }
  306 +
  307 +document.formcadastro.action = 'educar_relatorio_diario_classe_avaliacao_proc.php';
319 </script> 308 </script>
320 \ No newline at end of file 309 \ No newline at end of file
ieducar/intranet/educar_relatorio_diario_classe_avaliacao_conceitual_proc.php
@@ -1,446 +0,0 @@ @@ -1,446 +0,0 @@
1 -<?php  
2 -  
3 -/**  
4 - * i-Educar - Sistema de gestão escolar  
5 - *  
6 - * Copyright (C) 2006 Prefeitura Municipal de Itajaí  
7 - * <ctima@itajai.sc.gov.br>  
8 - *  
9 - * Este programa é software livre; você pode redistribuí-lo e/ou modificá-lo  
10 - * sob os termos da Licença Pública Geral GNU conforme publicada pela Free  
11 - * Software Foundation; tanto a versão 2 da Licença, como (a seu critério)  
12 - * qualquer versão posterior.  
13 - *  
14 - * Este programa é distribuí­do na expectativa de que seja útil, porém, SEM  
15 - * NENHUMA GARANTIA; nem mesmo a garantia implí­cita de COMERCIABILIDADE OU  
16 - * ADEQUAÇÃO A UMA FINALIDADE ESPECÍFICA. Consulte a Licença Pública Geral  
17 - * do GNU para mais detalhes.  
18 - *  
19 - * Você deve ter recebido uma cópia da Licença Pública Geral do GNU junto  
20 - * com este programa; se não, escreva para a Free Software Foundation, Inc., no  
21 - * endereço 59 Temple Street, Suite 330, Boston, MA 02111-1307 USA.  
22 - *  
23 - * @author Prefeitura Municipal de Itajaí <ctima@itajai.sc.gov.br>  
24 - * @category i-Educar  
25 - * @license @@license@@  
26 - * @package iEd_Pmieducar  
27 - * @since Arquivo disponível desde a versão 1.0.0  
28 - * @version $Id$  
29 - */  
30 -  
31 -require_once 'include/clsBase.inc.php';  
32 -require_once 'include/clsCadastro.inc.php';  
33 -require_once 'include/clsBanco.inc.php';  
34 -require_once 'include/pmieducar/geral.inc.php';  
35 -require_once 'include/clsPDF.inc.php';  
36 -  
37 -/**  
38 - * clsIndexBase class.  
39 - *  
40 - * @author Prefeitura Municipal de Itajaí <ctima@itajai.sc.gov.br>  
41 - * @category i-Educar  
42 - * @license @@license@@  
43 - * @package iEd_Pmieducar  
44 - * @since Classe disponível desde a versão 1.0.0  
45 - * @version @@package_version@@  
46 - */  
47 -class clsIndexBase extends clsBase  
48 -{  
49 - function Formular()  
50 - {  
51 - $this->SetTitulo($this->_instituicao . ' i-Educar - Diário de Classe - Avaliações');  
52 - $this->processoAp = 670;  
53 - $this->renderMenu = FALSE;  
54 - $this->renderMenuSuspenso = FALSE;  
55 - }  
56 -}  
57 -  
58 -/**  
59 - * indice class.  
60 - *  
61 - * @author Prefeitura Municipal de Itajaí <ctima@itajai.sc.gov.br>  
62 - * @category i-Educar  
63 - * @license @@license@@  
64 - * @package iEd_Pmieducar  
65 - * @since Classe disponível desde a versão 1.0.0  
66 - * @version @@package_version@@  
67 - */  
68 -class indice extends clsCadastro  
69 -{  
70 - var $pessoa_logada;  
71 -  
72 - var $ref_cod_instituicao;  
73 - var $ref_cod_escola;  
74 - var $ref_cod_serie;  
75 - var $ref_cod_turma;  
76 -  
77 - var $ano;  
78 - var $mes;  
79 -  
80 - var $nm_escola;  
81 - var $nm_instituicao;  
82 - var $ref_cod_curso;  
83 - var $sequencial;  
84 - var $pdf;  
85 - var $pagina_atual = 1;  
86 - var $total_paginas = 1;  
87 - var $nm_professor;  
88 - var $nm_turma;  
89 - var $nm_serie;  
90 - var $nm_disciplina;  
91 - var $avaliacao_globalizada;  
92 -  
93 - var $page_y = 139;  
94 - var $get_file;  
95 - var $cursos = array();  
96 - var $get_link;  
97 - var $total;  
98 - var $ref_cod_modulo;  
99 - var $numero_registros;  
100 - var $em_branco;  
101 -  
102 - var $meses_do_ano = array(  
103 - 1 => 'JANEIRO',  
104 - 2 => 'FEVEREIRO',  
105 - 3 => 'MARÇO',  
106 - 4 => 'ABRIL',  
107 - 5 => 'MAIO',  
108 - 6 => 'JUNHO',  
109 - 7 => 'JULHO',  
110 - 8 => 'AGOSTO',  
111 - 9 => 'SETEMBRO',  
112 - 10 => 'OUTUBRO',  
113 - 11 => 'NOVEMBRO',  
114 - 12 => 'DEZEMBRO'  
115 - );  
116 -  
117 - function renderHTML()  
118 - {  
119 - if ($_POST) {  
120 - foreach ($_POST as $key => $value) {  
121 - $this->$key = $value;  
122 - }  
123 - }  
124 -  
125 - $this->ref_cod_modulo = explode('-', $this->ref_cod_modulo);  
126 - $this->ref_cod_modulo = $this->ref_cod_modulo[1];  
127 -  
128 - if ($this->ref_ref_cod_serie) {  
129 - $this->ref_cod_serie = $this->ref_ref_cod_serie;  
130 - }  
131 -  
132 - $fonte = 'arial';  
133 - $corTexto = '#000000';  
134 -  
135 - if (empty($this->ref_cod_turma)) {  
136 - echo '  
137 - <script>  
138 - alert("Erro ao gerar relatório!\nNenhuma turma selecionada!");  
139 - window.parent.fechaExpansivel(\'div_dinamico_\'+(window.parent.DOM_divs.length-1));  
140 - </script>';  
141 -  
142 - return TRUE;  
143 - }  
144 -  
145 - if ($this->ref_cod_escola) {  
146 - $obj_escola = new clsPmieducarEscola($this->ref_cod_escola);  
147 - $det_escola = $obj_escola->detalhe();  
148 - $this->nm_escola = $det_escola['nome'];  
149 -  
150 - $obj_instituicao = new clsPmieducarInstituicao($det_escola['ref_cod_instituicao']);  
151 - $det_instituicao = $obj_instituicao->detalhe();  
152 - $this->nm_instituicao = $det_instituicao['nm_instituicao'];  
153 - }  
154 -  
155 - $obj_calendario = new clsPmieducarEscolaAnoLetivo();  
156 - $lista_calendario = $obj_calendario->lista($this->ref_cod_escola, $this->ano,  
157 - NULL, NULL, NULL, NULL, NULL, NULL, NULL, 1, NULL);  
158 -  
159 - $obj_turma = new clsPmieducarTurma($this->ref_cod_turma);  
160 - $det_turma = $obj_turma->detalhe();  
161 - $this->nm_turma = $det_turma['nm_turma'];  
162 -  
163 - $obj_serie = new clsPmieducarSerie($this->ref_cod_serie);  
164 - $det_serie = $obj_serie->detalhe();  
165 - $this->nm_serie = $det_serie['nm_serie'];  
166 -  
167 - $obj_pessoa = new clsPessoa_($det_turma['ref_cod_regente']);  
168 - $det = $obj_pessoa->detalhe();  
169 - $this->nm_professor = $det['nome'];  
170 -  
171 - if(!$lista_calendario) {  
172 - echo '  
173 - <script>  
174 - alert("Escola não possui calendário definido para este ano");  
175 - window.parent.fechaExpansivel(\'div_dinamico_\'+(window.parent.DOM_divs.length-1));  
176 - </script>';  
177 - return true;  
178 - }  
179 -  
180 - $prox_mes = $this->mes + 1;  
181 - $this->pdf = new clsPDF(sprintf('Diário de Classe - %s', $this->ano),  
182 - sprintf('Diário de Classe - %s e %s de %s', $this->meses_do_ano[$this->mes], $this->meses_do_ano[$prox_mes], $this->ano),  
183 - 'A4', '', FALSE, FALSE);  
184 -  
185 - $altura_linha = 15;  
186 - $inicio_escrita_y = 175;  
187 - $altura_pagina = 760;  
188 -  
189 - $obj = new clsPmieducarSerie();  
190 - $obj->setOrderby('cod_serie, etapa_curso');  
191 - $lista_serie_curso = $obj->lista(NULL, NULL, NULL, $this->ref_cod_curso, NULL,  
192 - NULL, NULL, NULL, NULL, NULL, NULL, NULL, 1, $this->ref_cod_instituicao);  
193 -  
194 - $obj_curso = new clsPmieducarCurso($this->ref_cod_curso);  
195 - $det_curso = $obj_curso->detalhe();  
196 -  
197 - $obj_curso = new clsPmieducarCurso($this->ref_cod_curso);  
198 - $det_curso = $obj_curso->detalhe();  
199 -  
200 - if (!$this->em_branco) {  
201 - $obj_matricula_turma = new clsPmieducarMatriculaTurma();  
202 - $obj_matricula_turma->setOrderby('nome_aluno');  
203 -  
204 - $lista_matricula = $obj_matricula_turma->lista(null, $this->ref_cod_turma,  
205 - NULL, NULL, NULL, NULL, NULL, NULL, 1, $this->ref_cod_serie, $this->ref_cod_curso,  
206 - $this->ref_cod_escola, $this->ref_cod_instituicao, NULL, NULL, NULL, NULL,  
207 - NULL, $this->ano, NULL, TRUE, NULL, NULL, TRUE);  
208 - }  
209 -  
210 - if ($lista_matricula || $this->em_branco) {  
211 - $this->pdf->OpenPage();  
212 - $this->addCabecalho();  
213 - $num_aluno = 1;  
214 -  
215 - if ($this->em_branco) {  
216 - $lista_matricula = array();  
217 - $this->numero_registros = $this->numero_registros ? $this->numero_registros : 20;  
218 -  
219 - for ($i = 0; $i < $this->numero_registros; $i++) {  
220 - $lista_matricula[] = '';  
221 - }  
222 - }  
223 -  
224 - foreach ($lista_matricula as $matricula) {  
225 - if($this->page_y > $altura_pagina) {  
226 - $this->desenhaLinhasVertical();  
227 - $this->pdf->ClosePage();  
228 - $this->pdf->OpenPage();  
229 - $this->page_y = 139;  
230 - $this->addCabecalho();  
231 - }  
232 -  
233 - $this->pdf->quadrado_relativo(30, $this->page_y, 540, $altura_linha);  
234 -  
235 - $this->pdf->escreve_relativo(sprintf('%02d', $num_aluno), 38, $this->page_y + 4,  
236 - 30, 15, $fonte, 7, $corTexto, 'left');  
237 -  
238 - $this->pdf->escreve_relativo($matricula['nome_aluno'], 55, $this->page_y + 4,  
239 - 160, 15, $fonte, 7, $corTexto, 'left');  
240 -  
241 - $num_aluno++;  
242 - $this->page_y += $altura_linha;  
243 - }  
244 -  
245 - $this->desenhaLinhasVertical();  
246 -  
247 - $this->rodape();  
248 - $this->pdf->ClosePage();  
249 - }  
250 - else {  
251 - echo '  
252 - <script>  
253 - alert("Turma não possui matriculas");  
254 - window.parent.fechaExpansivel(\'div_dinamico_\'+(window.parent.DOM_divs.length-1));  
255 - </script>';  
256 -  
257 - return;  
258 - }  
259 -  
260 - $this->pdf->CloseFile();  
261 - $this->get_link = $this->pdf->GetLink();  
262 -  
263 - echo sprintf('  
264 - <script>  
265 - window.onload=function()  
266 - {  
267 - parent.EscondeDiv("LoadImprimir");  
268 - window.location="download.php?filename=%s"  
269 - }  
270 - </script>', $this->get_link);  
271 -  
272 - echo sprintf('  
273 - <html>  
274 - <center>  
275 - Se o download não iniciar automaticamente <br>  
276 - <a target="blank" href="%s" style="font-size: 16px; color: #000000; text-decoration: underline;">clique aqui!</a><br><br>  
277 - <span style="font-size: 10px;">  
278 - Para visualizar os arquivos PDF, é necessário instalar o Adobe Acrobat Reader.<br>  
279 - Clique na Imagem para Baixar o instalador<br><br>  
280 - <a href="http://www.adobe.com.br/products/acrobat/readstep2.html" target="new"><br><img src="imagens/acrobat.gif" width="88" height="31" border="0"></a>  
281 - </span>  
282 - </center>  
283 - </html>', $this->get_link);  
284 - }  
285 -  
286 - public function addCabecalho()  
287 - {  
288 - /**  
289 - * Variável global com objetos do CoreExt.  
290 - * @see includes/bootstrap.php  
291 - */  
292 - global $coreExt;  
293 -  
294 - // Namespace de configuração do template PDF  
295 - $config = $coreExt['Config']->app->template->pdf;  
296 -  
297 - // Variável que controla a altura atual das caixas  
298 - $altura = 30;  
299 - $fonte = 'arial';  
300 - $corTexto = '#000000';  
301 -  
302 - // Cabeçalho  
303 - $logo = $config->get($config->logo, 'imagens/brasao.gif');  
304 -  
305 - $this->pdf->quadrado_relativo(30, $altura, 540, 85);  
306 - $this->pdf->insertImageScaled('gif', $logo, 50, 95, 41);  
307 -  
308 - // Título principal  
309 - $titulo = $config->get($config->titulo, 'i-Educar');  
310 -  
311 - $this->pdf->escreve_relativo($titulo, 30, 30, 782, 80, $fonte, 18, $corTexto, 'center');  
312 -  
313 - $this->pdf->escreve_relativo(date('d/m/Y'), 510, 100, 782, 80, $fonte, 10,  
314 - $corTexto, 'left');  
315 -  
316 - // Dados escola  
317 - $this->pdf->escreve_relativo("Instituição: $this->nm_instituicao", 120, 52,  
318 - 300, 80, $fonte, 7, $corTexto, 'left' );  
319 -  
320 - $this->pdf->escreve_relativo("Escola: {$this->nm_escola}", 132, 64, 300, 80,  
321 - $fonte, 7, $corTexto, 'left');  
322 -  
323 - $dif = 0;  
324 -  
325 - if ($this->nm_professor) {  
326 - $this->pdf->escreve_relativo("Prof. Regente: {$this->nm_professor}", 111, 76,  
327 - 300, 80, $fonte, 7, $corTexto, 'left');  
328 - }  
329 - else {  
330 - $dif = 12;  
331 - }  
332 -  
333 - $this->pdf->escreve_relativo("Série: {$this->nm_serie}", 138, 88 - $dif,  
334 - 300, 80, $fonte, 7, $corTexto, 'left');  
335 -  
336 - $this->pdf->escreve_relativo("Turma: {$this->nm_turma}", 134, 100 - $dif,  
337 - 300, 80, $fonte, 7, $corTexto, 'left');  
338 -  
339 - $this->pdf->escreve_relativo("BIMESTRE {$this->ref_cod_modulo}/2007", 134,  
340 - 100, 300, 80, $fonte, 7, $corTexto, 'right');  
341 -  
342 - $this->pdf->escreve_relativo("D I Á R I O D E A V A L I A Ç Ã O - $this->nm_serie",  
343 - 30, 75, 782, 80, $fonte, 12, $corTexto, 'center');  
344 -  
345 - $obj_modulo = new clsPmieducarModulo($this->ref_cod_modulo);  
346 - $det_modulo = $obj_modulo->detalhe();  
347 -  
348 - $this->pdf->linha_relativa(201, 125, 0, 14);  
349 - $this->pdf->linha_relativa(201, 125, 369, 0);  
350 - $this->pdf->escreve_relativo('COMPETÊNCIAS', 195, 128, 350, 80, $fonte,  
351 - 7, $corTexto, 'center');  
352 -  
353 - $this->pdf->linha_relativa(30, 139, 0, 20);  
354 -  
355 - $this->pdf->linha_relativa(30, 139, 540, 0);  
356 -  
357 - $this->pdf->escreve_relativo('Nº', 36, 145, 100, 80, $fonte, 7, $corTexto,  
358 - 'left');  
359 -  
360 - $this->pdf->escreve_relativo('Nome', 110, 145, 100, 80, $fonte, 7,  
361 - $corTexto, 'left');  
362 -  
363 - $this->page_y += 19;  
364 - $this->pdf->escreve_relativo('Dias de aula: ' . $this->total, 715, 100, 535,  
365 - 80, $fonte, 10, $corTexto, 'left');  
366 - }  
367 -  
368 - function desenhaLinhasVertical()  
369 - {  
370 - $corTexto = '#000000';  
371 -  
372 - $this->total = 16;  
373 - $largura_anos = 396;  
374 -  
375 - if ($this->total >= 1) {  
376 - $incremental = floor($largura_anos / ($this->total));  
377 - }  
378 - else {  
379 - $incremental = 1;  
380 - }  
381 -  
382 - $reta_ano_x = 200 ;  
383 - $resto = $largura_anos - ($incremental * $this->total);  
384 -  
385 - for ($linha = 0; $linha < $this->total - 1; $linha++) {  
386 - if (($resto > 0) || $linha == 0) {  
387 - $reta_ano_x++;  
388 - $resto--;  
389 - }  
390 -  
391 - $this->pdf->linha_relativa($reta_ano_x, 139, 0, $this->page_y - 139);  
392 - $this->pdf->escreve_relativo($linha + 1, $reta_ano_x, 145, $incremental,  
393 - 80, $fonte, 7, $corTexto, 'center');  
394 -  
395 - $reta_ano_x += $incremental;  
396 - }  
397 -  
398 - $this->pdf->linha_relativa(50, 139, 0, $this->page_y - 139);  
399 - $this->pdf->linha_relativa(812, 125, 0, $this->page_y - 139);  
400 - $this->pdf->linha_relativa(570, 125, 0, $this->page_y - 139);  
401 - }  
402 -  
403 - function rodape()  
404 - {  
405 - $corTexto = '#000000';  
406 - $fonte = 'arial';  
407 - $dataAtual = date('d/m/Y');  
408 -  
409 - $this->pdf->escreve_relativo("LEGENDA: \n  
410 -D = Desenvolvida  
411 -PD = Parcialmente Desenvolvida  
412 -ID = Iniciando o Desenvolvimento  
413 -ND = Não Desenvolvida  
414 -CNA = Competência Não Avaliada", 36,750, 200, 50, $fonte, 7, $corTexto, 'left');  
415 -  
416 - $this->pdf->escreve_relativo('Data: ____/____/_______', 200, 810, 100, 50,  
417 - $fonte, 7, $corTexto, 'left');  
418 -  
419 - $this->pdf->escreve_relativo('Assinatura do Professor(a)', 450, 780, 100, 50,  
420 - $fonte, 7, $corTexto, 'left');  
421 -  
422 - $this->pdf->linha_relativa(430, 775, 130, 0);  
423 - }  
424 -  
425 - function Editar()  
426 - {  
427 - return FALSE;  
428 - }  
429 -  
430 - function Excluir()  
431 - {  
432 - return FALSE;  
433 - }  
434 -}  
435 -  
436 -// Instancia objeto de página  
437 -$pagina = new clsIndexBase();  
438 -  
439 -// Instancia objeto de conteúdo  
440 -$miolo = new indice();  
441 -  
442 -// Atribui o conteúdo à página  
443 -$pagina->addForm($miolo);  
444 -  
445 -// Gera o código HTML  
446 -$pagina->MakeAll();  
447 \ No newline at end of file 0 \ No newline at end of file
ieducar/intranet/educar_relatorio_diario_classe_avaliacao_proc.php
@@ -34,6 +34,8 @@ require_once &#39;include/clsBanco.inc.php&#39;; @@ -34,6 +34,8 @@ require_once &#39;include/clsBanco.inc.php&#39;;
34 require_once 'include/pmieducar/geral.inc.php'; 34 require_once 'include/pmieducar/geral.inc.php';
35 require_once 'include/clsPDF.inc.php'; 35 require_once 'include/clsPDF.inc.php';
36 36
  37 +require_once 'App/Model/IedFinder.php';
  38 +
37 /** 39 /**
38 * clsIndexBase class. 40 * clsIndexBase class.
39 * 41 *
@@ -202,174 +204,103 @@ class indice extends clsCadastro @@ -202,174 +204,103 @@ class indice extends clsCadastro
202 $obj_curso = new clsPmieducarCurso($this->ref_cod_curso); 204 $obj_curso = new clsPmieducarCurso($this->ref_cod_curso);
203 $det_curso = $obj_curso->detalhe(); 205 $det_curso = $obj_curso->detalhe();
204 206
205 - if ($det_curso['falta_ch_globalizada'] && $det_curso['avaliacao_globalizada'] == 't') {  
206 - if (!$this->em_branco) {  
207 - $obj_matricula_turma = new clsPmieducarMatriculaTurma();  
208 - $obj_matricula_turma->setOrderby('nome_aluno');  
209 - $lista_matricula = $obj_matricula_turma->lista(NULL, $this->ref_cod_turma,  
210 - NULL, NULL, NULL, NULL, NULL, NULL, 1, $this->ref_cod_serie, $this->ref_cod_curso,  
211 - $this->ref_cod_escola, $this->ref_cod_instituicao, NULL, NULL, NULL, NULL,  
212 - NULL, $this->ano, NULL, TRUE, NULL, NULL, TRUE);  
213 - } 207 + // Recupera a lista de componentes curriculares da escola/série
  208 + $componentes = App_Model_IedFinder::getEscolaSerieDisciplina(
  209 + $this->ref_cod_serie, $this->ref_cod_escola, TRUE
  210 + );
214 211
215 - if($lista_matricula || $this->em_branco) {  
216 - $this->pdf->OpenPage();  
217 - $this->addCabecalho();  
218 - $num_aluno = 1;  
219 -  
220 - if ($this->em_branco) {  
221 - $lista_matricula = array();  
222 - $this->numero_registros = $this->numero_registros? $this->numero_registros : 20; 212 + if (0 == count($componentes)) {
  213 + echo '
  214 + <script>
  215 + alert("Turma não possui matriculas");
  216 + window.parent.fechaExpansivel(\'div_dinamico_\'+(window.parent.DOM_divs.length-1));
  217 + </script>';
223 218
224 - for ($i = 0 ; $i < $this->numero_registros; $i++) {  
225 - $lista_matricula[] = '';  
226 - } 219 + return;
  220 + }
  221 + else {
  222 + foreach ($componentes as $id => $componente) {
  223 + $this->nm_disciplina = $componente->nome;
  224 + $this->page_y = 139;
  225 +
  226 + // Número de semanas dos meses
  227 + $obj_quadro = new clsPmieducarQuadroHorario();
  228 + $obj_quadro->setCamposLista("cod_quadro_horario");
  229 + $quadro_horario = $obj_quadro->lista(NULL, NULL, NULL, $this->ref_cod_turma,
  230 + NULL, NULL, NULL, NULL, 1);
  231 +
  232 + if (!$quadro_horario && $det_curso['avaliacao_globalizada'] == 't') {
  233 + echo '
  234 + <script>
  235 + alert("Turma não possui quadro de horários");
  236 + window.location = "educar_relatorio_diario_classe.php";
  237 + </script>';
  238 + break;
227 } 239 }
228 240
229 - foreach ($lista_matricula as $matricula) {  
230 - if($this->page_y > $altura_pagina) {  
231 - $this->desenhaLinhasVertical();  
232 - $this->pdf->ClosePage();  
233 - $this->pdf->OpenPage();  
234 - $this->page_y = 139;  
235 - $this->addCabecalho();  
236 - }  
237 -  
238 - $this->pdf->quadrado_relativo( 30, $this->page_y , 540, $altura_linha);  
239 - $this->pdf->escreve_relativo(sprintf("%02d",$num_aluno) , 38 ,$this->page_y + 4,30, 15, $fonte, 7, $corTexto, 'left' );  
240 - $this->pdf->escreve_relativo($matricula['nome_aluno'] , 55 ,$this->page_y + 4,160, 15, $fonte, 7, $corTexto, 'left' );  
241 -  
242 - $num_aluno++;  
243 - $this->page_y +=$altura_linha; 241 + $obj_quadro_horarios = new clsPmieducarQuadroHorarioHorarios();
  242 + $obj_quadro_horarios->setCamposLista('dia_semana');
  243 + $obj_quadro_horarios->setOrderby('1 asc');
  244 +
  245 + $lista_quadro_horarios = $obj_quadro_horarios->lista($quadro_horario,
  246 + $this->ref_cod_serie, $this->ref_cod_escola, $disciplina, NULL, NULL,
  247 + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 1);
  248 +
  249 + if (!$this->em_branco) {
  250 + $obj_matricula_turma = new clsPmieducarMatriculaTurma();
  251 + $obj_matricula_turma->setOrderby('nome_ascii');
  252 + $lista_matricula = $obj_matricula_turma->lista( NULL, $this->ref_cod_turma,
  253 + NULL, NULL, NULL, NULL, NULL, NULL, 1, $this->ref_cod_serie,
  254 + $this->ref_cod_curso, $this->ref_cod_escola, $this->ref_cod_instituicao,
  255 + NULL, NULL, array(1, 2, 3), NULL, NULL, $this->ano, NULL, TRUE,
  256 + NULL, NULL, TRUE);
244 } 257 }
245 258
246 - $this->desenhaLinhasVertical(); 259 + $num_aluno = 1;
247 260
248 - $this->rodape();  
249 - $this->pdf->ClosePage();  
250 - }  
251 - else {  
252 - echo '  
253 - <script>  
254 - alert("Turma não possui matriculas");  
255 - window.parent.fechaExpansivel(\'div_dinamico_\'+(window.parent.DOM_divs.length-1));  
256 - </script>';  
257 -  
258 - return;  
259 - } 261 + if ($lista_matricula || $this->em_branco) {
  262 + $this->pdf->OpenPage();
  263 + $this->addCabecalho();
260 264
261 - $this->pdf->CloseFile();  
262 - $this->get_link = $this->pdf->GetLink();  
263 - }  
264 - else {  
265 - $obj_turma_disc = new clsPmieducarDisciplinaSerie();  
266 - $obj_turma_disc->setCamposLista('ref_cod_disciplina');  
267 - $lst_turma_disc = $obj_turma_disc->lista(NULL, $this->ref_cod_serie, 1);  
268 -  
269 - if ($lst_turma_disc) {  
270 - foreach ($lst_turma_disc as $disciplina) {  
271 - $obj_disc = new clsPmieducarDisciplina($disciplina);  
272 - $det_disc = $obj_disc->detalhe();  
273 - $this->nm_disciplina = $det_disc['nm_disciplina'];  
274 - $this->page_y = 139;  
275 -  
276 - // Número de semanas dos meses  
277 - $obj_quadro = new clsPmieducarQuadroHorario();  
278 - $obj_quadro->setCamposLista("cod_quadro_horario");  
279 - $quadro_horario = $obj_quadro->lista(NULL, NULL, NULL,$this->ref_cod_turma,  
280 - NULL, NULL, NULL, NULL, 1);  
281 -  
282 - if (!$quadro_horario && $det_curso['avaliacao_globalizada'] == 't') {  
283 - echo '  
284 - <script>  
285 - alert("Turma não possui quadro de horários");  
286 - window.location = "educar_relatorio_diario_classe.php";  
287 - </script>';  
288 - break;  
289 - } 265 + if ($this->em_branco) {
  266 + $lista_matricula = array();
  267 + $this->numero_registros = $this->numero_registros ?
  268 + $this->numero_registros : 20;
290 269
291 - $obj_quadro_horarios = new clsPmieducarQuadroHorarioHorarios();  
292 - $obj_quadro_horarios->setCamposLista('dia_semana');  
293 - $obj_quadro_horarios->setOrderby('1 asc');  
294 -  
295 - $lista_quadro_horarios = $obj_quadro_horarios->lista($quadro_horario,  
296 - $this->ref_cod_serie, $this->ref_cod_escola, $disciplina, NULL, NULL,  
297 - NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 1);  
298 -  
299 - if (!$this->em_branco) {  
300 - $obj_matricula_turma = new clsPmieducarMatriculaTurma();  
301 - $obj_matricula_turma->setOrderby('nome_ascii');  
302 - $lista_matricula = $obj_matricula_turma->lista( NULL, $this->ref_cod_turma,  
303 - NULL, NULL, NULL, NULL, NULL, NULL, 1, $this->ref_cod_serie,  
304 - $this->ref_cod_curso, $this->ref_cod_escola, $this->ref_cod_instituicao,  
305 - NULL, NULL, array(1, 2, 3), NULL, NULL, $this->ano, NULL, TRUE,  
306 - NULL, NULL, TRUE); 270 + for ($i = 0 ; $i < $this->numero_registros; $i++) {
  271 + $lista_matricula[] = '';
  272 + }
307 } 273 }
308 274
309 - $num_aluno = 1;  
310 -  
311 - if ($lista_matricula || $this->em_branco) {  
312 - $this->pdf->OpenPage();  
313 - $this->addCabecalho();  
314 -  
315 - if ($this->em_branco) {  
316 - $lista_matricula = array();  
317 - $this->numero_registros = $this->numero_registros ?  
318 - $this->numero_registros : 20;  
319 -  
320 - for ($i = 0 ; $i < $this->numero_registros; $i++) {  
321 - $lista_matricula[] = '';  
322 - } 275 + foreach ($lista_matricula as $matricula) {
  276 + if($this->page_y > $altura_pagina) {
  277 + $this->desenhaLinhasVertical();
  278 + $this->pdf->ClosePage();
  279 + $this->pdf->OpenPage();
  280 + $this->page_y = 139;
  281 + $this->addCabecalho();
323 } 282 }
324 283
325 - foreach ($lista_matricula as $matricula) {  
326 - if($this->page_y > $altura_pagina) {  
327 - $this->desenhaLinhasVertical();  
328 - $this->pdf->ClosePage();  
329 - $this->pdf->OpenPage();  
330 - $this->page_y = 139;  
331 - $this->addCabecalho();  
332 - }  
333 -  
334 - $this->pdf->quadrado_relativo(30, $this->page_y , 540, $altura_linha); 284 + $this->pdf->quadrado_relativo(30, $this->page_y , 540, $altura_linha);
335 285
336 - $this->pdf->escreve_relativo($num_aluno, 38 ,$this->page_y + 4,  
337 - 30, 15, $fonte, 7, $corTexto, 'left'); 286 + $this->pdf->escreve_relativo($num_aluno, 38 ,$this->page_y + 4,
  287 + 30, 15, $fonte, 7, $corTexto, 'left');
338 288
339 - $this->pdf->escreve_relativo($matricula['nome_aluno'] , 55,  
340 - $this->page_y + 4, 160, 15, $fonte, 7, $corTexto, 'left'); 289 + $this->pdf->escreve_relativo($matricula['nome_aluno'] , 55,
  290 + $this->page_y + 4, 160, 15, $fonte, 7, $corTexto, 'left');
341 291
342 - $num_aluno++;  
343 - $this->page_y +=$altura_linha;  
344 - }  
345 -  
346 - $this->desenhaLinhasVertical();  
347 - $this->rodape();  
348 - $this->pdf->ClosePage();  
349 - }  
350 - else {  
351 - echo '  
352 - <script>  
353 - alert("Turma não possui matriculas");  
354 - window.parent.fechaExpansivel(\'div_dinamico_\'+(window.parent.DOM_divs.length-1));  
355 - </script>';  
356 -  
357 - return; 292 + $num_aluno++;
  293 + $this->page_y += $altura_linha;
358 } 294 }
359 - }  
360 295
361 - $this->pdf->CloseFile();  
362 - $this->get_link = $this->pdf->GetLink();  
363 - }  
364 - else {  
365 - echo '  
366 - <script>  
367 - alert("A Série não possui disciplinas");  
368 - window.parent.fechaExpansivel(\'div_dinamico_\'+(window.parent.DOM_divs.length-1));  
369 - </script>';  
370 -  
371 - return; 296 + $this->desenhaLinhasVertical();
  297 + $this->rodape();
  298 + $this->pdf->ClosePage();
  299 + }
372 } 300 }
  301 +
  302 + $this->pdf->CloseFile();
  303 + $this->get_link = $this->pdf->GetLink();
373 } 304 }
374 305
375 echo sprintf(' 306 echo sprintf('
ieducar/lib/App/Model/IedFinder.php
@@ -221,12 +221,13 @@ class App_Model_IedFinder extends CoreExt_Entity @@ -221,12 +221,13 @@ class App_Model_IedFinder extends CoreExt_Entity
221 * Retorna array com as referências de pmieducar.escola_serie_disciplina 221 * Retorna array com as referências de pmieducar.escola_serie_disciplina
222 * a modules.componente_curricular ('ref_ref_cod_disciplina'). 222 * a modules.componente_curricular ('ref_ref_cod_disciplina').
223 * 223 *
224 - * @param int $codSerie  
225 - * @param int $codEscola 224 + * @param int $codSerie
  225 + * @param int $codEscola
  226 + * @param bool $hydrate
226 * @return array 227 * @return array
227 * @throws App_Model_Exception 228 * @throws App_Model_Exception
228 */ 229 */
229 - public static function getEscolaSerieDisciplina($codSerie, $codEscola) 230 + public static function getEscolaSerieDisciplina($codSerie, $codEscola, $hydrate = FALSE)
230 { 231 {
231 // Disciplinas na série na escola 232 // Disciplinas na série na escola
232 $escolaSerieDisciplina = self::addClassToStorage('clsPmieducarEscolaSerieDisciplina', 233 $escolaSerieDisciplina = self::addClassToStorage('clsPmieducarEscolaSerieDisciplina',
@@ -241,8 +242,18 @@ class App_Model_IedFinder extends CoreExt_Entity @@ -241,8 +242,18 @@ class App_Model_IedFinder extends CoreExt_Entity
241 ); 242 );
242 } 243 }
243 244
  245 + if ($hydrate) {
  246 + require_once 'ComponenteCurricular/Model/ComponenteDataMapper.php';
  247 + $mapper = new ComponenteCurricular_Model_ComponenteDataMapper();
  248 + }
  249 +
244 $disciplinas = array(); 250 $disciplinas = array();
245 foreach ($disciplinasEscolaSerie as $disciplinaEscolaSerie) { 251 foreach ($disciplinasEscolaSerie as $disciplinaEscolaSerie) {
  252 + if ($hydrate) {
  253 + $disciplinas[] = $mapper->find($disciplinaEscolaSerie['ref_cod_disciplina']);
  254 + continue;
  255 + }
  256 +
246 $disciplinas[] = array( 257 $disciplinas[] = array(
247 'ref_cod_disciplina' => $disciplinaEscolaSerie['ref_cod_disciplina'], 258 'ref_cod_disciplina' => $disciplinaEscolaSerie['ref_cod_disciplina'],
248 'carga_horaria' => $disciplinaEscolaSerie['carga_horaria'] 259 'carga_horaria' => $disciplinaEscolaSerie['carga_horaria']