Commit 6c193aea45efb23d93d8e8bc4298c34d0a48b56d
1 parent
3b10a31f
Exists in
2.8
and in
6 other branches
Limita seleção de cursos para usuários que são apenas professores
Showing
2 changed files
with
4 additions
and
4 deletions
Show diff stats
ieducar/lib/Portabilis/View/Helper/DynamicInput/Curso.php
... | ... | @@ -16,9 +16,9 @@ class Portabilis_View_Helper_DynamicInput_Curso extends Portabilis_View_Helper_D |
16 | 16 | $instituicaoId = $this->getInstituicaoId($options['instituicaoId'] ?? null); |
17 | 17 | $escolaId = $this->getEscolaId($options['escolaId'] ?? null); |
18 | 18 | $userId = $this->getCurrentUserId(); |
19 | - $isProfessor = Portabilis_Business_Professor::isProfessor($instituicaoId, $userId); | |
19 | + $isOnlyProfessor = Portabilis_Business_Professor::isOnlyProfessor($instituicaoId, $userId); | |
20 | 20 | |
21 | - if ($instituicaoId && $escolaId && empty($resources) && $isProfessor) { | |
21 | + if ($instituicaoId && $escolaId && empty($resources) && $isOnlyProfessor) { | |
22 | 22 | $cursos = Portabilis_Business_Professor::cursosAlocado($instituicaoId, $escolaId, $userId); |
23 | 23 | $resources = Portabilis_Array_Utils::setAsIdValue($cursos, 'id', 'nome'); |
24 | 24 | } elseif ($escolaId && empty($resources)) { | ... | ... |
ieducar/modules/DynamicInput/Views/CursoController.php
... | ... | @@ -17,9 +17,9 @@ class CursoController extends ApiCoreController |
17 | 17 | $escolaId = $this->getRequest()->escola_id; |
18 | 18 | $ano = $this->getRequest()->ano; |
19 | 19 | |
20 | - $isProfessor = Portabilis_Business_Professor::isProfessor($instituicaoId, $userId); | |
20 | + $isOnlyProfessor = Portabilis_Business_Professor::isOnlyProfessor($instituicaoId, $userId); | |
21 | 21 | |
22 | - if ($isProfessor) { | |
22 | + if ($isOnlyProfessor) { | |
23 | 23 | $cursos = Portabilis_Business_Professor::cursosAlocado($instituicaoId, $escolaId, $userId); |
24 | 24 | } else { |
25 | 25 | $params = [ $escolaId ]; | ... | ... |