From 85577a2fc0fd4da869df610198695bcc228553dc Mon Sep 17 00:00:00 2001
From: edmarmoretti
Date: Mon, 7 Nov 2016 20:27:43 -0200
Subject: [PATCH] Inclusão em ogc/index.php da lista de todos as camadas e abertura de modal conforme parâmetros enviados pela url
---
admin/admin.db | Bin 340992 -> 0 bytes
admin1/head.php | 16 ++++++++--------
init/head.php | 16 ++++++++--------
ogc/exec.php | 24 ++++++++++++++++++++++++
ogc/index.js | 98 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
ogc/index.php | 37 ++++++++++++++++++++++++++++++++++---
ogc/menu/grupo/exec.php | 2 +-
7 files changed, 173 insertions(+), 20 deletions(-)
diff --git a/admin/admin.db b/admin/admin.db
index 706e944..321e3d9 100755
Binary files a/admin/admin.db and b/admin/admin.db differ
diff --git a/admin1/head.php b/admin1/head.php
index 6c5f864..34449aa 100755
--- a/admin1/head.php
+++ b/admin1/head.php
@@ -59,13 +59,13 @@ hr {
.btn.btn-fab.btn-fab-mini {
font-size: 12px;
- height: 24px;
- min-width: 24px;
- padding-bottom: 5px;
- padding-left: 5px;
- padding-right: 5px;
- padding-top: 5px;
- width: 24px;
+ height: 28px;
+ min-width: 28px;
+ padding-bottom: 6px;
+ padding-left: 6px;
+ padding-right: 6px;
+ padding-top: 6px;
+ width: 28px;
}
.btn.btn-fab.btn-fab-max {
@@ -81,7 +81,7 @@ hr {
.material-icons.md-18 {
font-size: 18px;
- background-color: #e13023;
+
}
body {
diff --git a/init/head.php b/init/head.php
index b6da17a..f225e33 100755
--- a/init/head.php
+++ b/init/head.php
@@ -83,14 +83,14 @@ hr {
.navbar-collapse { max-height: 100% !important; }
.btn.btn-fab.btn-fab-mini {
- font-size: 12px;
- height: 24px;
- min-width: 24px;
- padding-bottom: 5px;
- padding-left: 5px;
- padding-right: 5px;
- padding-top: 5px;
- width: 24px;
+ font-size: 12px;
+ height: 28px;
+ min-width: 28px;
+ padding-bottom: 6px;
+ padding-left: 6px;
+ padding-right: 6px;
+ padding-top: 6px;
+ width: 28px;
}
.btn.btn-fab.btn-fab-max {
diff --git a/ogc/exec.php b/ogc/exec.php
index 2fa1981..64e0567 100755
--- a/ogc/exec.php
+++ b/ogc/exec.php
@@ -78,6 +78,30 @@ ORDER BY lower(n0.nome_menu)
}
retornaJSON ( array("dados"=>$dados) );
break;
+
+ case "LISTATODAS":
+ $sqlCamadas = "
+ SELECT * FROM (SELECT n3.id_tema AS id_tema,t.codigo_tema AS codigo_tema,t.nome_tema AS nome_tema,t.link_tema AS link_tema,
+ lower(t.ogc_tema) AS ogc_tema,lower(t.download_tema) AS download_tema
+ FROM {$esquemaadmin}i3geoadmin_n3 AS n3, {$esquemaadmin}i3geoadmin_temas AS t
+ WHERE n3.id_tema = t.id_tema AND t.ogc_tema != 'NAO' AND n3.publicado != 'NAO' AND (n3_perfil = '' OR n3_perfil isnull )
+ UNION
+ SELECT r.id_tema AS id_tema,t.codigo_tema AS codigo_tema,t.nome_tema AS nome_tema,t.link_tema AS link_tema,
+ lower(t.ogc_tema) AS ogc_tema,lower(t.download_tema) AS download_tema
+ FROM {$esquemaadmin}i3geoadmin_raiz AS r, {$esquemaadmin}i3geoadmin_temas AS t
+ WHERE r.id_tema = t.id_tema AND (t.ogc_tema != 'NAO' OR t.download_tema != 'NAO')) AS u
+ GROUP BY id_tema,codigo_tema,nome_tema,link_tema,ogc_tema,download_tema
+ ORDER BY lower(u.nome_tema)
+ ";
+ $camadas = pegaDados ( $sqlCamadas, "", false );
+ if ($camadas === false) {
+ header ( "HTTP/1.1 500 erro ao consultar banco de dados" );
+ exit ();
+ }
+
+ retornaJSON ( array("dados"=>"","camadas"=>$camadas) );
+ break;
}
+
cpjson ( $retorno );
?>
diff --git a/ogc/index.js b/ogc/index.js
index 0b9add2..1e3ac3e 100755
--- a/ogc/index.js
+++ b/ogc/index.js
@@ -64,5 +64,103 @@ Lista de menus
},
proximoNivel: function(id,nome){
window.location.href = "menu/index.php?id_menu=" + id + "&nome_menu=" + nome;
+ },
+ mostraLinksServico: function(codigo_tema){
+ $(".modal-body").html('Aguarde');
+ var html;
+ tradLinks["tema"] = codigo_tema;
+ html = Mustache.to_html(
+ $("#templateLinksOgc").html(),
+ tradLinks
+ );
+ $(".modal-body").html(html);
+ },
+ mostraLinksDownload: function(codigo_tema){
+ $(".modal-body").html('Aguarde');
+ tradLinks["tema"] = codigo_tema;
+ $.post(
+ "../classesphp/mapa_controle.php",
+ "map_file=&funcao=download3&tema="+codigo_tema
+ )
+ .done(
+ function(data, status){
+ var retorno = jQuery.parseJSON(data).data;
+ var html,arqs,i,n,ins = "";
+ tradLinks["mapfile"] = window.location.protocol + "//" + window.location.host + "/" + retorno.mapfileurl;
+ tradLinks["sldurl"] = tradLinks["urli3geo"] + "/ferramentas/legenda/exec.php?funcao=TEMA2SLD&tema=" + retorno.tema + "&map_file=" + retorno.mapfile;
+ arqs = retorno.arquivos.split(",");
+ n = arqs.length;
+ for (i=0; i"+arqs[i]+"
";
+ }
+ tradLinks["shp"] = ins;
+ html = Mustache.to_html(
+ $("#templateLinksDownload").html(),
+ tradLinks
+ );
+ tradLinks["shp"] = "";
+ tradLinks["mapfile"] = "";
+ tradLinks["sldurl"] = "";
+ $(".modal-body").html(html);
+ }
+ )
+ .fail(function(data){
+ ogc.grupo.ondeLista.html('' + data.status + " " +data.statusText + '
');
+ });
+ },
+
+ listaCompleta: function (onde){
+ $.post(
+ "exec.php",
+ "funcao=listatodas"
+ )
+ .done(
+ function(data, status){
+ var json = jQuery.parseJSON(data);
+ //
+ //monta a lista de camadas
+ //
+ var htmlcamadas = Mustache.to_html(
+ "{{#data}}" + $("#templateCamadas").html() + "{{/data}}",
+ $.extend(
+ {},
+ ogc.menus.dicionario,
+ {
+ "data": json["camadas"],
+ "dominio": "ogc.menus",
+ "disabledlink": function(){
+ if(this.link_tema == ""){
+ return "hidden";
+ }
+ else {
+ return "";
+ }
+ },
+ "disableddown": function(){
+ if(this.download_tema != "nao"){
+ return "";
+ }
+ else {
+ return "hidden";
+ }
+ },
+ "disabledogc": function(){
+ if(this.ogc_tema != "nao"){
+ return "";
+ }
+ else {
+ return "hidden";
+ }
+ }
+ }
+ )
+ );
+ ogc.menus.ondeLista.html(htmlcamadas);
+ $.material.init();
+ }
+ )
+ .fail(function(data){
+ ogc.menus.ondeLista.html('' + data.status + " " +data.statusText + '
');
+ });
}
};
\ No newline at end of file
diff --git a/ogc/index.php b/ogc/index.php
index b9ac1f8..8ea8329 100755
--- a/ogc/index.php
+++ b/ogc/index.php
@@ -3,6 +3,12 @@ define ( ONDEI3GEO, ".." );
include (dirname ( __FILE__ ) . "/../ms_configura.php");
include_once (dirname(__FILE__)."/../classesphp/sani_request.php");
error_reporting ( 0 );
+// pega a extensao geografica
+if ($ogcwsmap == "") {
+ $ogcwsmap = $locaplic . "/aplicmap/ogcws.map";
+}
+$map = ms_newMapObj ( $ogcwsmap );
+$mapext = $map->extent->minx . "," . $map->extent->miny . "," . $map->extent->maxx . "," . $map->extent->maxy;
include (ONDEI3GEO."/init/head.php");
?>
@@ -23,7 +29,7 @@ include (ONDEI3GEO."/init/head.php");
-
-
+
+
+
+
+
@@ -59,7 +68,15 @@ include (ONDEI3GEO."/init/head.php");