From ff9ce555ba1adbed570e3761df86a2cfbd93037e Mon Sep 17 00:00:00 2001 From: Edmar Moretti Date: Tue, 16 Aug 2011 13:19:42 +0000 Subject: [PATCH] Permissão para edição da legenda de temas do tipo gráfico --- admin/admin.db | Bin 74752 -> 0 bytes classesjs/classe_arvoredecamadas.js | 17 +++++++++-------- classesjs/classe_configura.js | 1 + classesjs/classe_eventos.js | 30 ++++++++++++++++-------------- classesjs/classe_janela.js | 5 ++++- classesjs/classe_mapa.js | 2 +- classesjs/classe_util.js | 6 ++++-- classesphp/classe_temas.php | 2 +- ferramentas/graficotema/index.js.php | 16 +++++++++++++++- interface/openlayers.htm | 2 +- 10 files changed, 52 insertions(+), 29 deletions(-) diff --git a/admin/admin.db b/admin/admin.db index dbdc82f..fc1958c 100644 Binary files a/admin/admin.db and b/admin/admin.db differ diff --git a/classesjs/classe_arvoredecamadas.js b/classesjs/classe_arvoredecamadas.js index 213faf3..7c80c8c 100644 --- a/classesjs/classe_arvoredecamadas.js +++ b/classesjs/classe_arvoredecamadas.js @@ -938,7 +938,7 @@ i3GEO.arvoreDeCamadas = { i3GEO.arvoreDeCamadas.adicionaOpcaoTema($trad("t37"),$trad("t37"),'i3GEO.tema.dialogo.graficotema(\"'+ltema.name+'\")',node); } } - if (ltema.type < 4 && funcoes.editorlegenda === true){ + if ((ltema.type < 4 || ltema.type === 8) && funcoes.editorlegenda === true){ i3GEO.arvoreDeCamadas.adicionaOpcaoTema($trad("t32"),$trad("t33"),'i3GEO.tema.dialogo.editaLegenda(\"'+ltema.name+'\")',node); } if(funcoes.destacar === true && i3GEO.Interface.ATUAL !== "googlemaps" && i3GEO.Interface.ATUAL !== "googleearth" && i3GEO.Interface.ATUAL !== "flamingo"){ @@ -1429,6 +1429,7 @@ i3GEO.arvoreDeCamadas = { var novon = novo.length,i; if(novon !== atual.length) {return (false);} + for (i=0;i 0){ + i -= 1; if(camadas[i].name === idtema){ - v = camadas[i]; + return camadas[i]; } - } - return v; + } + return false; }, /* Function: filtraCamadas diff --git a/classesjs/classe_configura.js b/classesjs/classe_configura.js index c12810d..5560a23 100644 --- a/classesjs/classe_configura.js +++ b/classesjs/classe_configura.js @@ -189,6 +189,7 @@ i3GEO.configura = { { id:"omenudataFerramentas5b",text: $trad("t29"), url: "javascript:i3GEO.tema.dialogo.filtro()"}, { id:"omenudataFerramentas6b",text: $trad("t33"), url: "javascript:i3GEO.tema.dialogo.editaLegenda()"}, { id:"omenudataFerramentas7b",text: $trad("t42"), url: "javascript:i3GEO.tema.dialogo.cortina()"}, + { id:"omenudataFerramentas8b",text: $trad("t37"), url: "javascript:i3GEO.tema.dialogo.graficotema()"}, { id:"omenudataFerramentas0c",text: ''+$trad("a15")+'',url: "#"}, { id:"omenudataFerramentas1c",text: $trad("a16"), url: "javascript:i3GEO.arvoreDeTemas.dialogo.conectaservico()"}, { id:"omenudataFerramentas0d",text: 'Upload',url: "#"}, diff --git a/classesjs/classe_eventos.js b/classesjs/classe_eventos.js index 0946832..9f0a9b9 100644 --- a/classesjs/classe_eventos.js +++ b/classesjs/classe_eventos.js @@ -512,20 +512,22 @@ i3GEO.eventos = { if (g_tipoacao !== "capturaponto"){return;} else{ try{ - x = objposicaocursor.dmsx.split(" "); - y = objposicaocursor.dmsy.split(" "); - if (doc.getElementById(ixg)) - {doc.getElementById(ixg).value = x[0];} - if (doc.getElementById(ixm)) - {doc.getElementById(ixm).value = x[1];} - if (doc.getElementById(ixs)) - {doc.getElementById(ixs).value = x[2];} - if (doc.getElementById(iyg)) - {doc.getElementById(iyg).value = y[0];} - if (doc.getElementById(iym)) - {doc.getElementById(iym).value = y[1];} - if (doc.getElementById(iys)) - {doc.getElementById(iys).value = y[2];} + if(doc){ + x = objposicaocursor.dmsx.split(" "); + y = objposicaocursor.dmsy.split(" "); + if (doc.getElementById(ixg)) + {doc.getElementById(ixg).value = x[0];} + if (doc.getElementById(ixm)) + {doc.getElementById(ixm).value = x[1];} + if (doc.getElementById(ixs)) + {doc.getElementById(ixs).value = x[2];} + if (doc.getElementById(iyg)) + {doc.getElementById(iyg).value = y[0];} + if (doc.getElementById(iym)) + {doc.getElementById(iym).value = y[1];} + if (doc.getElementById(iys)) + {doc.getElementById(iys).value = y[2];} + } } catch(m){ if(typeof(console) !== 'undefined'){console.error(m);} diff --git a/classesjs/classe_janela.js b/classesjs/classe_janela.js index 8b4c4e5..76d7416 100644 --- a/classesjs/classe_janela.js +++ b/classesjs/classe_janela.js @@ -805,7 +805,10 @@ i3GEO.janela = { c.style.position = "relative"; c.style.fontSize = "10px"; c.style.color = "#686868"; - c.value = i3GEOF[ferramenta].tema; + if(i3GEO.temaAtivo !== "") + {c.value = i3GEO.temaAtivo;} + if(i3GEOF[ferramenta].tema) + {c.value = i3GEOF[ferramenta].tema;} if(c.value === ""){ i3GEOF[ferramenta].tema = ""; $i("i3GEOF."+ferramenta+"_corpo").innerHTML = ""; diff --git a/classesjs/classe_mapa.js b/classesjs/classe_mapa.js index 7a5c9b5..31f83e6 100644 --- a/classesjs/classe_mapa.js +++ b/classesjs/classe_mapa.js @@ -73,7 +73,7 @@ i3GEO.mapa = { var temp,Dw,Dh, r = false; Dw = YAHOO.util.Dom.getViewportWidth(); Dh = YAHOO.util.Dom.getViewportHeight(); - if(typeof(console) !== 'undefined'){console.info(Dw+" "+Dh+" "+i3GEO.tamanhodoc);} + if(Math.abs(Dw - i3GEO.tamanhodoc[0]) > 50){ r = true; } diff --git a/classesjs/classe_util.js b/classesjs/classe_util.js index 693820e..cfffcdb 100644 --- a/classesjs/classe_util.js +++ b/classesjs/classe_util.js @@ -1491,7 +1491,7 @@ i3GEO.util = { {nome = "";} if (arguments.length < 5) {multiplo = false;} - var monta, lista, temp; + var monta, lista, temp, temp1, temp2; monta = function(retorno){ var i,comboTemas,temp,n,nome; if (retorno !== undefined) @@ -1542,7 +1542,9 @@ i3GEO.util = { if(tipoCombo === "ligadosComTabela"){ if(i3GEO.arvoreDeCamadas.CAMADAS !== ""){ temp = i3GEO.arvoreDeCamadas.filtraCamadas("status",2,"igual",i3GEO.arvoreDeCamadas.CAMADAS); - monta(i3GEO.arvoreDeCamadas.filtraCamadas("type",3,"menor",temp)); + temp1 = i3GEO.arvoreDeCamadas.filtraCamadas("type",3,"menor",temp); + temp2 = i3GEO.arvoreDeCamadas.filtraCamadas("type",8,"igual",temp); + monta(temp1.concat(temp2)); } else {i3GEO.php.listaTemas(monta,"ligados",i3GEO.configura.locaplic,i3GEO.configura.sid);} diff --git a/classesphp/classe_temas.php b/classesphp/classe_temas.php index 60e33e2..26932d3 100644 --- a/classesphp/classe_temas.php +++ b/classesphp/classe_temas.php @@ -892,7 +892,7 @@ lista - lista de item e cores de cada parte do grafico $novolayer = ms_newLayerObj($this->mapa, $this->layer); $nomer = nomeRandomico(); $novolayer->set("name",$nomer); - //$novolayer->set("group",$nomer); + $novolayer->set("group",""); $novolayer->set("type",MS_LAYER_CHART); $novolayer->setprocessing("CHART_TYPE=$tipo"); $novolayer->setprocessing("CHART_SIZE=$tamanho"); diff --git a/ferramentas/graficotema/index.js.php b/ferramentas/graficotema/index.js.php index 6123ab9..bca7637 100644 --- a/ferramentas/graficotema/index.js.php +++ b/ferramentas/graficotema/index.js.php @@ -59,6 +59,11 @@ i3GEOF.graficoTema = { iddiv {String} - id do div que receberá o conteudo HTML da ferramenta */ inicia: function(iddiv){ + i3GEO.janela.comboCabecalhoTemas("i3GEOFgraficotemaComboCabeca","i3GEOFgraficotemaComboCabecaSel","graficoTema","ligadosComTabela"); + if(i3GEO.temaAtivo === ""){ + $i(iddiv).innerHTML = "Escolha um tema na lista mostrada no cabeçalho"; + return; + } try{ $i(iddiv).innerHTML += i3GEOF.graficoTema.html(); i3GEO.guias.mostraGuiaFerramenta("i3GEOgraficotemaguia1","i3GEOgraficotemaguia"); @@ -148,8 +153,12 @@ i3GEOF.graficoTema = { */ criaJanelaFlutuante: function(){ var minimiza,cabecalho,janela,divid,temp,titulo; + if($i("i3GEOF.graficoTema")){ + i3GEOF.graficoTema.inicia("i3GEOF.graficoTema_corpo"); + return; + } //cria a janela flutuante - titulo = "Graficos    "; + titulo = "
------
   Graficos    "; janela = i3GEO.janela.cria( "400px", "320px", @@ -165,6 +174,11 @@ i3GEOF.graficoTema = { i3GEOF.graficoTema.aguarde = $i("i3GEOF.graficoTema_imagemCabecalho").style; $i("i3GEOF.graficoTema_corpo").style.backgroundColor = "white"; i3GEOF.graficoTema.inicia(divid); + temp = function(){ + if(i3GEO.eventos.ATUALIZAARVORECAMADAS.toString().search('i3GEO.janela.comboCabecalhoTemas("i3GEOFgraficotemaComboCabeca","i3GEOFgraficotemaComboCabecaSel","tabela","ligadosComTabela")') > 0) + {i3GEO.eventos.ATUALIZAARVORECAMADAS.remove('i3GEO.janela.comboCabecalhoTemas("i3GEOFgraficotemaComboCabeca","i3GEOFgraficotemaComboCabecaSel","tabela","ligadosComTabela")');} + }; + YAHOO.util.Event.addListener(janela[0].close, "click", temp); }, /* Function: montaListaItens diff --git a/interface/openlayers.htm b/interface/openlayers.htm index 9e525f4..ee63d0f 100644 --- a/interface/openlayers.htm +++ b/interface/openlayers.htm @@ -101,7 +101,7 @@ - +