Commit 290b873393bf4c45127bf4aaa60b3b37e4b98615

Authored by Edmar Moretti
1 parent ec68da88

criação do formulário para edição dos links para fontes

Showing 38 changed files with 541 additions and 85 deletions   Show diff stats
admin/admin.db
No preview for this file type
admin1/cadastros/identifica/exec.php
@@ -82,7 +82,7 @@ switch ($funcao) { @@ -82,7 +82,7 @@ switch ($funcao) {
82 } 82 }
83 break; 83 break;
84 default: 84 default:
85 - header ( "HTTP/1.1 500 erro funcao nao existe" ); 85 + if(!empty ($funcao)) header ( "HTTP/1.1 500 erro funcao nao existe" );
86 break; 86 break;
87 } 87 }
88 ?> 88 ?>
89 \ No newline at end of file 89 \ No newline at end of file
admin1/cadastros/perfis/exec.php
@@ -86,7 +86,7 @@ switch ($funcao) { @@ -86,7 +86,7 @@ switch ($funcao) {
86 } 86 }
87 break; 87 break;
88 default: 88 default:
89 - header ( "HTTP/1.1 500 erro funcao nao existe" ); 89 + if(!empty ($funcao)) header ( "HTTP/1.1 500 erro funcao nao existe" );
90 break; 90 break;
91 } 91 }
92 ?> 92 ?>
admin1/cadastros/servicos/exec.php
@@ -82,7 +82,7 @@ switch ($funcao) { @@ -82,7 +82,7 @@ switch ($funcao) {
82 } 82 }
83 break; 83 break;
84 default: 84 default:
85 - header ( "HTTP/1.1 500 erro funcao nao existe" ); 85 + if(!empty ($funcao)) header ( "HTTP/1.1 500 erro funcao nao existe" );
86 break; 86 break;
87 } 87 }
88 ?> 88 ?>
89 \ No newline at end of file 89 \ No newline at end of file
admin1/cadastros/sistemas/exec.php
@@ -94,7 +94,7 @@ switch ($funcao) { @@ -94,7 +94,7 @@ switch ($funcao) {
94 } 94 }
95 break; 95 break;
96 default: 96 default:
97 - header ( "HTTP/1.1 500 erro funcao nao existe" ); 97 + if(!empty ($funcao)) header ( "HTTP/1.1 500 erro funcao nao existe" );
98 break; 98 break;
99 } 99 }
100 ?> 100 ?>
admin1/cadastros/sistemas/funcoes/exec.php
@@ -94,7 +94,7 @@ switch ($funcao) { @@ -94,7 +94,7 @@ switch ($funcao) {
94 } 94 }
95 break; 95 break;
96 default: 96 default:
97 - header ( "HTTP/1.1 500 erro funcao nao existe" ); 97 + if(!empty ($funcao)) header ( "HTTP/1.1 500 erro funcao nao existe" );
98 break; 98 break;
99 } 99 }
100 100
admin1/cadastros/tags/exec.php
@@ -82,7 +82,7 @@ switch ($funcao) { @@ -82,7 +82,7 @@ switch ($funcao) {
82 } 82 }
83 break; 83 break;
84 default: 84 default:
85 - header ( "HTTP/1.1 500 erro funcao nao existe" ); 85 + if(!empty ($funcao)) header ( "HTTP/1.1 500 erro funcao nao existe" );
86 break; 86 break;
87 } 87 }
88 ?> 88 ?>
admin1/catalogo/atlas/exec.php
@@ -84,7 +84,7 @@ switch ($funcao) { @@ -84,7 +84,7 @@ switch ($funcao) {
84 } 84 }
85 break; 85 break;
86 default: 86 default:
87 - header ( "HTTP/1.1 500 erro funcao nao existe" ); 87 + if(!empty ($funcao)) header ( "HTTP/1.1 500 erro funcao nao existe" );
88 break; 88 break;
89 } 89 }
90 ?> 90 ?>
91 \ No newline at end of file 91 \ No newline at end of file
admin1/catalogo/atlas/pranchas/exec.php
@@ -84,7 +84,7 @@ switch ($funcao) { @@ -84,7 +84,7 @@ switch ($funcao) {
84 } 84 }
85 break; 85 break;
86 default: 86 default:
87 - header ( "HTTP/1.1 500 erro funcao nao existe" ); 87 + if(!empty ($funcao)) header ( "HTTP/1.1 500 erro funcao nao existe" );
88 break; 88 break;
89 } 89 }
90 ?> 90 ?>
91 \ No newline at end of file 91 \ No newline at end of file
admin1/catalogo/atlas/pranchas/temas/exec.php
@@ -92,7 +92,7 @@ switch ($funcao) { @@ -92,7 +92,7 @@ switch ($funcao) {
92 } 92 }
93 break; 93 break;
94 default: 94 default:
95 - header ( "HTTP/1.1 500 erro funcao nao existe" ); 95 + if(!empty ($funcao)) header ( "HTTP/1.1 500 erro funcao nao existe" );
96 break; 96 break;
97 } 97 }
98 ?> 98 ?>
99 \ No newline at end of file 99 \ No newline at end of file
admin1/catalogo/mapas/exec.php
@@ -106,7 +106,7 @@ switch ($funcao) { @@ -106,7 +106,7 @@ switch ($funcao) {
106 } 106 }
107 break; 107 break;
108 default: 108 default:
109 - header ( "HTTP/1.1 500 erro funcao nao existe" ); 109 + if(!empty ($funcao)) header ( "HTTP/1.1 500 erro funcao nao existe" );
110 break; 110 break;
111 } 111 }
112 ?> 112 ?>
admin1/catalogo/mapfile/cdados/exec.php
@@ -63,7 +63,7 @@ switch ($funcao) { @@ -63,7 +63,7 @@ switch ($funcao) {
63 ) ); 63 ) );
64 break; 64 break;
65 default: 65 default:
66 - header ( "HTTP/1.1 500 erro funcao nao existe" ); 66 + if(!empty ($funcao)) header ( "HTTP/1.1 500 erro funcao nao existe" );
67 break; 67 break;
68 } 68 }
69 ?> 69 ?>
admin1/catalogo/mapfile/comportamento/exec.php
@@ -55,7 +55,7 @@ switch ($funcao) { @@ -55,7 +55,7 @@ switch ($funcao) {
55 ) ); 55 ) );
56 break; 56 break;
57 default: 57 default:
58 - header ( "HTTP/1.1 500 erro funcao nao existe" ); 58 + if(!empty ($funcao)) header ( "HTTP/1.1 500 erro funcao nao existe" );
59 break; 59 break;
60 } 60 }
61 ?> 61 ?>
admin1/catalogo/mapfile/conexao/local/exec.php
@@ -54,7 +54,7 @@ switch ($funcao) { @@ -54,7 +54,7 @@ switch ($funcao) {
54 ) ); 54 ) );
55 break; 55 break;
56 default: 56 default:
57 - header ( "HTTP/1.1 500 erro funcao nao existe" ); 57 + if(!empty ($funcao)) header ( "HTTP/1.1 500 erro funcao nao existe" );
58 break; 58 break;
59 } 59 }
60 ?> 60 ?>
admin1/catalogo/mapfile/conexao/ogc/exec.php
@@ -54,7 +54,7 @@ switch ($funcao) { @@ -54,7 +54,7 @@ switch ($funcao) {
54 ) ); 54 ) );
55 break; 55 break;
56 default: 56 default:
57 - header ( "HTTP/1.1 500 erro funcao nao existe" ); 57 + if(!empty ($funcao)) header ( "HTTP/1.1 500 erro funcao nao existe" );
58 break; 58 break;
59 } 59 }
60 ?> 60 ?>
admin1/catalogo/mapfile/disponibilidade/exec.php
@@ -53,7 +53,7 @@ switch ($funcao) { @@ -53,7 +53,7 @@ switch ($funcao) {
53 ) ); 53 ) );
54 break; 54 break;
55 default: 55 default:
56 - header ( "HTTP/1.1 500 erro funcao nao existe" ); 56 + if(!empty ($funcao)) header ( "HTTP/1.1 500 erro funcao nao existe" );
57 break; 57 break;
58 } 58 }
59 ?> 59 ?>
admin1/catalogo/mapfile/editavel/exec.php
@@ -54,7 +54,7 @@ switch ($funcao) { @@ -54,7 +54,7 @@ switch ($funcao) {
54 ) ); 54 ) );
55 break; 55 break;
56 default: 56 default:
57 - header ( "HTTP/1.1 500 erro funcao nao existe" ); 57 + if(!empty ($funcao)) header ( "HTTP/1.1 500 erro funcao nao existe" );
58 break; 58 break;
59 } 59 }
60 60
admin1/catalogo/mapfile/exec.php
@@ -149,7 +149,7 @@ switch ($funcao) { @@ -149,7 +149,7 @@ switch ($funcao) {
149 \admin\php\funcoesAdmin\retornaJSON("ok"); 149 \admin\php\funcoesAdmin\retornaJSON("ok");
150 break; 150 break;
151 default: 151 default:
152 - header ( "HTTP/1.1 500 erro funcao nao existe" ); 152 + if(!empty ($funcao)) header ( "HTTP/1.1 500 erro funcao nao existe" );
153 break; 153 break;
154 } 154 }
155 ?> 155 ?>
156 \ No newline at end of file 156 \ No newline at end of file
admin1/catalogo/mapfile/gruposusuarios/exec.php
@@ -69,7 +69,7 @@ switch ($funcao) { @@ -69,7 +69,7 @@ switch ($funcao) {
69 } 69 }
70 break; 70 break;
71 default: 71 default:
72 - header ( "HTTP/1.1 500 erro funcao nao existe" ); 72 + if(!empty ($funcao)) header ( "HTTP/1.1 500 erro funcao nao existe" );
73 break; 73 break;
74 } 74 }
75 ?> 75 ?>
76 \ No newline at end of file 76 \ No newline at end of file
admin1/catalogo/mapfile/renderizacao/exec.php
@@ -54,7 +54,7 @@ switch ($funcao) { @@ -54,7 +54,7 @@ switch ($funcao) {
54 ) ); 54 ) );
55 break; 55 break;
56 default: 56 default:
57 - header ( "HTTP/1.1 500 erro funcao nao existe" ); 57 + if(!empty ($funcao)) header ( "HTTP/1.1 500 erro funcao nao existe" );
58 break; 58 break;
59 } 59 }
60 ?> 60 ?>
admin1/catalogo/menus/exec.php
@@ -96,7 +96,7 @@ switch ($funcao) { @@ -96,7 +96,7 @@ switch ($funcao) {
96 } 96 }
97 break; 97 break;
98 default: 98 default:
99 - header ( "HTTP/1.1 500 erro funcao nao existe" ); 99 + if(!empty ($funcao)) header ( "HTTP/1.1 500 erro funcao nao existe" );
100 break; 100 break;
101 } 101 }
102 ?> 102 ?>
admin1/catalogo/menus/grupos/exec.php
@@ -108,7 +108,7 @@ switch ($funcao) { @@ -108,7 +108,7 @@ switch ($funcao) {
108 } 108 }
109 break; 109 break;
110 default: 110 default:
111 - header ( "HTTP/1.1 500 erro funcao nao existe" ); 111 + if(!empty ($funcao)) header ( "HTTP/1.1 500 erro funcao nao existe" );
112 break; 112 break;
113 } 113 }
114 ?> 114 ?>
admin1/catalogo/menus/grupos/listadegrupos/exec.php
@@ -85,7 +85,7 @@ switch ($funcao) { @@ -85,7 +85,7 @@ switch ($funcao) {
85 } 85 }
86 break; 86 break;
87 default: 87 default:
88 - header ( "HTTP/1.1 500 erro funcao nao existe" ); 88 + if(!empty ($funcao)) header ( "HTTP/1.1 500 erro funcao nao existe" );
89 break; 89 break;
90 } 90 }
91 ?> 91 ?>
admin1/catalogo/menus/grupos/subgrupos/exec.php
@@ -109,7 +109,7 @@ switch ($funcao) { @@ -109,7 +109,7 @@ switch ($funcao) {
109 } 109 }
110 break; 110 break;
111 default: 111 default:
112 - header ( "HTTP/1.1 500 erro funcao nao existe" ); 112 + if(!empty ($funcao)) header ( "HTTP/1.1 500 erro funcao nao existe" );
113 break; 113 break;
114 } 114 }
115 ?> 115 ?>
admin1/catalogo/menus/grupos/subgrupos/listadesubgrupos/exec.php
@@ -83,7 +83,7 @@ switch ($funcao) { @@ -83,7 +83,7 @@ switch ($funcao) {
83 } 83 }
84 break; 84 break;
85 default: 85 default:
86 - header ( "HTTP/1.1 500 erro funcao nao existe" ); 86 + if(!empty ($funcao)) header ( "HTTP/1.1 500 erro funcao nao existe" );
87 break; 87 break;
88 } 88 }
89 ?> 89 ?>
admin1/catalogo/menus/grupos/subgrupos/temas/exec.php
@@ -101,7 +101,7 @@ switch ($funcao) { @@ -101,7 +101,7 @@ switch ($funcao) {
101 } 101 }
102 break; 102 break;
103 default: 103 default:
104 - header ( "HTTP/1.1 500 erro funcao nao existe" ); 104 + if(!empty ($funcao)) header ( "HTTP/1.1 500 erro funcao nao existe" );
105 break; 105 break;
106 } 106 }
107 ?> 107 ?>
108 \ No newline at end of file 108 \ No newline at end of file
admin1/dicionario/estat_fonteinfo.js
@@ -1,44 +0,0 @@ @@ -1,44 +0,0 @@
1 -//+$trad(1,i3GEOadmin.editormapfile.dicionario)+  
2 -i3GEOadmin.estat_fonteinfo = {};  
3 -i3GEOadmin.estat_fonteinfo.dicionario = {  
4 - 'fonteInfo' : [ {  
5 - pt : "Metadados estatísticos - Fonte",  
6 - en : "",  
7 - es : ""  
8 - } ],  
9 - 'ajuda' : [ {  
10 - pt : "Ajuda",  
11 - en : "",  
12 - es : ""  
13 - } ],  
14 - 'txtAjuda' : [ {  
15 - pt : "<p>Este formul&aacute;rio permite editar a lista de fontes que s&atilde;o mostradas nos formul&aacute;rios do sistema de metadados estat&iacute;sticos",  
16 - en : "",  
17 - es : ""  
18 - } ],  
19 - 'adicionaRegistro' : [ {  
20 - pt : "Adicionar um novo registro",  
21 - en : "",  
22 - es : ""  
23 - } ],  
24 - '' : [ {  
25 - pt : "",  
26 - en : "",  
27 - es : ""  
28 - } ],  
29 - '' : [ {  
30 - pt : "",  
31 - en : "",  
32 - es : ""  
33 - } ],  
34 - '' : [ {  
35 - pt : "",  
36 - en : "",  
37 - es : ""  
38 - } ],  
39 - '' : [ {  
40 - pt : "",  
41 - en : "",  
42 - es : ""  
43 - } ]  
44 -};  
admin1/dicionario/estat_fontes.js 0 → 100755
@@ -0,0 +1,32 @@ @@ -0,0 +1,32 @@
  1 +i3GEOadmin.fontes.dicionario = {
  2 + 'txtTitulo' : [ {
  3 + pt : "Cadastro de links para fontes de dados",
  4 + en : "",
  5 + es : ""
  6 + } ],
  7 + 'txtDesc' : [ {
  8 + pt : "Links para as fontes de dados originais utilizados nas vari&aacute;veis",
  9 + en : "",
  10 + es : ""
  11 + } ],
  12 + '' : [ {
  13 + pt : "",
  14 + en : "",
  15 + es : ""
  16 + } ],
  17 + '' : [ {
  18 + pt : "",
  19 + en : "",
  20 + es : ""
  21 + } ],
  22 + '' : [ {
  23 + pt : "",
  24 + en : "",
  25 + es : ""
  26 + } ],
  27 + '' : [ {
  28 + pt : "",
  29 + en : "",
  30 + es : ""
  31 + } ]
  32 +};
admin1/metaestat/conexoes/exec.php
@@ -81,7 +81,7 @@ switch ($funcao) { @@ -81,7 +81,7 @@ switch ($funcao) {
81 } 81 }
82 break; 82 break;
83 default: 83 default:
84 - header ( "HTTP/1.1 500 erro funcao nao existe" ); 84 + if(!empty ($funcao)) header ( "HTTP/1.1 500 erro funcao nao existe" );
85 break; 85 break;
86 } 86 }
87 ?> 87 ?>
88 \ No newline at end of file 88 \ No newline at end of file
admin1/metaestat/fontes/exec.php 0 → 100755
@@ -0,0 +1,87 @@ @@ -0,0 +1,87 @@
  1 +<?php
  2 +/****************************************************************/
  3 +////include (dirname ( __FILE__ ) . "/../../../ms_configura.php");
  4 +//
  5 +//checa login
  6 +//valida _GET e _POST, juntando em _GET
  7 +//pega algumas variaveis de uso mais comum
  8 +//session_start
  9 +//
  10 +include ("../../php/checaLogin.php");
  11 +\admin\php\login\checaLogin();
  12 +//funcoes de administracao
  13 +include ($_SESSION["locaplic"]."/admin1/php/funcoesAdmin.php");
  14 +//
  15 +//carrega outras funcoes e extensoes do PHP
  16 +//
  17 +include ($_SESSION["locaplic"]."/classesphp/carrega_ext.php");
  18 +//
  19 +//carrega as funcoes locais
  20 +//depende de funcoesAdmin.php
  21 +//
  22 +include ("funcoes.php");
  23 +//
  24 +//conexao com o banco de administracao
  25 +//cria as variaveis $dbh e $dbhw alem de conexaoadmin
  26 +//
  27 +include ($_SESSION["locaplic"]."/admin1/php/conexao.php");
  28 +/***************************************************************/
  29 +if (\admin\php\funcoesAdmin\verificaOperacaoSessao ( "admin/metaestat/geral" ) === false) {
  30 + header ( "HTTP/1.1 403 Vc nao pode realizar essa operacao" );
  31 + exit ();
  32 +}
  33 +$id_fonteinfo = $_POST["id_fonteinfo"];
  34 +
  35 +\admin\php\funcoesAdmin\testaSafeNumerico([$id_fonteinfo]);
  36 +
  37 +$funcao = strtoupper ( $funcao );
  38 +switch ($funcao) {
  39 + case "ADICIONAR" :
  40 + $novo = \admin\metaestat\fontes\adicionar ( $_POST["titulo"], $_POST["link"], $dbhw );
  41 + $dbhw = null;
  42 + $dbh = null;
  43 + if ($novo === false) {
  44 + header ( "HTTP/1.1 500 erro ao consultar banco de dados" );
  45 + }
  46 + break;
  47 + case "ALTERAR" :
  48 + $novo = \admin\metaestat\fontes\alterar ( $id_fonteinfo,$_POST["titulo"],$_POST["link"], $dbhw );
  49 + $dbhw = null;
  50 + $dbh = null;
  51 + if ($novo === false) {
  52 + header ( "HTTP/1.1 500 erro ao consultar banco de dados" );
  53 + }
  54 + break;
  55 + case "LISTAUNICO" :
  56 + $dados = \admin\metaestat\fontes\listar ( $dbh, $id_fonteinfo );
  57 + $dbhw = null;
  58 + $dbh = null;
  59 + if ($dados === false) {
  60 + header ( "HTTP/1.1 500 erro ao consultar banco de dados" );
  61 + } else {
  62 + \admin\php\funcoesAdmin\retornaJSON ( $dados );
  63 + }
  64 + break;
  65 + case "LISTA" :
  66 + $dados = \admin\metaestat\fontes\listar ( $dbh );
  67 + $dbhw = null;
  68 + $dbh = null;
  69 + if ($dados === false) {
  70 + header ( "HTTP/1.1 500 erro ao consultar banco de dados" );
  71 + } else {
  72 + \admin\php\funcoesAdmin\retornaJSON ( $dados );
  73 + }
  74 + break;
  75 + case "EXCLUIR" :
  76 + $retorna = \admin\metaestat\fontes\excluir ( $id_fonteinfo, $dbhw );
  77 + $dbhw = null;
  78 + $dbh = null;
  79 + if ($retorna === false) {
  80 + header ( "HTTP/1.1 500 erro ao consultar banco de dados" );
  81 + }
  82 + break;
  83 + default:
  84 + if(!empty ($funcao)) header ( "HTTP/1.1 500 erro funcao nao existe" );
  85 + break;
  86 +}
  87 +?>
0 \ No newline at end of file 88 \ No newline at end of file
admin1/metaestat/fontes/funcoes.php 0 → 100755
@@ -0,0 +1,61 @@ @@ -0,0 +1,61 @@
  1 +<?php
  2 +
  3 +namespace admin\metaestat\fontes;
  4 +
  5 +function listar($dbh, $id_fonteinfo = "") {
  6 + $esquemaadmin = $_SESSION ["esquemaadmin"];
  7 + if ($id_fonteinfo != "") {
  8 + $dados = \admin\php\funcoesAdmin\pegaDados ( "SELECT * from " . $esquemaadmin . "i3geoestat_fonteinfo WHERE id_fonteinfo = $id_fonteinfo ", $dbh, false );
  9 + $dados = $dados [0];
  10 + } else {
  11 + $dados = \admin\php\funcoesAdmin\pegaDados ( "SELECT * from " . $esquemaadmin . "i3geoestat_fonteinfo", $dbh, false );
  12 + }
  13 + if ($dados === false) {
  14 + return false;
  15 + } else {
  16 + return $dados;
  17 + }
  18 +}
  19 +function adicionar($titulo, $link, $dbhw) {
  20 + $esquemaadmin = $_SESSION ["esquemaadmin"];
  21 + try {
  22 + $dataCol = array (
  23 + "titulo" => '',
  24 + "link" => ''
  25 + );
  26 + $id_fonteinfo = \admin\php\funcoesAdmin\i3GeoAdminInsertUnico ( $dbhw, "i3geoestat_fonteinfo", $dataCol, "titulo", "id_fonteinfo" );
  27 + $retorna = \admin\metaestat\fontes\alterar ( $id_fonteinfo, $titulo, $link, $dbhw );
  28 +
  29 + return $retorna;
  30 + } catch ( PDOException $e ) {
  31 + return false;
  32 + }
  33 +}
  34 +function alterar($id_fonteinfo, $titulo, $link, $dbhw) {
  35 + $esquemaadmin = $_SESSION ["esquemaadmin"];
  36 + $dataCol = array (
  37 + "titulo" => $titulo,
  38 + "link" => $link
  39 + );
  40 + $resultado = \admin\php\funcoesAdmin\i3GeoAdminUpdate ( $dbhw, "i3geoestat_fonteinfo", $dataCol, "WHERE id_fonteinfo = $id_fonteinfo" );
  41 + if ($resultado === false) {
  42 + return false;
  43 + }
  44 + return $id_fonteinfo;
  45 +}
  46 +function excluir($id_fonteinfo, $dbhw) {
  47 + $esquemaadmin = $_SESSION ["esquemaadmin"];
  48 +
  49 + $r = \admin\php\funcoesAdmin\pegaDados("select * from ".$esquemaadmin."i3geoestat_fonteinfo_medida where id_fonteinfo=$id_fonteinfo");
  50 + if(count($r) > 0){
  51 + header ( "HTTP/1.1 500 erro ao excluir. Essa fonte esta em uso por i3geoestat_fonteinfo_medida" );
  52 + exit ();
  53 + }
  54 +
  55 + $resultado = \admin\php\funcoesAdmin\i3GeoAdminExclui ( $esquemaadmin . "i3geoestat_fonteinfo", "id_fonteinfo", $id_fonteinfo, $dbhw, false );
  56 + if ($resultado === false) {
  57 + return false;
  58 + }
  59 + return $resultado;
  60 +}
  61 +?>
0 \ No newline at end of file 62 \ No newline at end of file
admin1/metaestat/fontes/index.js 0 → 100755
@@ -0,0 +1,215 @@ @@ -0,0 +1,215 @@
  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&eacute;rio do Meio Ambiente Brasil
  9 +Desenvolvedor: Edmar Moretti edmar.moretti@gmail.com
  10 +
  11 +Este programa &eacute; software livre; voc&ecirc; pode redistribu&iacute;-lo
  12 +e/ou modific&aacute;-lo sob os termos da Licen&ccedil;a P&uacute;blica Geral
  13 +GNU conforme publicada pela Free Software Foundation;
  14 +
  15 +Este programa &eacute; distribu&iacute;do na expectativa de que seja &uacute;til,
  16 +por&eacute;m, SEM NENHUMA GARANTIA; nem mesmo a garantia impl&iacute;cita
  17 +de COMERCIABILIDADE OU ADEQUA&Ccedil;&Atilde;O A UMA FINALIDADE ESPEC&Iacute;FICA.
  18 +Consulte a Licen&ccedil;a P&uacute;blica Geral do GNU para mais detalhes.
  19 +Voc&ecirc; deve ter recebido uma c&oacute;pia da Licen&ccedil;a P&uacute;blica Geral do
  20 +GNU junto com este programa; se n&atilde;o, escreva para a
  21 +Free Software Foundation, Inc., no endere&ccedil;o
  22 +59 Temple Street, Suite 330, Boston, MA 02111-1307 USA.
  23 +
  24 + */
  25 +i3GEOadmin.fontes = {
  26 + //variavel global indicando o elemento que recebera a lista de fontes
  27 + ondeLista: "",
  28 + //conteudo html do formulario de adicao de operacao
  29 + formAdiciona: "",
  30 + //parametros obtidos do formulario de edicao antes de abrir o modal de confirmacao
  31 + parametrosSalvar: "",
  32 + init: function(onde){
  33 + i3GEOadmin.fontes.ondeLista = onde;
  34 + i3GEOadmin.fontes.lista();
  35 + },
  36 + /*
  37 +Function: lista
  38 +
  39 +Obt&eacute;m a lista de fontes
  40 + */
  41 + lista: function(){
  42 + i3GEOadmin.core.iconeAguarde(i3GEOadmin.fontes.ondeLista);
  43 + $.post(
  44 + "exec.php?funcao=lista"
  45 + )
  46 + .done(
  47 + function(data, status){
  48 + //objeto json com os dados viondos do banco
  49 + var json = jQuery.parseJSON(data);
  50 + //template do form de cada operacao
  51 + var templateLista = $("#templateLista").html();
  52 + //lista todas as fontes
  53 + var html = Mustache.to_html(
  54 + "{{#data}}" + templateLista + "{{/data}}",
  55 + $.extend(
  56 + {},
  57 + i3GEOadmin.fontes.dicionario,
  58 + {
  59 + "data": json,
  60 + "onExcluir": "i3GEOadmin.fontes.excluirDialogo",//funcao
  61 + "onEditar": "i3GEOadmin.fontes.editarDialogo"
  62 + }
  63 + )
  64 + );
  65 + i3GEOadmin.fontes.ondeLista.html(html);
  66 + //monta um template para o modal de inclusao
  67 + if(i3GEOadmin.fontes.formAdiciona == ""){
  68 + html = Mustache.to_html(
  69 + $("#templateFormLista").html(),
  70 + $.extend(
  71 + {},
  72 + i3GEOadmin.fontes.dicionario,
  73 + {
  74 + "codigo_estat_conexao": "modal",
  75 + "escondido": "hidden",
  76 + "excluir": i3GEOadmin.fontes.dicionario.cancelar,
  77 + "onExcluir": "i3GEOadmin.core.fechaModalGeral",//funcao
  78 + "onSalvar": "i3GEOadmin.fontes.adiciona"
  79 + }
  80 + )
  81 + );
  82 + i3GEOadmin.fontes.formAdiciona = html;
  83 + }
  84 + $.material.init();
  85 + }
  86 + )
  87 + .fail(function(data){
  88 + i3GEOadmin.fontes.ondeLista.html("");
  89 + i3GEOadmin.core.mostraErro(data.status + " " +data.statusText);
  90 + });
  91 + },
  92 + editarDialogo: function(id){
  93 + i3GEOadmin.core.fechaModalGeral();
  94 + i3GEOadmin.core.modalAguarde(true);
  95 + $.post(
  96 + "exec.php?funcao=listaunico",
  97 + "id_fonteinfo=" + id
  98 + )
  99 + .done(
  100 + function(data, status){
  101 + var json = jQuery.parseJSON(data);
  102 + //lista todas as fontes
  103 + var html = Mustache.to_html(
  104 + "{{#data}}" + $("#templateFormLista").html() + "{{/data}}",
  105 + $.extend(
  106 + {},
  107 + i3GEOadmin.fontes.dicionario,
  108 + {
  109 + "data": json,
  110 + "onExcluir": "i3GEOadmin.fontes.excluirDialogo",//funcao
  111 + "onSalvar": "i3GEOadmin.fontes.salvarDialogo"
  112 + }
  113 + )
  114 + );
  115 + i3GEOadmin.core.abreModalGeral(html);
  116 + }
  117 + )
  118 + .fail(
  119 + function(data){
  120 + i3GEOadmin.core.modalAguarde(false);
  121 + i3GEOadmin.core.mostraErro(data.status + " " +data.statusText);
  122 + }
  123 + );
  124 + },
  125 + adicionaDialogo: function(){
  126 + i3GEOadmin.core.abreModalGeral(i3GEOadmin.fontes.formAdiciona);
  127 + },
  128 +// os parametros sao obtidos do formulario aberto do modal
  129 + adiciona: function(){
  130 + var parametros = $("#modalGeral form").serialize();
  131 + i3GEOadmin.core.fechaModalGeral();
  132 + i3GEOadmin.core.modalAguarde(true);
  133 + $.post(
  134 + "exec.php?funcao=adicionar",
  135 + parametros
  136 + )
  137 + .done(
  138 + function(data, status){
  139 + i3GEOadmin.core.modalAguarde(false);
  140 + i3GEOadmin.core.iconeAguarde(i3GEOadmin.fontes.ondeLista);
  141 + i3GEOadmin.fontes.lista();
  142 + }
  143 + )
  144 + .fail(
  145 + function(data){
  146 + i3GEOadmin.core.modalAguarde(false);
  147 + i3GEOadmin.core.mostraErro(data.status + " " +data.statusText);
  148 + }
  149 + );
  150 + },
  151 + excluirDialogo: function(id){
  152 + var hash = {
  153 + "mensagem": i3GEOadmin.fontes.dicionario.confirma,
  154 + "onBotao1": "i3GEOadmin.fontes.excluir('"+id+"')",
  155 + "botao1": i3GEOadmin.fontes.dicionario.sim,
  156 + "onBotao2": "i3GEOadmin.core.fechaModalConfirma();",
  157 + "botao2": i3GEOadmin.fontes.dicionario.nao
  158 + };
  159 + i3GEOadmin.core.abreModalConfirma(hash);
  160 + },
  161 + excluir: function(id){
  162 + i3GEOadmin.core.modalAguarde(true);
  163 + $.post(
  164 + "exec.php?funcao=excluir",
  165 + "id_fonteinfo="+id
  166 + )
  167 + .done(
  168 + function(data, status){
  169 + i3GEOadmin.core.modalAguarde(false);
  170 + i3GEOadmin.fontes.lista();
  171 + }
  172 + )
  173 + .fail(
  174 + function(data){
  175 + i3GEOadmin.core.modalAguarde(false);
  176 + i3GEOadmin.core.mostraErro(data.status + " " +data.statusText);
  177 + }
  178 + );
  179 + },
  180 + salvarDialogo: function(id){
  181 + i3GEOadmin.fontes.parametrosSalvar = $("#form-edicao-" + id).serialize();
  182 + var hash = {
  183 + "mensagem": i3GEOadmin.fontes.dicionario.confirma,
  184 + "onBotao1": "i3GEOadmin.fontes.salvar('"+id+"')",
  185 + "botao1": i3GEOadmin.fontes.dicionario.sim,
  186 + "onBotao2": "i3GEOadmin.fontes.parametrosSalvar = '';i3GEOadmin.core.fechaModalConfirma();",
  187 + "botao2": i3GEOadmin.fontes.dicionario.nao
  188 + };
  189 + i3GEOadmin.core.abreModalConfirma(hash);
  190 + },
  191 + salvar: function(id){
  192 + var parametros = i3GEOadmin.fontes.parametrosSalvar;
  193 + i3GEOadmin.core.fechaModalGeral();
  194 + i3GEOadmin.core.modalAguarde(true);
  195 + $.post(
  196 + "exec.php?funcao=alterar",
  197 + "id_fonteinfo="+ id+"&"+parametros
  198 + )
  199 + .done(
  200 + function(data, status){
  201 + i3GEOadmin.fontes.parametrosSalvar = "";
  202 + i3GEOadmin.core.modalAguarde(false);
  203 + i3GEOadmin.core.iconeAguarde(i3GEOadmin.fontes.ondeLista);
  204 + i3GEOadmin.fontes.lista();
  205 + }
  206 + )
  207 + .fail(
  208 + function(data){
  209 + i3GEOadmin.fontes.parametrosSalvar = "";
  210 + i3GEOadmin.core.modalAguarde(false);
  211 + i3GEOadmin.core.mostraErro(data.status + " " +data.statusText);
  212 + }
  213 + );
  214 + }
  215 +};
0 \ No newline at end of file 216 \ No newline at end of file
admin1/metaestat/fontes/index.php
@@ -4,23 +4,61 @@ include (&quot;exec.php&quot;); @@ -4,23 +4,61 @@ include (&quot;exec.php&quot;);
4 4
5 include "../../head.php"; 5 include "../../head.php";
6 ?> 6 ?>
7 -<div class="container-fluid"> 7 +<div class="container-fluid migalha">
8 <div class="row"> 8 <div class="row">
9 - <ol class="breadcrumb">  
10 - <li><a href="../../init/index.php">i3Geo</a></li>  
11 - <li><a href="../../index.php">Admin</a></li>  
12 - <li>Metaestat</li>  
13 - <li class="active">Fontes</li>  
14 - </ol> 9 + <div class="btn-group btn-breadcrumb">
  10 + <a class="btn btn-default" href="../../../init/index.php"><span>i3Geo</span></a>
  11 + <a class="btn btn-default" href="../../index.php"><span>Admin</span></a>
  12 + <a class="btn btn-default" style="pointer-events: none"><span>Metaestat</span></a>
  13 + <a class="btn btn-default" style="pointer-events: none"><span>Fontes de dados</span></a>
  14 + </div>
15 </div> 15 </div>
16 -  
17 </div> 16 </div>
18 -<div class="container-fluid">  
19 - <div class="row">  
20 - <iframe src="../../../admin/html/estat_fonteinfo_.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" id="titulo">
  20 + <div class="well hidden" >
  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 + <h2><small>{{{txtTitulo}}}</small></h2>
  28 + <blockquote>{{{txtDesc}}}</blockquote>
  29 + <div class="clearfix"></div>
  30 + <div id="ajudaPrincipal" class="modal fade" tabindex="-1">
  31 + <div class="modal-dialog">
  32 + <div class="modal-content">
  33 + <div class="modal-body">
  34 + <p>{{{txtAjuda}}}</p>
  35 + </div>
  36 + </div>
  37 + </div>
  38 + </div>
  39 + </div>
  40 + <div class="well hidden">
  41 + <div class="panel-heading">
  42 + <p class="lead" style="margin:0px;">&nbsp;
  43 + <a title="{{{adicionar}}}" onclick="i3GEOadmin.fontes.adicionaDialogo();" href="javascript:void(0)"
  44 + class="pull-right btn btn-danger btn-fab btn-fab-mini" role="button" ><i class="material-icons ">add</i>
  45 + </a>
  46 + </p>
  47 + </div>
  48 + <div class="clearfix"></div>
  49 +
  50 + <div id="corpo">
  51 + </div>
  52 + </div>
  53 + </div>
22 </div> 54 </div>
23 </div> 55 </div>
  56 +<?php
  57 +include("templates/templateLista.php");
  58 +include("templates/templateFormLista.php");
  59 +?>
  60 +<script type="text/javascript" src="index.js"></script>
  61 +<script type="text/javascript" src="../../dicionario/estat_fontes.js"></script>
24 <script> 62 <script>
25 $(document).ready(function(){ 63 $(document).ready(function(){
26 //vem de admin1/index.js 64 //vem de admin1/index.js
@@ -31,7 +69,29 @@ include &quot;../../head.php&quot;; @@ -31,7 +69,29 @@ include &quot;../../head.php&quot;;
31 $(this).parent().siblings().removeClass('open'); 69 $(this).parent().siblings().removeClass('open');
32 $(this).parent().toggleClass('open'); 70 $(this).parent().toggleClass('open');
33 }); 71 });
  72 + //traducao
  73 + var t = $("#titulo");
  74 + //complementa dicionario
  75 + i3GEOadmin.fontes.dicionario = $.extend(
  76 + {},
  77 + i3GEOadmin.fontes.dicionario,
  78 + i3GEOadmin.core.dicionario
  79 + );
  80 +
  81 + i3GEOadmin.core.dicionario = null;
  82 +
  83 + i3GEOadmin.fontes.dicionario = i3GEO.idioma.objetoIdioma(i3GEOadmin.fontes.dicionario);
  84 +
  85 + t.html(
  86 + Mustache.to_html(
  87 + t.html(),
  88 + i3GEOadmin.fontes.dicionario
  89 + )
  90 + );
34 $.material.init(); 91 $.material.init();
  92 + i3GEOadmin.core.loginOn();
  93 + $(".hidden").removeClass('hidden');
  94 + i3GEOadmin.fontes.init($("#corpo"));
35 }); 95 });
36 </script> 96 </script>
37 </body> 97 </body>
admin1/metaestat/fontes/templates/templateFormLista.php 0 → 100755
@@ -0,0 +1,28 @@ @@ -0,0 +1,28 @@
  1 +<script id="templateFormLista" type="x-tmpl-mustache">
  2 +<form id="form-edicao-{{id_fonteinfo}}" style="" action="#" onsubmit="{{onSalvar}}('{{id_fonteinfo}}');return false;" class="form-horizontal" role="form" method="post" >
  3 + <div class="row">
  4 + <div class="col-md-12">
  5 + <div class="form-group form-group-lg">
  6 + <label class="col-md-2 control-label" for="titulo" >{{{tituloTxt}}}</label>
  7 + <div class="col-md-10">
  8 + <input title="{{{tituloTxt}}}" type="text" value="{{{titulo}}}" class="form-control" name="titulo" required>
  9 + </div>
  10 + </div>
  11 + </div>
  12 + </div>
  13 + <div class="row">
  14 + <div class="col-md-12">
  15 + <div class="form-group form-group-lg">
  16 + <label class="col-md-2 control-label" for="link" >URI</label>
  17 + <div class="col-md-10">
  18 + <input title="URI" type="text" value="{{{link}}}" class="form-control" name="link" required>
  19 + </div>
  20 + </div>
  21 + </div>
  22 + </div>
  23 + <div class="pull-right">
  24 + <button type="submit" class="btn btn-primary" role="button" style="color:#008579;">{{salvar}}</button>
  25 + </div>
  26 + <div class="clearfix"></div>
  27 +</form>
  28 +</script>
admin1/metaestat/fontes/templates/templateLista.php 0 → 100755
@@ -0,0 +1,17 @@ @@ -0,0 +1,17 @@
  1 +<script id="templateLista" type="x-tmpl-mustache">
  2 +<div class="list-group-item" id="form-{{id_fonteinfo}}">
  3 + <div class="row-content" >
  4 + <h4 class="list-group-item-heading {{escondido}}">
  5 + <a href="javascript:void(0)" onclick="{{onEditar}}('{{id_fonteinfo}}')" class="btn btn-danger btn-fab btn-fab-mini pull-right" role="button" aria-expanded="false" >
  6 + <i class="material-icons md-18">edit</i>
  7 + </a>
  8 + <span class="pull-right">&nbsp;&nbsp;</span>
  9 + <a href="javascript:void(0)" onclick="{{onExcluir}}('{{id_fonteinfo}}')" class="btn btn-danger btn-fab btn-fab-mini pull-right" role="button">
  10 + <i class="material-icons md-18">delete_forever</i>
  11 + </a>
  12 + &nbsp;<a href="{{{link}}}" target="_blank" >{{{titulo}}}</a>
  13 + </h4>
  14 + </div>
  15 + <div class="list-group-separator"></div>
  16 +</div>
  17 +</script>
admin1/usuarios/cadastro/exec.php
@@ -147,7 +147,7 @@ switch ($funcao) { @@ -147,7 +147,7 @@ switch ($funcao) {
147 } 147 }
148 break; 148 break;
149 default : 149 default :
150 - header ( "HTTP/1.1 500 erro funcao nao existe" ); 150 + if(!empty ($funcao)) header ( "HTTP/1.1 500 erro funcao nao existe" );
151 break; 151 break;
152 } 152 }
153 ?> 153 ?>
154 \ No newline at end of file 154 \ No newline at end of file
admin1/usuarios/grupos/exec.php
@@ -113,7 +113,7 @@ switch ($funcao) { @@ -113,7 +113,7 @@ switch ($funcao) {
113 } 113 }
114 break; 114 break;
115 default : 115 default :
116 - header ( "HTTP/1.1 500 erro funcao nao existe" ); 116 + if(!empty ($funcao)) header ( "HTTP/1.1 500 erro funcao nao existe" );
117 break; 117 break;
118 } 118 }
119 ?> 119 ?>
120 \ No newline at end of file 120 \ No newline at end of file
admin1/usuarios/operacoes/exec.php
@@ -121,7 +121,7 @@ switch ($funcao) { @@ -121,7 +121,7 @@ switch ($funcao) {
121 } 121 }
122 break; 122 break;
123 default : 123 default :
124 - header ( "HTTP/1.1 500 erro funcao nao existe" ); 124 + if(!empty ($funcao)) header ( "HTTP/1.1 500 erro funcao nao existe" );
125 break; 125 break;
126 } 126 }
127 ?> 127 ?>
128 \ No newline at end of file 128 \ No newline at end of file