Commit 84ea703ebf63731149e22f2e94504eab09383126

Authored by Lucas Schmoeller da Silva
1 parent d94c15d8
Exists in master

Tratar exibição de mensagens na enturmação

Quando nenhum aluno estiver enturmado porém não existir alunos a serem enturmados será exibido a mensagem "Não há alunos enturmados.";

portabilis/ieducar#102
ieducar/intranet/educar_matriculas_turma_cad.php
@@ -199,6 +199,8 @@ class indice extends clsCadastro @@ -199,6 +199,8 @@ class indice extends clsCadastro
199 $this->matriculas_turma = unserialize(urldecode($_POST['matriculas_turma'])); 199 $this->matriculas_turma = unserialize(urldecode($_POST['matriculas_turma']));
200 } 200 }
201 201
  202 + $alunosEnturmados = false;
  203 +
202 if (is_numeric($this->ref_cod_turma) && !$_POST) { 204 if (is_numeric($this->ref_cod_turma) && !$_POST) {
203 $obj_matriculas_turma = new clsPmieducarMatriculaTurma(); 205 $obj_matriculas_turma = new clsPmieducarMatriculaTurma();
204 $obj_matriculas_turma->setOrderby('nome_aluno'); 206 $obj_matriculas_turma->setOrderby('nome_aluno');
@@ -207,6 +209,7 @@ class indice extends clsCadastro @@ -207,6 +209,7 @@ class indice extends clsCadastro
207 array(1, 2, 3), NULL, NULL, $ano_letivo, NULL, TRUE, NULL, 1, TRUE); 209 array(1, 2, 3), NULL, NULL, $ano_letivo, NULL, TRUE, NULL, 1, TRUE);
208 210
209 if (is_array($lst_matriculas_turma)) { 211 if (is_array($lst_matriculas_turma)) {
  212 + $alunosEnturmados = true;
210 foreach ($lst_matriculas_turma as $key => $campo) { 213 foreach ($lst_matriculas_turma as $key => $campo) {
211 $this->matriculas_turma[$campo['ref_cod_matricula']]['sequencial_'] = $campo['sequencial']; 214 $this->matriculas_turma[$campo['ref_cod_matricula']]['sequencial_'] = $campo['sequencial'];
212 } 215 }
@@ -266,8 +269,10 @@ class indice extends clsCadastro @@ -266,8 +269,10 @@ class indice extends clsCadastro
266 $aluno, NULL, NULL, NULL); 269 $aluno, NULL, NULL, NULL);
267 } 270 }
268 } 271 }
269 - else { 272 + else if($alunosEnturmados){
270 $this->campoRotulo('rotulo_1', '-', 'Todos os alunos matriculados na série já se encontram enturmados.'); 273 $this->campoRotulo('rotulo_1', '-', 'Todos os alunos matriculados na série já se encontram enturmados.');
  274 + }else {
  275 + $this->campoRotulo('rotulo_1', '-', 'Não há alunos enturmados.');
271 } 276 }
272 277
273 $this->campoQuebra(); 278 $this->campoQuebra();