Commit a1f52cb4c2406a1ab929d1029297a851d0e17f88
1 parent
212aa924
Exists in
master
and in
7 other branches
Correção na ferramenta de busca para aceitar mais de um item
Showing
3 changed files
with
21 additions
and
20 deletions
Show diff stats
admin/admin.db
No preview for this file type
classesphp/classe_atributos.php
| @@ -729,11 +729,9 @@ class Atributos | @@ -729,11 +729,9 @@ class Atributos | ||
| 729 | //monta a lista de itens por tema | 729 | //monta a lista de itens por tema |
| 730 | foreach ($temas as $tema){ | 730 | foreach ($temas as $tema){ |
| 731 | $temp = array(); | 731 | $temp = array(); |
| 732 | - foreach ($ptvs as $p) | ||
| 733 | - { | 732 | + foreach ($ptvs as $p){ |
| 734 | $pp = explode(",",$p); | 733 | $pp = explode(",",$p); |
| 735 | - if ($pp[1] == $tema) | ||
| 736 | - { | 734 | + if ($pp[1] == $tema){ |
| 737 | $temp[] = $pp[0]; | 735 | $temp[] = $pp[0]; |
| 738 | } | 736 | } |
| 739 | $temasi[$tema] = $temp; | 737 | $temasi[$tema] = $temp; |
ferramentas/busca/index.js
| @@ -180,7 +180,7 @@ i3GEOF.busca = { | @@ -180,7 +180,7 @@ i3GEOF.busca = { | ||
| 180 | n = retorno.data.valores.length; | 180 | n = retorno.data.valores.length; |
| 181 | for (i=0;i<n; i++){ | 181 | for (i=0;i<n; i++){ |
| 182 | ins += "<tr><td><input size=2 style='cursor:pointer;border:0px solid white;' name='"+retorno.data.valores[i].item+","+retorno.data.valores[i].tema+"' type=checkbox /></td>"; | 182 | ins += "<tr><td><input size=2 style='cursor:pointer;border:0px solid white;' name='"+retorno.data.valores[i].item+","+retorno.data.valores[i].tema+"' type=checkbox /></td>"; |
| 183 | - ins += "<td> "+retorno.data.valores[i].item+" - "+retorno.data.valores[i].tema+"</td></tr>"; | 183 | + ins += "<td> " + retorno.data.valores[i].item + "</td></tr>"; |
| 184 | } | 184 | } |
| 185 | ins += "</table>"; | 185 | ins += "</table>"; |
| 186 | $i("i3GEObuscalistai").innerHTML = ins; | 186 | $i("i3GEObuscalistai").innerHTML = ins; |
| @@ -211,29 +211,32 @@ i3GEOF.busca = { | @@ -211,29 +211,32 @@ i3GEOF.busca = { | ||
| 211 | palavra = $i("i3GEObuscapalavra").value, | 211 | palavra = $i("i3GEObuscapalavra").value, |
| 212 | p, | 212 | p, |
| 213 | cp; | 213 | cp; |
| 214 | - for (i=0;i<n; i++) | ||
| 215 | - { | ||
| 216 | - if (inputs[i].checked === true) | ||
| 217 | - {listai.push(inputs[i].name);} | 214 | + for (i=0;i<n; i++){ |
| 215 | + if (inputs[i].checked === true){ | ||
| 216 | + listai.push(inputs[i].name); | ||
| 217 | + } | ||
| 218 | + } | ||
| 219 | + if (listai.length === 0){ | ||
| 220 | + alert($trad('selecionaItem',i3GEOF.busca.dicionario)); | ||
| 218 | } | 221 | } |
| 219 | - if (listai.length === 0) | ||
| 220 | - {alert($trad('selecionaItem',i3GEOF.busca.dicionario));} | ||
| 221 | else{ | 222 | else{ |
| 222 | - if ($i("i3GEObuscapalavra").value === "") | ||
| 223 | - {alert("Digite uma palavra");} | ||
| 224 | - else | ||
| 225 | - { | 223 | + if ($i("i3GEObuscapalavra").value === ""){ |
| 224 | + alert("Digite uma palavra"); | ||
| 225 | + } | ||
| 226 | + else{ | ||
| 226 | i3GEOF.busca.aguarde.visibility = "visible"; | 227 | i3GEOF.busca.aguarde.visibility = "visible"; |
| 227 | - if ($i("i3GEObuscaqualquer").checked === true) | ||
| 228 | - {tipo = "qualquer";} | ||
| 229 | - if ($i("i3GEObuscaregiao").checked === true) | ||
| 230 | - {onde = "regiao";} | 228 | + if ($i("i3GEObuscaqualquer").checked === true){ |
| 229 | + tipo = "qualquer"; | ||
| 230 | + } | ||
| 231 | + if ($i("i3GEObuscaregiao").checked === true){ | ||
| 232 | + onde = "regiao"; | ||
| 233 | + } | ||
| 231 | palavra = i3GEO.util.removeAcentos(palavra); | 234 | palavra = i3GEO.util.removeAcentos(palavra); |
| 232 | p = i3GEO.configura.locaplic+"/classesphp/mapa_controle.php?g_sid="+i3GEO.configura.sid; | 235 | p = i3GEO.configura.locaplic+"/classesphp/mapa_controle.php?g_sid="+i3GEO.configura.sid; |
| 233 | cp = new cpaint(); | 236 | cp = new cpaint(); |
| 234 | cp.set_response_type("json"); | 237 | cp.set_response_type("json"); |
| 235 | cp.set_transfer_mode('POST'); | 238 | cp.set_transfer_mode('POST'); |
| 236 | - cp.call(p,"listavaloresitens",i3GEOF.busca.mostraBusca,"funcao=listavaloresitens","palavra="+palavra,"lista="+listai.toString(),"tipo="+tipo,"onde="+onde,"ext="+i3GEO.parametros.mapexten); | 239 | + cp.call(p,"listavaloresitens",i3GEOF.busca.mostraBusca,"funcao=listavaloresitens","palavra="+palavra,"lista="+listai.join("|"),"tipo="+tipo,"onde="+onde,"ext="+i3GEO.parametros.mapexten); |
| 237 | } | 240 | } |
| 238 | } | 241 | } |
| 239 | }, | 242 | }, |