Commit 642a09063fdb58ce8cb5a3abdc87937326915dab
1 parent
80ac9990
Exists in
master
by Eriksen: Corrigido bug em alocação de cursos e disciplinas para servidor que …
…impossibilitava o cadastro ou edição dos mesmos
Showing
2 changed files
with
28 additions
and
35 deletions
Show diff stats
ieducar/intranet/educar_servidor_curso_lst.php
| ... | ... | @@ -79,7 +79,7 @@ class indice extends clsCadastro |
| 79 | 79 | $obj_permissoes = new clsPermissoes(); |
| 80 | 80 | |
| 81 | 81 | $obj_permissoes->permissao_cadastra( 635, $this->pessoa_logada, 3, "educar_servidor_lst.php" ); |
| 82 | - | |
| 82 | + | |
| 83 | 83 | if( is_numeric( $this->cod_servidor ) && is_numeric( $this->ref_cod_instituicao ) ) |
| 84 | 84 | { |
| 85 | 85 | |
| ... | ... | @@ -194,14 +194,12 @@ class indice extends clsCadastro |
| 194 | 194 | return true; |
| 195 | 195 | } |
| 196 | 196 | |
| 197 | - function Editar() | |
| 198 | - { | |
| 199 | - return false; | |
| 200 | - } | |
| 197 | + public function Editar() { | |
| 198 | + return $this->Novo(); | |
| 199 | + } | |
| 201 | 200 | |
| 202 | 201 | function Excluir() |
| 203 | 202 | { |
| 204 | - | |
| 205 | 203 | return false; |
| 206 | 204 | } |
| 207 | 205 | } | ... | ... |
ieducar/intranet/educar_servidor_disciplina_lst.php
| ... | ... | @@ -210,42 +210,37 @@ class indice extends clsCadastro |
| 210 | 210 | |
| 211 | 211 | } |
| 212 | 212 | |
| 213 | - function Novo() | |
| 214 | - { | |
| 213 | + public function Novo() | |
| 214 | + { | |
| 215 | + $cursos_disciplina = array(); | |
| 215 | 216 | |
| 217 | + @session_start(); | |
| 218 | + $curso_servidor = $_SESSION['cursos_servidor']; | |
| 216 | 219 | |
| 217 | - $cursos_disciplina = array(); | |
| 218 | - @session_start(); | |
| 219 | - $curso_servidor = $_SESSION['cursos_servidor']; | |
| 220 | + if ($this->ref_cod_curso) { | |
| 221 | + for ($i = 0, $loop = count($this->ref_cod_curso); $i < $loop; $i++) { | |
| 222 | + $curso = $this->ref_cod_curso[$i]; | |
| 223 | + $curso_servidor[$curso] = $curso; | |
| 220 | 224 | |
| 221 | - if ($this->ref_cod_curso) | |
| 222 | - { | |
| 223 | - foreach ($this->ref_cod_curso as $key => $curso) | |
| 224 | - { | |
| 225 | - $curso_servidor[$curso] = $curso; | |
| 226 | - foreach ($this->ref_cod_disciplina as $disciplina) | |
| 227 | - { | |
| 228 | - $cursos_disciplina[$curso][$disciplina] = $disciplina; | |
| 229 | - } | |
| 230 | - } | |
| 231 | - } | |
| 232 | - | |
| 233 | - $_SESSION['cursos_disciplina'] = $cursos_disciplina; | |
| 234 | - $_SESSION['cod_servidor'] = $this->cod_servidor; | |
| 235 | - $_SESSION['cursos_servidor'] = $curso_servidor; | |
| 236 | - @session_write_close(); | |
| 225 | + $disciplina = $this->ref_cod_disciplina[$i]; | |
| 226 | + $cursos_disciplina[$curso][$disciplina] = $disciplina; | |
| 227 | + } | |
| 228 | + } | |
| 237 | 229 | |
| 238 | - echo "<script>parent.fechaExpansivel( '{$_GET['div']}');</script>"; | |
| 239 | - die; | |
| 230 | + $_SESSION['cursos_disciplina'] = $cursos_disciplina; | |
| 231 | + $_SESSION['cod_servidor'] = $this->cod_servidor; | |
| 232 | + $_SESSION['cursos_servidor'] = $curso_servidor; | |
| 233 | + @session_write_close(); | |
| 240 | 234 | |
| 235 | + echo "<script>parent.fechaExpansivel( '{$_GET['div']}');</script>"; | |
| 236 | + die; | |
| 241 | 237 | |
| 242 | - return true; | |
| 243 | - } | |
| 238 | + return true; | |
| 239 | + } | |
| 244 | 240 | |
| 245 | - function Editar() | |
| 246 | - { | |
| 247 | - return false; | |
| 248 | - } | |
| 241 | + public function Editar() { | |
| 242 | + return $this->Novo(); | |
| 243 | + } | |
| 249 | 244 | |
| 250 | 245 | function Excluir() |
| 251 | 246 | { | ... | ... |