Commit 7bf918d70614569f03715b96d76bb4ffe67b511c
1 parent
3951d607
Exists in
master
and in
7 other branches
Adaptação do cadastro de webservices para uso com bootstrap
Showing
11 changed files
with
544 additions
and
438 deletions
Show diff stats
admin/admin.db
No preview for this file type
admin/html/webservices_.html
@@ -1,97 +0,0 @@ | @@ -1,97 +0,0 @@ | ||
1 | -<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd"> | ||
2 | -<html> | ||
3 | -<head> | ||
4 | -<meta http-equiv="content-type" content="text/html; charset=ISO-8859-1"> | ||
5 | -<title>Web Services</title> | ||
6 | -<style type="text/css"> | ||
7 | -/*margin and padding on body element | ||
8 | - can introduce errors in determining | ||
9 | - element position and are not recommended; | ||
10 | - we turn them off as a foundation for YUI | ||
11 | - CSS treatments. */ | ||
12 | -body { | ||
13 | - margin: 0; | ||
14 | - padding: 0; | ||
15 | -} | ||
16 | -</style> | ||
17 | -<script type="text/javascript" src="../js/core_.js"></script> | ||
18 | -<script type="text/javascript" src="../dicionario/core.js"></script> | ||
19 | -<script type="text/javascript" src="../js/webservices.js"></script> | ||
20 | -<script type="text/javascript" src="../dicionario/webservices.js"></script> | ||
21 | -<link rel="stylesheet" type="text/css" href="admin.css"> | ||
22 | -</head> | ||
23 | -<body class=" yui-skin-sam fundoPonto" style="background-color: white; margin-top: 20px;"> | ||
24 | - <center> | ||
25 | - <div class="mascaraPrincipal" id="divGeral"> | ||
26 | - <h1>{{{webservices}}}</h1> | ||
27 | - <div id="formulario" style="display: none"> | ||
28 | - <div id="ajuda" style="display: none"> | ||
29 | - <div class="hd">{{{ajuda}}}</div> | ||
30 | - <div class="bd" style="height: 144px; overflow: auto"> | ||
31 | - {{{txtAjuda}}} | ||
32 | - </div> | ||
33 | - <div class="ft"></div> | ||
34 | - </div> | ||
35 | - <input type=button id=adicionaNovoWebservice | ||
36 | - value="{{{adicionaEdereco}}}" /> <br> | ||
37 | - <p>{{{enderecosCadastrados}}}</p> | ||
38 | - <div id="letras_W" ></div><br> | ||
39 | - <div id="tabela" style="left: -5px;"></div> | ||
40 | - <div id=logajax style="display: block"></div> | ||
41 | - </div> | ||
42 | - </div> | ||
43 | - </center> | ||
44 | - <script> | ||
45 | - /* | ||
46 | - Title: Web Services | ||
47 | - | ||
48 | - HTML da interface de administração do cadastro de Web Services | ||
49 | - | ||
50 | - Veja também: | ||
51 | - | ||
52 | - <core.js> | ||
53 | - | ||
54 | - <webservices.js> | ||
55 | - | ||
56 | - Licenca: | ||
57 | - | ||
58 | - GPL2 | ||
59 | - | ||
60 | - i3Geo Interface Integrada de Ferramentas de Geoprocessamento para Internet | ||
61 | - | ||
62 | - Direitos Autorais Reservados (c) 2006 Ministério do Meio Ambiente Brasil | ||
63 | - Desenvolvedor: Edmar Moretti edmar.moretti@mma.gov.br | ||
64 | - | ||
65 | - Este programa é software livre; você pode redistribuí-lo | ||
66 | - e/ou modificá-lo sob os termos da Licença Pública Geral | ||
67 | - GNU conforme publicada pela Free Software Foundation; | ||
68 | - | ||
69 | - Este programa é distribuído na expectativa de que seja útil, | ||
70 | - porém, SEM NENHUMA GARANTIA; nem mesmo a garantia implícita | ||
71 | - de COMERCIABILIDADE OU ADEQUAÇÃO A UMA FINALIDADE ESPECÍFICA. | ||
72 | - Consulte a Licença Pública Geral do GNU para mais detalhes. | ||
73 | - Você deve ter recebido uma cópia da Licença Pública Geral do | ||
74 | - GNU junto com este programa; se não, escreva para a | ||
75 | - Free Software Foundation, Inc., no endereço | ||
76 | - 59 Temple Street, Suite 330, Boston, MA 02111-1307 USA. | ||
77 | - | ||
78 | - Arquivo: | ||
79 | - | ||
80 | - i3geo/admin/html/webservices.html | ||
81 | - */ | ||
82 | - | ||
83 | - //necessario para a ferramenta login e outras | ||
84 | - i3GEO.configura = { | ||
85 | - locaplic : "../.." | ||
86 | - }; | ||
87 | - // | ||
88 | - core_parseMustacheBody(i3GEOadmin.webservices.dicionario); | ||
89 | - cabecalhoGeral("cabecalhoPrincipal", ""); | ||
90 | - temp = function() { | ||
91 | - document.getElementById("formulario").style.display = "block"; | ||
92 | - i3GEOadmin.webservices.inicia(); | ||
93 | - }; | ||
94 | - i3GEO.login.verificaOperacao("admin/html/webservices", | ||
95 | - i3GEO.configura.locaplic, temp, "sessao",i3GEO.login.dialogo.abreLogin); | ||
96 | - </script> | ||
97 | -</body> |
admin/js/estat_unidade_medida.js
@@ -131,7 +131,7 @@ i3GEOadmin.umedida = { | @@ -131,7 +131,7 @@ i3GEOadmin.umedida = { | ||
131 | { label: "Cancela", value: "CANCEL", checked: false } | 131 | { label: "Cancela", value: "CANCEL", checked: false } |
132 | ]); | 132 | ]); |
133 | editorBotoes.on("checkedButtonChange", on_editorCheckBoxChange); | 133 | editorBotoes.on("checkedButtonChange", on_editorCheckBoxChange); |
134 | - YAHOO.umedida.panelEditor2 = new YAHOO.widget.Panel("janela_editor2", { modal:true,fixedcenter:true,close:false,width:"400px", height:"360px",overflow:"auto", visible:false,constraintoviewport:true } ); | 134 | + YAHOO.umedida.panelEditor2 = new YAHOO.widget.Panel("janela_editor2", { modal:true,fixedcenter:"contained",close:false,width:"400px", height:"360px",overflow:"auto", visible:false,constraintoviewport:true } ); |
135 | YAHOO.umedida.panelEditor2.render(); | 135 | YAHOO.umedida.panelEditor2.render(); |
136 | } | 136 | } |
137 | YAHOO.umedida.panelEditor2.show(); | 137 | YAHOO.umedida.panelEditor2.show(); |
@@ -0,0 +1,178 @@ | @@ -0,0 +1,178 @@ | ||
1 | +<?php | ||
2 | +/* | ||
3 | + * Licenca: | ||
4 | + * | ||
5 | + * GPL2 | ||
6 | + * | ||
7 | + * i3Geo Interface Integrada de Ferramentas de Geoprocessamento para Internet | ||
8 | + * | ||
9 | + * Direitos Autorais Reservados (c) 2006 Edmar Moretti | ||
10 | + * Desenvolvedor: Edmar Moretti edmar.moretti@gmail.com | ||
11 | + * | ||
12 | + * Este programa é software livre; você pode redistribuí-lo | ||
13 | + * e/ou modificá-lo sob os termos da Licença Pública Geral | ||
14 | + * GNU conforme publicada pela Free Software Foundation; | ||
15 | + * | ||
16 | + * Este programa é distribuído na expectativa de que seja útil, | ||
17 | + * porém, SEM NENHUMA GARANTIA; nem mesmo a garantia implícita | ||
18 | + * de COMERCIABILIDADE OU ADEQUAÇÃO A UMA FINALIDADE ESPECÍFICA. | ||
19 | + * Consulte a Licença Pública Geral do GNU para mais detalhes. | ||
20 | + * Você deve ter recebido uma copia da Licença Pública Geral do | ||
21 | + * GNU junto com este programa; se não, escreva para a | ||
22 | + * Free Software Foundation, Inc., no endereço | ||
23 | + * 59 Temple Street, Suite 330, Boston, MA 02111-1307 USA. | ||
24 | + */ | ||
25 | +error_reporting ( 0 ); | ||
26 | +// | ||
27 | +// pega as variaveis passadas com get ou post | ||
28 | +// | ||
29 | + | ||
30 | +include_once (dirname ( __FILE__ ) . "/../../../admin/php/login.php"); | ||
31 | +$funcoesEdicao = array ( | ||
32 | + "ADICIONARWS", | ||
33 | + "ALTERARWS", | ||
34 | + "EXCLUIRWS" | ||
35 | +); | ||
36 | +if (in_array ( strtoupper ( $funcao ), $funcoesEdicao )) { | ||
37 | + if (verificaOperacaoSessao ( "admin/html/webservices" ) == false) { | ||
38 | + header ( "HTTP/1.1 403 Vc nao pode realizar essa operacao" ); | ||
39 | + exit (); | ||
40 | + } | ||
41 | +} | ||
42 | +include (dirname ( __FILE__ ) . "/../../../admin/php/conexao.php"); | ||
43 | +$funcao = strtoupper ( $funcao ); | ||
44 | +switch ($funcao) { | ||
45 | + case "ADICIONARWS" : | ||
46 | + $novo = adicionarWs( $autor_ws, $desc_ws, $link_ws, $nome_ws, $tipo_ws,$dbhw ); | ||
47 | + if ($novo == false) { | ||
48 | + header ( "HTTP/1.1 500 erro ao consultar banco de dados" ); | ||
49 | + exit (); | ||
50 | + } | ||
51 | + exit (); | ||
52 | + break; | ||
53 | + case "ALTERARWS" : | ||
54 | + $novo = alterarWs ( $id_ws,$autor_ws, $desc_ws, $link_ws, $nome_ws, $tipo_ws,$dbhw ); | ||
55 | + if ($novo == false) { | ||
56 | + header ( "HTTP/1.1 500 erro ao consultar banco de dados" ); | ||
57 | + exit (); | ||
58 | + } | ||
59 | + $dados = pegaDados ( "SELECT id_ws,autor_ws,desc_ws,link_ws,nome_ws,tipo_ws from ".$esquemaadmin."i3geoadmin_ws order by nome_ws", $dbh, false ); | ||
60 | + if ($dados == false) { | ||
61 | + header ( "HTTP/1.1 500 erro ao consultar banco de dados" ); | ||
62 | + exit (); | ||
63 | + } | ||
64 | + retornaJSON ( $dados ); | ||
65 | + exit (); | ||
66 | + break; | ||
67 | + case "PEGAWS" : | ||
68 | + $ws = pegaDados ( "SELECT id_ws,autor_ws,desc_ws,link_ws,nome_ws,tipo_ws from ".$esquemaadmin."i3geoadmin_ws order by nome_ws", $dbh, false ); | ||
69 | + if ($ws == false) { | ||
70 | + $dbhw = null; | ||
71 | + $dbh = null; | ||
72 | + header ( "HTTP/1.1 500 erro ao consultar banco de dados" ); | ||
73 | + exit (); | ||
74 | + } | ||
75 | + $dbhw = null; | ||
76 | + $dbh = null; | ||
77 | + retornaJSON ( $ws ); | ||
78 | + break; | ||
79 | + case "EXCLUIRWS" : | ||
80 | + $retorna = excluirWs ( $id_ws, $dbhw ); | ||
81 | + $dbhw = null; | ||
82 | + $dbh = null; | ||
83 | + if ($retorna == false) { | ||
84 | + header ( "HTTP/1.1 500 erro ao consultar banco de dados" ); | ||
85 | + exit (); | ||
86 | + } | ||
87 | + retornaJSON ( $id_ws ); | ||
88 | + exit (); | ||
89 | + break; | ||
90 | +} | ||
91 | +cpjson ( $retorno ); | ||
92 | + | ||
93 | +// $papeis deve ser um array | ||
94 | +function adicionarWs($autor_ws,$desc_ws,$link_ws,$nome_ws,$tipo_ws,$dbhw) { | ||
95 | + global $esquemaadmin; | ||
96 | + try { | ||
97 | + $dataCol = array( | ||
98 | + "desc_ws" => '', | ||
99 | + "nome_ws" => '', | ||
100 | + "link_ws" => '', | ||
101 | + "autor_ws" => '', | ||
102 | + "tipo_ws" => '', | ||
103 | + "nacessos" => 0, | ||
104 | + "nacessosok" => 0 | ||
105 | + ); | ||
106 | + $retorna = i3GeoAdminInsertUnico($dbhw,"i3geoadmin_ws",$dataCol,"nome_ws","id_ws"); | ||
107 | + return $retorna; | ||
108 | + } catch ( PDOException $e ) { | ||
109 | + return false; | ||
110 | + } | ||
111 | +} | ||
112 | +// $papeis deve ser um array | ||
113 | +function alterarWs($id_ws,$autor_ws,$desc_ws,$link_ws,$nome_ws,$tipo_ws,$dbhw) { | ||
114 | + global $esquemaadmin; | ||
115 | + if($convUTF){ | ||
116 | + $nome_ws = utf8_encode($nome_ws); | ||
117 | + $desc_ws = utf8_encode($desc_ws); | ||
118 | + $autor_ws = utf8_encode($autor_ws); | ||
119 | + } | ||
120 | + $dataCol = array( | ||
121 | + "desc_ws" => $desc_ws, | ||
122 | + "nome_ws" => $nome_ws, | ||
123 | + "link_ws" => $link_ws, | ||
124 | + "autor_ws" => $autor_ws, | ||
125 | + "tipo_ws" => $tipo_ws | ||
126 | + ); | ||
127 | + $resultado = i3GeoAdminUpdate ( $dbhw, "i3geoadmin_ws", $dataCol, "WHERE id_ws = $id_ws" ); | ||
128 | + if ($resultado == false) { | ||
129 | + return false; | ||
130 | + } | ||
131 | + return $id_ws; | ||
132 | +} | ||
133 | +function excluirWs($id_ws, $dbhw) { | ||
134 | + global $esquemaadmin; | ||
135 | + $resultado = exclui ( $esquemaadmin . "i3geoadmin_ws", "id_ws", $id_ws, $dbhw, false ); | ||
136 | + if ($resultado == false) { | ||
137 | + return false; | ||
138 | + } | ||
139 | + return $resultado; | ||
140 | +} | ||
141 | +//usado em wmswfs.php | ||
142 | +function adicionaAcesso($id_ws,$sucesso){ | ||
143 | + global $esquemaadmin; | ||
144 | + try { | ||
145 | + if($id_ws == ""){ | ||
146 | + return; | ||
147 | + } | ||
148 | + include("conexao.php"); | ||
149 | + $dados = pegaDados("select * from ".$esquemaadmin."i3geoadmin_ws WHERE id_ws = $id_ws"); | ||
150 | + if(count($dados) == 0){ | ||
151 | + return; | ||
152 | + }; | ||
153 | + if($dados[0]["nacessos"] == ""){ | ||
154 | + $dados[0]["nacessos"] = 0; | ||
155 | + } | ||
156 | + $acessos = $dados[0]["nacessos"] + 1; | ||
157 | + | ||
158 | + if($sucesso) | ||
159 | + $ok = $dados[0]["nacessosok"] + 1; | ||
160 | + else | ||
161 | + $ok = $dados[0]["nacessosok"]; | ||
162 | + | ||
163 | + if($ok == ""){ | ||
164 | + $ok = 0; | ||
165 | + } | ||
166 | + $dataCol = array( | ||
167 | + "nacessos" => $acessos, | ||
168 | + "nacessosok" => $ok | ||
169 | + ); | ||
170 | + i3GeoAdminUpdate($dbhw,"i3geoadmin_ws",$dataCol,"WHERE id_ws = $id_ws"); | ||
171 | + $dbhw = null; | ||
172 | + $dbh = null; | ||
173 | + } | ||
174 | + catch (PDOException $e){ | ||
175 | + return "Error!: "; | ||
176 | + } | ||
177 | +} | ||
178 | +?> |
@@ -0,0 +1,219 @@ | @@ -0,0 +1,219 @@ | ||
1 | +/* | ||
2 | +Licenca: | ||
3 | + | ||
4 | +GPL2 | ||
5 | + | ||
6 | +i3Geo Interface Integrada de Ferramentas de Geoprocessamento para Internet | ||
7 | + | ||
8 | +Direitos Autorais Reservados (c) 2006 Ministério do Meio Ambiente Brasil | ||
9 | +Desenvolvedor: Edmar Moretti edmar.moretti@gmail.com | ||
10 | + | ||
11 | +Este programa é software livre; você pode redistribuí-lo | ||
12 | +e/ou modificá-lo sob os termos da Licença Pública Geral | ||
13 | +GNU conforme publicada pela Free Software Foundation; | ||
14 | + | ||
15 | +Este programa é distribuído na expectativa de que seja útil, | ||
16 | +porém, SEM NENHUMA GARANTIA; nem mesmo a garantia implícita | ||
17 | +de COMERCIABILIDADE OU ADEQUAÇÃO A UMA FINALIDADE ESPECÍFICA. | ||
18 | +Consulte a Licença Pública Geral do GNU para mais detalhes. | ||
19 | +Você deve ter recebido uma cópia da Licença Pública Geral do | ||
20 | +GNU junto com este programa; se não, escreva para a | ||
21 | +Free Software Foundation, Inc., no endereço | ||
22 | +59 Temple Street, Suite 330, Boston, MA 02111-1307 USA. | ||
23 | + | ||
24 | + */ | ||
25 | +i3GEOadmin.webservices = { | ||
26 | + //variavel global indicando o elemento que recebera a lista de Webservices | ||
27 | + ondeListaWebservices: "", | ||
28 | + //conteudo html do formulario de adicao de operacao | ||
29 | + formAdicionaWebservices: "", | ||
30 | + init: function(onde){ | ||
31 | + i3GEOadmin.webservices.ondeListaWebservices = onde; | ||
32 | + i3GEOadmin.webservices.pegaWebservices(); | ||
33 | + }, | ||
34 | + /* | ||
35 | +Function: pegaWebservices | ||
36 | + | ||
37 | +Obtém a lista de Webservices | ||
38 | + */ | ||
39 | + pegaWebservices: function(){ | ||
40 | + i3GEOadmin.core.iconeAguarde(i3GEOadmin.webservices.ondeListaWebservices); | ||
41 | + $.post( | ||
42 | + "exec.php?funcao=pegaWS" | ||
43 | + ) | ||
44 | + .done( | ||
45 | + function(data, status){ | ||
46 | + //valor do filtro atual | ||
47 | + var filtro = i3GEOadmin.webservices.valorFiltro(); | ||
48 | + //objeto json com os dados viondos do banco | ||
49 | + var json = jQuery.parseJSON(data); | ||
50 | + //template do form de cada operacao | ||
51 | + var templateWebservices = $("#templateWebservices").html(); | ||
52 | + //lista todas as Webservices | ||
53 | + var html = Mustache.to_html( | ||
54 | + "{{#data}}" + templateWebservices + "{{/data}}", | ||
55 | + $.extend( | ||
56 | + i3GEOadmin.webservices.dicionario, | ||
57 | + { | ||
58 | + "data": json, | ||
59 | + "onExcluir": "i3GEOadmin.webservices.excluirWebserviceDialogo",//funcao | ||
60 | + "onSalvar": "i3GEOadmin.webservices.salvarWebserviceDialogo",//funcao | ||
61 | + "opcoesTipo": function(){ | ||
62 | + var hash = {}; | ||
63 | + hash[this.tipo_ws + "-sel"] = "selected"; | ||
64 | + return Mustache.to_html( | ||
65 | + $("#templateOpcoesTipo").html(), | ||
66 | + hash | ||
67 | + ); | ||
68 | + } | ||
69 | + } | ||
70 | + ) | ||
71 | + ); | ||
72 | + i3GEOadmin.webservices.ondeListaWebservices.html(html); | ||
73 | + //filtro | ||
74 | + html = Mustache.to_html( | ||
75 | + "{{#data}}" + $("#templateFiltro").html() + "{{/data}}", | ||
76 | + {"data":json} | ||
77 | + ); | ||
78 | + $("#filtro").html("<option value='' >Todos</option>" + html); | ||
79 | + $("#filtro").combobox(); | ||
80 | + if(filtro != ""){ | ||
81 | + i3GEOadmin.webservices.defineFiltro(filtro); | ||
82 | + i3GEOadmin.webservices.filtra(i3GEOadmin.webservices.pegaFiltro()); | ||
83 | + } | ||
84 | + //monta um template para o modal de inclusao de novo usuario | ||
85 | + html = Mustache.to_html( | ||
86 | + $("#templateWebservices").html(), | ||
87 | + $.extend( | ||
88 | + i3GEOadmin.webservices.dicionario, | ||
89 | + { | ||
90 | + "id_ws": "modal", | ||
91 | + "excluir": i3GEOadmin.webservices.dicionario.cancelar, | ||
92 | + "onExcluir": "i3GEOadmin.core.fechaModalGeral",//funcao | ||
93 | + "onSalvar": "i3GEOadmin.webservices.adicionaWebservice",//funcao | ||
94 | + "opcoesTipo": $("#templateOpcoesTipo").html() | ||
95 | + } | ||
96 | + ) | ||
97 | + ); | ||
98 | + i3GEOadmin.webservices.formAdicionaWebservices = html; | ||
99 | + $.material.init(); | ||
100 | + } | ||
101 | + ) | ||
102 | + .fail(function(data){ | ||
103 | + i3GEOadmin.webservices.ondeListaWebservices.html(""); | ||
104 | + i3GEOadmin.core.mostraErro(data.status + " " +data.statusText); | ||
105 | + }); | ||
106 | + }, | ||
107 | + adicionaWebserviceDialogo: function(){ | ||
108 | + i3GEOadmin.core.abreModalGeral(i3GEOadmin.webservices.formAdicionaWebservices); | ||
109 | + }, | ||
110 | +// os parametros sao obtidos do formulario aberto do modal | ||
111 | + adicionaWebservice: function(){ | ||
112 | + var parametros = $("#form-modal form").serialize(); | ||
113 | + i3GEOadmin.core.fechaModalGeral(); | ||
114 | + i3GEOadmin.core.modalAguarde(true); | ||
115 | + $.post( | ||
116 | + "exec.php?funcao=adicionarWs", | ||
117 | + parametros | ||
118 | + ) | ||
119 | + .done( | ||
120 | + function(data, status){ | ||
121 | + i3GEOadmin.core.modalAguarde(false); | ||
122 | + i3GEOadmin.core.iconeAguarde(i3GEOadmin.webservices.ondeListaWebservices); | ||
123 | + i3GEOadmin.webservices.pegaWebservices(); | ||
124 | + } | ||
125 | + ) | ||
126 | + .fail( | ||
127 | + function(data){ | ||
128 | + i3GEOadmin.core.modalAguarde(false); | ||
129 | + i3GEOadmin.core.mostraErro(data.status + " " +data.statusText); | ||
130 | + } | ||
131 | + ); | ||
132 | + }, | ||
133 | + excluirWebserviceDialogo: function(id_usuario){ | ||
134 | + var hash = { | ||
135 | + "mensagem": i3GEOadmin.webservices.dicionario.confirma, | ||
136 | + "onBotao1": "i3GEOadmin.webservices.excluirWebservice('"+id_ws+"')", | ||
137 | + "botao1": i3GEOadmin.webservices.dicionario.sim, | ||
138 | + "onBotao2": "i3GEOadmin.core.fechaModalConfirma();", | ||
139 | + "botao2": i3GEOadmin.webservices.dicionario.nao | ||
140 | + }; | ||
141 | + i3GEOadmin.core.abreModalConfirma(hash); | ||
142 | + }, | ||
143 | + excluirWebservice: function(id_usuario){ | ||
144 | + i3GEOadmin.core.modalAguarde(true); | ||
145 | + $.post( | ||
146 | + "exec.php?funcao=excluirWs", | ||
147 | + "id_ws="+id_ws | ||
148 | + ) | ||
149 | + .done( | ||
150 | + function(data, status){ | ||
151 | + i3GEOadmin.core.modalAguarde(false); | ||
152 | + var json = jQuery.parseJSON(data)*1; | ||
153 | + $("#form-" + json).remove(); | ||
154 | + } | ||
155 | + ) | ||
156 | + .fail( | ||
157 | + function(data){ | ||
158 | + i3GEOadmin.core.modalAguarde(false); | ||
159 | + i3GEOadmin.core.mostraErro(data.status + " " +data.statusText); | ||
160 | + } | ||
161 | + ); | ||
162 | + }, | ||
163 | + salvarWebserviceDialogo: function(id_ws){ | ||
164 | + var hash = { | ||
165 | + "mensagem": i3GEOadmin.webservices.dicionario.confirma, | ||
166 | + "onBotao1": "i3GEOadmin.webservices.salvarWebservice('"+id_ws+"')", | ||
167 | + "botao1": i3GEOadmin.webservices.dicionario.sim, | ||
168 | + "onBotao2": "i3GEOadmin.core.fechaModalConfirma();", | ||
169 | + "botao2": i3GEOadmin.webservices.dicionario.nao | ||
170 | + }; | ||
171 | + i3GEOadmin.core.abreModalConfirma(hash); | ||
172 | + }, | ||
173 | + salvarWebservice: function(id_ws){ | ||
174 | + var parametros = $("#form-" + id_ws + " form").serialize(); | ||
175 | + i3GEOadmin.core.fechaModalGeral(); | ||
176 | + i3GEOadmin.core.modalAguarde(true); | ||
177 | + $.post( | ||
178 | + "exec.php?funcao=alterarWs", | ||
179 | + "id_ws="+ id_ws+"&"+parametros | ||
180 | + ) | ||
181 | + .done( | ||
182 | + function(data, status){ | ||
183 | + i3GEOadmin.core.modalAguarde(false); | ||
184 | + i3GEOadmin.core.iconeAguarde(i3GEOadmin.webservices.ondeListaWebservices); | ||
185 | + i3GEOadmin.webservices.pegaWebservices(); | ||
186 | + } | ||
187 | + ) | ||
188 | + .fail( | ||
189 | + function(data){ | ||
190 | + i3GEOadmin.core.modalAguarde(false); | ||
191 | + i3GEOadmin.core.mostraErro(data.status + " " +data.statusText); | ||
192 | + } | ||
193 | + ); | ||
194 | + }, | ||
195 | + pegaFiltro: function(){ | ||
196 | + return $i("filtro"); | ||
197 | + }, | ||
198 | + valorFiltro: function(){ | ||
199 | + return i3GEOadmin.webservices.pegaFiltro().value; | ||
200 | + }, | ||
201 | + defineFiltro: function(valor){ | ||
202 | + i3GEOadmin.webservices.pegaFiltro().value = valor; | ||
203 | + }, | ||
204 | + filtra: function(obj){ | ||
205 | + $("#corpo .panel").each( | ||
206 | + function(i,el){ | ||
207 | + if(obj.value == ""){ | ||
208 | + $(el).show(); | ||
209 | + } | ||
210 | + else { | ||
211 | + $(el).hide(); | ||
212 | + } | ||
213 | + } | ||
214 | + ); | ||
215 | + if(obj.value != ""){ | ||
216 | + $("#"+obj.value).show(); | ||
217 | + } | ||
218 | + } | ||
219 | +}; | ||
0 | \ No newline at end of file | 220 | \ No newline at end of file |
admin1/cadastros/servicos/index.php
@@ -13,14 +13,112 @@ include "../../head.php"; | @@ -13,14 +13,112 @@ include "../../head.php"; | ||
13 | <li class="active">Serviços</li> | 13 | <li class="active">Serviços</li> |
14 | </ol> | 14 | </ol> |
15 | </div> | 15 | </div> |
16 | - | ||
17 | </div> | 16 | </div> |
18 | -<div class="container-fluid"> | ||
19 | - <div class="row"> | ||
20 | - <iframe src="../../../admin/html/webservices_.html" | ||
21 | - style="width: 100%; height: 5000px; border: none; scrolling: no; frameborder: 0; marginheight: 0; marginwidth: 0;"></iframe> | 17 | +<div class="container"> |
18 | + <div class="row center-block"> | ||
19 | + <div class="col-md-12"> | ||
20 | + <div class="well hidden" id="titulo"> | ||
21 | + <!-- | ||
22 | + <button data-toggle="modal" data-target="#ajudaPrincipal" | ||
23 | + class="btn btn-primary btn-fab btn-fab-mini pull-right"> | ||
24 | + <i class="material-icons">help</i> | ||
25 | + </button> | ||
26 | + --> | ||
27 | + <h3>{{{webservices}}}</h3> | ||
28 | + <h4>{{{txtAjuda}}}</h4> | ||
29 | + <!-- aqui entra o filtro --> | ||
30 | + <div class="form-group"> | ||
31 | + <label class="control-label">{{{filtro}}}</label> | ||
32 | + <select onchange="i3GEOadmin.webservices.filtra(this)" id="filtro" class="form-control input-lg"> | ||
33 | + </select> | ||
34 | + </div> | ||
35 | + <div class="row pull-right"> | ||
36 | + <a onclick="i3GEOadmin.webservices.adicionaWebserviceDialogo();" href="javascript:void(0)" class="btn btn-primary" role="button">{{{adicionar}}}</a> | ||
37 | + </div> | ||
38 | + <div class="clearfix"></div> | ||
39 | + <!--Modal ajuda | ||
40 | + <div id="ajudaPrincipal" class="modal fade" tabindex="-1"> | ||
41 | + <div class="modal-dialog"> | ||
42 | + <div class="modal-content"> | ||
43 | + <div class="modal-body"> | ||
44 | + <p>{{{txtWebservices}}}</p> | ||
45 | + </div> | ||
46 | + </div> | ||
47 | + </div> | ||
48 | + </div> | ||
49 | + --> | ||
50 | + </div> | ||
51 | + <div class="well hidden"> | ||
52 | + <div id="corpo"> | ||
53 | + </div> | ||
54 | + </div> | ||
55 | + </div> | ||
56 | + </div> | ||
57 | +</div> | ||
58 | +<script id="templateFiltro" type="x-tmpl-mustache"> | ||
59 | +<option value="form-{{id_ws}}">{{{nome_ws}}}</option> | ||
60 | +</script> | ||
61 | +<script id="templateWebservices" type="x-tmpl-mustache"> | ||
62 | +<div class="panel panel-default" id="form-{{id_ws}}"> | ||
63 | + <div class="panel-body"> | ||
64 | + <form style="" onchange="this.style.boxShadow='2px 2px 5px 0 #009688';" class="form" role="form" method="post" action="" > | ||
65 | + <div class="row"> | ||
66 | + <div class="col-md-12"> | ||
67 | + <h4>{{{nome_ws}}}</h4> | ||
68 | + <div class="form-group form-group-lg"> | ||
69 | + <label class="col-md-2 control-label" for="nome_ws" >{{{nome}}}</label> | ||
70 | + <div class="col-md-10"> | ||
71 | + <input type="text" value="{{{nome_ws}}}" class="form-control" name="nome_ws" required> | ||
72 | + </div> | ||
73 | + </div> | ||
74 | + <div class="form-group form-group-lg"> | ||
75 | + <label class="col-md-2 control-label" for="login">{{{descricao}}}</label> | ||
76 | + <div class="col-md-10"> | ||
77 | + <input type="text" value="{{{desc_ws}}}" class="form-control" name="desc_ws" > | ||
78 | + </div> | ||
79 | + </div> | ||
80 | + <div class="form-group form-group-lg"> | ||
81 | + <label class="col-md-2 control-label" for="email">{{{autor}}}</label> | ||
82 | + <div class="col-md-10"> | ||
83 | + <input type="email" value="{{{autor_ws}}}" class="form-control" name="autor_ws" required> | ||
84 | + </div> | ||
85 | + </div> | ||
86 | + <div class="form-group form-group-lg"> | ||
87 | + <label class="col-md-2 control-label" for="link_ws">{{{endereco}}}</label> | ||
88 | + <div class="col-md-10"> | ||
89 | + <input type="text" value="{{{link_ws}}}" class="form-control" name="link_ws"> | ||
90 | + </div> | ||
91 | + </div> | ||
92 | + <div class="form-group form-group-lg"> | ||
93 | + <label class="col-md-2 control-label" for="tipo_ws">{{{tipo}}}</label> | ||
94 | + <div class="col-md-10"> | ||
95 | + <select name="tipo_ws" class="form-control"> | ||
96 | + {{{opcoesTipo}}} | ||
97 | + </select> | ||
98 | + </div> | ||
99 | + </div> | ||
100 | + </div> | ||
101 | + </div> | ||
102 | + </form> | ||
103 | + <div class="pull-right"> | ||
104 | + <a href="javascript:void(0)" onclick="{{onExcluir}}('{{id_ws}}')" class="btn btn-danger" role="button">{{excluir}}</a> | ||
105 | + <a href="javascript:void(0)" onclick="{{onSalvar}}('{{id_ws}}')" class="btn btn-primary" role="button">{{salvar}}</a> | ||
106 | + </div> | ||
22 | </div> | 107 | </div> |
23 | </div> | 108 | </div> |
109 | +</script> | ||
110 | +<script id="templateOpcoesTipo" type="x-tmpl-mustache"> | ||
111 | + <option value="">---</option> | ||
112 | + <option {{KML-sel}} value="KML">KML</option> | ||
113 | + <option {{WMS-sel}} value="WMS">WMS</option> | ||
114 | + <option {{WMS-Tile-sel}} value="WMS-Tile">WMS-Tile</option> | ||
115 | + <option {{GEORSS-sel}} value="GEORSS">GEORSS</option> | ||
116 | + <option {{WS-sel}} value="WS">WS</option> | ||
117 | + <option {{DOWNLOAD-sel}} value="DOWNLOAD">DOWNLOAD</option> | ||
118 | + <option {{GEOJSON-sel}} value="GEOJSON">GEOJSON</option> | ||
119 | +</script> | ||
120 | +<script type="text/javascript" src="index.js"></script> | ||
121 | +<script type="text/javascript" src="../../dicionario/webservices.js"></script> | ||
24 | <script> | 122 | <script> |
25 | $(document).ready(function(){ | 123 | $(document).ready(function(){ |
26 | //vem de admin1/index.js | 124 | //vem de admin1/index.js |
@@ -31,7 +129,37 @@ include "../../head.php"; | @@ -31,7 +129,37 @@ include "../../head.php"; | ||
31 | $(this).parent().siblings().removeClass('open'); | 129 | $(this).parent().siblings().removeClass('open'); |
32 | $(this).parent().toggleClass('open'); | 130 | $(this).parent().toggleClass('open'); |
33 | }); | 131 | }); |
132 | + //traducao | ||
133 | + var t = $("#titulo"); | ||
134 | + //complementa dicionario | ||
135 | + i3GEOadmin.webservices.dicionario.adicionar = i3GEOadmin.core.dicionario.adicionar; | ||
136 | + i3GEOadmin.webservices.dicionario.filtro = i3GEOadmin.core.dicionario.filtro; | ||
137 | + i3GEOadmin.webservices.dicionario.excluir = i3GEOadmin.core.dicionario.excluir; | ||
138 | + i3GEOadmin.webservices.dicionario.salvar = i3GEOadmin.core.dicionario.salva; | ||
139 | + i3GEOadmin.webservices.dicionario.cancelar = i3GEOadmin.core.dicionario.cancelar; | ||
140 | + i3GEOadmin.webservices.dicionario.confirma = i3GEOadmin.core.dicionario.confirma; | ||
141 | + i3GEOadmin.webservices.dicionario.nome = i3GEOadmin.core.dicionario.nome; | ||
142 | + i3GEOadmin.webservices.dicionario.tipo = i3GEOadmin.core.dicionario.tipo; | ||
143 | + i3GEOadmin.webservices.dicionario.descricao = i3GEOadmin.core.dicionario.descricao; | ||
144 | + i3GEOadmin.webservices.dicionario.sim = i3GEOadmin.core.dicionario.sim; | ||
145 | + i3GEOadmin.webservices.dicionario.nao = i3GEOadmin.core.dicionario.nao; | ||
146 | + | ||
147 | + i3GEOadmin.core.dicionario = null; | ||
148 | + | ||
149 | + i3GEOadmin.webservices.dicionario = i3GEO.idioma.objetoIdioma(i3GEOadmin.webservices.dicionario); | ||
150 | + | ||
151 | + t.html( | ||
152 | + Mustache.to_html( | ||
153 | + t.html(), | ||
154 | + i3GEOadmin.webservices.dicionario | ||
155 | + ) | ||
156 | + ); | ||
34 | $.material.init(); | 157 | $.material.init(); |
158 | + var inicia = function() { | ||
159 | + $(".hidden").removeClass('hidden'); | ||
160 | + i3GEOadmin.webservices.init($("#corpo")); | ||
161 | + }; | ||
162 | + i3GEO.login.verificaOperacao("admin/html/webservices",i3GEO.configura.locaplic, inicia, "sessao"); | ||
35 | }); | 163 | }); |
36 | </script> | 164 | </script> |
37 | </body> | 165 | </body> |
admin1/dicionario/core.js
@@ -355,13 +355,13 @@ i3GEOadmin.core.dicionario = { | @@ -355,13 +355,13 @@ i3GEOadmin.core.dicionario = { | ||
355 | en : "", | 355 | en : "", |
356 | es : "" | 356 | es : "" |
357 | } ], | 357 | } ], |
358 | - '' : [ { | ||
359 | - pt : "", | 358 | + 'ajuda' : [ { |
359 | + pt : "Ajuda", | ||
360 | en : "", | 360 | en : "", |
361 | es : "" | 361 | es : "" |
362 | } ], | 362 | } ], |
363 | - '' : [ { | ||
364 | - pt : "", | 363 | + 'tipo' : [ { |
364 | + pt : "Tipo", | ||
365 | en : "", | 365 | en : "", |
366 | es : "" | 366 | es : "" |
367 | } ], | 367 | } ], |
admin1/dicionario/webservices.js
@@ -2,17 +2,12 @@ | @@ -2,17 +2,12 @@ | ||
2 | //i3GEOadmin.webservices = {}; | 2 | //i3GEOadmin.webservices = {}; |
3 | i3GEOadmin.webservices.dicionario = { | 3 | i3GEOadmin.webservices.dicionario = { |
4 | 'webservices' : [ { | 4 | 'webservices' : [ { |
5 | - pt : "Administração do i3geo - web Services", | ||
6 | - en : "", | ||
7 | - es : "" | ||
8 | - } ], | ||
9 | - 'ajuda' : [ { | ||
10 | - pt : "Ajuda", | 5 | + pt : "Cadastro de Webservices", |
11 | en : "", | 6 | en : "", |
12 | es : "" | 7 | es : "" |
13 | } ], | 8 | } ], |
14 | 'txtAjuda' : [ { | 9 | 'txtAjuda' : [ { |
15 | - pt : "Este programa permite editar o cadastro de Web Services.<br><br> O i3Geo acessa Web Services e serviços para obtenção de dados nos padrões WMS, RSS, GEORSS e endereços de sistemas de download de dados. Todos os endereços são cadastrados e organizados por tipos. A lista de WMS e GEORSS é utilizada na guia de adição de temas já os Web Services convencionais, são utilizados no aplicativo WSCLIENTE. Pode-se ainda cadastrar endereços para sítios na internet que possibilitam o download de dados, esse cadastro é utilizado no aplicativo DATADOWNLOAD.<br> <br>A lista de Web Services é baseada no banco admin.db.<br><br> A lista de IPs dos usuários que podem administrar o i3geo é definida no arquivo i3geo/ms_configura.php", | 10 | + pt : "O i3Geo acessa Web Services e serviços para obtenção de dados em diferentes formatos, organizados por tipo. O cadastro é utilizado no catálogo de temas.", |
16 | en : "", | 11 | en : "", |
17 | es : "" | 12 | es : "" |
18 | } ], | 13 | } ], |
@@ -26,26 +21,6 @@ i3GEOadmin.webservices.dicionario = { | @@ -26,26 +21,6 @@ i3GEOadmin.webservices.dicionario = { | ||
26 | en : "", | 21 | en : "", |
27 | es : "" | 22 | es : "" |
28 | } ], | 23 | } ], |
29 | - 'tipo' : [ { | ||
30 | - pt : "tipo", | ||
31 | - en : "", | ||
32 | - es : "" | ||
33 | - } ], | ||
34 | - 'msgBuscaEndereco' : [ { | ||
35 | - pt : "buscando endereços...", | ||
36 | - en : "", | ||
37 | - es : "" | ||
38 | - } ], | ||
39 | - 'nome' : [ { | ||
40 | - pt : "Nome:", | ||
41 | - en : "", | ||
42 | - es : "" | ||
43 | - } ], | ||
44 | - 'descricao' : [ { | ||
45 | - pt : "Descrição:", | ||
46 | - en : "", | ||
47 | - es : "" | ||
48 | - } ], | ||
49 | 'autor' : [ { | 24 | 'autor' : [ { |
50 | pt : "Autor:", | 25 | pt : "Autor:", |
51 | en : "", | 26 | en : "", |
@@ -56,11 +31,6 @@ i3GEOadmin.webservices.dicionario = { | @@ -56,11 +31,6 @@ i3GEOadmin.webservices.dicionario = { | ||
56 | en : "", | 31 | en : "", |
57 | es : "" | 32 | es : "" |
58 | } ], | 33 | } ], |
59 | - 'tipo1' : [ { | ||
60 | - pt : "Tipo:", | ||
61 | - en : "", | ||
62 | - es : "" | ||
63 | - } ], | ||
64 | '' : [ { | 34 | '' : [ { |
65 | pt : "", | 35 | pt : "", |
66 | en : "", | 36 | en : "", |
admin1/ferramentas/banco/index.php
@@ -66,7 +66,7 @@ include "../../head.php"; | @@ -66,7 +66,7 @@ include "../../head.php"; | ||
66 | </div> | 66 | </div> |
67 | </div> | 67 | </div> |
68 | </div> | 68 | </div> |
69 | - </div> | 69 | + |
70 | <script> | 70 | <script> |
71 | $(document).ready(function(){ | 71 | $(document).ready(function(){ |
72 | //vem de admin1/index.js | 72 | //vem de admin1/index.js |
admin1/js/webservices.js
@@ -1,297 +0,0 @@ | @@ -1,297 +0,0 @@ | ||
1 | -/* | ||
2 | -Title: webservices.js | ||
3 | - | ||
4 | -Funções que controlam a interface do editor do cadastro de Web Services | ||
5 | - | ||
6 | -Licenca: | ||
7 | - | ||
8 | -GPL2 | ||
9 | - | ||
10 | -i3Geo Interface Integrada de Ferramentas de Geoprocessamento para Internet | ||
11 | - | ||
12 | -Direitos Autorais Reservados (c) 2006 Ministério do Meio Ambiente Brasil | ||
13 | -Desenvolvedor: Edmar Moretti edmar.moretti@gmail.com | ||
14 | - | ||
15 | -Este programa é software livre; você pode redistribuí-lo | ||
16 | -e/ou modificá-lo sob os termos da Licença Pública Geral | ||
17 | -GNU conforme publicada pela Free Software Foundation; | ||
18 | - | ||
19 | -Este programa é distribuído na expectativa de que seja útil, | ||
20 | -porém, SEM NENHUMA GARANTIA; nem mesmo a garantia implícita | ||
21 | -de COMERCIABILIDADE OU ADEQUAÇÃO A UMA FINALIDADE ESPECÍFICA. | ||
22 | -Consulte a Licença Pública Geral do GNU para mais detalhes. | ||
23 | -Você deve ter recebido uma cópia da Licença Pública Geral do | ||
24 | -GNU junto com este programa; se não, escreva para a | ||
25 | -Free Software Foundation, Inc., no endereço | ||
26 | -59 Temple Street, Suite 330, Boston, MA 02111-1307 USA. | ||
27 | - | ||
28 | -Arquivo: | ||
29 | - | ||
30 | -i3geo/admin/js/webservices.js | ||
31 | -*/ | ||
32 | -if(typeof(i3GEOadmin) === 'undefined'){ | ||
33 | - var i3GEOadmin = {}; | ||
34 | -} | ||
35 | -i3GEOadmin.webservices = { | ||
36 | - dados: "", | ||
37 | - letra: "", | ||
38 | - dataTable: null, | ||
39 | - colunas: ["id_ws","desc_ws","nome_ws","link_ws","tipo_ws","autor_ws"], | ||
40 | - formatTexto: function(elCell, oRecord, oColumn, oData){ | ||
41 | - if(oData === ""){ | ||
42 | - oData = "<span style='color:gray' ></span>"; | ||
43 | - } | ||
44 | - elCell.innerHTML = "<pre ><p style=cursor:default >" + oData + "</pre>"; | ||
45 | - }, | ||
46 | - formatExclui: function(elCell, oRecord, oColumn){ | ||
47 | - elCell.innerHTML = "<div title="+ $trad("excluiTitulo",i3GEOadmin.core.dicionario) +" class=excluir style='text-align:center' ></div>"; | ||
48 | - }, | ||
49 | - formatMais: function(elCell, oRecord, oColumn){ | ||
50 | - elCell.innerHTML = "<div class="+ $trad("editar",i3GEOadmin.core.dicionario) +" style='text-align:center' ></div>"; | ||
51 | - }, | ||
52 | - defColunas: function(){ | ||
53 | - return [ | ||
54 | - {key:"excluir",label:$trad("excluir",i3GEOadmin.core.dicionario),formatter:i3GEOadmin.webservices.formatExclui}, | ||
55 | - {key:"mais",label:$trad("editar",i3GEOadmin.core.dicionario),formatter:i3GEOadmin.webservices.formatMais}, | ||
56 | - {label:"id",key:"id_ws", formatter:i3GEOadmin.webservices.formatTexto}, | ||
57 | - {label:$trad("nome",i3GEOadmin.core.dicionario),resizeable:true,key:"nome_ws", formatter:i3GEOadmin.webservices.formatTexto}, | ||
58 | - {label:$trad("tipo",i3GEOadmin.webservices.dicionario),resizeable:true,key:"tipo_ws", formatter:i3GEOadmin.webservices.formatTexto} | ||
59 | - ]; | ||
60 | - }, | ||
61 | - /* | ||
62 | - * Inicializa o menu | ||
63 | - */ | ||
64 | - inicia: function(){ | ||
65 | - YAHOO.namespace("webservices"); | ||
66 | - YAHOO.namespace("admin.container"); | ||
67 | - core_ativaPainelAjuda("ajuda","botaoAjuda"); | ||
68 | - var temp = function(o){ | ||
69 | - i3GEOadmin.webservices.obtem(); | ||
70 | - return; | ||
71 | - }; | ||
72 | - core_ativaBotaoAdicionaLinha("../php/webservices.php?funcao=alterarWS","adicionaNovoWebservice",temp); | ||
73 | - i3GEOadmin.webservices.obtem(); | ||
74 | - }, | ||
75 | - /* | ||
76 | - * Obtém a lista de menus | ||
77 | - */ | ||
78 | - obtem: function(){ | ||
79 | - i3GEOadmin.webservices.dados = ""; | ||
80 | - core_carregando("ativa"); | ||
81 | - var tipows = "",u; | ||
82 | - try{ | ||
83 | - u = window.location.href.split("?"); | ||
84 | - u = u[1].split("="); | ||
85 | - tipows = u[1]; | ||
86 | - } | ||
87 | - catch(e){tipows = "";} | ||
88 | - core_pegaDados($trad("msgBuscaEndereco",i3GEOadmin.webservices.dicionario),"../php/webservices.php?funcao=pegaWS&tipows="+tipows,"i3GEOadmin.webservices.tabela"); | ||
89 | - }, | ||
90 | - tabela: function(dados){ | ||
91 | - if(i3GEOadmin.webservices.dados == ""){ | ||
92 | - i3GEOadmin.webservices.dados = dados; | ||
93 | - } | ||
94 | - core_listaDeLetras("letras_W","i3GEOadmin.webservices.filtra",false,300); | ||
95 | - YAHOO.example.InlineCellEditing = new function(){ | ||
96 | - // Custom formatter for "address" column to preserve line breaks | ||
97 | - var myDataSource = new YAHOO.util.DataSource(dados); | ||
98 | - myDataSource.responseType = YAHOO.util.DataSource.TYPE_JSARRAY; | ||
99 | - myDataSource.responseSchema = { | ||
100 | - fields: i3GEOadmin.webservices.colunas | ||
101 | - }; | ||
102 | - //i3GEOadmin.webservices.dataTable = new YAHOO.widget.DataTable("tabela", i3GEOadmin.webservices.defColunas(), myDataSource); | ||
103 | - i3GEOadmin.webservices.dataTable = new YAHOO.widget.ScrollingDataTable("tabela", i3GEOadmin.webservices.defColunas(), myDataSource,{width:"100%"}); | ||
104 | - i3GEOadmin.webservices.dataTable.subscribe('postRenderEvent',function(){ | ||
105 | - //abre o editor | ||
106 | - if(i3GEOadmin.webservices.dados[0].nome_ws == ""){ | ||
107 | - var rec = i3GEOadmin.webservices.dataTable.getRecordSet().getRecord(0); | ||
108 | - i3GEOadmin.webservices.editor([i3GEOadmin.webservices.dados[0]],i3GEOadmin.webservices.dados[0].id_ws,rec.getId()); | ||
109 | - } | ||
110 | - } | ||
111 | - ); | ||
112 | - i3GEOadmin.webservices.dataTable.subscribe('cellClickEvent',function(ev){ | ||
113 | - var sUrl, callback,$clicouId, $recordid, | ||
114 | - target = YAHOO.util.Event.getTarget(ev), | ||
115 | - column = this.getColumn(target), | ||
116 | - registro = this.getRecord(target); | ||
117 | - if(YAHOO.webservices.panelCK) { | ||
118 | - YAHOO.webservices.panelCK.destroy(); | ||
119 | - YAHOO.webservices.panelCK = null; | ||
120 | - } | ||
121 | - if (column.key == 'excluir'){ | ||
122 | - i3GEOadmin.webservices.exclui(registro.getData('id_ws'),target); | ||
123 | - } | ||
124 | - if (column.key == 'mais'){ | ||
125 | - core_carregando("ativa"); | ||
126 | - core_carregando($trad("msgBuscaDados",i3GEOadmin.core.dicionario)); | ||
127 | - $clicouId = registro.getData('id_ws'); | ||
128 | - $recordid = registro.getId(); | ||
129 | - sUrl = "../php/webservices.php?funcao=pegaDados&id_ws="+$clicouId; | ||
130 | - callback = { | ||
131 | - success:function(o){ | ||
132 | - try{ | ||
133 | - i3GEOadmin.webservices.editor(YAHOO.lang.JSON.parse(o.responseText),$clicouId,$recordid); | ||
134 | - } | ||
135 | - catch(e){core_handleFailure(e,o.responseText);} | ||
136 | - }, | ||
137 | - failure:core_handleFailure, | ||
138 | - argument: { foo:"foo", bar:"bar" } | ||
139 | - }; | ||
140 | - core_makeRequest(sUrl,callback); | ||
141 | - } | ||
142 | - }); | ||
143 | - }; | ||
144 | - core_carregando("desativa"); | ||
145 | - }, | ||
146 | - editor: function(dados,id,recordid){ | ||
147 | - function on_editorCheckBoxChange(p_oEvent){ | ||
148 | - if(p_oEvent.newValue.get("value") == "OK"){ | ||
149 | - i3GEOadmin.webservices.salva(id,recordid); | ||
150 | - } | ||
151 | - YAHOO.webservices.panelEditor2.destroy(); | ||
152 | - YAHOO.webservices.panelEditor2 = null; | ||
153 | - }; | ||
154 | - if(!$i("janela_editor2")){ | ||
155 | - var editorBotoes,ins, | ||
156 | - novoel = document.createElement("div"); | ||
157 | - novoel.id = "janela_editor2"; | ||
158 | - ins = '<div class="hd">'+ $trad("editor",i3GEOadmin.core.dicionario) +'</div>'; | ||
159 | - ins += "<div class='bd' style='height:354px;overflow:auto'>"; | ||
160 | - ins += "<div id='okcancel_checkbox2'></div><div id='editor_bd2'></div>"; | ||
161 | - ins += "<div id='letras_W'></div>"; | ||
162 | - novoel.innerHTML = ins; | ||
163 | - | ||
164 | - document.body.appendChild(novoel); | ||
165 | - editorBotoes = new YAHOO.widget.ButtonGroup({id:"okcancel_checkbox_id2", name: "okcancel_checkbox_id2", container: "okcancel_checkbox2" }); | ||
166 | - editorBotoes.addButtons([ | ||
167 | - { label: $trad("salva1",i3GEOadmin.core.dicionario), value: "OK", checked: false}, | ||
168 | - { label: $trad("cancela",i3GEOadmin.core.dicionario), value: "CANCEL", checked: false } | ||
169 | - ]); | ||
170 | - editorBotoes.on("checkedButtonChange", on_editorCheckBoxChange); | ||
171 | - YAHOO.webservices.panelEditor2 = new YAHOO.widget.Panel("janela_editor2", { modal:true,fixedcenter:true,close:false,width:"400px", height:"480px",overflow:"auto", visible:false,constraintoviewport:true } ); | ||
172 | - YAHOO.webservices.panelEditor2.render(); | ||
173 | - } | ||
174 | - YAHOO.webservices.panelEditor2.show(); | ||
175 | - $i("editor_bd2").innerHTML = i3GEOadmin.webservices.formulario(dados[0]); | ||
176 | - core_carregando("desativa"); | ||
177 | - }, | ||
178 | - formulario: function(i){ | ||
179 | - var param = { | ||
180 | - "linhas":[ | ||
181 | - {titulo:$trad("nome",i3GEOadmin.webservices.dicionario),id:"Enome_ws",size:"50",value:i.nome_ws,tipo:"text",div:""}, | ||
182 | - {titulo:$trad("descricao",i3GEOadmin.webservices.dicionario),id:"Edesc_ws",size:"50",value:i.desc_ws,tipo:"text",div:""}, | ||
183 | - {titulo:$trad("autor",i3GEOadmin.webservices.dicionario),id:"Eautor_ws",size:"50",value:i.autor_ws,tipo:"text",div:""}, | ||
184 | - {titulo:$trad("endereco",i3GEOadmin.webservices.dicionario),id:"Elink_ws",size:"50",value:i.link_ws,tipo:"text",div:""} | ||
185 | - ] | ||
186 | - }; | ||
187 | - var ins = ""; | ||
188 | - ins += core_geraLinhas(param); | ||
189 | - | ||
190 | - ins += "<p>"+ $trad("tipo1",i3GEOadmin.webservices.dicionario) +"<br>"; | ||
191 | - ins += "<div class='styled-select'><select id='Etipo_ws' />"; | ||
192 | - ins += "<option value='' "; | ||
193 | - if (i.tipo_ws == ""){ins += "selected";} | ||
194 | - ins += ">---</option>"; | ||
195 | - ins += "<option value='KML' "; | ||
196 | - if (i.tipo_ws == "KML"){ins += "selected";} | ||
197 | - ins += " >KML</option>"; | ||
198 | - ins += "<option value='WMS' "; | ||
199 | - if (i.tipo_ws == "WMS"){ins += "selected";} | ||
200 | - ins += " >WMS</option>"; | ||
201 | - ins += "<option value='WMS-Tile' "; | ||
202 | - if (i.tipo_ws == "WMS-Tile"){ins += "selected";} | ||
203 | - ins += " >WMS-Tile</option>"; | ||
204 | - ins += "<option value='GEORSS' "; | ||
205 | - if (i.tipo_ws == "GEORSS"){ins += "selected";} | ||
206 | - ins += " >GEORSS</option>"; | ||
207 | - ins += "<option value='WS' "; | ||
208 | - if (i.tipo_ws == "WS"){ins += "selected";} | ||
209 | - ins += " >WS</option>"; | ||
210 | - ins += "<option value='DOWNLOAD' "; | ||
211 | - if (i.tipo_ws == "DOWNLOAD"){ins += "selected";} | ||
212 | - ins += " >DOWNLOAD</option>"; | ||
213 | - ins += "<option value='GEOJSON' "; | ||
214 | - if (i.tipo_ws == "GEOJSON"){ins += "selected";} | ||
215 | - ins += " >GEOJSON</option>"; | ||
216 | - | ||
217 | - ins += "</select></div>"; | ||
218 | - return(ins); | ||
219 | - }, | ||
220 | - atualizaFiltro: function(dados){ | ||
221 | - i3GEOadmin.webservices.dados = dados; | ||
222 | - i3GEOadmin.webservices.filtra(i3GEOadmin.webservices.letra); | ||
223 | - }, | ||
224 | - filtra: function(letra){ | ||
225 | - i3GEOadmin.webservices.letra = letra; | ||
226 | - if(i3GEOadmin.webservices.dados == ""){ | ||
227 | - var tipows = "",u; | ||
228 | - try{ | ||
229 | - u = window.location.href.split("?"); | ||
230 | - u = u[1].split("="); | ||
231 | - tipows = u[1]; | ||
232 | - } | ||
233 | - catch(e){tipows = "";} | ||
234 | - core_pegaDados($trad("msgBuscaEndereco",i3GEOadmin.webservices.dicionario),"../php/webservices.php?funcao=pegaWS&tipows="+tipows,"i3GEOadmin.webservices.atualizaFiltro"); | ||
235 | - return; | ||
236 | - } | ||
237 | - var i,temp, | ||
238 | - n = i3GEOadmin.webservices.dados.length, | ||
239 | - novo; | ||
240 | - if(letra == "Todos"){ | ||
241 | - novo = i3GEOadmin.webservices.dados; | ||
242 | - } | ||
243 | - else{ | ||
244 | - novo = []; | ||
245 | - for(i=0;i<n;i++){ | ||
246 | - temp = i3GEOadmin.webservices.dados[i].nome_ws; | ||
247 | - //if(temp.charAt(0).toUpperCase() == letra.toUpperCase()){ | ||
248 | - if(temp.toUpperCase().startsWith(letra.toUpperCase(),0)){ | ||
249 | - novo.push(i3GEOadmin.webservices.dados[i]); | ||
250 | - } | ||
251 | - } | ||
252 | - } | ||
253 | - i3GEOadmin.webservices.tabela(novo); | ||
254 | - }, | ||
255 | - exclui: function(id,row){ | ||
256 | - var mensagem = $trad("msgExclui",i3GEOadmin.core.dicionario)+id, | ||
257 | - sUrl = "../php/webservices.php?funcao=excluir&id="+id; | ||
258 | - core_excluiLinha(sUrl,row,mensagem,"",i3GEOadmin.webservices.dataTable); | ||
259 | - i3GEOadmin.webservices.dados = ""; | ||
260 | - }, | ||
261 | - salva: function(id,recordid){ | ||
262 | - var i,c,sUrl, callback, | ||
263 | - campos = i3GEOadmin.webservices.colunas, | ||
264 | - par = "", | ||
265 | - n = campos.length; | ||
266 | - for (i=0;i<n;i++){ | ||
267 | - c = $i("E"+campos[i].key); | ||
268 | - if(c){ | ||
269 | - par += "&"+campos[i].key+"="+(c.value); | ||
270 | - } | ||
271 | - } | ||
272 | - par += "&id_ws="+id; | ||
273 | - core_carregando("ativa"); | ||
274 | - core_carregando($trad("gravaId",i3GEOadmin.core.dicionario)+id); | ||
275 | - sUrl = "../php/webservices.php?funcao=alterarWS"+par; | ||
276 | - callback = { | ||
277 | - success:function(o){ | ||
278 | - try { | ||
279 | - if(YAHOO.lang.JSON.parse(o.responseText) == "erro") { | ||
280 | - core_carregando("<span style=color:red >"+ $trad("msgErroExclui",i3GEOadmin.core.dicionario) +"</span>"); | ||
281 | - setTimeout("core_carregando('desativa')",3000); | ||
282 | - } | ||
283 | - else{ | ||
284 | - var rec = i3GEOadmin.webservices.dataTable.getRecordSet().getRecord(recordid); | ||
285 | - i3GEOadmin.webservices.dataTable.updateRow(rec,YAHOO.lang.JSON.parse(o.responseText)[0]); | ||
286 | - i3GEOadmin.webservices.dados = ""; | ||
287 | - core_carregando("desativa"); | ||
288 | - } | ||
289 | - } | ||
290 | - catch(e){core_handleFailure(e,o.responseText);} | ||
291 | - }, | ||
292 | - failure:core_handleFailure, | ||
293 | - argument: { foo:"foo", bar:"bar" } | ||
294 | - }; | ||
295 | - core_makeRequest(sUrl,callback); | ||
296 | - } | ||
297 | -}; |
classesphp/wmswfs.php
@@ -335,7 +335,12 @@ function temaswms() | @@ -335,7 +335,12 @@ function temaswms() | ||
335 | //$wms_service_request = "c://temp//teste.xml"; | 335 | //$wms_service_request = "c://temp//teste.xml"; |
336 | include_once(dirname(__FILE__)."/../admin/php/admin.php"); | 336 | include_once(dirname(__FILE__)."/../admin/php/admin.php"); |
337 | 337 | ||
338 | - include_once(dirname(__FILE__)."/../admin/php/webservices.php"); | 338 | + if(file_exists(dirname(__FILE__)."/../admin1/cadastros/servicoes/exec.php")){ |
339 | + include_once(dirname(__FILE__)."/../admin1/cadastros/servicoes/exec.php"); | ||
340 | + } | ||
341 | + else{ | ||
342 | + include_once(dirname(__FILE__)."/../admin/php/webservices.php"); | ||
343 | + } | ||
339 | 344 | ||
340 | //error_reporting(0); | 345 | //error_reporting(0); |
341 | if($wms_service_request == "erro") { | 346 | if($wms_service_request == "erro") { |