Commit de05365df721847147a01303b40e8868dbb80da8

Authored by Edmar Moretti
1 parent 1ada30f0
Exists in master and in 1 other branch docker

Inclusão de log de transações #62

admin/admin.db
No preview for this file type
admin/js/sistemas.js
... ... @@ -262,7 +262,7 @@ function montaDivFuncoes(i)
262 262 var param =
263 263 {
264 264 "linhas":[
265   - {titulo:$trad("publicado",i3GEOadmin.sistemas.dicionario),id:"Enome_funcao",size:"50",value:i.nome_funcao,tipo:"text",div:""},
  265 + {titulo:$trad("funcao",i3GEOadmin.sistemas.dicionario),id:"Enome_funcao",size:"50",value:i.nome_funcao,tipo:"text",div:""},
266 266 {titulo:$trad("programa",i3GEOadmin.sistemas.dicionario),id:"Eabrir_funcao",size:"50",value:i.abrir_funcao,tipo:"text",div:""},
267 267 {titulo:$trad("largura",i3GEOadmin.sistemas.dicionario),id:"Ew_funcao",size:"5",value:i.w_funcao,tipo:"text",div:""},
268 268 {titulo:$trad("altura",i3GEOadmin.sistemas.dicionario),id:"Eh_funcao",size:"5",value:i.h_funcao,tipo:"text",div:""},
... ...
admin/php/sistemas.php
1 1 <?php
2 2 /*
3   -Title: sistemas.php
  3 + Title: sistemas.php
4 4  
5 5 Fun&ccedil;&otilde;es utilizadas pelo editor do cadastro de sistemas
6 6  
... ... @@ -24,7 +24,7 @@ por&amp;eacute;m, SEM NENHUMA GARANTIA; nem mesmo a garantia impl&amp;iacute;cita
24 24 de COMERCIABILIDADE OU ADEQUA&Ccedil;&Atilde;O A UMA FINALIDADE ESPEC&Iacute;FICA.
25 25 Consulte a Licen&ccedil;a P&uacute;blica Geral do GNU para mais detalhes.
26 26 Voc&ecirc; deve ter recebido uma cópia da Licen&ccedil;a P&uacute;blica Geral do
27   -GNU junto com este programa; se n&atilde;o, escreva para a
  27 + GNU junto com este programa; se n&atilde;o, escreva para a
28 28 Free Software Foundation, Inc., no endere&ccedil;o
29 29 59 Temple Street, Suite 330, Boston, MA 02111-1307 USA.
30 30  
... ... @@ -55,12 +55,12 @@ error_reporting(0);
55 55 switch (strtoupper($funcao))
56 56 {
57 57 /*
58   - Note:
  58 + Note:
59 59  
60 60 Valores que o par&acirc;metro &funcao pode receber. Os par&acirc;metros devem ser enviados na requisi&ccedil;&atilde;o em AJAX.
61 61 */
62 62 /*
63   - Valor: PEGASISTEMAS
  63 + Valor: PEGASISTEMAS
64 64  
65 65 Lista de sistemas
66 66  
... ... @@ -71,127 +71,127 @@ switch (strtoupper($funcao))
71 71 case "PEGASISTEMAS":
72 72 retornaJSON(pegaDados("SELECT * from ".$esquemaadmin."i3geoadmin_sistemas order by nome_sistema"));
73 73 exit;
74   - break;
75   - /*
76   - Valor: PEGASISTEMA
  74 + break;
  75 + /*
  76 + Valor: PEGASISTEMA
77 77  
78   - Dados de um sistemas
  78 + Dados de um sistemas
79 79  
80   - Parametro:
  80 + Parametro:
81 81  
82   - id_sistema
  82 + id_sistema
83 83  
84   - Retorno:
  84 + Retorno:
85 85  
86   - {JSON}
87   - */
  86 + {JSON}
  87 + */
88 88 case "PEGASISTEMA":
89 89 retornaJSON(pegaDados("SELECT * from ".$esquemaadmin."i3geoadmin_sistemas where id_sistema='$id_sistema'"));
90 90 exit;
91   - break;
92   - /*
93   - Valor: PEGAFUNCOES
  91 + break;
  92 + /*
  93 + Valor: PEGAFUNCOES
94 94  
95   - Lista de fun&ccedil;&otilde;es de um sistema
  95 + Lista de fun&ccedil;&otilde;es de um sistema
96 96  
97   - Parametro:
  97 + Parametro:
98 98  
99   - id_sistema
  99 + id_sistema
100 100  
101   - Retorno:
  101 + Retorno:
102 102  
103   - {JSON}
104   - */
  103 + {JSON}
  104 + */
105 105 case "PEGAFUNCOES":
106 106 retornaJSON(pegaDados("SELECT * from ".$esquemaadmin."i3geoadmin_sistemasf where id_sistema ='$id_sistema'"));
107 107 exit;
108   - break;
109   - /*
110   - Valor: PEGAFUNCAO
  108 + break;
  109 + /*
  110 + Valor: PEGAFUNCAO
111 111  
112   - Pega os dados de uma fun&ccedil;&atilde;o espec&iacute;fica
  112 + Pega os dados de uma fun&ccedil;&atilde;o espec&iacute;fica
113 113  
114   - Parametro:
  114 + Parametro:
115 115  
116   - id_funcao
  116 + id_funcao
117 117  
118   - Retorno:
  118 + Retorno:
119 119  
120   - {JSON}
121   - */
  120 + {JSON}
  121 + */
122 122 case "PEGAFUNCAO":
123 123 retornaJSON(pegaDados("SELECT * from ".$esquemaadmin."i3geoadmin_sistemasf where id_funcao ='$id_funcao'"));
124 124 exit;
125   - break;
126   - /*
127   - Valor: ALTERARSISTEMAS
  125 + break;
  126 + /*
  127 + Valor: ALTERARSISTEMAS
128 128  
129   - Altera os dados de um sistema
  129 + Altera os dados de um sistema
130 130  
131   - Parametros:
  131 + Parametros:
132 132  
133   - id_sistema
  133 + id_sistema
134 134  
135   - perfil_sistema
  135 + perfil_sistema
136 136  
137   - nome_sistema
  137 + nome_sistema
138 138  
139   - publicado_sistema
  139 + publicado_sistema
140 140  
141   - Retorno:
  141 + Retorno:
142 142  
143   - {JSON}
144   - */
  143 + {JSON}
  144 + */
145 145 case "ALTERARSISTEMAS":
146 146 $novo = alterarSistemas();
147 147 $sql = "SELECT * from ".$esquemaadmin."i3geoadmin_sistemas WHERE id_sistema = '".$novo."'";
148 148 retornaJSON(pegaDados($sql));
149 149 exit;
150   - break;
151   - /*
152   - Valor: ALTERARFUNCOES
  150 + break;
  151 + /*
  152 + Valor: ALTERARFUNCOES
153 153  
154   - Altera os dados de uma fun&ccedil;&atilde;o
  154 + Altera os dados de uma fun&ccedil;&atilde;o
155 155  
156   - Parametros:
  156 + Parametros:
157 157  
158   - id_sistema
  158 + id_sistema
159 159  
160   - id_funcao
  160 + id_funcao
161 161  
162   - perfil_funcao
  162 + perfil_funcao
163 163  
164   - nome_funcao
  164 + nome_funcao
165 165  
166   - w_funcao
  166 + w_funcao
167 167  
168   - h_funcao
  168 + h_funcao
169 169  
170   - abrir_funcao
  170 + abrir_funcao
171 171  
172   - Retorno:
  172 + Retorno:
173 173  
174   - {JSON}
175   - */
  174 + {JSON}
  175 + */
176 176 case "ALTERARFUNCOES":
177 177 $novo = alterarFuncoes();
178 178 $sql = "SELECT * from ".$esquemaadmin."i3geoadmin_sistemasf WHERE id_funcao = '".$novo."'";
179 179 retornaJSON(pegaDados($sql));
180 180 exit;
181   - break;
182   - /*
183   - Valor: EXCLUIRSISTEMA
  181 + break;
  182 + /*
  183 + Valor: EXCLUIRSISTEMA
184 184  
185   - Exclui um sistema
  185 + Exclui um sistema
186 186  
187   - Parametros:
  187 + Parametros:
188 188  
189   - id
  189 + id
190 190  
191   - Retorno:
  191 + Retorno:
192 192  
193   - {JSON}
194   - */
  193 + {JSON}
  194 + */
195 195 case "EXCLUIRSISTEMA":
196 196 $tabela = "i3geoadmin_sistemas";
197 197 $f = verificaFilhos();
... ... @@ -205,65 +205,62 @@ switch (strtoupper($funcao))
205 205 retornaJSON("erro");
206 206 exit;
207 207 }
208   - break;
209   - /*
210   - Valor: EXCLUIRFUNCAO
  208 + break;
  209 + /*
  210 + Valor: EXCLUIRFUNCAO
211 211  
212   - Exclui uma fun&ccedil;&atilde;o
  212 + Exclui uma fun&ccedil;&atilde;o
213 213  
214   - Parametros:
  214 + Parametros:
215 215  
216   - id
  216 + id
217 217  
218   - Retorno:
  218 + Retorno:
219 219  
220   - {JSON}
221   - */
  220 + {JSON}
  221 + */
222 222 case "EXCLUIRFUNCAO":
223 223 retornaJSON(excluirFuncoes());
224 224 exit;
225   - break;
  225 + break;
226 226  
227 227 }
228 228 /*
229   -Altera o registro de um WS
  229 + Altera o registro de um WS
230 230 */
231   -function alterarSistemas()
232   -{
  231 +function alterarSistemas(){
233 232 global $esquemaadmin,$id_sistema,$perfil_sistema,$nome_sistema,$publicado_sistema;
234   - try
235   - {
236   - require_once("conexao.php");
237   - if($convUTF)
238   - {
  233 + try {
  234 + require_once("conexao.php");
  235 + if($convUTF){
239 236 $nome_sistema = utf8_encode($nome_sistema);
240 237 }
241   - if($id_sistema != "")
242   - {
243   - $dbhw->query("UPDATE ".$esquemaadmin."i3geoadmin_sistemas SET publicado_sistema='$publicado_sistema',nome_sistema = '$nome_sistema',perfil_sistema = '$perfil_sistema' WHERE id_sistema = $id_sistema");
244   - $retorna = $id_sistema;
245   - }
246   - else
247   - {
248   - $idtemp = (rand (9000,10000)) * -1;
249   - $dbhw->query("INSERT INTO ".$esquemaadmin."i3geoadmin_sistemas (publicado_sistema,nome_sistema,perfil_sistema) VALUES ('','$idtemp','')");
250   - $id = $dbh->query("SELECT id_sistema FROM ".$esquemaadmin."i3geoadmin_sistemas WHERE nome_sistema = '$idtemp'");
251   - $id = $id->fetchAll();
252   - $id = $id[0]['id_sistema'];
253   - $dbhw->query("UPDATE ".$esquemaadmin."i3geoadmin_sistemas SET nome_sistema = '' WHERE id_sistema = $id AND nome_sistema = '$idtemp'");
254   - $retorna = $id;
255   - }
256   - $dbhw = null;
257   - $dbh = null;
258   - return $retorna;
  238 + if($id_sistema != ""){
  239 + $dataCol = array(
  240 + "publicado_sistema" => $publicado_sistema,
  241 + "nome_sistema" => $nome_sistema,
  242 + "perfil_sistema" => $perfil_sistema
  243 + );
  244 + i3GeoAdminUpdate($dbhw,"i3geoadmin_sistemas",$dataCol,"WHERE id_sistema = $id_sistema");
  245 + $retorna = $id_sistema;
  246 + }
  247 + else{
  248 + $dataCol = array(
  249 + "publicado_sistema" => '',
  250 + "nome_sistema" => '',
  251 + "perfil_sistema" => ''
  252 + );
  253 + $retorna = i3GeoAdminInsertUnico($dbhw,"i3geoadmin_sistemas",$dataCol,"nome_sistema","id_sistema");
  254 + }
  255 + $dbhw = null;
  256 + $dbh = null;
  257 + return $retorna;
259 258 }
260   - catch (PDOException $e)
261   - {
262   - return "Error!: " . $e->getMessage();
  259 + catch (PDOException $e){
  260 + return "Error!: " . $e->getMessage();
263 261 }
264 262 }
265   -function alterarFuncoes()
266   -{
  263 +function alterarFuncoes(){
267 264 global $esquemaadmin,$id_sistema,$id_funcao,$perfil_funcao,$nome_funcao,$w_funcao,$h_funcao,$abrir_funcao;
268 265 if(empty($w_funcao)){
269 266 $w_funcao = 200;
... ... @@ -272,62 +269,71 @@ function alterarFuncoes()
272 269 $h_funcao = 200;
273 270 }
274 271 try{
275   - require_once("conexao.php");
  272 + require_once("conexao.php");
276 273 if($convUTF){
277 274 $nome_funcao = utf8_encode($nome_funcao);
278 275 }
279   - if($id_funcao != ""){
280   - $dbhw->query("UPDATE ".$esquemaadmin."i3geoadmin_sistemasf SET nome_funcao = '$nome_funcao',perfil_funcao = '$perfil_funcao', w_funcao = '$w_funcao',h_funcao = '$h_funcao', abrir_funcao = '$abrir_funcao' WHERE id_funcao = $id_funcao");
281   - $retorna = $id_funcao;
282   - }
283   - else{
284   - $idtemp = (rand (9000,10000)) * -1;
285   - $dbhw->query("INSERT INTO ".$esquemaadmin."i3geoadmin_sistemasf (id_sistema,nome_funcao) VALUES ('$id_sistema','$idtemp')");
286   - $id = $dbh->query("SELECT id_funcao FROM ".$esquemaadmin."i3geoadmin_sistemasf WHERE nome_funcao = '$idtemp'");
287   - $id = $id->fetchAll();
288   - $id = $id[0]['id_funcao'];
289   - $dbhw->query("UPDATE ".$esquemaadmin."i3geoadmin_sistemasf SET nome_funcao = '' WHERE id_funcao = $id AND nome_funcao = '$idtemp'");
290   - $retorna = $id;
291   - }
292   - $dbhw = null;
293   - $dbh = null;
294   - return $retorna;
  276 + if($id_funcao != ""){
  277 + $dataCol = array(
  278 + "nome_funcao" => $nome_funcao,
  279 + "perfil_funcao" => $perfil_funcao,
  280 + "w_funcao" => $w_funcao,
  281 + "h_funcao" => $h_funcao,
  282 + "abrir_funcao" => $abrir_funcao
  283 + );
  284 + i3GeoAdminUpdate($dbhw,"i3geoadmin_sistemasf",$dataCol,"WHERE id_funcao = $id_funcao");
  285 + $retorna = $id_sistema;
  286 + }
  287 + else{
  288 + $dataCol = array(
  289 + "nome_funcao" => '',
  290 + "perfil_funcao" => '',
  291 + "w_funcao" => '',
  292 + "h_funcao" => '',
  293 + "abrir_funcao" => '',
  294 + "id_sistema" => $id_sistema
  295 + );
  296 + $retorna = i3GeoAdminInsertUnico($dbhw,"i3geoadmin_sistemasf",$dataCol,"nome_funcao","id_funcao");
  297 + }
  298 + $dbhw = null;
  299 + $dbh = null;
  300 + return $retorna;
295 301 }
296 302 catch (PDOException $e)
297 303 {
298   - return "Error!: " . $e->getMessage();
  304 + return "Error!: " . $e->getMessage();
299 305 }
300 306 }
301 307 function excluirFuncoes()
302 308 {
303 309 global $id,$esquemaadmin;
304   - try
305   - {
306   - include("conexao.php");
307   - $dbhw->query("DELETE from ".$esquemaadmin."i3geoadmin_sistemasf WHERE id_funcao = $id");
308   - $dbhw = null;
309   - $dbh = null;
310   - return "ok";
  310 + try {
  311 + include("conexao.php");
  312 + $sql = "DELETE from ".$esquemaadmin."i3geoadmin_sistemasf WHERE id_funcao = $id";
  313 + $dbhw->query($sql);
  314 + i3GeoAdminInsertLog($dbhw,$sql);
  315 + $dbhw = null;
  316 + $dbh = null;
  317 + return "ok";
311 318 }
312   - catch (PDOException $e)
313   - {
314   - return "Error!: " . $e->getMessage();
  319 + catch (PDOException $e){
  320 + return "Error!: " . $e->getMessage();
315 321 }
316 322 }
317 323 function excluirSistemas()
318 324 {
319 325 global $id,$esquemaadmin;
320   - try
321   - {
322   - include("conexao.php");
323   - $dbhw->query("DELETE from ".$esquemaadmin."i3geoadmin_sistemas WHERE id_sistema = $id");
324   - $dbhw = null;
325   - $dbh = null;
326   - return $id;
  326 + try {
  327 + include("conexao.php");
  328 + $sql = "DELETE from ".$esquemaadmin."i3geoadmin_sistemas WHERE id_sistema = $id";
  329 + $dbhw->query($sql);
  330 + i3GeoAdminInsertLog($dbhw,$sql);
  331 + $dbhw = null;
  332 + $dbh = null;
  333 + return $id;
327 334 }
328   - catch (PDOException $e)
329   - {
330   - return "Error!: " . $e->getMessage();
  335 + catch (PDOException $e){
  336 + return "Error!: " . $e->getMessage();
331 337 }
332 338 }
333 339  
... ...
interface/black_ol.htm
... ... @@ -148,6 +148,7 @@
148 148 i3GEO.arvoreDeTemas.OPCOESADICIONAIS.comentarios = true;
149 149 i3GEO.arvoreDeCamadas.VERIFICAABRANGENCIATEMAS = true;
150 150 i3GEO.arvoreDeCamadas.MOSTRALISTAKML = false;
  151 +
151 152 i3GEO.mapa.AUTORESIZE = true;
152 153 i3GEO.guias.TIPO = "movel";
153 154 i3GEO.guias.guiaMovel.config.topGuiaMovel = 36;
... ...