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 | 79 | $this->inputsHelper()->dynamic('turma', array('label' => 'Selecione a turma do ano anterior')); |
80 | 80 | $this->inputsHelper()->dynamic('anoLetivo', array('label' => 'Ano destino'), $anoLetivoHelperOptions); |
81 | 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 | 139 | $mensagem .= "</br> As enturmações podem ser realizadas em: Movimentação > Enturmação.</span>"; |
139 | 140 | $this->mensagem = $mensagem; |
140 | 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 | 144 | }elseif(empty($this->mensagem)) |
144 | 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 | 237 | |
238 | 238 | $ret = array(); |
239 | 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 | 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 | 54 | $escolaId = $this->getEscolaId($options['escolaId']); |
55 | 55 | $serieId = $this->getSerieId($options['serieId']); |
56 | 56 | $ano = $this->viewInstance->ano; |
57 | + $naoFiltrarAno = $this->viewInstance->nao_filtrar_ano; | |
57 | 58 | |
58 | 59 | $userId = $this->getCurrentUserId(); |
59 | 60 | $isProfessor = Portabilis_Business_Professor::isProfessor($instituicaoId, $userId); |
... | ... | @@ -69,7 +70,7 @@ class Portabilis_View_Helper_DynamicInput_Turma extends Portabilis_View_Helper_D |
69 | 70 | // caso no letivo esteja definido para filtrar turmas por ano, |
70 | 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 | 74 | foreach ($resources as $id => $nome) { |
74 | 75 | $turma = new clsPmieducarTurma(); |
75 | 76 | $turma->cod_turma = $id; | ... | ... |
ieducar/modules/DynamicInput/Assets/Javascripts/Turma.js
... | ... | @@ -9,6 +9,8 @@ |
9 | 9 | var $turmaField = getElementFor('turma'); |
10 | 10 | var $ano = getElementFor('ano'); |
11 | 11 | |
12 | + var $naoFiltrarAno = getElementFor('nao_filtrar_ano') || null; | |
13 | + | |
12 | 14 | var handleGetTurmas = function(response) { |
13 | 15 | var selectOptions = jsonResourcesToSelectOptions(response['options']); |
14 | 16 | updateSelect($turmaField, selectOptions, "Selecione uma turma"); |
... | ... | @@ -24,7 +26,8 @@ |
24 | 26 | instituicao_id : $instituicaoField.val(), |
25 | 27 | escola_id : $escolaField.val(), |
26 | 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 | 33 | var options = { | ... | ... |