Commit a641f66b449e7bf1799938d321904d6e49b713aa
1 parent
4b02f7e3
Exists in
master
and in
7 other branches
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.
Showing
7 changed files
with
43 additions
and
21 deletions
Show diff stats
admin/admin.db
No preview for this file type
admin/js/arvore.js
| ... | ... | @@ -512,7 +512,8 @@ function novoGrupo(id_menu) |
| 512 | 512 | tempNode.isLeaf = false; |
| 513 | 513 | tempNode.setDynamicLoad(loadSubgruposData, temaIconMode, id_menu); |
| 514 | 514 | tree.draw(); |
| 515 | - core_carregando("desativa"); | |
| 515 | + core_carregando("desativa"); | |
| 516 | + editar('grupo',dados.id_n1); | |
| 516 | 517 | }, |
| 517 | 518 | failure:core_handleFailure, |
| 518 | 519 | argument: { foo:"foo", bar:"bar" } |
| ... | ... | @@ -546,6 +547,7 @@ function novoSubGrupo(id_menu,id_n1) |
| 546 | 547 | tempNode.setDynamicLoad(loadSubgruposData, temaIconMode, id_menu); |
| 547 | 548 | tree.draw(); |
| 548 | 549 | core_carregando("desativa"); |
| 550 | + editar("subgrupo",dados.id_n2); | |
| 549 | 551 | }, |
| 550 | 552 | failure:core_handleFailure, |
| 551 | 553 | argument: { foo:"foo", bar:"bar" } |
| ... | ... | @@ -578,6 +580,7 @@ function novoTema(id_menu,id_n2) |
| 578 | 580 | tempNode.isLeaf = true; |
| 579 | 581 | tree.draw(); |
| 580 | 582 | core_carregando("desativa"); |
| 583 | + editar('tema',dados.id_n3); | |
| 581 | 584 | }, |
| 582 | 585 | failure:core_handleFailure, |
| 583 | 586 | argument: { foo:"foo", bar:"bar" } | ... | ... |
admin/js/atlas.js
| ... | ... | @@ -54,7 +54,9 @@ function ativaBotaoAdicionaAtlas(sUrl,idBotao) |
| 54 | 54 | { |
| 55 | 55 | try |
| 56 | 56 | { |
| 57 | - adicionaNosAtlas(YAHOO.lang.JSON.parse(o.responseText),true); | |
| 57 | + var j = YAHOO.lang.JSON.parse(o.responseText); | |
| 58 | + adicionaNosAtlas(j,true); | |
| 59 | + editar("atlas",j[j.length-1].id_atlas); | |
| 58 | 60 | core_carregando("desativa"); |
| 59 | 61 | } |
| 60 | 62 | catch(e){core_handleFailure(e,o.responseText);} |
| ... | ... | @@ -151,11 +153,17 @@ function adicionaNosTemas(no,dados,redesenha) |
| 151 | 153 | } |
| 152 | 154 | for (var i=0, j=dados.length; i<j; i++) |
| 153 | 155 | { |
| 156 | + if(dados[i].nome_tema == "null" || !dados[i].nome_tema || dados[i].codigo_tema == "") | |
| 157 | + {dados[i].nome_tema = "";} | |
| 154 | 158 | var conteudo = " <img style=\"position:relative;cursor:pointer;top:0px\" onclick=\"sobeDesce('sobe','tema','"+dados[i].id_tema+"')\" title=sobe src=\"../imagens/34.png\" />" |
| 155 | 159 | conteudo += " <img style=\"position:relative;cursor:pointer;top:0px\" onclick=\"sobeDesce('desce','tema','"+dados[i].id_tema+"')\" title=desce src=\"../imagens/33.png\" />" |
| 156 | 160 | conteudo += " <img style=\"position:relative;cursor:pointer;top:0px\" onclick=\"excluir('tema','"+dados[i].id_tema+"')\" title=excluir width='10px' heigth='10px' src=\"../imagens/01.png\" />" |
| 157 | 161 | conteudo += " <img style=\"position:relative;cursor:pointer;top:0px\" onclick=\"testarMapfile('"+dados[i].codigo_tema+"')\" title=testar width='10px' heigth='10px' src=\"../imagens/41.png\" />" |
| 158 | - conteudo += " <img style=\"position:relative;cursor:pointer;top:0px\" onclick=\"editar('tema','"+dados[i].id_tema+"')\" title=editar width='10px' heigth='10px' src=\"../imagens/06.png\" /> <span>"+dados[i].codigo_tema+"</span>" | |
| 162 | + conteudo += " <img style=\"position:relative;cursor:pointer;top:0px\" onclick=\"editar('tema','"+dados[i].id_tema+"')\" title=editar width='10px' heigth='10px' src=\"../imagens/06.png\" />" | |
| 163 | + if(dados[i].codigo_tema != "") | |
| 164 | + {conteudo += " <span>"+dados[i].codigo_tema+" - </span><span style=color:gray >"+dados[i].nome_tema+"</span>"} | |
| 165 | + else | |
| 166 | + {conteudo += " <span style=color:red >Edite para definir o tema!!!</span>"} | |
| 159 | 167 | var d = {html:conteudo,id_tema:dados[i].id_tema,tipo:"tema"} |
| 160 | 168 | var tempNode = new YAHOO.widget.HTMLNode(d, no, false,true); |
| 161 | 169 | tempNode.isLeaf = true; |
| ... | ... | @@ -213,7 +221,11 @@ function adicionaNosPranchas(no,dados,redesenha) |
| 213 | 221 | var conteudo = " <img style=\"position:relative;cursor:pointer;top:0px\" onclick=\"sobeDesce('sobe','prancha','"+dados[i].id_prancha+"')\" title=sobe src=\"../imagens/34.png\" />" |
| 214 | 222 | conteudo += " <img style=\"position:relative;cursor:pointer;top:0px\" onclick=\"sobeDesce('desce','prancha','"+dados[i].id_prancha+"')\" title=desce src=\"../imagens/33.png\" />" |
| 215 | 223 | conteudo += " <img style=\"position:relative;cursor:pointer;top:0px\" onclick=\"excluir('prancha','"+dados[i].id_prancha+"')\" title=excluir width='10px' heigth='10px' src=\"../imagens/01.png\" />" |
| 216 | - conteudo += " <img style=\"position:relative;cursor:pointer;top:0px\" onclick=\"editar('prancha','"+dados[i].id_prancha+"')\" title=editar width='10px' heigth='10px' src=\"../imagens/06.png\" /> <span>"+dados[i].titulo_prancha+"</span>" | |
| 224 | + conteudo += " <img style=\"position:relative;cursor:pointer;top:0px\" onclick=\"editar('prancha','"+dados[i].id_prancha+"')\" title=editar width='10px' heigth='10px' src=\"../imagens/06.png\" />" | |
| 225 | + if(dados[i].titulo_prancha != "") | |
| 226 | + {conteudo += " <span>"+dados[i].titulo_prancha+"</span>"} | |
| 227 | + else | |
| 228 | + {conteudo += " <span style=color:red >Edite para definir a prancha!!!</span>"} | |
| 217 | 229 | var d = {html:conteudo,id_prancha:dados[i].id_prancha,tipo:"prancha"} |
| 218 | 230 | var tempNode = new YAHOO.widget.HTMLNode(d, no, false,true); |
| 219 | 231 | //tempNode.isLeaf = true; |
| ... | ... | @@ -229,7 +241,11 @@ function adicionaNosAtlas(dados,redesenha) |
| 229 | 241 | var conteudo = " <img style=\"position:relative;cursor:pointer;top:0px\" onclick=\"sobeDesce('sobe','atlas','"+dados[i].id_atlas+"')\" title=sobe src=\"../imagens/34.png\" />" |
| 230 | 242 | conteudo += " <img style=\"position:relative;cursor:pointer;top:0px\" onclick=\"sobeDesce('desce','atlas','"+dados[i].id_atlas+"')\" title=desce src=\"../imagens/33.png\" />" |
| 231 | 243 | conteudo += " <img style=\"position:relative;cursor:pointer;top:2px\" onclick=\"excluir('atlas','"+dados[i].id_atlas+"')\" title=excluir src=\"../imagens/01.png\" />" |
| 232 | - conteudo += " <img style=\"position:relative;cursor:pointer;top:2px\" onclick=\"editar('atlas','"+dados[i].id_atlas+"')\" title=editar src=\"../imagens/06.png\" /><b> <span>"+dados[i].titulo_atlas+"</span>" | |
| 244 | + conteudo += " <img style=\"position:relative;cursor:pointer;top:2px\" onclick=\"editar('atlas','"+dados[i].id_atlas+"')\" title=editar src=\"../imagens/06.png\" /><b>" | |
| 245 | + if(dados[i].titulo_atlas != "") | |
| 246 | + {conteudo += " <span>"+dados[i].titulo_atlas+"</span>"} | |
| 247 | + else | |
| 248 | + {conteudo += " <span style=color:red >Edite para definir o Atlas!!!</span>"} | |
| 233 | 249 | var d = {html:conteudo,id_atlas:dados[i].id_atlas,tipo:"atlas"}; |
| 234 | 250 | var tempNode = new YAHOO.widget.HTMLNode(d, root, false,true); |
| 235 | 251 | } |
| ... | ... | @@ -445,8 +461,9 @@ function adicionarTema(id) |
| 445 | 461 | { |
| 446 | 462 | success: function(oResponse) |
| 447 | 463 | { |
| 448 | - var dados = YAHOO.lang.JSON.parse(oResponse.responseText) | |
| 464 | + var dados = YAHOO.lang.JSON.parse(oResponse.responseText); | |
| 449 | 465 | adicionaNosTemas(no,dados,true) |
| 466 | + editar('tema',dados[dados.length-1].id_tema); | |
| 450 | 467 | }, |
| 451 | 468 | failure:core_handleFailure, |
| 452 | 469 | argument: { foo:"foo", bar:"bar" } |
| ... | ... | @@ -471,6 +488,7 @@ function adicionarPrancha(id) |
| 471 | 488 | { |
| 472 | 489 | var dados = YAHOO.lang.JSON.parse(oResponse.responseText) |
| 473 | 490 | adicionaNosPranchas(no,dados,true) |
| 491 | + editar('prancha',dados[dados.length-1].id_prancha); | |
| 474 | 492 | }, |
| 475 | 493 | failure:core_handleFailure, |
| 476 | 494 | argument: { foo:"foo", bar:"bar" } |
| ... | ... | @@ -530,18 +548,21 @@ function gravaDados(tipo,id) |
| 530 | 548 | { |
| 531 | 549 | var no = tree.getNodeByProperty("id_atlas",id) |
| 532 | 550 | no.getContentEl().getElementsByTagName("span")[0].innerHTML = document.getElementById("Etitulo_atlas").value |
| 551 | + no.getContentEl().getElementsByTagName("span")[0].style.color = ""; | |
| 533 | 552 | no.html = no.getContentEl().innerHTML; |
| 534 | 553 | } |
| 535 | 554 | if(tipo == "prancha") |
| 536 | 555 | { |
| 537 | 556 | var no = tree.getNodeByProperty("id_prancha",id) |
| 538 | 557 | no.getContentEl().getElementsByTagName("span")[0].innerHTML = document.getElementById("Etitulo_prancha").value |
| 558 | + no.getContentEl().getElementsByTagName("span")[0].style.color = ""; | |
| 539 | 559 | no.html = no.getContentEl().innerHTML; |
| 540 | 560 | } |
| 541 | 561 | if(tipo == "tema") |
| 542 | 562 | { |
| 543 | 563 | var no = tree.getNodeByProperty("id_tema",id) |
| 544 | 564 | no.getContentEl().getElementsByTagName("span")[0].innerHTML = document.getElementById("Ecodigo_tema").value |
| 565 | + no.getContentEl().getElementsByTagName("span")[0].style.color = ""; | |
| 545 | 566 | no.html = no.getContentEl().innerHTML; |
| 546 | 567 | } |
| 547 | 568 | core_carregando("desativa"); | ... | ... |
admin/js/editormapfile.js
admin/php/atlas.php
| ... | ... | @@ -92,7 +92,7 @@ switch (strtoupper($funcao)) |
| 92 | 92 | {JSON} |
| 93 | 93 | */ |
| 94 | 94 | case "PEGATEMAS": |
| 95 | - retornaJSON(pegaDados("SELECT * from i3geoadmin_atlast where id_prancha = '$id_prancha' order by ordem_tema")); | |
| 95 | + 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")); | |
| 96 | 96 | exit; |
| 97 | 97 | break; |
| 98 | 98 | /* | ... | ... |
temas/acidmap.map
| 1 | -MAP | |
| 2 | - FONTSET "c:\ms4w\apache\htdocs\i3geo/symbols/fontes.txt" | |
| 3 | - SYMBOLSET "c:\ms4w\apache\htdocs\i3geo/symbols/simbolos.sym" | |
| 1 | +MAP | |
| 2 | + FONTSET "c:\ms4w\apache\htdocs\i3geo/symbols/fontes.txt" | |
| 3 | + SYMBOLSET "c:\ms4w\apache\htdocs\i3geo/symbols/simbolos.sym" | |
| 4 | 4 | LAYER |
| 5 | - #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 | |
| 6 | - #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" | |
| 7 | 5 | 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" |
| 8 | - CONNECTIONTYPE WMS | |
| 6 | + CONNECTIONTYPE WMS | |
| 9 | 7 | METADATA |
| 10 | 8 | "wms_srs" "EPSG:4326" |
| 11 | 9 | "tipooriginal" "" |
| ... | ... | @@ -14,13 +12,11 @@ MAP |
| 14 | 12 | "wfs" "nao" |
| 15 | 13 | "wms_force_separate_request" "1" |
| 16 | 14 | "TEXTO" "NAO" |
| 17 | - #"legendawms" "http://localhost:8080/geoserver/wms&service=wms&request=getlegendgraphic&version=1.1.1&service=wms&layer=i3geo:locali&format=image/png" | |
| 18 | 15 | "formatosinfo" "text/plain,application/vnd.ogc.gml,text/html" |
| 19 | 16 | "wms_name" "i3geo:locali" |
| 20 | 17 | "nomeoriginal" "i3geo:locali" |
| 21 | 18 | "wms_format" "image/png" |
| 22 | 19 | "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" |
| 23 | - #"wms_connectiontimeout" "30" | |
| 24 | 20 | "tema" "i3geo:locali" |
| 25 | 21 | "wms_server_version" "1.1.1" |
| 26 | 22 | "wms_style" "" |
| ... | ... | @@ -31,4 +27,6 @@ MAP |
| 31 | 27 | TYPE RASTER |
| 32 | 28 | UNITS METERS |
| 33 | 29 | END |
| 30 | + | |
| 34 | 31 | END |
| 32 | + | ... | ... |
temas/atlas_biomas.map
| 1 | -MAP | |
| 2 | - | |
| 3 | - | |
| 4 | -SYMBOLSET ../symbols/simbolos.sym | |
| 5 | -FONTSET "../symbols/fontes.txt" | |
| 1 | +MAP | |
| 2 | + FONTSET "../symbols/fontes.txt" | |
| 3 | + SYMBOLSET "../symbols/simbolos.sym" | |
| 6 | 4 | LAYER |
| 7 | 5 | CONNECTION "http://mapas.mma.gov.br/i3geo/ogc.php?tema=bioma" |
| 8 | 6 | CONNECTIONTYPE WMS |
| ... | ... | @@ -29,7 +27,8 @@ FONTSET "../symbols/fontes.txt" |
| 29 | 27 | UNITS METERS |
| 30 | 28 | CLASS |
| 31 | 29 | NAME "testevvvvv" |
| 32 | - KEYIMAGE "" | |
| 33 | 30 | END |
| 34 | 31 | END |
| 32 | + | |
| 35 | 33 | END |
| 34 | + | ... | ... |