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 | 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> "+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 | 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 | }, | ... | ... |