Commit 937786e865f3783b0a1cdbc3d698ba5fd50fbe67
Exists in
master
Merge branch 'devel-unb' of https://github.com/i-educar-unb/ieducar into devel-unb
Showing
3 changed files
with
42 additions
and
8 deletions
Show diff stats
ieducar/intranet/educar_matricula_cad.php
@@ -82,6 +82,7 @@ class indice extends clsCadastro | @@ -82,6 +82,7 @@ class indice extends clsCadastro | ||
82 | var $ref_cod_instituicao; | 82 | var $ref_cod_instituicao; |
83 | var $ref_cod_curso; | 83 | var $ref_cod_curso; |
84 | var $ref_cod_escola; | 84 | var $ref_cod_escola; |
85 | + var $ref_cod_turma; | ||
85 | 86 | ||
86 | var $matricula_transferencia; | 87 | var $matricula_transferencia; |
87 | var $semestre; | 88 | var $semestre; |
@@ -97,7 +98,7 @@ class indice extends clsCadastro | @@ -97,7 +98,7 @@ class indice extends clsCadastro | ||
97 | 98 | ||
98 | $this->cod_matricula = $_GET['cod_matricula']; | 99 | $this->cod_matricula = $_GET['cod_matricula']; |
99 | $this->ref_cod_aluno = $_GET['ref_cod_aluno']; | 100 | $this->ref_cod_aluno = $_GET['ref_cod_aluno']; |
100 | - | 101 | + |
101 | $obj_aluno = new clsPmieducarAluno($this->ref_cod_aluno); | 102 | $obj_aluno = new clsPmieducarAluno($this->ref_cod_aluno); |
102 | 103 | ||
103 | if (! $obj_aluno->existe()) { | 104 | if (! $obj_aluno->existe()) { |
@@ -158,8 +159,9 @@ class indice extends clsCadastro | @@ -158,8 +159,9 @@ class indice extends clsCadastro | ||
158 | $anoLetivoHelperOptions = array('situacoes' => array('em_andamento', 'nao_iniciado')); | 159 | $anoLetivoHelperOptions = array('situacoes' => array('em_andamento', 'nao_iniciado')); |
159 | 160 | ||
160 | $this->inputsHelper()->dynamic(array('instituicao', 'escola', 'curso', 'serie')); | 161 | $this->inputsHelper()->dynamic(array('instituicao', 'escola', 'curso', 'serie')); |
162 | + $this->inputsHelper()->dynamic('turma', array('required' => false, 'option value' => 'Enturmar depois')); | ||
161 | $this->inputsHelper()->dynamic('anoLetivo', array('label' => 'Ano destino'), $anoLetivoHelperOptions); | 163 | $this->inputsHelper()->dynamic('anoLetivo', array('label' => 'Ano destino'), $anoLetivoHelperOptions); |
162 | - | 164 | + |
163 | 165 | ||
164 | if (is_numeric($this->ref_cod_curso)) { | 166 | if (is_numeric($this->ref_cod_curso)) { |
165 | $obj_curso = new clsPmieducarCurso($this->ref_cod_curso); | 167 | $obj_curso = new clsPmieducarCurso($this->ref_cod_curso); |
@@ -257,7 +259,7 @@ class indice extends clsCadastro | @@ -257,7 +259,7 @@ class indice extends clsCadastro | ||
257 | if (is_array($serie) && count($serie)) | 259 | if (is_array($serie) && count($serie)) |
258 | $serie = $serie['nm_serie']; | 260 | $serie = $serie['nm_serie']; |
259 | else | 261 | else |
260 | - $serie = ''; | 262 | + $serie = ''; |
261 | 263 | ||
262 | $escola = new clsPmieducarEscola($m['ref_ref_cod_escola']); | 264 | $escola = new clsPmieducarEscola($m['ref_ref_cod_escola']); |
263 | $escola = $escola->detalhe(); | 265 | $escola = $escola->detalhe(); |
@@ -284,7 +286,7 @@ class indice extends clsCadastro | @@ -284,7 +286,7 @@ class indice extends clsCadastro | ||
284 | 286 | ||
285 | return false; | 287 | return false; |
286 | } | 288 | } |
287 | - } | 289 | + } |
288 | 290 | ||
289 | $obj_reserva_vaga = new clsPmieducarReservaVaga(); | 291 | $obj_reserva_vaga = new clsPmieducarReservaVaga(); |
290 | $lst_reserva_vaga = $obj_reserva_vaga->lista(NULL, $this->ref_cod_escola, | 292 | $lst_reserva_vaga = $obj_reserva_vaga->lista(NULL, $this->ref_cod_escola, |
@@ -385,7 +387,7 @@ class indice extends clsCadastro | @@ -385,7 +387,7 @@ class indice extends clsCadastro | ||
385 | if (! $this->removerFlagUltimaMatricula($this->ref_cod_aluno)) { | 387 | if (! $this->removerFlagUltimaMatricula($this->ref_cod_aluno)) { |
386 | return false; | 388 | return false; |
387 | } | 389 | } |
388 | - | 390 | + |
389 | $obj = new clsPmieducarMatricula(NULL, $this->ref_cod_reserva_vaga, | 391 | $obj = new clsPmieducarMatricula(NULL, $this->ref_cod_reserva_vaga, |
390 | $this->ref_cod_escola, $this->ref_cod_serie, NULL, | 392 | $this->ref_cod_escola, $this->ref_cod_serie, NULL, |
391 | $this->pessoa_logada, $this->ref_cod_aluno, 3, NULL, NULL, 1, $this->ano, | 393 | $this->pessoa_logada, $this->ref_cod_aluno, 3, NULL, NULL, 1, $this->ano, |
@@ -393,6 +395,11 @@ class indice extends clsCadastro | @@ -393,6 +395,11 @@ class indice extends clsCadastro | ||
393 | $this->matricula_transferencia, $this->semestre); | 395 | $this->matricula_transferencia, $this->semestre); |
394 | 396 | ||
395 | $cadastrou = $obj->cadastra(); | 397 | $cadastrou = $obj->cadastra(); |
398 | + | ||
399 | + // turma | ||
400 | + $cod_matricula = $cadastrou; | ||
401 | + $this->enturmacaoMatricula($cod_matricula, $this->ref_cod_turma); | ||
402 | + | ||
396 | if ($cadastrou) { | 403 | if ($cadastrou) { |
397 | 404 | ||
398 | $obj_transferencia = new clsPmieducarTransferenciaSolicitacao(); | 405 | $obj_transferencia = new clsPmieducarTransferenciaSolicitacao(); |
@@ -527,7 +534,7 @@ class indice extends clsCadastro | @@ -527,7 +534,7 @@ class indice extends clsCadastro | ||
527 | #die(); | 534 | #die(); |
528 | #return true; | 535 | #return true; |
529 | } | 536 | } |
530 | - | 537 | + |
531 | $this->mensagem = 'Cadastro não realizado.<br />'; | 538 | $this->mensagem = 'Cadastro não realizado.<br />'; |
532 | return FALSE; | 539 | return FALSE; |
533 | } | 540 | } |
@@ -652,6 +659,33 @@ class indice extends clsCadastro | @@ -652,6 +659,33 @@ class indice extends clsCadastro | ||
652 | 659 | ||
653 | return true; | 660 | return true; |
654 | } | 661 | } |
662 | + | ||
663 | + function enturmacaoMatricula($matriculaId, $turmaDestinoId) { | ||
664 | + | ||
665 | + $enturmacaoExists = new clsPmieducarMatriculaTurma(); | ||
666 | + $enturmacaoExists = $enturmacaoExists->lista($matriculaId, | ||
667 | + $turmaDestinoId, | ||
668 | + NULL, | ||
669 | + NULL, | ||
670 | + NULL, | ||
671 | + NULL, | ||
672 | + NULL, | ||
673 | + NULL, | ||
674 | + 1); | ||
675 | + | ||
676 | + $enturmacaoExists = is_array($enturmacaoExists) && count($enturmacaoExists) > 0; | ||
677 | + if (! $enturmacaoExists) { | ||
678 | + $enturmacao = new clsPmieducarMatriculaTurma($matriculaId, | ||
679 | + $turmaDestinoId, | ||
680 | + $this->pessoa_logada, | ||
681 | + $this->pessoa_logada, | ||
682 | + NULL, | ||
683 | + NULL, | ||
684 | + 1); | ||
685 | + return $enturmacao->cadastra(); | ||
686 | + } | ||
687 | + return false; | ||
688 | + } | ||
655 | } | 689 | } |
656 | 690 | ||
657 | // Instancia objeto de página | 691 | // Instancia objeto de página |
ieducar/lib/Portabilis/View/Helper/DynamicInput/Turma.php
@@ -80,7 +80,7 @@ class Portabilis_View_Helper_DynamicInput_Turma extends Portabilis_View_Helper_D | @@ -80,7 +80,7 @@ class Portabilis_View_Helper_DynamicInput_Turma extends Portabilis_View_Helper_D | ||
80 | } | 80 | } |
81 | } | 81 | } |
82 | 82 | ||
83 | - return $this->insertOption(null, "Selecione uma turma", $resources); | 83 | + return $this->insertOption(null, "Enturmar depois", $resources); |
84 | } | 84 | } |
85 | 85 | ||
86 | protected function turmasPorAno($escolaId, $ano) { | 86 | protected function turmasPorAno($escolaId, $ano) { |
ieducar/modules/DynamicInput/Assets/Javascripts/Turma.js
@@ -11,7 +11,7 @@ | @@ -11,7 +11,7 @@ | ||
11 | 11 | ||
12 | var handleGetTurmas = function(response) { | 12 | var handleGetTurmas = function(response) { |
13 | var selectOptions = jsonResourcesToSelectOptions(response['options']); | 13 | var selectOptions = jsonResourcesToSelectOptions(response['options']); |
14 | - updateSelect($turmaField, selectOptions, "Selecione uma turma"); | 14 | + updateSelect($turmaField, selectOptions, "Enturmar depois"); |
15 | } | 15 | } |
16 | 16 | ||
17 | var updateTurmas = function(){ | 17 | var updateTurmas = function(){ |