Commit 376e59e772df47b3574d55e7bc7e68870d9cf60c
1 parent
95c45768
Exists in
master
Corrigido configuração de anos escolares, para exibir corretamente nome das séri…
…es e do curso fixes #3
Showing
2 changed files
with
6 additions
and
3 deletions
Show diff stats
ieducar/modules/ComponenteCurricular/Views/AnoController.php
... | ... | @@ -112,10 +112,11 @@ class AnoController extends Core_Controller_Page_EditController |
112 | 112 | $series = App_Model_IedFinder::getSeries($this->getEntity()->instituicao); |
113 | 113 | $cursos = array(); |
114 | 114 | |
115 | - foreach ($series as $serie) { | |
115 | + foreach ($series as $id => $nome) { | |
116 | + $serie = App_Model_IedFinder::getSerie($id); | |
116 | 117 | $codCurso = $serie['ref_cod_curso']; |
117 | - $codSerie = $serie['cod_serie']; | |
118 | - $cursos[$codCurso][$codSerie] = $serie['nm_serie']; | |
118 | + | |
119 | + $cursos[$codCurso][$id] = $nome; | |
119 | 120 | } |
120 | 121 | |
121 | 122 | return $cursos; | ... | ... |
ieducar/tests/unit/App/Model/IedFinderTest.php
... | ... | @@ -199,6 +199,8 @@ class App_Model_IedFinderTest extends UnitBaseTest |
199 | 199 | |
200 | 200 | public function testGetSeries() |
201 | 201 | { |
202 | + // # FIXME corrigir teste uma vez que App_Model_IedFinder::getSeries não retorna | |
203 | + // mais um array de arrays (id => objeto), e sim (id => nome serie) | |
202 | 204 | $returnValue = array( |
203 | 205 | 1 => array('cod_serie' => 1, 'ref_ref_cod_instituicao' => 1, 'nm_serie' => 'Pré'), |
204 | 206 | 2 => array('cod_serie' => 2, 'ref_ref_cod_instituicao' => 2, 'nm_serie' => 'Pré') | ... | ... |