Commit 24fabfacaea21282da8091343a5025c34911fa86
1 parent
71b56833
Exists in
master
and in
7 other branches
Inclusão de opção para visualizar várias tabelas de atributos aomesmo tempo
Showing
5 changed files
with
152 additions
and
20 deletions
Show diff stats
admin/admin.db
No preview for this file type
classesphp/classe_atributos.php
... | ... | @@ -358,10 +358,10 @@ class Atributos |
358 | 358 | if ((!isset($tipolista)) || ($tipolista=="")){ |
359 | 359 | $tipolista = "tudo"; |
360 | 360 | } |
361 | - if (!isset($inicio)){ | |
361 | + if (empty($inicio)){ | |
362 | 362 | $inicio = 0; |
363 | 363 | } |
364 | - if (!isset($fim)){ | |
364 | + if (empty($fim)){ | |
365 | 365 | $fim = ""; |
366 | 366 | } |
367 | 367 | //se tipo for igual a brasil, define a extensão geográfica total |
... | ... | @@ -507,7 +507,12 @@ class Atributos |
507 | 507 | $classe = ""; |
508 | 508 | if($dadosDaClasse == "sim" && $unico != "sim"){ |
509 | 509 | $indice = $this->layer->getClassIndex($shape); |
510 | - $nome = $this->layer->getclass($indice)->name; | |
510 | + if($indice >= 0){ | |
511 | + $nome = $this->layer->getclass($indice)->name; | |
512 | + } | |
513 | + else{ | |
514 | + $nome = ""; | |
515 | + } | |
511 | 516 | $classe = array( |
512 | 517 | "indice"=>$indice, |
513 | 518 | "nome"=>$nome |
... | ... | @@ -515,6 +520,7 @@ class Atributos |
515 | 520 | } |
516 | 521 | if(count($valitem) > 0){ |
517 | 522 | $ext = $this->extensaoShape($shape); |
523 | + //echo "<br>".$indx; | |
518 | 524 | $registros[] = array("indice"=>$indx,"valores"=>$valitem,"status"=>$chk,"classe"=>$classe,"ext"=>$ext); |
519 | 525 | } |
520 | 526 | $chk = ""; | ... | ... |
ferramentas/graficointerativo/index.js
... | ... | @@ -316,7 +316,7 @@ i3GEOF.graficointerativo = { |
316 | 316 | ' <p class=paragrafo ><select onchange="i3GEOF.graficointerativo.obterDados()" id="i3GEOgraficointerativoTipoAgregacao" ><option value="soma">Soma</option><option value="media">Média</option></select> Tipo de agregação dos valores do eixo Y</p>' + |
317 | 317 | '</div>'+ |
318 | 318 | '<div class=guiaobj id="i3GEOgraficointerativoguia4obj" style="left:1px;display:none;top:-10px">' + |
319 | - '<a href="#" onclick="i3GEOF.graficointerativo.novaJanela()" >abrir em uma janela separada</a>' + | |
319 | + ' <a href="#" onclick="i3GEOF.graficointerativo.novaJanela()" >abrir em uma janela separada</a>' + | |
320 | 320 | '</div>' + |
321 | 321 | '<div class=guiaobj id="i3GEOgraficointerativoguia5obj" style="font-size:10px;left:10px;display:none;top:-0px">' + |
322 | 322 | '</div>' + | ... | ... |
ferramentas/tabela/dicionario.js
... | ... | @@ -211,7 +211,19 @@ es:"", |
211 | 211 | it:"" |
212 | 212 | }], |
213 | 213 | 36: [{ |
214 | -pt:"", | |
214 | +pt:"abrir em uma janela separada", | |
215 | +en:"", | |
216 | +es:"", | |
217 | +it:"" | |
218 | +}], | |
219 | +37: [{ | |
220 | +pt:"Marque uma coluna para vincular com outras tabelas. Marque uma linha para localizar em todas as tabelas abertas", | |
221 | +en:"", | |
222 | +es:"", | |
223 | +it:"" | |
224 | +}], | |
225 | +38: [{ | |
226 | +pt:"Os dados utilizados referem-se apenas à região atual mostrada no mapa", | |
215 | 227 | en:"", |
216 | 228 | es:"", |
217 | 229 | it:"" | ... | ... |
ferramentas/tabela/index.js
... | ... | @@ -282,6 +282,7 @@ i3GEOF.tabela = { |
282 | 282 | ins += $inputText("","","i3GEOtabelafim","",5,"20"); |
283 | 283 | ins += ' <img style=cursor:pointer onclick="i3GEOF.tabela.mais()" src="'+i3GEO.configura.locaplic+'/imagens/plus.gif" />'; |
284 | 284 | ins += ' <input title="'+$trad(18,i3GEOF.tabela.dicionario)+'" id=i3GEOtabelabotaoLista size=25 type=button value="'+$trad(19,i3GEOF.tabela.dicionario)+'"/>'; |
285 | + ins += ' <a href="#" onclick="i3GEOF.tabela.novaJanela()" >'+$trad(36,i3GEOF.tabela.dicionario)+'</a>'; | |
285 | 286 | ins += ' </div>'; |
286 | 287 | ins += ' <div id=i3GEOtabelaregistros style="position:relative;top:20px;left:0px;text-align:left;">'; |
287 | 288 | ins += ' </div>'; |
... | ... | @@ -395,6 +396,92 @@ i3GEOF.tabela = { |
395 | 396 | i.zIndex = 21000 + i3GEO.janela.ULTIMOZINDEX; |
396 | 397 | }, |
397 | 398 | /* |
399 | + Function: novaJanela | |
400 | + | |
401 | + Abre a tabela em uma nova janela que pode conviver com outras tabelas | |
402 | + */ | |
403 | + novaJanela: function(){ | |
404 | + if(typeof(i3GEO.vincularTabelas) === 'undefined'){ | |
405 | + i3GEO.vincularTabelas = {}; | |
406 | + i3GEO.vincularTabelas.janelas = []; | |
407 | + i3GEO.janela.tempoMsg($trad(37,i3GEOF.tabela.dicionario)); | |
408 | + } | |
409 | + var janela = "", | |
410 | + divid, | |
411 | + cabecalho = function(){}, | |
412 | + id = YAHOO.util.Dom.generateId(), | |
413 | + minimiza = function(){ | |
414 | + i3GEO.janela.minimiza(id); | |
415 | + }, | |
416 | + titulo = " "+i3GEO.arvoreDeCamadas.pegaTema(i3GEOF.tabela.tema).tema; | |
417 | + janela = i3GEO.janela.cria( | |
418 | + "420px", | |
419 | + "200px", | |
420 | + "", | |
421 | + "", | |
422 | + "", | |
423 | + titulo, | |
424 | + id, | |
425 | + false, | |
426 | + "hd", | |
427 | + cabecalho, | |
428 | + minimiza | |
429 | + ); | |
430 | + divid = janela[2].id; | |
431 | + i3GEO.vincularTabelas.janelas.push(id); | |
432 | + temp = function(retorno){ | |
433 | + i3GEOF.tabela.aguarde.visibility = "hidden"; | |
434 | + if (retorno.data !== undefined){ | |
435 | + var ins = [], | |
436 | + i, | |
437 | + vals, | |
438 | + cor, | |
439 | + j, | |
440 | + n, | |
441 | + imagem, | |
442 | + i3GEOtabelalegenda = true; | |
443 | + //cabecalho da tabela | |
444 | + ins = "<table class=lista8 style='width:100%'>"; | |
445 | + ins += "<tr><td></td><td></td><td></td>"; | |
446 | + n = retorno.data[0].itens.length; | |
447 | + for (i=0;i<n;i++){ | |
448 | + ins += "<td style='background-color:yellow' ><input type=radio name='coluna_"+id+"' style='cursor:pointer;' /><br><b>"+retorno.data[0].alias[i]+"</b></td>"; | |
449 | + } | |
450 | + ins += "</tr>"; | |
451 | + cor = "linha"; | |
452 | + n = retorno.data[1].registros.length; | |
453 | + for (i=0;i<n;i++){ | |
454 | + ins += "<tr>"; | |
455 | + ins += "<td><input type=radio name='linha_"+id+"' style='cursor:pointer;' /></td>"; | |
456 | + ins += "<td>"; | |
457 | + if(retorno.data[1].registros[i].ext && retorno.data[1].registros[i].ext != ""){ | |
458 | + ins += "<img style=cursor:pointer onclick='i3GEO.navega.zoomExt(\"\",\"\",\"\",\""+retorno.data[1].registros[i].ext+"\")' src='"+i3GEO.configura.locaplic+"/imagens/o.gif' title='zoom' ids="+retorno.data[1].registros[i].indice+" />"; | |
459 | + } | |
460 | + ins += "</td>"; | |
461 | + if(i3GEOtabelalegenda == true){ | |
462 | + imagem = retorno.data.legenda[retorno.data[1].registros[i].classe["indice"]]; | |
463 | + ins += "<td><img title='"+retorno.data[1].registros[i].classe["nome"]+"' src='"+imagem+"' /></td>"; | |
464 | + } | |
465 | + else{ | |
466 | + ins += "<td></td>"; | |
467 | + } | |
468 | + vals = retorno.data[1].registros[i].valores; | |
469 | + for (j=0;j<vals.length;j++){ | |
470 | + ins += "<td class='"+cor+"'>"+vals[j].valor+"</td>"; | |
471 | + } | |
472 | + if (cor === "linha"){ | |
473 | + cor = "linha1"; | |
474 | + } | |
475 | + else{ | |
476 | + cor = "linha"; | |
477 | + } | |
478 | + } | |
479 | + $i(divid).innerHTML = ins; | |
480 | + } | |
481 | + }; | |
482 | + i3GEOF.tabela.pegaRegistros("brasil","tudo","sim",true,true,temp); | |
483 | + }, | |
484 | + /* | |
398 | 485 | Function: ativaAutoAtualiza |
399 | 486 | |
400 | 487 | Ativa ou desativa a atualização automática da tabela quando o usuário navega no mapa |
... | ... | @@ -434,28 +521,55 @@ i3GEOF.tabela = { |
434 | 521 | |
435 | 522 | <LISTAREGISTROS> |
436 | 523 | */ |
437 | - pegaRegistros: function(){ | |
524 | + pegaRegistros: function(tiporeg,tipolista,dadosDaClasse,inicio,fim,funcao){ | |
438 | 525 | if(i3GEOF.tabela.aguarde.visibility === "visible") |
439 | 526 | {return;} |
440 | 527 | i3GEOF.tabela.aguarde.visibility = "visible"; |
441 | - var tipolista = "tudo", | |
442 | - tiporeg = "brasil", | |
443 | - inicio = $i("i3GEOtabelainicio").value - 1, | |
444 | - fim = $i("i3GEOtabelafim").value, | |
445 | - p, | |
446 | - dadosDaClasse = "nao", | |
528 | + var p, | |
447 | 529 | cp = new cpaint(); |
448 | - if ($i("i3GEOtabelatiporeg").checked){ | |
449 | - tiporeg = "mapa"; | |
450 | - i3GEO.janela.tempoMsg("Os dados utilizados referem-se apenas à região atual mostrada no mapa"); | |
530 | + if(!tiporeg){ | |
531 | + if($i("i3GEOtabelatiporeg").checked){ | |
532 | + tiporeg = "mapa"; | |
533 | + i3GEO.janela.tempoMsg($trad(38,i3GEOF.tabela.dicionario)); | |
534 | + } | |
535 | + else{ | |
536 | + tiporeg = "brasil"; | |
537 | + } | |
538 | + } | |
539 | + if(!tipolista){ | |
540 | + if ($i("i3GEOtabelatipolista").checked){ | |
541 | + tipolista = "selecionados"; | |
542 | + } | |
543 | + else{ | |
544 | + tipolista = "tudo"; | |
545 | + } | |
546 | + } | |
547 | + if(!dadosDaClasse){ | |
548 | + if ($i("i3GEOtabelalegenda").checked){ | |
549 | + dadosDaClasse = "sim"; | |
550 | + } | |
551 | + else{ | |
552 | + dadosDaClasse = "nao"; | |
553 | + } | |
554 | + } | |
555 | + if(!inicio){ | |
556 | + inicio = $i("i3GEOtabelainicio").value - 1; | |
557 | + } | |
558 | + else{ | |
559 | + inicio = ""; | |
560 | + } | |
561 | + if(!fim){ | |
562 | + fim = $i("i3GEOtabelafim").value - 1; | |
563 | + } | |
564 | + else{ | |
565 | + fim = ""; | |
566 | + } | |
567 | + if(!funcao){ | |
568 | + funcao = i3GEOF.tabela.montaTabela; | |
451 | 569 | } |
452 | - if ($i("i3GEOtabelatipolista").checked) | |
453 | - {tipolista = "selecionados";} | |
454 | - if ($i("i3GEOtabelalegenda").checked) | |
455 | - {dadosDaClasse = "sim";} | |
456 | 570 | p = i3GEO.configura.locaplic+"/classesphp/mapa_controle.php?g_sid="+i3GEO.configura.sid+"&funcao=listaregistros&inicio="+inicio+"&fim="+fim+"&tema="+i3GEOF.tabela.tema+"&tipo="+tiporeg+"&tipolista="+tipolista+"&ext="+i3GEO.parametros.mapexten+"&dadosDaClasse="+dadosDaClasse; |
457 | 571 | cp.set_response_type("JSON"); |
458 | - cp.call(p,"listaRegistros",i3GEOF.tabela.montaTabela); | |
572 | + cp.call(p,"listaRegistros",funcao); | |
459 | 573 | }, |
460 | 574 | /* |
461 | 575 | Function: montaTabela | ... | ... |