Commit b86633e5550757ebde9a253b9a8b5a2e5ed2a682
1 parent
eed23d4f
Exists in
master
and in
7 other branches
correção na busca por perfis cadastrados
Showing
1 changed file
with
24 additions
and
8 deletions
Show diff stats
admin/php/classe_arvore.php
| @@ -81,7 +81,9 @@ class Arvore | @@ -81,7 +81,9 @@ class Arvore | ||
| 81 | $resultado = array(); | 81 | $resultado = array(); |
| 82 | foreach($regs as $reg) | 82 | foreach($regs as $reg) |
| 83 | { | 83 | { |
| 84 | - if ($this->verificaOcorrencia($perfil,explode(",",$reg["perfil_menu"]))) | 84 | + $a = $reg["perfil_menu"]; |
| 85 | + $a = str_replace(" ",",",$a); | ||
| 86 | + if ($this->verificaOcorrencia($perfil,explode(",",$a))) | ||
| 85 | { | 87 | { |
| 86 | $status = "fechado"; | 88 | $status = "fechado"; |
| 87 | if(strtolower($reg["aberto"]) == "sim") | 89 | if(strtolower($reg["aberto"]) == "sim") |
| @@ -106,17 +108,23 @@ class Arvore | @@ -106,17 +108,23 @@ class Arvore | ||
| 106 | $grupos = $this->pegaGruposMenu($menu["idmenu"]); | 108 | $grupos = $this->pegaGruposMenu($menu["idmenu"]); |
| 107 | foreach($grupos["grupos"] as $grupo) | 109 | foreach($grupos["grupos"] as $grupo) |
| 108 | { | 110 | { |
| 109 | - if($this->verificaOcorrencia($perfil,explode(",",$grupo["n1_perfil"]))) | 111 | + $a = $grupo["n1_perfil"]; |
| 112 | + $a = str_replace(" ",",",$a); | ||
| 113 | + if($this->verificaOcorrencia($perfil,explode(",",$a))) | ||
| 110 | { | 114 | { |
| 111 | $sgrupos = $this->pegaSubgruposGrupo($menu["idmenu"],$grupo["id_n1"]); | 115 | $sgrupos = $this->pegaSubgruposGrupo($menu["idmenu"],$grupo["id_n1"]); |
| 112 | foreach($sgrupos["subgrupos"] as $sgrupo) | 116 | foreach($sgrupos["subgrupos"] as $sgrupo) |
| 113 | { | 117 | { |
| 114 | - if($this->verificaOcorrencia($perfil,explode(",",$sgrupo["n2_perfil"]))) | 118 | + $a = $sgrupo["n2_perfil"]; |
| 119 | + $a = str_replace(" ",",",$a); | ||
| 120 | + if($this->verificaOcorrencia($perfil,explode(",",$a))) | ||
| 115 | { | 121 | { |
| 116 | $temas = $this->pegaTemasSubGrupo($sgrupo["id_n2"]); | 122 | $temas = $this->pegaTemasSubGrupo($sgrupo["id_n2"]); |
| 117 | foreach ($temas as $tema) | 123 | foreach ($temas as $tema) |
| 118 | { | 124 | { |
| 119 | - if($this->verificaOcorrencia($perfil,explode(",",$tema["n3_perfil"]))) | 125 | + $a = $tema["n3_perfil"]; |
| 126 | + $a = str_replace(" ",",",$a); | ||
| 127 | + if($this->verificaOcorrencia($perfil,explode(",",$a))) | ||
| 120 | { | 128 | { |
| 121 | $t = $this->pegaTema($tema["id_tema"]); | 129 | $t = $this->pegaTema($tema["id_tema"]); |
| 122 | $t = $t[0]; | 130 | $t = $t[0]; |
| @@ -200,7 +208,9 @@ class Arvore | @@ -200,7 +208,9 @@ class Arvore | ||
| 200 | {$grupos[] = array();} | 208 | {$grupos[] = array();} |
| 201 | foreach($dados["grupos"] as $grupo) | 209 | foreach($dados["grupos"] as $grupo) |
| 202 | { | 210 | { |
| 203 | - if($this->verificaOcorrencia($perfil,explode(",",$grupo["n1_perfil"]))) | 211 | + $a = $grupo["n1_perfil"]; |
| 212 | + $a = str_replace(" ",",",$a); | ||
| 213 | + if($this->verificaOcorrencia($perfil,explode(",",$a))) | ||
| 204 | { | 214 | { |
| 205 | $temas = array(); | 215 | $temas = array(); |
| 206 | $raizgrupo = $this->pegaTemasRaizGrupo($id_menu,$grupo["id_n1"]); | 216 | $raizgrupo = $this->pegaTemasRaizGrupo($id_menu,$grupo["id_n1"]); |
| @@ -220,7 +230,9 @@ class Arvore | @@ -220,7 +230,9 @@ class Arvore | ||
| 220 | 230 | ||
| 221 | foreach($dadossubgrupos["subgrupos"] as $sgrupo) | 231 | foreach($dadossubgrupos["subgrupos"] as $sgrupo) |
| 222 | { | 232 | { |
| 223 | - if($this->verificaOcorrencia($perfil,explode(",",$sgrupo["n2_perfil"]))) | 233 | + $a = $sgrupo["n2_perfil"]; |
| 234 | + $a = str_replace(" ",",",$a); | ||
| 235 | + if($this->verificaOcorrencia($perfil,explode(",",$a))) | ||
| 224 | { | 236 | { |
| 225 | //verifica se existem temas que podem receber download | 237 | //verifica se existem temas que podem receber download |
| 226 | $down = "nao"; | 238 | $down = "nao"; |
| @@ -265,7 +277,9 @@ class Arvore | @@ -265,7 +277,9 @@ class Arvore | ||
| 265 | $subgrupos = array(); | 277 | $subgrupos = array(); |
| 266 | foreach($dados["subgrupos"] as $sgrupo) | 278 | foreach($dados["subgrupos"] as $sgrupo) |
| 267 | { | 279 | { |
| 268 | - if ($this->verificaOcorrencia($perfil,explode(",",$sgrupo["n2_perfil"]))) | 280 | + $a = $sgrupo["n2_perfil"]; |
| 281 | + $a = str_replace(" ",",",$a); | ||
| 282 | + if ($this->verificaOcorrencia($perfil,explode(",",$a))) | ||
| 269 | { | 283 | { |
| 270 | $listaT = $this->pegaTemasSubGrupo($sgrupo["id_n2"]); | 284 | $listaT = $this->pegaTemasSubGrupo($sgrupo["id_n2"]); |
| 271 | $down = "nao"; | 285 | $down = "nao"; |
| @@ -293,7 +307,9 @@ class Arvore | @@ -293,7 +307,9 @@ class Arvore | ||
| 293 | $temas = array(); | 307 | $temas = array(); |
| 294 | foreach($dados as $tema) | 308 | foreach($dados as $tema) |
| 295 | { | 309 | { |
| 296 | - if($this->verificaOcorrencia($perfil,explode(",",$tema["n3_perfil"]))) | 310 | + $a = $tema["n3_perfil"]; |
| 311 | + $a = str_replace(" ",",",$a); | ||
| 312 | + if($this->verificaOcorrencia($perfil,explode(",",$a))) | ||
| 297 | {$temas[] = $this->formataTema($tema["id_tema"],$tema["publicado"]);} | 313 | {$temas[] = $this->formataTema($tema["id_tema"],$tema["publicado"]);} |
| 298 | } | 314 | } |
| 299 | return $temas; | 315 | return $temas; |