Commit c83e58ccb5a999b973b365f55f66a9add3d8611e
1 parent
a80e17b3
Exists in
master
and in
7 other branches
Inclusão de opção para vincular registros entre tabelas
Showing
4 changed files
with
189 additions
and
12 deletions
Show diff stats
classesjs/dicionario_ajuda.js
... | ... | @@ -1003,10 +1003,17 @@ g_traducao_ajuda = { |
1003 | 1003 | pt:"Cria uma cópia de uma camada existente no mapa e adiciona com novo nome.", |
1004 | 1004 | complemento:"", |
1005 | 1005 | apijs:"i3GEO.tema.copia(idtema)" |
1006 | + }, | |
1007 | + "120": { | |
1008 | + titulo: "Víncula dados entre tabelas", | |
1009 | + diretorio:"i3geo/ferramentas/tabela/index.js", | |
1010 | + categoria:"5", | |
1011 | + pt:"Opção utilizada na ferramenta tabela que pemrite vincular a listagem de registros entre tabelas que estejam em diferentes janelas flutuantes", | |
1012 | + complemento:"", | |
1013 | + apijs:"" | |
1006 | 1014 | } |
1007 | 1015 | } |
1008 | 1016 | }; |
1009 | - | |
1010 | 1017 | g_traducao_ajuda_categorias = { |
1011 | 1018 | "1":{titulo:"Propriedades do mapa",observacao:"Funcionalidades que permitem alterar características gerais do mapa, como tamanho e filtro de cores."}, |
1012 | 1019 | "2":{titulo:"Arquivos"}, | ... | ... |
ferramentas/preferencias/index.js
... | ... | @@ -55,23 +55,23 @@ i3GEOF.preferencias = { |
55 | 55 | tipo: "boolean", |
56 | 56 | elemento: "i3GEO.configura.iniciaFerramentas.quais.metaestat.ativa" |
57 | 57 | },{ |
58 | - titulo: "<b>"+$trad(81,i3GEOF.preferencias.dicionario)+"</b>", | |
58 | + titulo: $trad(81,i3GEOF.preferencias.dicionario), | |
59 | 59 | tipo: "boolean", |
60 | 60 | elemento: "i3GEO.configura.iniciaFerramentas.quais.legenda.ativa" |
61 | 61 | },{ |
62 | - titulo: $trad(82,i3GEOF.preferencias.dicionario), | |
62 | + titulo: "<span style=left:10px;position:relative; >"+$trad(82,i3GEOF.preferencias.dicionario)+"</span>", | |
63 | 63 | tipo: "numero", |
64 | 64 | elemento: "i3GEO.configura.iniciaFerramentas.quais.legenda.largura" |
65 | 65 | },{ |
66 | - titulo: $trad(83,i3GEOF.preferencias.dicionario), | |
66 | + titulo: "<span style=left:10px;position:relative; >"+$trad(83,i3GEOF.preferencias.dicionario)+"</span>", | |
67 | 67 | tipo: "numero", |
68 | 68 | elemento: "i3GEO.configura.iniciaFerramentas.quais.legenda.altura" |
69 | 69 | },{ |
70 | - titulo: $trad(84,i3GEOF.preferencias.dicionario), | |
70 | + titulo: "<span style=left:10px;position:relative; >"+$trad(84,i3GEOF.preferencias.dicionario)+"</span>", | |
71 | 71 | tipo: "numero", |
72 | 72 | elemento: "i3GEO.configura.iniciaFerramentas.quais.legenda.topo" |
73 | 73 | },{ |
74 | - titulo: $trad(85,i3GEOF.preferencias.dicionario), | |
74 | + titulo: "<span style=left:10px;position:relative; >"+$trad(85,i3GEOF.preferencias.dicionario)+"</span>", | |
75 | 75 | tipo: "numero", |
76 | 76 | elemento: "i3GEO.configura.iniciaFerramentas.quais.legenda.esquerda" |
77 | 77 | } |
... | ... | @@ -708,11 +708,13 @@ i3GEOF.preferencias = { |
708 | 708 | elem = raiz.getElementsByTagName(tipos[i]); |
709 | 709 | nelem = elem.length; |
710 | 710 | for(j=0;j<nelem;j++){ |
711 | - if (elem[j].type === "checkbox"){ | |
712 | - eval("elem[j].checked = "+elem[j].id+";"); | |
713 | - } | |
714 | - else{ | |
715 | - eval("elem[j].value = "+elem[j].id+";"); | |
711 | + if(elem[j].id){ | |
712 | + if (elem[j].type === "checkbox"){ | |
713 | + eval("elem[j].checked = "+elem[j].id+";"); | |
714 | + } | |
715 | + else{ | |
716 | + eval("elem[j].value = "+elem[j].id+";"); | |
717 | + } | |
716 | 718 | } |
717 | 719 | } |
718 | 720 | } | ... | ... |
ferramentas/tabela/dicionario.js
... | ... | @@ -205,5 +205,47 @@ i3GEOF.tabela.dicionario = { |
205 | 205 | en:"", |
206 | 206 | es:"", |
207 | 207 | it:"" |
208 | + }], | |
209 | + 42: [{ | |
210 | + pt:"Gráfico", | |
211 | + en:"", | |
212 | + es:"", | |
213 | + it:"" | |
214 | + }], | |
215 | + 43: [{ | |
216 | + pt:"Vínculos entre as tabelas abertas", | |
217 | + en:"", | |
218 | + es:"", | |
219 | + it:"" | |
220 | + }], | |
221 | + 44: [{ | |
222 | + pt:"Vínculos", | |
223 | + en:"", | |
224 | + es:"", | |
225 | + it:"" | |
226 | + }], | |
227 | + 45: [{ | |
228 | + pt:"Escolha uma tabela", | |
229 | + en:"", | |
230 | + es:"", | |
231 | + it:"" | |
232 | + }], | |
233 | + 46: [{ | |
234 | + pt:"Escolha uma segunda tabela", | |
235 | + en:"", | |
236 | + es:"", | |
237 | + it:"" | |
238 | + }], | |
239 | + 47: [{ | |
240 | + pt:"Criar vínculo", | |
241 | + en:"", | |
242 | + es:"", | |
243 | + it:"" | |
244 | + }], | |
245 | + 48: [{ | |
246 | + pt:"Coluna", | |
247 | + en:"", | |
248 | + es:"", | |
249 | + it:"" | |
208 | 250 | }] |
209 | 251 | }; | ... | ... |
ferramentas/tabela/index.js
... | ... | @@ -10,6 +10,7 @@ i3GEOF.tabela = { |
10 | 10 | */ |
11 | 11 | janelas: [], |
12 | 12 | propJanelas: {}, |
13 | + vinculos:{}, | |
13 | 14 | /* |
14 | 15 | Para efeitos de compatibilidade antes da versão 4.7 que não tinha dicionário |
15 | 16 | */ |
... | ... | @@ -165,6 +166,12 @@ i3GEOF.tabela = { |
165 | 166 | i3GEOF.tabela.relatorioTexto(idjanela); |
166 | 167 | }}} |
167 | 168 | ); |
169 | + new YAHOO.widget.Button( | |
170 | + idjanela+"i3GEOtabelabotaoVinculos", | |
171 | + {onclick:{fn: function(){ | |
172 | + i3GEOF.tabela.vinculos.iniciaJanelaFlutuante(); | |
173 | + }}} | |
174 | + ); | |
168 | 175 | i3GEO.util.mensagemAjuda(idjanela+"i3GEOtabelamen1",$i(idjanela+"i3GEOtabelamen1").innerHTML); |
169 | 176 | |
170 | 177 | if (i3GEO.parametros.r.toLowerCase() !== "sim"){ |
... | ... | @@ -214,7 +221,9 @@ i3GEOF.tabela = { |
214 | 221 | ins += ' <input title="'+$trad(10,i3GEOF.tabela.dicionario)+'" id='+idjanela+'i3GEOtabelabotao2 size=25 type=button value="'+$trad(11,i3GEOF.tabela.dicionario)+'" />'; |
215 | 222 | ins += ' <input title="'+$trad(12,i3GEOF.tabela.dicionario)+'" id='+idjanela+'i3GEOtabelabotao3 size=25 type=button value="'+$trad(13,i3GEOF.tabela.dicionario)+'"/>'; |
216 | 223 | ins += ' <input title="'+$trad(14,i3GEOF.tabela.dicionario)+'" id='+idjanela+'i3GEOtabelabotao6 size=30 type=button value="'+$trad(15,i3GEOF.tabela.dicionario)+'"/>'; |
217 | - ins += ' <input type=button value="'+$trad("t37b")+'" id='+idjanela+'i3GEOtabelaGraficoI />'; | |
224 | + ins += ' <input id='+idjanela+'i3GEOtabelaGraficoI type=button value="'+$trad(42,i3GEOF.tabela.dicionario)+'" />'; | |
225 | + ins += ' <input title="'+$trad(43,i3GEOF.tabela.dicionario)+'" id='+idjanela+'i3GEOtabelabotaoVinculos size=30 type=button value="'+$trad(44,i3GEOF.tabela.dicionario)+'"/>'; | |
226 | + | |
218 | 227 | ins += ' <div id='+idjanela+'i3GEOtabelacontador style="background-color:rgb(240,240,240);width:100%;position:relative;top:15px;left:0px;text-align:left;height:25px;">'; |
219 | 228 | ins += ' '+$trad(16,i3GEOF.tabela.dicionario)+' <img style=cursor:pointer onclick="i3GEOF.tabela.menos(\''+idjanela+'\')" src="'+i3GEO.configura.locaplic+'/imagens/minus.gif" />'; |
220 | 229 | ins += $inputText("","",idjanela+"i3GEOtabelainicio","",5,"1"); |
... | ... | @@ -280,6 +289,7 @@ i3GEOF.tabela = { |
280 | 289 | //i3GEO.janela.tempoMsg($trad(38,i3GEOF.tabela.dicionario)); |
281 | 290 | i3GEOF.tabela.janelas.push(id); |
282 | 291 | i3GEOF.tabela.propJanelas[id] = {}; |
292 | + i3GEOF.tabela.propJanelas[id].colunas = {"itens":[],"alias":[]}; | |
283 | 293 | i3GEOF.tabela.propJanelas[id].registros = []; |
284 | 294 | i3GEOF.tabela.propJanelas[id].tema = i3GEO.temaAtivo; |
285 | 295 | i3GEOF.tabela.propJanelas[id].atualiza = false; |
... | ... | @@ -379,6 +389,118 @@ i3GEOF.tabela = { |
379 | 389 | i3GEO.janela.ULTIMOZINDEX++; |
380 | 390 | i.zIndex = 21000 + i3GEO.janela.ULTIMOZINDEX; |
381 | 391 | }, |
392 | + vinculos:{ | |
393 | + iniciaJanelaFlutuante: function(){ | |
394 | + var minimiza,cabecalho,janela,divid,titulo; | |
395 | + //cria a janela flutuante | |
396 | + titulo = " "+$trad(44,i3GEOF.tabela.dicionario)+" <a class=ajuda_usuario target=_blank href='" + i3GEO.configura.locaplic + "/ajuda_usuario.php?idcategoria=5&idajuda=120' > </a>"; | |
397 | + janela = i3GEO.janela.cria( | |
398 | + "300px", | |
399 | + "300px", | |
400 | + "", | |
401 | + "", | |
402 | + "", | |
403 | + titulo, | |
404 | + "i3GEOFtabelaVinculos", | |
405 | + true, | |
406 | + "hd", | |
407 | + "", | |
408 | + "", | |
409 | + "", | |
410 | + true, | |
411 | + i3GEO.configura.locaplic+"/imagens/oxygen/16x16/edit-table-cell-merge.png" | |
412 | + ); | |
413 | + divid = janela[2].id; | |
414 | + if(i3GEOF.tabela.janelas.length > 1){ | |
415 | + temp = janela[0].cfg.config; | |
416 | + janela[0].moveTo(temp.x.value + (i3GEOF.tabela.janelas.length * 50),temp.y.value + (i3GEOF.tabela.janelas.length * 15)); | |
417 | + } | |
418 | + $i("i3GEOFtabelaVinculos_corpo").style.backgroundColor = "white"; | |
419 | + i3GEOF.tabela.vinculos.inicia(); | |
420 | + }, | |
421 | + html: function(){ | |
422 | + var ins = "" + | |
423 | + " <fieldset class=subbloco >" + | |
424 | + " <p class=paragrafo >" + $trad(45,i3GEOF.tabela.dicionario) + "<br>" + | |
425 | + i3GEOF.tabela.comboJanelas("i3GEOFTabelaOpcoesAdicionaVinculoT1","i3GEOF.tabela.vinculos.comboColunasT1()") + | |
426 | + " <div id=i3GEOFTabelaVinculoT1Colunas style=position:relative;left:10px ></div>" + | |
427 | + " <p class=paragrafo >" + $trad(46,i3GEOF.tabela.dicionario) + "<br>" + | |
428 | + i3GEOF.tabela.comboJanelas("i3GEOFTabelaOpcoesAdicionaVinculoT2","i3GEOF.tabela.vinculos.comboColunasT2()") + | |
429 | + " <div id=i3GEOFTabelaVinculoT2Colunas style=position:relative;left:10px ></div>" + | |
430 | + " <p class=paragrafo ><input id=i3GEOFTabelaVinculoBotaoCriar size=25 type=button value='"+$trad(47,i3GEOF.tabela.dicionario)+"' /></p>" + | |
431 | + " </fieldset>" + | |
432 | + " <fieldset class=subbloco id=i3GEOFtabelaVinculosLista >" + | |
433 | + " </fieldset>"; | |
434 | + return ins; | |
435 | + }, | |
436 | + inicia: function(){ | |
437 | + $i("i3GEOFtabelaVinculos_corpo").innerHTML = i3GEOF.tabela.vinculos.html(); | |
438 | + new YAHOO.widget.Button( | |
439 | + "i3GEOFTabelaVinculoBotaoCriar", | |
440 | + {onclick:{fn: function(){ | |
441 | + | |
442 | + }}} | |
443 | + ); | |
444 | + i3GEOF.tabela.vinculos.lista(); | |
445 | + }, | |
446 | + comboColunasT1: function(){ | |
447 | + var colunas = i3GEOF.tabela.comboColunas( | |
448 | + $i("i3GEOFTabelaOpcoesAdicionaVinculoT1").value, | |
449 | + "i3GEOFTabelaOpcoesAdicionaVinculoColunaT1" | |
450 | + ), | |
451 | + ins = ""; | |
452 | + ins = " <p class=paragrafo >" + $trad(48,i3GEOF.tabela.dicionario) + "<br>" + colunas; | |
453 | + $i("i3GEOFTabelaVinculoT1Colunas").innerHTML = ins; | |
454 | + }, | |
455 | + comboColunasT2: function(){ | |
456 | + var colunas = i3GEOF.tabela.comboColunas( | |
457 | + $i("i3GEOFTabelaOpcoesAdicionaVinculoT2").value, | |
458 | + "i3GEOFTabelaOpcoesAdicionaVinculoColunaT2" | |
459 | + ), | |
460 | + ins = ""; | |
461 | + ins = " <p class=paragrafo >" + $trad(48,i3GEOF.tabela.dicionario) + "<br>" + colunas; | |
462 | + $i("i3GEOFTabelaVinculoT2Colunas").innerHTML = ins; | |
463 | + }, | |
464 | + lista: function(){ | |
465 | + $i("i3GEOFtabelaVinculosLista").innerHTML = "operacao em desenvolvimento"; | |
466 | + } | |
467 | + }, | |
468 | + comboJanelas: function(idcombo,funcao,w){ | |
469 | + var i,n = i3GEOF.tabela.janelas.length; | |
470 | + if(!funcao){ | |
471 | + funcao = ""; | |
472 | + } | |
473 | + if(!w){ | |
474 | + w = 270; | |
475 | + } | |
476 | + ins = "" + | |
477 | + " <select style='width:" + w + "px;' id='" + idcombo + "' onchange='" + funcao + "'>" + | |
478 | + " <option value='' >---</option>"; | |
479 | + for(i=0;i<n;i++){ | |
480 | + ins += "<option value='" + i3GEOF.tabela.janelas[i] + "' >" + i3GEOF.tabela.janelas[i] + "</option>"; | |
481 | + } | |
482 | + ins += "</select>"; | |
483 | + return ins; | |
484 | + }, | |
485 | + comboColunas: function(idJanela,idcombo,funcao,w){ | |
486 | + var i, | |
487 | + c = i3GEOF.tabela.propJanelas[idJanela].colunas, | |
488 | + n = c.itens.length; | |
489 | + if(!funcao){ | |
490 | + funcao = ""; | |
491 | + } | |
492 | + if(!w){ | |
493 | + w = 270; | |
494 | + } | |
495 | + ins = "" + | |
496 | + " <select style='width:" + w + "px;' id='" + idcombo + "' onchange='" + funcao + "'>" + | |
497 | + " <option value='' >---</option>"; | |
498 | + for(i=0;i<n;i++){ | |
499 | + ins += "<option value='" + c.itens[i] + "' >" + c.alias[i] + "</option>"; | |
500 | + } | |
501 | + ins += "</select>"; | |
502 | + return ins; | |
503 | + }, | |
382 | 504 | /* |
383 | 505 | Function: novaJanela |
384 | 506 | |
... | ... | @@ -640,6 +762,10 @@ i3GEOF.tabela = { |
640 | 762 | //cabecalho da tabela |
641 | 763 | ins = "<table id="+idjanela+"i3GEOtabelatabelai class=lista8 >"; |
642 | 764 | ins += "<tr><td style='background-color:yellow'></td><td style='background-color:yellow'></td><td style='background-color:yellow'></td><td style='background-color:yellow'></td>"; |
765 | + i3GEOF.tabela.propJanelas[idjanela].colunas = { | |
766 | + "itens": retorno.data[0].itens, | |
767 | + "alias": retorno.data[0].alias | |
768 | + }; | |
643 | 769 | n = retorno.data[0].itens.length; |
644 | 770 | for (i=0;i<n;i++){ |
645 | 771 | ins += "<td accessKey='"+(i * 1 + 4)+"' style='background-color:yellow' ><img style=cursor:pointer onclick='i3GEOF.tabela.excluiColuna(this,"+(i * 1 + 4)+")' src='"+i3GEO.configura.locaplic+"/imagens/x.gif' title='"+$trad("t12")+"' /> <img style=cursor:pointer onclick='i3GEOF.tabela.ordenaColuna(this,"+(i * 1 + 4)+")' src='"+i3GEO.configura.locaplic+"/imagens/ordena1.gif' title='"+$trad(31,i3GEOF.tabela.dicionario)+"' /><br><span title='"+retorno.data[0].itens[i]+"'> <b>"+retorno.data[0].alias[i]+"</b></span></td>"; | ... | ... |