From a641f66b449e7bf1799938d321904d6e49b713aa Mon Sep 17 00:00:00 2001 From: Edmar Moretti Date: Sat, 16 Jul 2011 19:33:22 +0000 Subject: [PATCH] Modificação no comportamento dos botões que adicionam elementos nos editores de atlas, mapfiles e árvore de temas. Ao adicionar, o formulário de edição agora é aberto automaticamente. --- admin/admin.db | Bin 71680 -> 0 bytes admin/js/arvore.js | 5 ++++- admin/js/atlas.js | 31 ++++++++++++++++++++++++++----- admin/js/editormapfile.js | 1 + admin/php/atlas.php | 2 +- temas/acidmap.map | 14 ++++++-------- temas/atlas_biomas.map | 11 +++++------ 7 files changed, 43 insertions(+), 21 deletions(-) diff --git a/admin/admin.db b/admin/admin.db index fee86e0..b826e26 100644 Binary files a/admin/admin.db and b/admin/admin.db differ diff --git a/admin/js/arvore.js b/admin/js/arvore.js index 6a26a21..3a35320 100644 --- a/admin/js/arvore.js +++ b/admin/js/arvore.js @@ -512,7 +512,8 @@ function novoGrupo(id_menu) tempNode.isLeaf = false; tempNode.setDynamicLoad(loadSubgruposData, temaIconMode, id_menu); tree.draw(); - core_carregando("desativa"); + core_carregando("desativa"); + editar('grupo',dados.id_n1); }, failure:core_handleFailure, argument: { foo:"foo", bar:"bar" } @@ -546,6 +547,7 @@ function novoSubGrupo(id_menu,id_n1) tempNode.setDynamicLoad(loadSubgruposData, temaIconMode, id_menu); tree.draw(); core_carregando("desativa"); + editar("subgrupo",dados.id_n2); }, failure:core_handleFailure, argument: { foo:"foo", bar:"bar" } @@ -578,6 +580,7 @@ function novoTema(id_menu,id_n2) tempNode.isLeaf = true; tree.draw(); core_carregando("desativa"); + editar('tema',dados.id_n3); }, failure:core_handleFailure, argument: { foo:"foo", bar:"bar" } diff --git a/admin/js/atlas.js b/admin/js/atlas.js index 7ec64bc..0665d5a 100644 --- a/admin/js/atlas.js +++ b/admin/js/atlas.js @@ -54,7 +54,9 @@ function ativaBotaoAdicionaAtlas(sUrl,idBotao) { try { - adicionaNosAtlas(YAHOO.lang.JSON.parse(o.responseText),true); + var j = YAHOO.lang.JSON.parse(o.responseText); + adicionaNosAtlas(j,true); + editar("atlas",j[j.length-1].id_atlas); core_carregando("desativa"); } catch(e){core_handleFailure(e,o.responseText);} @@ -151,11 +153,17 @@ function adicionaNosTemas(no,dados,redesenha) } for (var i=0, j=dados.length; i" conteudo += " " conteudo += " " conteudo += " " - conteudo += "  "+dados[i].codigo_tema+"" + conteudo += " " + if(dados[i].codigo_tema != "") + {conteudo += " "+dados[i].codigo_tema+" - "+dados[i].nome_tema+""} + else + {conteudo += " Edite para definir o tema!!!"} var d = {html:conteudo,id_tema:dados[i].id_tema,tipo:"tema"} var tempNode = new YAHOO.widget.HTMLNode(d, no, false,true); tempNode.isLeaf = true; @@ -213,7 +221,11 @@ function adicionaNosPranchas(no,dados,redesenha) var conteudo = " " conteudo += " " conteudo += " " - conteudo += "  "+dados[i].titulo_prancha+"" + conteudo += " " + if(dados[i].titulo_prancha != "") + {conteudo += " "+dados[i].titulo_prancha+""} + else + {conteudo += " Edite para definir a prancha!!!"} var d = {html:conteudo,id_prancha:dados[i].id_prancha,tipo:"prancha"} var tempNode = new YAHOO.widget.HTMLNode(d, no, false,true); //tempNode.isLeaf = true; @@ -229,7 +241,11 @@ function adicionaNosAtlas(dados,redesenha) var conteudo = " " conteudo += " " conteudo += " " - conteudo += "  "+dados[i].titulo_atlas+"" + conteudo += " " + if(dados[i].titulo_atlas != "") + {conteudo += " "+dados[i].titulo_atlas+""} + else + {conteudo += " Edite para definir o Atlas!!!"} var d = {html:conteudo,id_atlas:dados[i].id_atlas,tipo:"atlas"}; var tempNode = new YAHOO.widget.HTMLNode(d, root, false,true); } @@ -445,8 +461,9 @@ function adicionarTema(id) { success: function(oResponse) { - var dados = YAHOO.lang.JSON.parse(oResponse.responseText) + var dados = YAHOO.lang.JSON.parse(oResponse.responseText); adicionaNosTemas(no,dados,true) + editar('tema',dados[dados.length-1].id_tema); }, failure:core_handleFailure, argument: { foo:"foo", bar:"bar" } @@ -471,6 +488,7 @@ function adicionarPrancha(id) { var dados = YAHOO.lang.JSON.parse(oResponse.responseText) adicionaNosPranchas(no,dados,true) + editar('prancha',dados[dados.length-1].id_prancha); }, failure:core_handleFailure, argument: { foo:"foo", bar:"bar" } @@ -530,18 +548,21 @@ function gravaDados(tipo,id) { var no = tree.getNodeByProperty("id_atlas",id) no.getContentEl().getElementsByTagName("span")[0].innerHTML = document.getElementById("Etitulo_atlas").value + no.getContentEl().getElementsByTagName("span")[0].style.color = ""; no.html = no.getContentEl().innerHTML; } if(tipo == "prancha") { var no = tree.getNodeByProperty("id_prancha",id) no.getContentEl().getElementsByTagName("span")[0].innerHTML = document.getElementById("Etitulo_prancha").value + no.getContentEl().getElementsByTagName("span")[0].style.color = ""; no.html = no.getContentEl().innerHTML; } if(tipo == "tema") { var no = tree.getNodeByProperty("id_tema",id) no.getContentEl().getElementsByTagName("span")[0].innerHTML = document.getElementById("Ecodigo_tema").value + no.getContentEl().getElementsByTagName("span")[0].style.color = ""; no.html = no.getContentEl().innerHTML; } core_carregando("desativa"); diff --git a/admin/js/editormapfile.js b/admin/js/editormapfile.js index d6fbc7b..1d888c3 100644 --- a/admin/js/editormapfile.js +++ b/admin/js/editormapfile.js @@ -586,6 +586,7 @@ function adicionaNovoLayer(codigoMap) tempNode.setDynamicLoad(loadLayerData, iconMode); tempNode.isLeaf = false; tree.draw(); + editorGeral(codigoMap,dados.layers[0]); core_carregando("desativa"); } } diff --git a/admin/php/atlas.php b/admin/php/atlas.php index 003eaa3..f4121d1 100644 --- a/admin/php/atlas.php +++ b/admin/php/atlas.php @@ -92,7 +92,7 @@ switch (strtoupper($funcao)) {JSON} */ case "PEGATEMAS": - retornaJSON(pegaDados("SELECT * from i3geoadmin_atlast where id_prancha = '$id_prancha' order by ordem_tema")); + retornaJSON(pegaDados("SELECT i3geoadmin_atlast.*,i3geoadmin_temas.nome_tema from i3geoadmin_atlast LEFT JOIN i3geoadmin_temas ON ( i3geoadmin_atlast.codigo_tema = i3geoadmin_temas.codigo_tema ) where id_prancha = '$id_prancha' order by ordem_tema")); exit; break; /* diff --git a/temas/acidmap.map b/temas/acidmap.map index b5cf32b..a5e32f2 100644 --- a/temas/acidmap.map +++ b/temas/acidmap.map @@ -1,11 +1,9 @@ -MAP - FONTSET "c:\ms4w\apache\htdocs\i3geo/symbols/fontes.txt" - SYMBOLSET "c:\ms4w\apache\htdocs\i3geo/symbols/simbolos.sym" +MAP + FONTSET "c:\ms4w\apache\htdocs\i3geo/symbols/fontes.txt" + SYMBOLSET "c:\ms4w\apache\htdocs\i3geo/symbols/simbolos.sym" LAYER - #http://ams.xoomcode.com/geoserver/wms?LAYERS=sf%3Abugsites&STYLES=&FORMAT=image%2Fpng&VALUE_COLUMN=cat&SIMPLIFY_METHOD=3&SIMPLIFY_SIZE=90&INTERVALS%5B%5D=10%2C20%2C45%2C70%2C100&INTERVALS_COLORS%5B%5D=0xffffffcc%2C0xffcc%2C0xff00cc%2C0xffff00cc%2C0xff0000cc&RENDERER_TYPE=2&INTERPOLATION_STRATEGY=2&RADIUS=40&SERVICE=AMS&VERSION=1.1.1&REQUEST=GetMap&EXCEPTIONS=application%2Fvnd.ogc.se_inimage&SRS=EPSG%3A26713&BBOX=582635.72005652,4911438.0767765,616050.17867886,4923193.6965477&WIDTH=938&HEIGHT=330 - #CONNECTION "http://ams.xoomcode.com/geoserver/wms?VALUE_COLUMN=cat&SIMPLIFY_METHOD=3&SIMPLIFY_SIZE=90&INTERVALS%5B%5D=10%2C20%2C45%2C70%2C100&INTERVALS_COLORS%5B%5D=0xffffffcc%2C0xffcc%2C0xff00cc%2C0xffff00cc%2C0xff0000cc&RENDERER_TYPE=2&INTERPOLATION_STRATEGY=2&RADIUS=40&SERVICE=AMS" CONNECTION "http://localhost:8080/geoserver/wms?VALUE_COLUMN=VALOR&SERVICE=AMS&VERSION=1.1.1&REQUEST=GetMap&SRS=EPSG:4326&FORMAT=image/png&EXCEPTIONS=application/vnd.ogc.se_inimage&TILED=true&TRANSPARENT=FALSE&VALUE_COLUMN=value&SIMPLIFY_METHOD=1&SIMPLIFY_SIZE=400&INTERVALS[]=10,20,45,70,100&INTERVALS_COLORS[]=0xffffff00,0xffb2,0xff00b2,0xffff00b2,0xff0000b2&RENDERER_TYPE=2&INTERPOLATION_STRATEGY=2&RADIUS=32" - CONNECTIONTYPE WMS + CONNECTIONTYPE WMS METADATA "wms_srs" "EPSG:4326" "tipooriginal" "" @@ -14,13 +12,11 @@ MAP "wfs" "nao" "wms_force_separate_request" "1" "TEXTO" "NAO" - #"legendawms" "http://localhost:8080/geoserver/wms&service=wms&request=getlegendgraphic&version=1.1.1&service=wms&layer=i3geo:locali&format=image/png" "formatosinfo" "text/plain,application/vnd.ogc.gml,text/html" "wms_name" "i3geo:locali" "nomeoriginal" "i3geo:locali" "wms_format" "image/png" "wms_formatlist" "image/png,application/atom xml,application/atom xml,application/openlayers,application/pdf,application/rss xml,application/rss xml,application/vnd.google-earth.kml,application/vnd.google-earth.kml xml,application/vnd.google-earth.kml xml,application/vnd.google-earth.kmz,application/vnd.google-earth.kmz xml,application/vnd.google-earth.kmz xml,atom,image/geotiff,image/geotiff8,image/gif,image/jpeg,image/png8,image/svg,image/svg xml,image/svg xml,image/tiff,image/tiff8,kml,kmz,openlayers,rss" - #"wms_connectiontimeout" "30" "tema" "i3geo:locali" "wms_server_version" "1.1.1" "wms_style" "" @@ -31,4 +27,6 @@ MAP TYPE RASTER UNITS METERS END + END + diff --git a/temas/atlas_biomas.map b/temas/atlas_biomas.map index 261e97d..a8d3105 100644 --- a/temas/atlas_biomas.map +++ b/temas/atlas_biomas.map @@ -1,8 +1,6 @@ -MAP - - -SYMBOLSET ../symbols/simbolos.sym -FONTSET "../symbols/fontes.txt" +MAP + FONTSET "../symbols/fontes.txt" + SYMBOLSET "../symbols/simbolos.sym" LAYER CONNECTION "http://mapas.mma.gov.br/i3geo/ogc.php?tema=bioma" CONNECTIONTYPE WMS @@ -29,7 +27,8 @@ FONTSET "../symbols/fontes.txt" UNITS METERS CLASS NAME "testevvvvv" - KEYIMAGE "" END END + END + -- libgit2 0.21.2