Commit a1f52cb4c2406a1ab929d1029297a851d0e17f88

Authored by Edmar Moretti
1 parent 212aa924

Correção na ferramenta de busca para aceitar mais de um item

admin/admin.db
No preview for this file type
classesphp/classe_atributos.php
... ... @@ -729,11 +729,9 @@ class Atributos
729 729 //monta a lista de itens por tema
730 730 foreach ($temas as $tema){
731 731 $temp = array();
732   - foreach ($ptvs as $p)
733   - {
  732 + foreach ($ptvs as $p){
734 733 $pp = explode(",",$p);
735   - if ($pp[1] == $tema)
736   - {
  734 + if ($pp[1] == $tema){
737 735 $temp[] = $pp[0];
738 736 }
739 737 $temasi[$tema] = $temp;
... ...
ferramentas/busca/index.js
... ... @@ -180,7 +180,7 @@ i3GEOF.busca = {
180 180 n = retorno.data.valores.length;
181 181 for (i=0;i<n; i++){
182 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>&nbsp;"+retorno.data.valores[i].item+" - "+retorno.data.valores[i].tema+"</td></tr>";
  183 + ins += "<td>&nbsp;" + retorno.data.valores[i].item + "</td></tr>";
184 184 }
185 185 ins += "</table>";
186 186 $i("i3GEObuscalistai").innerHTML = ins;
... ... @@ -211,29 +211,32 @@ i3GEOF.busca = {
211 211 palavra = $i("i3GEObuscapalavra").value,
212 212 p,
213 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 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 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 234 palavra = i3GEO.util.removeAcentos(palavra);
232 235 p = i3GEO.configura.locaplic+"/classesphp/mapa_controle.php?g_sid="+i3GEO.configura.sid;
233 236 cp = new cpaint();
234 237 cp.set_response_type("json");
235 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 },
... ...