Commit 06163685a772c8d5a3b868bd26bbfc14671bf257

Authored by Eriksen Costa Paixão
1 parent 8a28d98c
Exists in master

Removido relatório '''Diário de freqência temporário'''. O relatório '''Diário d…

…e frequência''' desempenha a mesma função opcionalmente, diminuindo a duplicidade de código e a quantidade de itens de permissão e menus
ieducar/configuration/ieducar.ini
@@ -83,6 +83,9 @@ app.admin.reports.pagina_tempo = 5 @@ -83,6 +83,9 @@ app.admin.reports.pagina_tempo = 5
83 app.admin.reports.emails[] = seu.email@example.com 83 app.admin.reports.emails[] = seu.email@example.com
84 ;app.admin.reports.emails[] = seu.email.2@example.com 84 ;app.admin.reports.emails[] = seu.email.2@example.com
85 85
  86 +; Configurações de relatórios
  87 +report.diario_classe.dias_temporarios = 30
  88 +
86 89
87 90
88 [development : production] 91 [development : production]
ieducar/intranet/educar_relatorio_diario_classe.php
@@ -71,48 +71,11 @@ class indice extends clsCadastro @@ -71,48 +71,11 @@ class indice extends clsCadastro
71 var $ref_cod_escola; 71 var $ref_cod_escola;
72 var $ref_cod_serie; 72 var $ref_cod_serie;
73 var $ref_cod_turma; 73 var $ref_cod_turma;
74 -  
75 - var $ano;  
76 - var $mes;  
77 -  
78 - var $nm_escola;  
79 - var $nm_instituicao;  
80 var $ref_cod_curso; 74 var $ref_cod_curso;
81 - var $sequencial;  
82 - var $pdf;  
83 - var $pagina_atual = 1;  
84 - var $total_paginas = 1;  
85 - var $nm_professor;  
86 - var $nm_turma;  
87 - var $nm_serie;  
88 - var $nm_disciplina;  
89 -  
90 - var $page_y = 125;  
91 -  
92 - var $get_file;  
93 -  
94 - var $cursos = array();  
95 -  
96 - var $get_link;  
97 -  
98 - var $total;  
99 -  
100 var $ref_cod_modulo; 75 var $ref_cod_modulo;
101 76
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 - ); 77 + var $sequencial;
  78 + var $ano;
116 79
117 function Inicializar() 80 function Inicializar()
118 { 81 {
@@ -146,6 +109,9 @@ class indice extends clsCadastro @@ -146,6 +109,9 @@ class indice extends clsCadastro
146 109
147 $this->campoCheck('em_branco', 'Relatório em branco', ''); 110 $this->campoCheck('em_branco', 'Relatório em branco', '');
148 $this->campoNumero('numero_registros', 'Número de linhas', '', 3, 3); 111 $this->campoNumero('numero_registros', 'Número de linhas', '', 3, 3);
  112 + $this->campoCheck('temporario', 'Gerar lista temporária?', '',
  113 + 'Gera lista de alunos mesmo para os componentes curriculares ' .
  114 + 'não definidos no quadro de horário da turma.');
149 115
150 $get_escola = TRUE; 116 $get_escola = TRUE;
151 $obrigatorio = TRUE; 117 $obrigatorio = TRUE;
ieducar/intranet/educar_relatorio_diario_classe_proc.php
@@ -107,14 +107,27 @@ class indice extends clsCadastro @@ -107,14 +107,27 @@ class indice extends clsCadastro
107 var $ref_cod_modulo; 107 var $ref_cod_modulo;
108 var $data_ini, $data_fim; 108 var $data_ini, $data_fim;
109 109
  110 + /**
  111 + * Define se será gerado uma lista com uma quantidade de dias padrão
  112 + * (report.diario_classe.dias_temporario) caso o componente curricular não
  113 + * esteja atribuído no quadro de horário da turma.
  114 + *
  115 + * @var bool
  116 + */
  117 + var $temporario = FALSE;
  118 +
110 function renderHTML() 119 function renderHTML()
111 { 120 {
  121 + global $coreExt;
  122 +
112 if ($_POST) { 123 if ($_POST) {
113 foreach ($_POST as $key => $value) { 124 foreach ($_POST as $key => $value) {
114 $this->$key = $value; 125 $this->$key = $value;
115 } 126 }
116 } 127 }
117 128
  129 + $this->temporario = isset($_POST['temporario']) ? TRUE : FALSE;
  130 +
118 if ($this->ref_ref_cod_serie) { 131 if ($this->ref_ref_cod_serie) {
119 $this->ref_cod_serie = $this->ref_ref_cod_serie; 132 $this->ref_cod_serie = $this->ref_ref_cod_serie;
120 } 133 }
@@ -295,6 +308,9 @@ class indice extends clsCadastro @@ -295,6 +308,9 @@ class indice extends clsCadastro
295 $quadro_horario = $obj_quadro->lista(NULL, NULL, NULL, $this->ref_cod_turma, 308 $quadro_horario = $obj_quadro->lista(NULL, NULL, NULL, $this->ref_cod_turma,
296 NULL, NULL, NULL, NULL, 1); 309 NULL, NULL, NULL, NULL, 1);
297 310
  311 + $total_semanas = 0;
  312 + $this->indefinido = FALSE;
  313 +
298 if (!$quadro_horario) { 314 if (!$quadro_horario) {
299 echo ' 315 echo '
300 <script> 316 <script>
@@ -313,19 +329,31 @@ class indice extends clsCadastro @@ -313,19 +329,31 @@ class indice extends clsCadastro
313 $this->ref_cod_serie, $this->ref_cod_escola, $componente->id, NULL, NULL, 329 $this->ref_cod_serie, $this->ref_cod_escola, $componente->id, NULL, NULL,
314 NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 1); 330 NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 1);
315 331
316 - if (FALSE == $lista_quadro_horarios) { 332 + // Se não for retornado horário e o diário não for temporário, gera
  333 + // a lista para o próximo componente
  334 + if (FALSE == $lista_quadro_horarios && FALSE == $this->temporario) {
317 continue; 335 continue;
318 } 336 }
319 337
320 - for ($mes_ = $meses[0]; $mes_ <= $meses[1]; $mes_++) { 338 + // Caso o diário seja temporário, gera lista de alunos para 30 dias
  339 + // por padrão
  340 + if (FALSE == $lista_quadro_horarios && TRUE == $this->temporario) {
  341 + $this->indefinido = TRUE;
  342 +
  343 + $total_semanas = $coreExt['Config']->get(
  344 + $coreExt['Config']->report->diario_classe->dias_temporarios, 30
  345 + );
  346 + }
  347 +
  348 + for ($mes_ = $meses[0]; $mes_ <= $meses[1] && FALSE != $lista_quadro_horarios; $mes_++) {
321 $mes_final = FALSE; 349 $mes_final = FALSE;
322 350
323 foreach ($lista_quadro_horarios as $dia_semana) { 351 foreach ($lista_quadro_horarios as $dia_semana) {
324 if($mes_ == $meses[0]) { 352 if($mes_ == $meses[0]) {
325 $dia = $dias[0]; 353 $dia = $dias[0];
326 } 354 }
327 - elseif ($mes == $meses[1]) {  
328 - $dia = 1; 355 + elseif ($mes_ == $meses[1]) {
  356 + $dia = $dias[1];
329 $mes_final = TRUE; 357 $mes_final = TRUE;
330 } 358 }
331 else { 359 else {
@@ -575,7 +603,15 @@ class indice extends clsCadastro @@ -575,7 +603,15 @@ class indice extends clsCadastro
575 603
576 $this->page_y += 19; 604 $this->page_y += 19;
577 605
578 - $this->pdf->escreve_relativo('Dias de aula: ' . $this->total, 715, 100, 535, 606 + $label = $this->total;
  607 + $pos = 715;
  608 +
  609 + if ($this->indefinido) {
  610 + $label = 'indefinido';
  611 + $pos = 680;
  612 + }
  613 +
  614 + $this->pdf->escreve_relativo('Dias de aula: ' . $label, $pos, 100, 535,
579 80, $fonte, 10, $corTexto, 'left'); 615 80, $fonte, 10, $corTexto, 'left');
580 } 616 }
581 617
ieducar/intranet/educar_relatorio_diario_classe_temp.php
@@ -1,316 +0,0 @@ @@ -1,316 +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');  
52 - $this->processoAp = 927;  
53 - }  
54 -}  
55 -  
56 -/**  
57 - * indice class.  
58 - *  
59 - * @author Prefeitura Municipal de Itajaí <ctima@itajai.sc.gov.br>  
60 - * @category i-Educar  
61 - * @license @@license@@  
62 - * @package iEd_Pmieducar  
63 - * @since Classe disponível desde a versão 1.0.0  
64 - * @version @@package_version@@  
65 - */  
66 -class indice extends clsCadastro  
67 -{  
68 - var $pessoa_logada;  
69 -  
70 - var $ref_cod_instituicao;  
71 - var $ref_cod_escola;  
72 - var $ref_cod_serie;  
73 - var $ref_cod_turma;  
74 -  
75 - var $ano;  
76 - var $mes;  
77 -  
78 - var $nm_escola;  
79 - var $nm_instituicao;  
80 - var $ref_cod_curso;  
81 - var $sequencial;  
82 - var $pdf;  
83 - var $pagina_atual = 1;  
84 - var $total_paginas = 1;  
85 - var $nm_professor;  
86 - var $nm_turma;  
87 - var $nm_serie;  
88 - var $nm_disciplina;  
89 -  
90 - var $page_y = 125;  
91 -  
92 - var $get_file;  
93 -  
94 - var $cursos = array();  
95 -  
96 - var $get_link;  
97 -  
98 - var $total;  
99 -  
100 - var $ref_cod_modulo;  
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 Inicializar()  
118 - {  
119 - $retorno = 'Novo';  
120 -  
121 - @session_start();  
122 - $this->pessoa_logada = $_SESSION['id_pessoa'];  
123 - @session_write_close();  
124 -  
125 - return $retorno;  
126 - }  
127 -  
128 - function Gerar()  
129 - {  
130 - $obj_permissoes = new clsPermissoes();  
131 - $nivel_usuario = $obj_permissoes->nivel_acesso($this->pessoa_logada);  
132 -  
133 - @session_start();  
134 - $this->pessoa_logada = $_SESSION['id_pessoa'];  
135 - @session_write_close();  
136 -  
137 - if ($_POST) {  
138 - foreach ($_POST as $key => $value) {  
139 - $this->$key = $value;  
140 - }  
141 - }  
142 -  
143 - $this->ano = $ano_atual = date('Y');  
144 -  
145 - $this->campoNumero('ano', 'Ano', $this->ano, 4, 4, TRUE);  
146 -  
147 - $this->campoCheck('em_branco', 'Relatório em branco', '');  
148 - $this->campoNumero('numero_registros', 'Número de linhas', '', 3, 3);  
149 -  
150 - $get_escola = TRUE;  
151 - $obrigatorio = TRUE;  
152 - $exibe_nm_escola = TRUE;  
153 - $get_curso = TRUE;  
154 - $get_escola_curso_serie = TRUE;  
155 -  
156 - include 'include/pmieducar/educar_campo_lista.php';  
157 -  
158 - $opcoes_turma = array('' => 'Selecione');  
159 -  
160 - if (($this->ref_ref_cod_serie && $this->ref_cod_escola) || $this->ref_cod_curso) {  
161 - $obj_turma = new clsPmieducarTurma();  
162 - $obj_turma->setOrderby('nm_turma ASC');  
163 -  
164 - $lst_turma = $obj_turma->lista(NULL, NULL, NULL, $this->ref_ref_cod_serie,  
165 - $this->ref_cod_escola, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,  
166 - NULL, 1, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, $this->ref_cod_curso);  
167 -  
168 - if (is_array($lst_turma) && count($lst_turma)) {  
169 - foreach ($lst_turma as $turma) {  
170 - $opcoes_turma[$turma['cod_turma']] = $turma['nm_turma'];  
171 - }  
172 - }  
173 - }  
174 -  
175 - $this->campoLista('ref_cod_turma', 'Turma', $opcoes_turma, $this->ref_cod_turma);  
176 -  
177 - $this->campoLista('ref_cod_modulo', 'Módulo', array('' => 'Selecione'), '');  
178 -  
179 - if ($this->ref_cod_escola) {  
180 - $this->ref_ref_cod_escola = $this->ref_cod_escola;  
181 - }  
182 -  
183 - if ($this->get_link) {  
184 - $this->campoRotulo('rotulo11', '-', sprintf('<a href="%s" target="_blank">Baixar Relatório</a>', $this->get_link));  
185 - }  
186 -  
187 - $this->url_cancelar = 'educar_index.php';  
188 - $this->nome_url_cancelar = 'Cancelar';  
189 -  
190 - $this->acao_enviar = 'acao2()';  
191 - $this->acao_executa_submit = FALSE;  
192 - }  
193 -}  
194 -  
195 -// Instancia objeto de página  
196 -$pagina = new clsIndexBase();  
197 -  
198 -// Instancia objeto de conteúdo  
199 -$miolo = new indice();  
200 -  
201 -// Atribui o conteúdo à página  
202 -$pagina->addForm($miolo);  
203 -  
204 -// Gera o código HTML  
205 -$pagina->MakeAll();  
206 -?>  
207 -<script type="text/javascript">  
208 -function acao2()  
209 -{  
210 - if (!acao()) {  
211 - return false;  
212 - }  
213 -  
214 - showExpansivelImprimir(400, 200, '', [], 'Diário de Classe');  
215 -  
216 - document.formcadastro.target = 'miolo_' + (DOM_divs.length - 1);  
217 -  
218 - document.formcadastro.submit();  
219 -}  
220 -  
221 -document.formcadastro.action = 'educar_relatorio_diario_classe_temp_proc.php';  
222 -  
223 -function getModulos()  
224 -{  
225 - var campoEscola = document.getElementById('ref_cod_escola').value;  
226 - var campoCurso = document.getElementById('ref_cod_curso').value;  
227 - var campoAno = document.getElementById('ano').value;  
228 - var campoTurma = document.getElementById('ref_cod_turma').value;  
229 -  
230 - var xml1 = new ajax(getModulos_XML);  
231 - strURL = 'educar_modulo_xml.php?esc=' + campoEscola + '&ano=' + campoAno  
232 - + '&curso=' + campoCurso + '&turma=' + campoTurma;  
233 -  
234 - xml1.envia(strURL);  
235 -}  
236 -  
237 -function getModulos_XML(xml)  
238 -{  
239 - var modulos = xml.getElementsByTagName('ano_letivo_modulo');  
240 -  
241 - var campoEscola = document.getElementById('ref_cod_escola').value;  
242 - var campoCurso = document.getElementById('ref_cod_curso').value;  
243 - var campoModulo = document.getElementById('ref_cod_modulo');  
244 - var campoAno = document.getElementById('ano').value;  
245 -  
246 - campoModulo.length = 1;  
247 - campoModulo.options[0] = new Option('Selecione um módulo', '', false, false);  
248 -  
249 - for (var j = 0; j < modulos.length; j++) {  
250 - campoModulo.options[campoModulo.options.length] = new Option(  
251 - modulos[j].firstChild.nodeValue, modulos[j].getAttribute('cod_modulo') + '-' + modulos[j].getAttribute('sequencial'),  
252 - false, false  
253 - );  
254 - }  
255 -  
256 - if (campoModulo.length == 1) {  
257 - campoModulo.options[0] = new Option('O curso não possui nenhum módulo', '', false, false);  
258 - }  
259 -}  
260 -  
261 -document.getElementById('ref_cod_escola').onchange = function()  
262 -{  
263 - getEscolaCurso();  
264 - document.getElementById('ref_cod_curso').onchange();  
265 -}  
266 -  
267 -document.getElementById('ano').onchange = function()  
268 -{  
269 - getModulos();  
270 -}  
271 -  
272 -document.getElementById('ref_cod_curso').onchange = function()  
273 -{  
274 - getEscolaCursoSerie();  
275 - document.getElementById('ref_cod_modulo').length = 1;  
276 - getModulos();  
277 -}  
278 -  
279 -document.getElementById('ref_cod_turma').onchange = function()  
280 -{  
281 - document.getElementById('ref_cod_modulo').length = 1;  
282 - getModulos();  
283 -}  
284 -  
285 -document.getElementById('ref_ref_cod_serie').onchange = function()  
286 -{  
287 - var campoEscola = document.getElementById('ref_cod_escola').value;  
288 - var campoSerie = document.getElementById('ref_ref_cod_serie').value;  
289 -  
290 - var xml1 = new ajax(getTurma_XML);  
291 - strURL = 'educar_turma_xml.php?esc=' + campoEscola + '&ser=' + campoSerie;  
292 - xml1.envia(strURL);  
293 -}  
294 -  
295 -function getTurma_XML(xml)  
296 -{  
297 - var campoSerie = document.getElementById('ref_ref_cod_serie').value;  
298 -  
299 - var campoTurma = document.getElementById('ref_cod_turma');  
300 -  
301 - var turma = xml.getElementsByTagName('turma');  
302 -  
303 - campoTurma.length = 1;  
304 - campoTurma.options[0] = new Option('Selecione uma Turma', '', false, false);  
305 -  
306 - for (var j = 0; j < turma.length; j++) {  
307 - campoTurma.options[campoTurma.options.length] = new Option(  
308 - turma[j].firstChild.nodeValue, turma[j].getAttribute('cod_turma'), false, false  
309 - );  
310 - }  
311 -  
312 - if (campoTurma.length == 1 && campoSerie != '') {  
313 - campoTurma.options[0] = new Option('A série não possui nenhuma turma', '', false, false);  
314 - }  
315 -}  
316 -</script>  
317 \ No newline at end of file 0 \ No newline at end of file
ieducar/intranet/educar_relatorio_diario_classe_temp_proc.php
@@ -1,917 +0,0 @@ @@ -1,917 +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');  
52 - $this->processoAp = 927;  
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 - var $mes_inicial;  
80 - var $mes_final;  
81 -  
82 - var $nm_escola;  
83 - var $nm_instituicao;  
84 - var $ref_cod_curso;  
85 - var $sequencial;  
86 - var $pdf;  
87 - var $pagina_atual = 1;  
88 - var $total_paginas = 1;  
89 - var $nm_professor;  
90 - var $nm_turma;  
91 - var $nm_serie;  
92 - var $nm_disciplina;  
93 -  
94 - var $numero_registros;  
95 - var $em_branco;  
96 -  
97 - var $page_y = 125;  
98 -  
99 - var $get_file;  
100 -  
101 - var $cursos = array();  
102 -  
103 - var $get_link;  
104 -  
105 - var $total;  
106 -  
107 - var $ref_cod_modulo;  
108 - var $data_ini,$data_fim;  
109 -  
110 - var $z = 0;  
111 -  
112 - var $meses_do_ano = array(  
113 - 1 => 'JANEIRO',  
114 - 2 => 'FEVEREIRO',  
115 - 3 => 'MARÇO',  
116 - 4 => 'ABRIL',  
117 - 5 => 'MAIO',  
118 - 6 => 'JUNHO',  
119 - 7 => 'JULHO',  
120 - 8 => 'AGOSTO',  
121 - 9 => 'SETEMBRO',  
122 - 10 => 'OUTUBRO',  
123 - 11 => 'NOVEMBRO',  
124 - 12 => 'DEZEMBRO'  
125 - );  
126 -  
127 - var $indefinido;  
128 -  
129 - function renderHTML()  
130 - {  
131 - if ($_POST){  
132 - foreach ($_POST as $key => $value) {  
133 - $this->$key = $value;  
134 - }  
135 - }  
136 -  
137 - if ($this->ref_ref_cod_serie) {  
138 - $this->ref_cod_serie = $this->ref_ref_cod_serie;  
139 - }  
140 -  
141 - $fonte = 'arial';  
142 - $corTexto = '#000000';  
143 -  
144 - if (empty($this->ref_cod_turma)) {  
145 - echo '  
146 - <script>  
147 - alert("Erro ao gerar relatório!\nNenhuma turma selecionada!");  
148 - window.parent.fechaExpansivel(\'div_dinamico_\' + (window.parent.DOM_divs.length - 1));  
149 - </script>';  
150 -  
151 - return TRUE;  
152 - }  
153 -  
154 - $modulo_sequencial = explode('-', $this->ref_cod_modulo);  
155 - $this->ref_cod_modulo = $modulo_sequencial[0];  
156 - $this->sequencial = $modulo_sequencial[1];  
157 -  
158 - if ($this->ref_cod_escola) {  
159 - $obj_escola = new clsPmieducarEscola($this->ref_cod_escola);  
160 - $det_escola = $obj_escola->detalhe();  
161 - $this->nm_escola = $det_escola['nome'];  
162 -  
163 - $obj_instituicao = new clsPmieducarInstituicao($det_escola['ref_cod_instituicao']);  
164 - $det_instituicao = $obj_instituicao->detalhe();  
165 - $this->nm_instituicao = $det_instituicao['nm_instituicao'];  
166 - }  
167 -  
168 - $obj_calendario = new clsPmieducarEscolaAnoLetivo();  
169 - $lista_calendario = $obj_calendario->lista($this->ref_cod_escola, $this->ano,  
170 - NULL, NULL, NULL, NULL, NULL, NULL, NULL,1, NULL);  
171 -  
172 - $obj_turma = new clsPmieducarTurma($this->ref_cod_turma);  
173 - $det_turma = $obj_turma->detalhe();  
174 - $this->nm_turma = $det_turma['nm_turma'];  
175 -  
176 - $obj_serie = new clsPmieducarSerie($this->ref_cod_serie);  
177 - $det_serie = $obj_serie->detalhe();  
178 - $this->nm_serie = $det_serie['nm_serie'];  
179 -  
180 - $obj_pessoa = new clsPessoa_($det_turma["ref_cod_regente"]);  
181 - $det = $obj_pessoa->detalhe();  
182 - $this->nm_professor = $det["nome"];  
183 -  
184 - if (!$lista_calendario) {  
185 - echo '  
186 - <script>  
187 - alert("Escola não possui calendário definido para este ano");  
188 - window.parent.fechaExpansivel(\'div_dinamico_\'+(window.parent.DOM_divs.length-1));  
189 - </script>';  
190 -  
191 - return TRUE;  
192 - }  
193 -  
194 - $altura_linha = 23;  
195 - $inicio_escrita_y = 175;  
196 -  
197 - $obj = new clsPmieducarSerie();  
198 - $obj->setOrderby('cod_serie, etapa_curso');  
199 - $lista_serie_curso = $obj->lista(NULL, NULL, NULL, $this->ref_cod_curso, NULL,  
200 - NULL, NULL, NULL, NULL, NULL, NULL, NULL, 1, $this->ref_cod_instituicao);  
201 -  
202 - $obj_curso = new clsPmieducarCurso($this->ref_cod_curso);  
203 - $det_curso = $obj_curso->detalhe();  
204 -  
205 - if ($det_curso['falta_ch_globalizada']) {  
206 - /**  
207 - * numero de semanas dos meses  
208 - */  
209 - $db = new clsBanco();  
210 -  
211 - $consulta = sprintf('SELECT padrao_ano_escolar FROM pmieducar.curso WHERE cod_curso = %d',  
212 - $this->ref_cod_curso);  
213 -  
214 - $padrao_ano_escolar = $db->CampoUnico($consulta);  
215 -  
216 - $total_semanas = 0;  
217 -  
218 - if ($padrao_ano_escolar) {  
219 - $meses = $db->CampoUnico(sprintf("  
220 - SELECT  
221 - to_char(data_inicio,'dd/mm') || '-' || to_char(data_fim,'dd/mm')  
222 - FROM  
223 - pmieducar.ano_letivo_modulo,  
224 - pmieducar.modulo  
225 - WHERE  
226 - modulo.cod_modulo = ano_letivo_modulo.ref_cod_modulo  
227 - AND modulo.ativo = 1  
228 - AND ano_letivo_modulo.ref_cod_modulo = %d  
229 - AND ano_letivo_modulo.sequencial = %d  
230 - AND ref_ano =  
231 - AND ref_ref_cod_escola = %d  
232 - ORDER BY  
233 - data_inicio,  
234 - data_fim ASC  
235 - ", $this->ref_cod_modulo, $this->sequencial, $this->ano, $this->ref_cod_escola));  
236 -  
237 - $data = explode('-', $meses);  
238 -  
239 - if (!$this->data_ini) {  
240 - $this->data_ini = $data[0];  
241 - }  
242 -  
243 - if (!$this->data_fim) {  
244 - $this->data_fim = $data[1];  
245 - }  
246 -  
247 - $data_ini = explode('/', $data[0]);  
248 - $data_fim = explode('/', $data[1]);  
249 -  
250 - $meses = array($data_ini[1], $data_fim[1]);  
251 - $dias = array($data_ini[0], $data_fim[0]);  
252 -  
253 - $total_semanas = 0;  
254 -  
255 - for ($mes = (int)$meses[0]; $mes <= (int)$meses[1]; $mes++) {  
256 - $mes_final = FALSE;  
257 -  
258 - if ($mes == (int)$meses[0]) {  
259 - $dia = $dias[0];  
260 - }  
261 - elseif ($mes == (int)$meses[1]) {  
262 - $dia = $dias[1];  
263 - $mes_final = TRUE;  
264 - }  
265 - else {  
266 - $dia = 1;  
267 - }  
268 -  
269 - $total_semanas += $this->getNumeroDiasMes($dia, $mes, $this->ano, $mes_final);  
270 - }  
271 - }  
272 - else {  
273 - $meses = $db->CampoUnico(sprintf("  
274 - SELECT  
275 - to_char(data_inicio,'dd/mm') || '-' || to_char(data_fim,'dd/mm')  
276 - FROM  
277 - pmieducar.turma_modulo,  
278 - pmieducar.modulo  
279 - WHERE  
280 - modulo.cod_modulo = turma_modulo.ref_cod_modulo  
281 - AND ref_cod_turma = %d  
282 - AND turma_modulo.ref_cod_modulo = %d  
283 - AND turma_modulo.sequencial =  
284 - AND to_char(data_inicio,'yyyy') = %d  
285 - ORDER BY  
286 - data_inicio,  
287 - data_fim ASC  
288 - ", $this->ref_cod_turma, $this->ref_cod_modulo, $this->sequencial, $this->ano));  
289 -  
290 - $total_semanas = 0;  
291 -  
292 - $data = explode('-', $meses);  
293 -  
294 - if (!$this->data_ini) {  
295 - $this->data_ini = $data[0];  
296 - }  
297 -  
298 - if (!$this->data_fim) {  
299 - $this->data_fim = $data[1];  
300 - }  
301 -  
302 - $data_ini = explode('/', $data[0]);  
303 - $data_fim = explode('/', $data[1]);  
304 -  
305 - $meses = array($data_ini[1], $data_fim[1]);  
306 - $dias = array($data_ini[0], $data_fim[0]);  
307 -  
308 - $total_semanas = 0;  
309 -  
310 - for ($mes = $meses[0]; $mes <= $meses[1]; $mes++) {  
311 - $mes_final = FALSE;  
312 -  
313 - if ($mes == $meses[0]) {  
314 - $dia = $dias[0];  
315 - }  
316 - elseif ($mes == $meses[1]) {  
317 - $dia = 1;  
318 - $mes_final = TRUE;  
319 - }  
320 - else {  
321 - $dia = 1;  
322 - }  
323 -  
324 - $total_semanas += $this->getNumeroDiasMes($dia, $mes, $this->ano, $mes_final);  
325 - }  
326 - }  
327 -  
328 - $this->pdf = new clsPDF('Diário de Classe - ' . $this->ano,  
329 - sprintf('Diário de Classe - %s até %s de %d', $data[0], $data[1], $this->ano),  
330 - 'A4', '', FALSE, FALSE);  
331 -  
332 - $this->mes_inicial = (int) $meses[0];  
333 - $this->mes_final = (int) $meses[1];  
334 - $this->pdf->largura = 842.0;  
335 - $this->pdf->altura = 595.0;  
336 -  
337 - $this->total = $total_semanas;  
338 -  
339 - if (!$this->em_branco) {  
340 - $obj_matricula_turma = new clsPmieducarMatriculaTurma();  
341 - $obj_matricula_turma->setOrderby('nome_ascii');  
342 -  
343 - $lista_matricula = $obj_matricula_turma->lista(NULL, $this->ref_cod_turma,  
344 - NULL, NULL, NULL, NULL, NULL, NULL, 1, $this->ref_cod_serie,  
345 - $this->ref_cod_curso, $this->ref_cod_escola, $this->ref_cod_instituicao,  
346 - NULL, NULL, array(1,2,3), NULL, NULL, $this->ano, NULL, TRUE, NULL, NULL, TRUE);  
347 - }  
348 -  
349 - if ($lista_matricula || $this->em_branco) {  
350 - $this->pdf->OpenPage();  
351 - $this->addCabecalho();  
352 -  
353 - if($this->em_branco) {  
354 - $lista_matricula = array();  
355 - $this->numero_registros = $this->numero_registros ? $this->numero_registros : 20;  
356 -  
357 - for ($i = 0; $i < $this->numero_registros; $i++) {  
358 - $lista_matricula[] = '';  
359 - }  
360 - }  
361 -  
362 - $num = 0;  
363 - foreach ($lista_matricula as $matricula) {  
364 - $num++;  
365 -  
366 - if ($this->page_y > 500) {  
367 - $this->desenhaLinhasVertical();  
368 - $this->pdf->ClosePage();  
369 - $this->pdf->OpenPage();  
370 - $this->page_y = 125;  
371 - $this->addCabecalho();  
372 - }  
373 -  
374 - $this->pdf->quadrado_relativo(30, $this->page_y, 782, 19);  
375 -  
376 - $this->pdf->escreve_relativo($matricula['nome_aluno'], 33,  
377 - $this->page_y + 4, 160, 15, $fonte, 7, $corTexto, 'left');  
378 -  
379 - $this->pdf->escreve_relativo(sprintf('%02d', $num), 757, $this->page_y + 4,  
380 - 30, 30, $fonte, 7, $corTexto, 'left');  
381 -  
382 - $this->page_y +=19;  
383 - }  
384 -  
385 - $this->desenhaLinhasVertical();  
386 -  
387 - $this->rodape();  
388 - $this->pdf->ClosePage();  
389 - }  
390 - else {  
391 - echo '  
392 - <script>  
393 - alert("Turma não possui matriculas");  
394 - window.parent.fechaExpansivel(\'div_dinamico_\'+(window.parent.DOM_divs.length-1));  
395 - </script>';  
396 -  
397 - return;  
398 - }  
399 -  
400 - $this->pdf->CloseFile();  
401 - $this->get_link = $this->pdf->GetLink();  
402 - }  
403 - else  
404 - {  
405 - // Carga horária não globalizada gera uma página por disciplina  
406 - $obj_turma_disc = new clsPmieducarDisciplinaSerie();  
407 - $obj_turma_disc->setCamposLista("ref_cod_disciplina");  
408 - $lst_turma_disc = $obj_turma_disc->lista(null,$this->ref_cod_serie,1);  
409 -  
410 - if ($lst_turma_disc) {  
411 - $this->indefinido = FALSE;  
412 -  
413 - $this->pdf = new clsPDF('Diário de Classe - ' . $this->ano,  
414 - sprintf('Diário de Classe - %s até %s de %d', $this->data_ini, $this->data_fim, $this->ano),  
415 - 'A4', '', FALSE, FALSE  
416 - );  
417 -  
418 - foreach ($lst_turma_disc as $disciplina) {  
419 - $obj_disc = new clsPmieducarDisciplina($disciplina);  
420 - $det_disc = $obj_disc->detalhe();  
421 - $this->nm_disciplina = $det_disc['nm_disciplina'];  
422 - $this->page_y = 125;  
423 -  
424 - $db = new clsBanco();  
425 -  
426 - $consulta = sprintf('SELECT padrao_ano_escolar FROM pmieducar.curso WHERE cod_curso = %d',  
427 - $this->ref_cod_curso);  
428 -  
429 - $padrao_ano_escolar = $db->CampoUnico($consulta);  
430 -  
431 - $total_semanas = 0;  
432 -  
433 - if ($padrao_ano_escolar) {  
434 - $meses = $db->CampoUnico(sprintf("  
435 - SELECT  
436 - to_char(data_inicio,'dd/mm') || '-' || to_char(data_fim,'dd/mm')  
437 - FROM  
438 - pmieducar.ano_letivo_modulo,  
439 - pmieducar.modulo  
440 - WHERE  
441 - modulo.cod_modulo = ano_letivo_modulo.ref_cod_modulo  
442 - AND modulo.ativo = 1  
443 - AND ano_letivo_modulo.ref_cod_modulo = %d  
444 - AND ano_letivo_modulo.sequencial = %d  
445 - AND ref_ano = %d  
446 - AND ref_ref_cod_escola = %d  
447 - ORDER BY  
448 - data_inicio,  
449 - data_fim ASC  
450 - ", $this->ref_cod_modulo, $this->sequencial, $this->ano, $this->ref_cod_escola));  
451 -  
452 - $data = explode('-', $meses);  
453 -  
454 - if (!$this->data_ini) {  
455 - $this->data_ini = $data[0];  
456 - }  
457 -  
458 - if (!$this->data_fim) {  
459 - $this->data_fim = $data[1];  
460 - }  
461 -  
462 - $data_ini = explode('/', $data[0]);  
463 - $data_fim = explode('/', $data[1]);  
464 -  
465 - $meses = array($data_ini[1], $data_fim[1]);  
466 - $dias = array($data_ini[0], $data_fim[0]);  
467 - }  
468 - else {  
469 - $meses = $db->CampoUnico( "  
470 - SELECT  
471 - to_char(data_inicio,'mm') || '-' || to_char(data_fim,'mm')  
472 - FROM  
473 - pmieducar.turma_modulo,  
474 - pmieducar.modulo  
475 - WHERE  
476 - modulo.cod_modulo = turma_modulo.ref_cod_modulo  
477 - AND ref_cod_turma = %d  
478 - AND turma_modulo.ref_cod_modulo = %d  
479 - AND turma_modulo.sequencial = %d  
480 - AND to_char(data_inicio,'yyyy') = %d  
481 - ORDER BY  
482 - data_inicio,  
483 - data_fim ASC  
484 - ", $this->ref_cod_turma, $this->ref_cod_modulo, $this->sequencial, $this->ano);  
485 -  
486 - $data = explode('-', $meses);  
487 -  
488 - if (!$this->data_ini) {  
489 - $this->data_ini = $data[0];  
490 - }  
491 -  
492 - if (!$this->data_fim) {  
493 - $this->data_fim = $data[1];  
494 - }  
495 -  
496 - $data_ini = explode('/', $data[0]);  
497 - $data_fim = explode('/', $data[1]);  
498 -  
499 - $meses = array($data_ini[1], $data_fim[1]);  
500 - $dias = array($data_ini[0], $data_fim[0]);  
501 - }  
502 -  
503 - $total_dias_semanas = 0;  
504 -  
505 - if ($lista_quadro_horarios) {  
506 - for ($mes_ = $meses[0]; $mes_ <= $meses[1]; $mes_++) {  
507 - $mes_final = FALSE;  
508 -  
509 - foreach ($lista_quadro_horarios as $dia_semana) {  
510 - if ($mes_ == $meses[0]) {  
511 - $dia = $dias[0];  
512 - }  
513 - elseif ($mes == $meses[1]) {  
514 - $dia = 1;  
515 - $mes_final = TRUE;  
516 - }  
517 - else {  
518 - $dia = 1;  
519 - }  
520 -  
521 - $total_dias_semanas += $this->getDiasSemanaMes($dia, $mes_,  
522 - $this->ano,$dia_semana,$mes_final);  
523 - }  
524 - }  
525 - }  
526 - else {  
527 - $total_dias_semanas = 30;  
528 - $this->indefinido = TRUE;  
529 - }  
530 -  
531 - $this->mes_inicial = (int) $meses[0];  
532 - $this->mes_final = (int) $meses[1];  
533 - $this->pdf->largura = 842.0;  
534 - $this->pdf->altura = 595.0;  
535 -  
536 - $this->total = $total_dias_semanas;  
537 -  
538 - if (!$this->total) {  
539 - break;  
540 - }  
541 -  
542 - if(!$this->em_branco) {  
543 - $obj_matricula_turma = new clsPmieducarMatriculaTurma();  
544 - $obj_matricula_turma->setOrderby('nome_ascii');  
545 -  
546 - $lista_matricula = $obj_matricula_turma->lista(NULL, $this->ref_cod_turma,  
547 - NULL, NULL, NULL, NULL, NULL, NULL, 1, $this->ref_cod_serie,  
548 - $this->ref_cod_curso, $this->ref_cod_escola, $this->ref_cod_instituicao,  
549 - NULL, NULL, array(1, 2, 3), NULL, NULL, $this->ano, NULL, TRUE, NULL,  
550 - NULL, TRUE  
551 - );  
552 - }  
553 -  
554 - if ($lista_matricula || $this->em_branco) {  
555 - $this->pdf->OpenPage();  
556 - $this->addCabecalho();  
557 -  
558 - if ($this->em_branco) {  
559 - $lista_matricula = array();  
560 - $this->numero_registros = $this->numero_registros? $this->numero_registros : 20;  
561 -  
562 - for ($i = 0 ; $i < $this->numero_registros; $i++) {  
563 - $lista_matricula[] = '';  
564 - }  
565 - }  
566 -  
567 - $num = 0;  
568 -  
569 - foreach ($lista_matricula as $matricula) {  
570 - $num++;  
571 -  
572 - if ($this->page_y > 500) {  
573 - $this->desenhaLinhasVertical();  
574 - $this->pdf->ClosePage();  
575 - $this->pdf->OpenPage();  
576 - $this->page_y = 125;  
577 - $this->addCabecalho();  
578 - }  
579 -  
580 - $this->pdf->quadrado_relativo(30, $this->page_y , 782, 19);  
581 -  
582 - $this->pdf->escreve_relativo($matricula['nome_aluno'], 33,  
583 - $this->page_y + 4, 160, 15, $fonte, 7, $corTexto, 'left');  
584 -  
585 - $this->pdf->escreve_relativo(sprintf('%02d', $num), 757,  
586 - $this->page_y + 4, 30, 30, $fonte, 7, $corTexto, 'left');  
587 -  
588 - $this->page_y += 19;  
589 - }  
590 -  
591 - $this->desenhaLinhasVertical();  
592 - $this->pdf->ClosePage();  
593 - }  
594 - else {  
595 - echo '  
596 - <script>  
597 - alert("Turma não possui matriculas");  
598 - window.parent.fechaExpansivel(\'div_dinamico_\'+(window.parent.DOM_divs.length-1));  
599 - </script>';  
600 -  
601 - return;  
602 - }  
603 - }  
604 - }  
605 -  
606 - if ($this->total) {  
607 - $this->pdf->CloseFile();  
608 - $this->get_link = $this->pdf->GetLink();  
609 - }  
610 - else {  
611 - $this->mensagem = "Não existem dias letivos cadastrados para esta turma";  
612 - }  
613 - }  
614 -  
615 - echo sprintf('  
616 - <script>  
617 - window.onload = function()  
618 - {  
619 - parent.EscondeDiv("LoadImprimir");  
620 - window.location="download.php?filename=%s"  
621 - }  
622 - </script>', $this->get_link);  
623 -  
624 - echo sprintf('  
625 - <html>  
626 - <center>  
627 - Se o download não iniciar automaticamente <br /><a target="blank" href="%s" style="font-size: 16px; color: #000000; text-decoration: underline;">clique aqui!</a><br><br>  
628 - <span style="font-size: 10px;">Para visualizar os arquivos PDF, é necessário instalar o Adobe Acrobat Reader.<br>  
629 - Clique na Imagem para Baixar o instalador<br><br>  
630 - <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>  
631 - </span>  
632 - </center>  
633 - </html>', $this->get_link);  
634 - }  
635 -  
636 - public function addCabecalho()  
637 - {  
638 - /**  
639 - * Variável global com objetos do CoreExt.  
640 - * @see includes/bootstrap.php  
641 - */  
642 - global $coreExt;  
643 -  
644 - // Namespace de configuração do template PDF  
645 - $config = $coreExt['Config']->app->template->pdf;  
646 -  
647 - // Variável que controla a altura atual das caixas  
648 - $altura = 30;  
649 - $fonte = 'arial';  
650 - $corTexto = '#000000';  
651 -  
652 - // Cabeçalho  
653 - $logo = $config->get($config->logo, 'imagens/brasao.gif');  
654 -  
655 - $this->pdf->quadrado_relativo(30, $altura, 782, 85);  
656 - $this->pdf->insertImageScaled('gif', $logo, 50, 95, 41);  
657 -  
658 - // Título principal  
659 - $titulo = $config->get($config->titulo, 'i-Educar');  
660 -  
661 - $this->pdf->escreve_relativo($titulo, 30, 30, 782, 80, $fonte, 18,  
662 - $corTexto, 'center');  
663 -  
664 - $this->pdf->escreve_relativo(date('d/m/Y'), 25, 30, 782, 80, $fonte, 10,  
665 - $corTexto, 'right');  
666 -  
667 - // Dados escola  
668 - $this->pdf->escreve_relativo('Instituição: ' . $this->nm_instituicao, 120, 52,  
669 - 300, 80, $fonte, 7, $corTexto, 'left');  
670 -  
671 - $this->pdf->escreve_relativo('Escola: ' . $this->nm_escola,132, 64, 300, 80,  
672 - $fonte, 7, $corTexto, 'left' );  
673 -  
674 - $dif = 0;  
675 - if ($this->nm_professor) {  
676 - $this->pdf->escreve_relativo('Prof. Regente: ' . $this->nm_professor,111,  
677 - 76, 300, 80, $fonte, 7, $corTexto, 'left');  
678 - }  
679 - else {  
680 - $dif = 12;  
681 - }  
682 -  
683 - $this->pdf->escreve_relativo('Série: ' . $this->nm_serie, 138, 88 - $dif, 300,  
684 - 80, $fonte, 7, $corTexto, 'left');  
685 -  
686 - $this->pdf->escreve_relativo('Turma: ' . $this->nm_turma, 134, 100 - $dif, 300,  
687 - 80, $fonte, 7, $corTexto, 'left');  
688 -  
689 - // Título  
690 - $nm_disciplina = '';  
691 - if ($this->nm_disciplina) {  
692 - $nm_disciplina = ' - ' . $this->nm_disciplina;  
693 - }  
694 -  
695 - $this->pdf->escreve_relativo('Diário de Frequência ' . $nm_disciplina, 30,  
696 - 75, 782, 80, $fonte, 12, $corTexto, 'center');  
697 -  
698 - $obj_modulo = new clsPmieducarModulo($this->ref_cod_modulo);  
699 - $det_modulo = $obj_modulo->detalhe();  
700 -  
701 - // Data  
702 - $this->pdf->escreve_relativo(sprintf("%s até %s de %d", $this->data_ini,  
703 - $this->data_fim, $this->ano), 45, 100, 782, 80, $fonte, 10, $corTexto, 'center');  
704 -  
705 - $this->pdf->linha_relativa(201, 125, 612, 0);  
706 - $this->page_y += 19;  
707 -  
708 - if ($this->indefinido) {  
709 - $this->pdf->escreve_relativo('Dias de aula: Indefinido', 680, 100, 535,  
710 - 80, $fonte, 10, $corTexto, 'left' );  
711 - }  
712 - else {  
713 - $this->pdf->escreve_relativo('Dias de aula: ' . $this->total, 715, 100,  
714 - 535, 80, $fonte, 10, $corTexto, 'left');  
715 - }  
716 - }  
717 -  
718 - function desenhaLinhasVertical()  
719 - {  
720 - $corTexto = '#000000';  
721 - $largura_anos = 550;  
722 -  
723 - if ($this->total >= 1) {  
724 - $incremental = floor($largura_anos / ($this->total + 1)) ;  
725 - }  
726 - else {  
727 - $incremental = 1;  
728 - }  
729 -  
730 - $reta_ano_x = 200 ;  
731 -  
732 - $resto = $largura_anos - ($incremental * $this->total);  
733 -  
734 - for ($linha = 0; $linha < $this->total + 1; $linha++) {  
735 - if (($resto > 0) || $linha == 0) {  
736 - $reta_ano_x++;  
737 - $resto--;  
738 - }  
739 -  
740 - $this->pdf->linha_relativa($reta_ano_x, 125, 0, $this->page_y - 125);  
741 -  
742 - $reta_ano_x += $incremental;  
743 - }  
744 -  
745 - $this->pdf->linha_relativa(812, 125, 0, $this->page_y - 125);  
746 -  
747 - $this->pdf->escreve_relativo('Nº:', 755, 128, 100, 80, $fonte, 7, $corTexto, 'left');  
748 -  
749 - $this->pdf->linha_relativa(775, 125, 0, $this->page_y - 125);  
750 -  
751 - $this->pdf->escreve_relativo('Faltas', 783, 128, 100, 80, $fonte, 7, $corTexto, 'left');  
752 -  
753 - $this->rodape();  
754 - $this->pdf->ClosePage();  
755 - $this->pdf->OpenPage();  
756 - $this->page_y = 125;  
757 - $this->addCabecalho();  
758 -  
759 - for ($ct = 125; $ct < 500; $ct += 19) {  
760 - $this->pdf->quadrado_relativo(30, $ct , 782, 19);  
761 - }  
762 -  
763 - $this->pdf->escreve_relativo('Observações', 30, 130, 782, 30, $fonte, 7,  
764 - $corTexto, 'center');  
765 -  
766 - $this->pdf->linha_relativa(418, 144, 0, 360);  
767 - }  
768 -  
769 - function rodape()  
770 - {  
771 - $corTexto = '#000000';  
772 - $fonte = 'arial';  
773 - $dataAtual = date('d/m/Y');  
774 -  
775 - $this->pdf->escreve_relativo('Data: ' . $dataAtual, 36, 795, 100, 50,  
776 - $fonte, 7, $corTexto, 'left');  
777 -  
778 - $this->pdf->escreve_relativo('Assinatura do Professor(a)', 695, 520, 100, 50,  
779 - $fonte, 7, $corTexto, 'left');  
780 -  
781 - $this->pdf->linha_relativa(660, 517, 130, 0);  
782 - }  
783 -  
784 - function Editar()  
785 - {  
786 - return FALSE;  
787 - }  
788 -  
789 - function Excluir()  
790 - {  
791 - return FALSE;  
792 - }  
793 -  
794 - function getNumeroDiasMes($dia, $mes, $ano, $mes_final = FALSE)  
795 - {  
796 - $year = $ano;  
797 - $month = $mes;  
798 -  
799 - $date = mktime(1, 1, 1, $month, $dia, $year);  
800 -  
801 - $first_day_of_month = strtotime('-' . (date('d', $date) - 1) . ' days', $date);  
802 - $last_day_of_month = strtotime('+' . (date('t', $first_day_of_month) - 1) . ' days', $first_day_of_month);  
803 -  
804 - $last_day_of_month = date('d', $last_day_of_month);  
805 -  
806 - $numero_dias = 0;  
807 -  
808 - // Verifica se é dia não-letivo  
809 - $obj_calendario = new clsPmieducarCalendarioAnoLetivo();  
810 - $obj_calendario->setCamposLista('cod_calendario_ano_letivo');  
811 - $lista = $obj_calendario->lista(NULL,$this->ref_cod_escola, NULL, NULL,  
812 - $this->ano, NULL, NULL, NULL, NULL, 1);  
813 -  
814 - if ($lista) {  
815 - $lista_calendario = array_shift($lista);  
816 - }  
817 -  
818 - $obj_dia = new clsPmieducarCalendarioDia();  
819 - $obj_dia->setCamposLista('dia');  
820 - $dias_nao_letivo = $obj_dia->lista($lista_calendario, $mes, NULL, NULL, NULL,  
821 - NULL, NULL, NULL, NULL, NULL, NULL, NULL, 1, 'n');  
822 -  
823 - if (!$dias_nao_letivo) {  
824 - $dias_nao_letivo = array();  
825 - }  
826 -  
827 - if ($mes_final) {  
828 - $last_day_of_month = $dia;  
829 - $dia = 1;  
830 - }  
831 -  
832 - for ($day = $dia; $day <= $last_day_of_month; $day++) {  
833 - $date = mktime(1, 1, 1, $month, $day, $year);  
834 - $dia_semana_corrente = getdate($date);  
835 - $dia_semana_corrente = $dia_semana_corrente['wday'] + 1;  
836 -  
837 - if (($dia_semana_corrente != 1 && $dia_semana_corrente != 7) &&  
838 - (array_search($day, $dias_nao_letivo) === FALSE)  
839 - ) {  
840 - $numero_dias++;  
841 - }  
842 - }  
843 -  
844 - return $numero_dias;  
845 - }  
846 -  
847 - function getDiasSemanaMes($dia, $mes, $ano, $dia_semana, $mes_final = FALSE)  
848 - {  
849 - $year = $ano;  
850 - $month = $mes;  
851 -  
852 - $date = mktime(1, 1, 1, $month, $dia, $year);  
853 -  
854 - $first_day_of_month = strtotime('-' . (date('d', $date)-1) . ' days', $date);  
855 - $last_day_of_month = strtotime('+' . (date('t', $first_day_of_month) - 1) . ' days', $first_day_of_month);  
856 -  
857 - $last_day_of_month = date('d', $last_day_of_month);  
858 -  
859 - $numero_dias = 0;  
860 -  
861 - // Verifica se é dia não-letivo  
862 - $obj_calendario = new clsPmieducarCalendarioAnoLetivo();  
863 - $obj_calendario->setCamposLista('cod_calendario_ano_letivo');  
864 - $lista_calendario = $obj_calendario->lista(NULL, $this->ref_cod_escola, NULL,  
865 - NULL,$this->ano, NULL, NULL, NULL, NULL, 1);  
866 -  
867 - if(is_array($lista_calendario)) {  
868 - $lista_calendario = array_shift($lista_calendario);  
869 - }  
870 -  
871 - $obj_dia = new clsPmieducarCalendarioDia();  
872 - $obj_dia->setCamposLista('dia');  
873 -  
874 - $dias_nao_letivo = $obj_dia->lista($lista_calendario, $mes, NULL, NULL, NULL,  
875 - NULL, NULL, NULL, NULL, NULL, NULL, NULL, 1, 'n');  
876 -  
877 - if (!$dias_nao_letivo) {  
878 - $dias_nao_letivo = array();  
879 - }  
880 -  
881 - if ($mes_final) {  
882 - $last_day_of_month = $dia;  
883 - $dia = 1;  
884 - }  
885 -  
886 - for($day = $dia; $day <= $last_day_of_month; $day++) {  
887 - $date = mktime(1, 1, 1, $month, $day, $year);  
888 - $dia_semana_corrente = getdate($date);  
889 - $dia_semana_corrente = $dia_semana_corrente['wday'] + 1;  
890 -  
891 - $data_atual = sprintf('%d/%d/%d', $day, $mes, $ano);  
892 - $data_final = sprintf('%s/%d', $this->data_fim);  
893 -  
894 - if (($dia_semana == $dia_semana_corrente) &&  
895 - (array_search($day, $dias_nao_letivo) === FALSE) &&  
896 - data_maior($data_final, $data_atual)  
897 - ) {  
898 - $numero_dias++;  
899 - }  
900 - }  
901 -  
902 - return $numero_dias;  
903 - }  
904 -}  
905 -  
906 -  
907 -// Instancia objeto de página  
908 -$pagina = new clsIndexBase();  
909 -  
910 -// Instancia objeto de conteúdo  
911 -$miolo = new indice();  
912 -  
913 -// Atribui o conteúdo à página  
914 -$pagina->addForm($miolo);  
915 -  
916 -// Gera o código HTML  
917 -$pagina->MakeAll();  
918 \ No newline at end of file 0 \ No newline at end of file
ieducar/intranet/include/clsCampos.inc.php
@@ -1824,7 +1824,7 @@ class clsCampos extends Core_Controller_Page_Abstract @@ -1824,7 +1824,7 @@ class clsCampos extends Core_Controller_Page_Abstract
1824 $onClick = "onclick=\"{$componente[5]}\""; 1824 $onClick = "onclick=\"{$componente[5]}\"";
1825 } 1825 }
1826 1826
1827 - $retorno .= "<input valor=\"{$componente[3]}\" type='checkbox' name=\"{$nome}\" id=\"{$nome}\" {$onClick}"; 1827 + $retorno .= "<input value=\"{$componente[3]}\" type='checkbox' name=\"{$nome}\" id=\"{$nome}\" {$onClick}";
1828 1828
1829 if ($componente[3]) { 1829 if ($componente[3]) {
1830 $retorno .= ' checked'; 1830 $retorno .= ' checked';
ieducar/misc/database/deltas/20_remove_permissao_e_menu_diario_avaliacao_temp.sql 0 → 100644
@@ -0,0 +1,22 @@ @@ -0,0 +1,22 @@
  1 +-- //
  2 +
  3 +--
  4 +-- @author Eriksen Costa Paixão <eriksen.paixao_bs@cobra.com.br>
  5 +-- @license @@license@@
  6 +-- @version $Id$
  7 +--
  8 +
  9 +DELETE FROM portal.menu_funcionario WHERE ref_cod_menu_submenu = 927;
  10 +DELETE FROM pmieducar.menu_tipo_usuario WHERE ref_cod_menu_submenu = 927;
  11 +DELETE FROM pmicontrolesis.menu WHERE ref_cod_menu_submenu = 927;
  12 +DELETE FROM portal.menu_submenu WHERE cod_menu_submenu = 927;
  13 +
  14 +-- //@UNDO
  15 +
  16 +INSERT INTO menu_submenu VALUES (927, 55, 2, 'Diário de Frequência Temporário', 'educar_relatorio_diario_classe_temp.php', '', 3);
  17 +INSERT INTO pmicontrolesis.menu VALUES (nextval('menu_cod_menu_seq'::regclass), 927, 21127, 'Diário de Frequência Temp.', 5, 'educar_relatorio_diario_classe_temp.php', '_self', 1, 15, 1);
  18 +INSERT INTO menu_tipo_usuario VALUES (1, 927, 1, 1, 1);
  19 +INSERT INTO menu_tipo_usuario VALUES (2, 927, 1, 1, 1);
  20 +INSERT INTO menu_funcionario VALUES (1, 1, 1, 927);
  21 +
  22 +-- //
0 \ No newline at end of file 23 \ No newline at end of file
ieducar/misc/database/ieducar.sql
@@ -17906,7 +17906,6 @@ INSERT INTO menu VALUES (21150, NULL, 21122, &#39;Série&#39;, 4, NULL, &#39;_self&#39;, 1, 15, 3 @@ -17906,7 +17906,6 @@ INSERT INTO menu VALUES (21150, NULL, 21122, &#39;Série&#39;, 4, NULL, &#39;_self&#39;, 1, 15, 3
17906 INSERT INTO menu VALUES (21151, 633, 21123, 'Motivo de Afastamento', 4, 'educar_motivo_afastamento_lst.php', '_self', 1, 15, 1); 17906 INSERT INTO menu VALUES (21151, 633, 21123, 'Motivo de Afastamento', 4, 'educar_motivo_afastamento_lst.php', '_self', 1, 15, 1);
17907 INSERT INTO menu VALUES (21152, 642, 21124, 'Faltas/Notas', 4, 'educar_falta_nota_aluno_lst.php', '_self', 1, 15, 1); 17907 INSERT INTO menu VALUES (21152, 642, 21124, 'Faltas/Notas', 4, 'educar_falta_nota_aluno_lst.php', '_self', 1, 15, 1);
17908 INSERT INTO menu VALUES (21153, 634, 21123, 'Função', 5, 'educar_funcao_lst.php', '_self', 1, 15, 1); 17908 INSERT INTO menu VALUES (21153, 634, 21123, 'Função', 5, 'educar_funcao_lst.php', '_self', 1, 15, 1);
17909 -INSERT INTO menu VALUES (21155, 927, 21127, 'Diário de Frequência Temp.', 5, 'educar_relatorio_diario_classe_temp.php', '_self', 1, 15, 1);  
17910 INSERT INTO menu VALUES (21156, 829, 21123, 'Categoria Níveis', 5, 'educar_categoria_nivel_lst.php', '_self', 1, 15, 20); 17909 INSERT INTO menu VALUES (21156, 829, 21123, 'Categoria Níveis', 5, 'educar_categoria_nivel_lst.php', '_self', 1, 15, 20);
17911 INSERT INTO menu VALUES (21157, 587, 21122, 'Sequência de Enturmação', 5, 'educar_sequencia_serie_lst.php', '_self', 1, 15, 145); 17910 INSERT INTO menu VALUES (21157, 587, 21122, 'Sequência de Enturmação', 5, 'educar_sequencia_serie_lst.php', '_self', 1, 15, 145);
17912 INSERT INTO menu VALUES (21158, NULL, 21123, 'Relatórios Servidores', 6, NULL, '_self', 1, 15, 176); 17911 INSERT INTO menu VALUES (21158, NULL, 21123, 'Relatórios Servidores', 6, NULL, '_self', 1, 15, 176);
@@ -18769,7 +18768,6 @@ INSERT INTO menu_tipo_usuario VALUES (2, 786, 1, 1, 1); @@ -18769,7 +18768,6 @@ INSERT INTO menu_tipo_usuario VALUES (2, 786, 1, 1, 1);
18769 INSERT INTO menu_tipo_usuario VALUES (2, 944, 1, 1, 1); 18768 INSERT INTO menu_tipo_usuario VALUES (2, 944, 1, 1, 1);
18770 INSERT INTO menu_tipo_usuario VALUES (2, 664, 1, 1, 1); 18769 INSERT INTO menu_tipo_usuario VALUES (2, 664, 1, 1, 1);
18771 INSERT INTO menu_tipo_usuario VALUES (2, 670, 1, 1, 1); 18770 INSERT INTO menu_tipo_usuario VALUES (2, 670, 1, 1, 1);
18772 -INSERT INTO menu_tipo_usuario VALUES (2, 927, 1, 1, 1);  
18773 INSERT INTO menu_tipo_usuario VALUES (2, 711, 1, 1, 1); 18771 INSERT INTO menu_tipo_usuario VALUES (2, 711, 1, 1, 1);
18774 INSERT INTO menu_tipo_usuario VALUES (2, 659, 1, 1, 1); 18772 INSERT INTO menu_tipo_usuario VALUES (2, 659, 1, 1, 1);
18775 INSERT INTO menu_tipo_usuario VALUES (2, 561, 1, 1, 1); 18773 INSERT INTO menu_tipo_usuario VALUES (2, 561, 1, 1, 1);
@@ -18870,7 +18868,6 @@ INSERT INTO menu_tipo_usuario VALUES (1, 786, 1, 1, 1); @@ -18870,7 +18868,6 @@ INSERT INTO menu_tipo_usuario VALUES (1, 786, 1, 1, 1);
18870 INSERT INTO menu_tipo_usuario VALUES (1, 944, 1, 1, 1); 18868 INSERT INTO menu_tipo_usuario VALUES (1, 944, 1, 1, 1);
18871 INSERT INTO menu_tipo_usuario VALUES (1, 664, 1, 1, 1); 18869 INSERT INTO menu_tipo_usuario VALUES (1, 664, 1, 1, 1);
18872 INSERT INTO menu_tipo_usuario VALUES (1, 670, 1, 1, 1); 18870 INSERT INTO menu_tipo_usuario VALUES (1, 670, 1, 1, 1);
18873 -INSERT INTO menu_tipo_usuario VALUES (1, 927, 1, 1, 1);  
18874 INSERT INTO menu_tipo_usuario VALUES (1, 711, 1, 1, 1); 18871 INSERT INTO menu_tipo_usuario VALUES (1, 711, 1, 1, 1);
18875 INSERT INTO menu_tipo_usuario VALUES (1, 659, 1, 1, 1); 18872 INSERT INTO menu_tipo_usuario VALUES (1, 659, 1, 1, 1);
18876 INSERT INTO menu_tipo_usuario VALUES (1, 561, 1, 1, 1); 18873 INSERT INTO menu_tipo_usuario VALUES (1, 561, 1, 1, 1);
@@ -19690,7 +19687,6 @@ INSERT INTO menu_funcionario VALUES (1, 1, 1, 786); @@ -19690,7 +19687,6 @@ INSERT INTO menu_funcionario VALUES (1, 1, 1, 786);
19690 INSERT INTO menu_funcionario VALUES (1, 1, 1, 944); 19687 INSERT INTO menu_funcionario VALUES (1, 1, 1, 944);
19691 INSERT INTO menu_funcionario VALUES (1, 1, 1, 664); 19688 INSERT INTO menu_funcionario VALUES (1, 1, 1, 664);
19692 INSERT INTO menu_funcionario VALUES (1, 1, 1, 670); 19689 INSERT INTO menu_funcionario VALUES (1, 1, 1, 670);
19693 -INSERT INTO menu_funcionario VALUES (1, 1, 1, 927);  
19694 INSERT INTO menu_funcionario VALUES (1, 1, 1, 711); 19690 INSERT INTO menu_funcionario VALUES (1, 1, 1, 711);
19695 INSERT INTO menu_funcionario VALUES (1, 1, 1, 659); 19691 INSERT INTO menu_funcionario VALUES (1, 1, 1, 659);
19696 INSERT INTO menu_funcionario VALUES (1, 1, 1, 561); 19692 INSERT INTO menu_funcionario VALUES (1, 1, 1, 561);
@@ -19954,7 +19950,6 @@ INSERT INTO menu_submenu VALUES (918, 55, 2, &#39;Ata Resultado Final&#39;, &#39;educar_rela @@ -19954,7 +19950,6 @@ INSERT INTO menu_submenu VALUES (918, 55, 2, &#39;Ata Resultado Final&#39;, &#39;educar_rela
19954 INSERT INTO menu_submenu VALUES (911, 55, 2, 'Ficha de Rematrícula', 'educar_relatorio_ficha_rematricula.php', '', 3); 19950 INSERT INTO menu_submenu VALUES (911, 55, 2, 'Ficha de Rematrícula', 'educar_relatorio_ficha_rematricula.php', '', 3);
19955 INSERT INTO menu_submenu VALUES (916, 55, 2, 'Registro de Transferências Expedidas', 'educar_relatorio_registro_transferencias.php', '', 3); 19951 INSERT INTO menu_submenu VALUES (916, 55, 2, 'Registro de Transferências Expedidas', 'educar_relatorio_registro_transferencias.php', '', 3);
19956 INSERT INTO menu_submenu VALUES (900, 55, 2, 'Relação de Alunos ANEEs Quantidade', 'educar_relatorio_relacao_qtd_aluno_pnee_escola.php', '', 3); 19952 INSERT INTO menu_submenu VALUES (900, 55, 2, 'Relação de Alunos ANEEs Quantidade', 'educar_relatorio_relacao_qtd_aluno_pnee_escola.php', '', 3);
19957 -INSERT INTO menu_submenu VALUES (927, 55, 2, 'Diário de Frequência Temporário', 'educar_relatorio_diario_classe_temp.php', '', 3);  
19958 INSERT INTO menu_submenu VALUES (933, 55, 2, 'Levantamento Turma Período', 'educar_relatorio_levantamento_turma_periodo_aluno.php', '', 3); 19953 INSERT INTO menu_submenu VALUES (933, 55, 2, 'Levantamento Turma Período', 'educar_relatorio_levantamento_turma_periodo_aluno.php', '', 3);
19959 INSERT INTO menu_submenu VALUES (555, 56, 2, 'Usuário', 'educar_usuario_lst.php', '', 3); 19954 INSERT INTO menu_submenu VALUES (555, 56, 2, 'Usuário', 'educar_usuario_lst.php', '', 3);
19960 INSERT INTO menu_submenu VALUES (554, 56, 2, 'Tipo Usuário', 'educar_tipo_usuario_lst.php', '', 3); 19955 INSERT INTO menu_submenu VALUES (554, 56, 2, 'Tipo Usuário', 'educar_tipo_usuario_lst.php', '', 3);
@@ -20098,6 +20093,7 @@ INSERT INTO changelog VALUES (16, &#39;Main&#39;, &#39;NOW()&#39;, &#39;NOW()&#39;, &#39;dbdeploy&#39;, &#39;16_perm @@ -20098,6 +20093,7 @@ INSERT INTO changelog VALUES (16, &#39;Main&#39;, &#39;NOW()&#39;, &#39;NOW()&#39;, &#39;dbdeploy&#39;, &#39;16_perm
20098 INSERT INTO changelog VALUES (17, 'Main', 'NOW()', 'NOW()', 'dbdeploy', '17_adiciona_campo_curso_componente_ano_escolar_e_atualiza_constraint_servidor_disciplina.sql'); 20093 INSERT INTO changelog VALUES (17, 'Main', 'NOW()', 'NOW()', 'dbdeploy', '17_adiciona_campo_curso_componente_ano_escolar_e_atualiza_constraint_servidor_disciplina.sql');
20099 INSERT INTO changelog VALUES (18, 'Main', 'NOW()', 'NOW()', 'dbdeploy', '18_cria_tabelas_de_parecer_descritivo.sql'); 20094 INSERT INTO changelog VALUES (18, 'Main', 'NOW()', 'NOW()', 'dbdeploy', '18_cria_tabelas_de_parecer_descritivo.sql');
20100 INSERT INTO changelog VALUES (19, 'Main', 'NOW()', 'NOW()', 'dbdeploy', '19_atualiza_nome_de_relatorio_no_menu_e_permissoes.sql'); 20095 INSERT INTO changelog VALUES (19, 'Main', 'NOW()', 'NOW()', 'dbdeploy', '19_atualiza_nome_de_relatorio_no_menu_e_permissoes.sql');
  20096 +INSERT INTO changelog VALUES (20, 'Main', 'NOW()', 'NOW()', 'dbdeploy', '20_remove_permissao_e_menu_diario_avaliacao_temp.sql');
20101 20097
20102 20098
20103 -- 20099 --