Changeset 724
- Timestamp:
- 07/24/10 19:27:41
- Arquivos:
-
- trunk/ieducar/intranet/educar_disciplina_xml.php (modified) (2 diffs)
- trunk/ieducar/intranet/educar_escola_serie_det.php (modified) (3 diffs)
- trunk/ieducar/intranet/educar_turma_cad.php (modified) (10 diffs)
- trunk/ieducar/intranet/educar_turma_det.php (modified) (2 diffs)
Legenda:
- Não modificado
- Adicionado
- Removido
- Modificado
- Copiado
- Movido
trunk/ieducar/intranet/educar_disciplina_xml.php
r626 r724 33 33 require_once 'include/clsBanco.inc.php'; 34 34 require_once 'include/funcoes.inc.php'; 35 require_once 'ComponenteCurricular/Model/AnoEscolarDataMapper.php';36 35 37 36 echo "<?xml version=\"1.0\" encoding=\"ISO-8859-15\"?>\n<query xmlns=\"sugestoes\">\n"; 38 37 38 $componentes = array(); 39 40 // Seleciona os componentes de um curso ou série 39 41 if (is_numeric($_GET['cur']) || is_numeric($_GET['ser'])) { 42 require_once 'ComponenteCurricular/Model/AnoEscolarDataMapper.php'; 40 43 $mapper = new ComponenteCurricular_Model_AnoEscolarDataMapper(); 41 44 … … 46 49 $componentes = $mapper->findComponentePorSerie($_GET['ser']); 47 50 } 51 } 48 52 49 foreach ($componentes as $componente) { 50 print sprintf(' <disciplina cod_disciplina="%d" carga_horaria="%d">%s</disciplina>%s', 51 $componente->id, $componente->cargaHoraria, $componente, PHP_EOL); 52 } 53 // Seleciona os componentes de uma escola-série 54 if (is_numeric($_GET['esc']) && is_numeric($_GET['ser'])) { 55 require_once 'App/Model/IedFinder.php'; 56 57 $componentes = App_Model_IedFinder::getEscolaSerieDisciplina($_GET['ser'], 58 $_GET['esc']); 53 59 } 60 61 foreach ($componentes as $componente) { 62 print sprintf(' <disciplina cod_disciplina="%d" carga_horaria="%d">%s</disciplina>%s', 63 $componente->id, $componente->cargaHoraria, $componente, PHP_EOL); 64 } 65 54 66 echo "</query>"; trunk/ieducar/intranet/educar_escola_serie_det.php
r628 r724 33 33 require_once 'include/clsBanco.inc.php'; 34 34 require_once 'include/pmieducar/geral.inc.php'; 35 require_once 'ComponenteCurricular/Model/AnoEscolarDataMapper.php'; 35 36 require_once 'App/Model/IedFinder.php'; 36 37 37 38 /** … … 161 162 } 162 163 163 $obj = new clsPmieducarEscolaSerieDisciplina(); 164 $escolaSerieDisciplinas = $obj->lista($this->ref_cod_serie, $this->ref_cod_escola, NULL, 1); 165 166 // Mapper de componente curricular 167 $componenteMapper = new ComponenteCurricular_Model_ComponenteDataMapper(); 168 169 if ($escolaSerieDisciplinas) { 164 // Componentes da escola-série 165 $componentes = App_Model_IedFinder::getEscolaSerieDisciplina($this->ref_cod_serie, $this->ref_cod_escola); 166 167 if (0 < count($componentes)) { 170 168 $tabela = ' 171 169 <table> 172 170 <tr align="center"> 173 171 <td bgcolor="#A1B3BD"><b>Nome</b></td> 172 <td bgcolor="#A1B3BD"><b>Carga horária</b></td> 174 173 </tr>'; 175 174 176 175 $cont = 0; 177 176 178 foreach ($ escolaSerieDisciplinas as $escolaSerieDisciplina) {177 foreach ($componentes as $componente) { 179 178 if (($cont % 2) == 0) { 180 179 $color = ' bgcolor="#E4E9ED" '; … … 184 183 } 185 184 186 $componente = $componenteMapper->find($escolaSerieDisciplina['ref_cod_disciplina']);187 188 185 $tabela .= sprintf(' 189 <tr> 190 <td %s align="left">%s</td> 191 </tr>', $color, $componente); 186 <tr> 187 <td %s align="left">%s</td> 188 <td %s align="center">%.0f h</td> 189 </tr>', 190 $color, $componente, $color, $componente->cargaHoraria 191 ); 192 192 193 193 $cont++; trunk/ieducar/intranet/educar_turma_cad.php
r723 r724 325 325 $this->campoHora( 'hora_fim_intervalo', 'Hora Fim Intervalo', $this->hora_fim_intervalo, FALSE); 326 326 327 $this->campoQuebra2(); 328 327 329 if ($this->ref_ref_cod_serie) { 328 330 require_once 'ComponenteCurricular/Model/ComponenteDataMapper.php'; … … 396 398 } 397 399 398 $this->campoQuebra2(); 399 400 $help = array(); 401 $componentes = App_Model_IedFinder::getEscolaSerieDisciplina($this->ref_ref_cod_serie, $this->ref_cod_escola); 400 $componentes = $help = array(); 401 402 try { 403 $componentes = App_Model_IedFinder::getEscolaSerieDisciplina( 404 $this->ref_ref_cod_serie, $this->ref_cod_escola 405 ); 406 } 407 catch (Exception $e) { 408 } 409 402 410 foreach ($componentes as $componente) { 403 411 $help[] = sprintf('%s (%.0f h)', $componente->nome, $componente->cargaHoraria); 404 412 } 405 $help = '<ul><li>' . implode('</li><li>', $help) . '</li></ul>'; 413 414 if (count($componentes)) { 415 $help = '<ul><li>' . implode('</li><li>', $help) . '</li></ul>'; 416 } 417 else { 418 $help = ''; 419 } 406 420 407 421 $label = 'Componentes curriculares:<br />' 408 422 . '<strong>Observação:</strong> caso não defina os componentes<br />' 409 423 . 'curriculares para a turma, esta usará a definição<br />' 410 . 'da série/ano escolar da escola' 411 . $help; 424 . 'da série/ano escolar da escola:' 425 . '<span id="_escola_serie_componentes">%s</span>'; 426 427 $label = sprintf($label, $help); 412 428 413 429 $this->campoRotulo('disciplinas_', $label, 414 430 "<div id='disciplinas'>$disciplinas</div>"); 431 432 $this->campoQuebra2(); 415 433 416 434 if ($_POST['turma_modulo']) { … … 519 537 ); 520 538 521 $this->campoQuebra(); 522 523 // Inclui dia da semana 524 $this->campoQuebra(); 539 $this->campoQuebra2(); 525 540 526 541 if ($_POST['turma_dia_semana']) { … … 611 626 "<a href='#' onclick=\"document.getElementById('incluir_dia_semana').value = 'S'; document.getElementById('tipoacao').value = ''; acao();\"><img src='imagens/nvp_bot_adiciona.gif' alt='adicionar' title='Incluir' border=0></a>" 612 627 ); 613 614 $this->campoQuebra();615 628 616 629 $this->campoOculto('padrao_ano_escolar', $this->padrao_ano_escolar); … … 1102 1115 } 1103 1116 1117 setVisibility('tr_hora_inicial', true); 1118 setVisibility('tr_hora_final', true); 1119 setVisibility('tr_hora_inicio_intervalo', true); 1120 setVisibility('tr_hora_fim_intervalo', true); 1121 1104 1122 if (document.getElementById('ref_cod_curso').value) { 1105 if (document.getElementById('padrao_ano_escolar').value == 1) { 1106 setVisibility('tr_hora_inicial', true); 1107 setVisibility('tr_hora_final', true); 1108 setVisibility('tr_hora_inicio_intervalo', true); 1109 setVisibility('tr_hora_fim_intervalo', true); 1110 } 1111 else if (document.getElementById('padrao_ano_escolar').value == 0) { 1123 if (document.getElementById('padrao_ano_escolar').value == 0) { 1112 1124 setVisibility('tr_ref_cod_modulo', true); 1113 1125 setVisibility('ref_cod_modulo', true); … … 1256 1268 { 1257 1269 if (this.value) { 1270 codEscola = document.getElementById('ref_cod_escola').value; 1271 1258 1272 getHoraEscolaSerie(); 1259 1273 getComponentesCurriculares(this.value); 1274 getComponentesEscolaSerie(codEscola, this.value); 1260 1275 } 1261 1276 … … 1271 1286 var xml_disciplina = new ajax(parseComponentesCurriculares); 1272 1287 xml_disciplina.envia("educar_disciplina_xml.php?ser=" + campoSerie); 1288 } 1289 1290 function getComponentesEscolaSerie(codEscola, codSerie) 1291 { 1292 var xml_disciplina = new ajax(parseComponentesCurricularesEscolaSerie); 1293 xml_disciplina.envia("educar_disciplina_xml.php?esc=" + codEscola + "&ser=" + codSerie); 1273 1294 } 1274 1295 … … 1310 1331 } 1311 1332 1333 function parseComponentesCurricularesEscolaSerie(xml) 1334 { 1335 var helpSpan = document.getElementById('_escola_serie_componentes'); 1336 var elements = xml.getElementsByTagName('disciplina'); 1337 1338 ret = ''; 1339 1340 if (elements.length) { 1341 ret = '<ul>'; 1342 1343 for (var i = 0; i < elements.length; i++) { 1344 carga = elements[i].getAttribute('carga_horaria'); 1345 name = elements[i].firstChild.data; 1346 1347 ret += '<li>' + name + ' (' + carga + ' h)</li>'; 1348 } 1349 1350 ret += '</ul>'; 1351 } 1352 1353 helpSpan.innerHTML = ret; 1354 } 1355 1312 1356 function hideMultiSerie() 1313 1357 { … … 1383 1427 } 1384 1428 1385 setVisibility('tr_hora_inicial', false);1386 setVisibility('tr_hora_final', false);1387 setVisibility('tr_hora_inicio_intervalo', false);1388 setVisibility('tr_hora_fim_intervalo', false);1389 1390 if (campoCurso == '') {1429 setVisibility('tr_hora_inicial', true); 1430 setVisibility('tr_hora_final', true); 1431 setVisibility('tr_hora_inicio_intervalo', true); 1432 setVisibility('tr_hora_fim_intervalo', true); 1433 1434 if (campoCurso == '') { 1391 1435 return; 1392 1436 } … … 1394 1438 var campoCurso = document.getElementById('ref_cod_curso').value; 1395 1439 1396 if (document.getElementById('padrao_ano_escolar').value == 1) { 1397 setVisibility('tr_hora_inicial', true); 1398 setVisibility('tr_hora_final', true); 1399 setVisibility('tr_hora_inicio_intervalo', true); 1400 setVisibility('tr_hora_fim_intervalo', true); 1401 } 1402 else if (document.getElementById('padrao_ano_escolar').value == 0) { 1440 if (document.getElementById('padrao_ano_escolar').value == 0) { 1403 1441 setVisibility('tr_ref_cod_modulo', true); 1404 1442 setVisibility('ref_cod_modulo', true); trunk/ieducar/intranet/educar_turma_det.php
r721 r724 396 396 <tr align="center"> 397 397 <td bgcolor="#A1B3BD"><b>Nome</b></td> 398 <td bgcolor="#A1B3BD"><b>Carga horária</b></td> 398 399 </tr>'; 399 400 … … 404 405 $tabela3 .= sprintf(' 405 406 <tr> 406 <td %s align=left>%s</td> 407 <td %s align="left">%s</td> 408 <td %s align="center">%.0f h</td> 407 409 </tr>', 408 $color, $componente 410 $color, $componente, $color, $componente->cargaHoraria 409 411 ); 410 412 }
