Commit 31d9dae4db383dabc691bcaf18edba06390db24f
Committed by
Caroline Salib
1 parent
458cfaf8
Exists in
master
and in
1 other branch
Corrigido bug ao carregar turmas na rematricula automática;
portabilis/ieducar#154
Showing
5 changed files
with
11 additions
and
6 deletions
Show diff stats
ieducar/intranet/educar_avancar_mod_cad.php
@@ -79,6 +79,7 @@ class indice extends clsCadastro | @@ -79,6 +79,7 @@ class indice extends clsCadastro | ||
79 | $this->inputsHelper()->dynamic('turma', array('label' => 'Selecione a turma do ano anterior')); | 79 | $this->inputsHelper()->dynamic('turma', array('label' => 'Selecione a turma do ano anterior')); |
80 | $this->inputsHelper()->dynamic('anoLetivo', array('label' => 'Ano destino'), $anoLetivoHelperOptions); | 80 | $this->inputsHelper()->dynamic('anoLetivo', array('label' => 'Ano destino'), $anoLetivoHelperOptions); |
81 | $this->inputsHelper()->date('data_matricula', array('label' => 'Data da matrícula', 'placeholder' => 'dd/mm/yyyy')); | 81 | $this->inputsHelper()->date('data_matricula', array('label' => 'Data da matrícula', 'placeholder' => 'dd/mm/yyyy')); |
82 | + $this->inputsHelper()->hidden('nao_filtrar_ano', array('value' => '1')); | ||
82 | } | 83 | } |
83 | 84 | ||
84 | /** | 85 | /** |
@@ -138,8 +139,8 @@ class indice extends clsCadastro | @@ -138,8 +139,8 @@ class indice extends clsCadastro | ||
138 | $mensagem .= "</br> As enturmações podem ser realizadas em: Movimentação > Enturmação.</span>"; | 139 | $mensagem .= "</br> As enturmações podem ser realizadas em: Movimentação > Enturmação.</span>"; |
139 | $this->mensagem = $mensagem; | 140 | $this->mensagem = $mensagem; |
140 | }else{ | 141 | }else{ |
141 | - $this->mensagem = "<span class='notice'>Nenhum aluno rematriculado. Certifique-se que a turma possui alunos aprovados ou reprovados não matriculados em $ano.</span>"; | ||
142 | - } | 142 | + $this->mensagem = "<span class='notice'>Nenhum aluno rematriculado. Certifique-se que a turma possui alunos aprovados ou reprovados não matriculados em ".($ano-1).".</span>"; |
143 | + } | ||
143 | }elseif(empty($this->mensagem)) | 144 | }elseif(empty($this->mensagem)) |
144 | $this->mensagem = "Ocorreu algum erro inesperado durante as rematrículas, por favor, tente novamente."; | 145 | $this->mensagem = "Ocorreu algum erro inesperado durante as rematrículas, por favor, tente novamente."; |
145 | 146 |
ieducar/lib/App/Model/IedFinder.php
@@ -237,7 +237,7 @@ class App_Model_IedFinder extends CoreExt_Entity | @@ -237,7 +237,7 @@ class App_Model_IedFinder extends CoreExt_Entity | ||
237 | 237 | ||
238 | $ret = array(); | 238 | $ret = array(); |
239 | foreach ($turmas as $turma) { | 239 | foreach ($turmas as $turma) { |
240 | - $ret[$turma['cod_turma']] = $turma['nm_turma']; | 240 | + $ret[$turma['cod_turma']] = $turma['nm_turma'].' - '.($turma['ano'] == null ? 'Sem ano' : $turma['ano'] ); |
241 | } | 241 | } |
242 | 242 | ||
243 | return $ret; | 243 | return $ret; |
ieducar/lib/Portabilis/View/Helper/DynamicInput/Turma.php
@@ -54,6 +54,7 @@ class Portabilis_View_Helper_DynamicInput_Turma extends Portabilis_View_Helper_D | @@ -54,6 +54,7 @@ class Portabilis_View_Helper_DynamicInput_Turma extends Portabilis_View_Helper_D | ||
54 | $escolaId = $this->getEscolaId($options['escolaId']); | 54 | $escolaId = $this->getEscolaId($options['escolaId']); |
55 | $serieId = $this->getSerieId($options['serieId']); | 55 | $serieId = $this->getSerieId($options['serieId']); |
56 | $ano = $this->viewInstance->ano; | 56 | $ano = $this->viewInstance->ano; |
57 | + $naoFiltrarAno = $this->viewInstance->nao_filtrar_ano; | ||
57 | 58 | ||
58 | $userId = $this->getCurrentUserId(); | 59 | $userId = $this->getCurrentUserId(); |
59 | $isProfessor = Portabilis_Business_Professor::isProfessor($instituicaoId, $userId); | 60 | $isProfessor = Portabilis_Business_Professor::isProfessor($instituicaoId, $userId); |
@@ -69,7 +70,7 @@ class Portabilis_View_Helper_DynamicInput_Turma extends Portabilis_View_Helper_D | @@ -69,7 +70,7 @@ class Portabilis_View_Helper_DynamicInput_Turma extends Portabilis_View_Helper_D | ||
69 | // caso no letivo esteja definido para filtrar turmas por ano, | 70 | // caso no letivo esteja definido para filtrar turmas por ano, |
70 | // somente exibe as turmas do ano letivo. | 71 | // somente exibe as turmas do ano letivo. |
71 | 72 | ||
72 | - if ($escolaId && $ano && $this->turmasPorAno($escolaId, $ano)) { | 73 | + if ($escolaId && $ano && !$naoFiltrarAno && $this->turmasPorAno($escolaId, $ano)) { |
73 | foreach ($resources as $id => $nome) { | 74 | foreach ($resources as $id => $nome) { |
74 | $turma = new clsPmieducarTurma(); | 75 | $turma = new clsPmieducarTurma(); |
75 | $turma->cod_turma = $id; | 76 | $turma->cod_turma = $id; |
ieducar/modules/DynamicInput/Assets/Javascripts/Turma.js
@@ -9,6 +9,8 @@ | @@ -9,6 +9,8 @@ | ||
9 | var $turmaField = getElementFor('turma'); | 9 | var $turmaField = getElementFor('turma'); |
10 | var $ano = getElementFor('ano'); | 10 | var $ano = getElementFor('ano'); |
11 | 11 | ||
12 | + var $naoFiltrarAno = getElementFor('nao_filtrar_ano') || null; | ||
13 | + | ||
12 | var handleGetTurmas = function(response) { | 14 | var handleGetTurmas = function(response) { |
13 | var selectOptions = jsonResourcesToSelectOptions(response['options']); | 15 | var selectOptions = jsonResourcesToSelectOptions(response['options']); |
14 | updateSelect($turmaField, selectOptions, "Selecione uma turma"); | 16 | updateSelect($turmaField, selectOptions, "Selecione uma turma"); |
@@ -24,7 +26,8 @@ | @@ -24,7 +26,8 @@ | ||
24 | instituicao_id : $instituicaoField.val(), | 26 | instituicao_id : $instituicaoField.val(), |
25 | escola_id : $escolaField.val(), | 27 | escola_id : $escolaField.val(), |
26 | serie_id : $serieField.val(), | 28 | serie_id : $serieField.val(), |
27 | - ano : $ano.val() | 29 | + ano : $naoFiltrarAno ? null : $ano.val(), |
30 | + nao_filtrar_ano : $naoFiltrarAno ? 1 : null | ||
28 | }); | 31 | }); |
29 | 32 | ||
30 | var options = { | 33 | var options = { |