Commit 35b31a65b1b7aeb24f4b8b21cffb5fd3a3273124
1 parent
130554e8
Exists in
master
Correção na ferramenta de busca para aceitar mais de um item
Showing
1 changed file
with
19 additions
and
16 deletions
Show diff stats
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 | }, |