Commit b5ae8482ee601cad421997f6c4c1d4ace02c3629

Authored by Edmar Moretti
1 parent e00621bd

$1

admin/admin.db
No preview for this file type
admin/html/subirshapefile.html
... ... @@ -5,18 +5,18 @@
5 5 <title>Shape file</title>
6 6 <style type="text/css">
7 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. */
  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 12 body {
13 13 margin: 0;
14 14 padding: 0;
15 15 }
16 16 </style>
17 17 <script type="text/javascript" src="../../classesjs/i3geo.js"></script>
18   -<script type="text/javascript"
19   - src="../../ferramentas/upload/index.js"></script>
  18 +<script type="text/javascript" src="../../ferramentas/upload/index.js"></script>
  19 +<script type="text/javascript" src="../../ferramentas/upload/dicionario.js"></script>
20 20 <script type="text/javascript" src="../js/core.js"></script>
21 21 <link rel="stylesheet" type="text/css" href="admin.css">
22 22 </head>
... ...
admin/js/arvore.js
... ... @@ -156,8 +156,8 @@ function montaArvore(dados)
156 156 }
157 157 buildTree();
158 158 }();
159   - montaNosMenus(dados);
160   - tree.draw();
  159 + montaNosMenus(dados);
  160 + tree.draw();
161 161 }
162 162 function temaIconMode()
163 163 {
... ... @@ -445,8 +445,8 @@ function novoTemaRaiz(id)
445 445 tree.draw();
446 446 core_carregando("desativa");
447 447 },
448   - failure:core_handleFailure,
449   - argument: { foo:"foo", bar:"bar" }
  448 + failure:core_handleFailure,
  449 + argument: { foo:"foo", bar:"bar" }
450 450 };
451 451 core_makeRequest(sUrl,callback);
452 452 }
... ... @@ -477,8 +477,8 @@ function novoTemaRaizGrupo(idmenu,id)
477 477 tree.draw();
478 478 core_carregando("desativa");
479 479 },
480   - failure:core_handleFailure,
481   - argument: { foo:"foo", bar:"bar" }
  480 + failure:core_handleFailure,
  481 + argument: { foo:"foo", bar:"bar" }
482 482 };
483 483 core_makeRequest(sUrl,callback);
484 484 }
... ... @@ -511,8 +511,8 @@ function novoGrupo(id_menu)
511 511 core_carregando("desativa");
512 512 editar('grupo',dados.id_n1);
513 513 },
514   - failure:core_handleFailure,
515   - argument: { foo:"foo", bar:"bar" }
  514 + failure:core_handleFailure,
  515 + argument: { foo:"foo", bar:"bar" }
516 516 };
517 517 core_makeRequest(sUrl,callback);
518 518 }
... ... @@ -545,8 +545,8 @@ function novoSubGrupo(id_menu,id_n1)
545 545 core_carregando("desativa");
546 546 editar("subgrupo",dados.id_n2);
547 547 },
548   - failure:core_handleFailure,
549   - argument: { foo:"foo", bar:"bar" }
  548 + failure:core_handleFailure,
  549 + argument: { foo:"foo", bar:"bar" }
550 550 };
551 551 core_makeRequest(sUrl,callback);
552 552 }
... ... @@ -578,8 +578,8 @@ function novoTema(id_menu,id_n2)
578 578 core_carregando("desativa");
579 579 editar('tema',dados.id_n3);
580 580 },
581   - failure:core_handleFailure,
582   - argument: { foo:"foo", bar:"bar" }
  581 + failure:core_handleFailure,
  582 + argument: { foo:"foo", bar:"bar" }
583 583 };
584 584 core_makeRequest(sUrl,callback);
585 585 }
... ... @@ -786,89 +786,88 @@ function gravaDados(tipo,id)
786 786 var sUrl = prog+par;
787 787 var callback =
788 788 {
789   - success:function(o)
790   - {
791   - try
792   - {
793   - if(YAHOO.lang.JSON.parse(o.responseText) == "erro")
794   - {
795   - core_carregando("<span style=color:red >Nao foi possivel excluir. Verifique se nao existem menus vinculados a este tema</span>");
796   - setTimeout("core_carregando('desativa')",3000);
797   - }
798   - else
799   - {
800   - if(tipo == "grupo")
801   - {
802   - var obj = document.getElementById("Eid_grupo");
803   - var texto = obj.options[obj.selectedIndex].text;
804   - var objpub = document.getElementById("Epublicado");
805   - var publicado = objpub.options[objpub.selectedIndex].value;
806   - var no = tree.getNodeByProperty("id_n1",id);
807   - no.getContentEl().getElementsByTagName("span")[0].innerHTML = texto;
808   -
809   - if(publicado == "NAO")
810   - no.getContentEl().getElementsByTagName("span")[0].style.color = "red";
811   - else
812   - no.getContentEl().getElementsByTagName("span")[0].style.color = "black";
813   -
814   - no.html = no.getContentEl().innerHTML;
815   - }
816   - if(tipo == "subgrupo")
817   - {
818   - var obj = document.getElementById("Eid_subgrupo");
819   - var texto = obj.options[obj.selectedIndex].text;
820   -
821   - var objpub = document.getElementById("Epublicado");
822   - var publicado = objpub.options[objpub.selectedIndex].value;
823   -
824   - var no = tree.getNodeByProperty("id_n2",id);
825   - no.getContentEl().getElementsByTagName("span")[0].innerHTML = texto;
826   -
827   - if(publicado == "NAO")
828   - no.getContentEl().getElementsByTagName("span")[0].style.color = "red";
829   - else
830   - no.getContentEl().getElementsByTagName("span")[0].style.color = "black";
831   -
832   - no.html = no.getContentEl().innerHTML;
833   - }
834   - if(tipo == "tema")
835   - {
836   - var obj = document.getElementById("Eid_tema");
837   - var texto = obj.options[obj.selectedIndex].text;
838   -
839   - var objpub = document.getElementById("Epublicado");
840   - var publicado = objpub.options[objpub.selectedIndex].value;
841   -
842   - var no = tree.getNodeByProperty("id_n3",id);
843   -
844   - no.getContentEl().getElementsByTagName("span")[0].innerHTML = texto;
845   -
846   - if(publicado == "NAO")
847   - no.getContentEl().getElementsByTagName("span")[0].style.color = "red";
848   - else
849   - no.getContentEl().getElementsByTagName("span")[0].style.color = "black";
850   -
851   - no.html = no.getContentEl().innerHTML;
852   - }
  789 + success:function(o)
  790 + {
  791 + try
  792 + {
  793 + if(YAHOO.lang.JSON.parse(o.responseText) == "erro")
  794 + {
  795 + core_carregando("<span style=color:red >Nao foi possivel excluir. Verifique se nao existem menus vinculados a este tema</span>");
  796 + setTimeout("core_carregando('desativa')",3000);
  797 + }
  798 + else
  799 + {
  800 + if(tipo == "grupo"){
  801 + var texto = document.getElementById("Eid_grupo");
  802 + texto = texto.options[texto.selectedIndex].text;
  803 + var objpub = document.getElementById("Epublicado");
  804 + var publicado = objpub.options[objpub.selectedIndex].value;
  805 + var no = tree.getNodeByProperty("id_n1",id);
  806 + no.getContentEl().getElementsByTagName("span")[0].innerHTML = texto;
  807 +
  808 + if(publicado == "NAO")
  809 + no.getContentEl().getElementsByTagName("span")[0].style.color = "red";
  810 + else
  811 + no.getContentEl().getElementsByTagName("span")[0].style.color = "black";
  812 +
  813 + no.html = no.getContentEl().innerHTML;
  814 + }
  815 + if(tipo == "subgrupo")
  816 + {
  817 + var texto = document.getElementById("Eid_subgrupo");
  818 + texto = texto.options[texto.selectedIndex].text;
  819 +
  820 + var objpub = document.getElementById("Epublicado");
  821 + var publicado = objpub.options[objpub.selectedIndex].value;
  822 +
  823 + var no = tree.getNodeByProperty("id_n2",id);
  824 + no.getContentEl().getElementsByTagName("span")[0].innerHTML = texto;
  825 +
  826 + if(publicado == "NAO")
  827 + no.getContentEl().getElementsByTagName("span")[0].style.color = "red";
  828 + else
  829 + no.getContentEl().getElementsByTagName("span")[0].style.color = "black";
  830 +
  831 + no.html = no.getContentEl().innerHTML;
  832 + }
  833 + if(tipo == "tema")
  834 + {
  835 + var texto = document.getElementById("Eid_tema");
  836 + texto = texto.options[texto.selectedIndex].text;
  837 +
  838 + var objpub = document.getElementById("Epublicado");
  839 + var publicado = objpub.options[objpub.selectedIndex].value;
  840 +
  841 + var no = tree.getNodeByProperty("id_n3",id);
  842 +
  843 + no.getContentEl().getElementsByTagName("span")[0].innerHTML = texto;
  844 +
  845 + if(publicado == "NAO")
  846 + no.getContentEl().getElementsByTagName("span")[0].style.color = "red";
  847 + else
  848 + no.getContentEl().getElementsByTagName("span")[0].style.color = "black";
  849 +
  850 + no.html = no.getContentEl().innerHTML;
  851 + }
853 852 if(tipo == "raizmenu" || tipo == "raizgrupo")
854   - {
855   - var obje = document.getElementById("Eid_tema");
856   - if(obje){
857   - var texto = obje.options[obje.selectedIndex].text;
858   - var no = tree.getNodeByProperty("id_raiz",id);
859   - no.getContentEl().getElementsByTagName("span")[0].innerHTML = texto;
860   - no.html = no.getContentEl().innerHTML;
861   - }
862   - }
863   - core_carregando("desativa");
864   - }
  853 + {
  854 + var obje = document.getElementById("Eid_tema");
  855 + if(obje){
  856 + var texto = obje.options[obje.selectedIndex].text;
  857 + var no = tree.getNodeByProperty("id_raiz",id);
  858 + no.getContentEl().getElementsByTagName("span")[0].innerHTML = texto;
  859 + no.html = no.getContentEl().innerHTML;
  860 + }
  861 + }
  862 + core_carregando("desativa");
  863 + }
865 864 YAHOO.admin.container.panelEditor.destroy();
866 865 YAHOO.admin.container.panelEditor = null;
867   - }
868   - catch(e){core_handleFailure(e,o.responseText);}
869   - },
870   - failure:core_handleFailure,
871   - argument: { foo:"foo", bar:"bar" }
  866 + }
  867 + catch(e){core_handleFailure(e,o.responseText);}
  868 + },
  869 + failure:core_handleFailure,
  870 + argument: { foo:"foo", bar:"bar" }
872 871 };
873 872 core_makeRequest(sUrl,callback,'POST');
874 873 }
... ... @@ -900,8 +899,8 @@ function sobeDesce(movimento,tipo,id)
900 899 {
901 900 success: function(oResponse)
902 901 {core_carregando("desativa");},
903   - failure:core_handleFailure,
904   - argument: { foo:"foo", bar:"bar" }
  902 + failure:core_handleFailure,
  903 + argument: { foo:"foo", bar:"bar" }
905 904 };
906 905 if(movimenta)
907 906 {
... ...
admin/js/estat_conexao.js
... ... @@ -40,7 +40,11 @@ i3GEOadmin.conexao = {
40 40 YAHOO.namespace("conexao");
41 41 YAHOO.namespace("admin.container");
42 42 core_ativaPainelAjuda("ajuda","botaoAjuda");
43   - core_ativaBotaoAdicionaLinha("../php/metaestat.php?funcao=alterarConexao","adicionaNovaLinha","i3GEOadmin.conexao.obtem");
  43 + var temp = function(o){
  44 + i3GEOadmin.conexao.obtem();
  45 + return;
  46 + };
  47 + core_ativaBotaoAdicionaLinha("../php/metaestat.php?funcao=alterarConexao","adicionaNovaLinha",temp);
44 48 i3GEOadmin.conexao.obtem();
45 49 },
46 50 /*
... ... @@ -65,6 +69,14 @@ i3GEOadmin.conexao = {
65 69 };
66 70 //i3GEOadmin.conexao.dataTable = new YAHOO.widget.DataTable("tabela", i3GEOadmin.conexao.defColunas(), myDataSource);
67 71 i3GEOadmin.conexao.dataTable = new YAHOO.widget.ScrollingDataTable("tabela", i3GEOadmin.conexao.defColunas(), myDataSource,{width:"100%"});
  72 + i3GEOadmin.conexao.dataTable.subscribe('postRenderEvent',function(){
  73 + //abre o editor
  74 + if(i3GEOadmin.conexao.dados[0].bancodedados == ""){
  75 + var rec = i3GEOadmin.conexao.dataTable.getRecordSet().getRecord(0);
  76 + i3GEOadmin.conexao.editor([i3GEOadmin.conexao.dados[0]],i3GEOadmin.conexao.dados[0].codigo_estat_conexao,rec.getId());
  77 + }
  78 + }
  79 + );
68 80 i3GEOadmin.conexao.dataTable.subscribe('cellClickEvent',function(ev){
69 81 var sUrl, callback,$clicouId, $recordid,
70 82 target = YAHOO.util.Event.getTarget(ev),
... ... @@ -84,14 +96,14 @@ i3GEOadmin.conexao = {
84 96 $recordid = registro.getId();
85 97 sUrl = "../php/metaestat.php?funcao=listaConexao&codigo_estat_conexao="+$clicouId;
86 98 callback = {
87   - success:function(o){
88   - try{
89   - i3GEOadmin.conexao.editor(YAHOO.lang.JSON.parse(o.responseText),$clicouId,$recordid);
90   - }
91   - catch(e){core_handleFailure(e,o.responseText);}
92   - },
93   - failure:core_handleFailure,
94   - argument: { foo:"foo", bar:"bar" }
  99 + success:function(o){
  100 + try{
  101 + i3GEOadmin.conexao.editor(YAHOO.lang.JSON.parse(o.responseText),$clicouId,$recordid);
  102 + }
  103 + catch(e){core_handleFailure(e,o.responseText);}
  104 + },
  105 + failure:core_handleFailure,
  106 + argument: { foo:"foo", bar:"bar" }
95 107 };
96 108 core_makeRequest(sUrl,callback);
97 109 }
... ... @@ -193,23 +205,23 @@ i3GEOadmin.conexao = {
193 205 core_carregando(" gravando o registro do id= "+id);
194 206 sUrl = "../php/metaestat.php?funcao=alterarConexao"+par;
195 207 callback = {
196   - success:function(o){
197   - try {
198   - if(YAHOO.lang.JSON.parse(o.responseText) == "erro") {
199   - core_carregando("<span style=color:red >N&atilde;o foi poss&iacute;vel excluir. Verifique se n&atilde;o existem registros vinculados</span>");
200   - setTimeout("core_carregando('desativa')",3000);
201   - }
202   - else{
203   - var rec = i3GEOadmin.conexao.dataTable.getRecordSet().getRecord(recordid);
204   - i3GEOadmin.conexao.dataTable.updateRow(rec,YAHOO.lang.JSON.parse(o.responseText));
205   - i3GEOadmin.conexao.dados = "";
206   - core_carregando("desativa");
207   - }
208   - }
209   - catch(e){core_handleFailure(e,o.responseText);}
210   - },
211   - failure:core_handleFailure,
212   - argument: { foo:"foo", bar:"bar" }
  208 + success:function(o){
  209 + try {
  210 + if(YAHOO.lang.JSON.parse(o.responseText) == "erro") {
  211 + core_carregando("<span style=color:red >N&atilde;o foi poss&iacute;vel excluir. Verifique se n&atilde;o existem registros vinculados</span>");
  212 + setTimeout("core_carregando('desativa')",3000);
  213 + }
  214 + else{
  215 + var rec = i3GEOadmin.conexao.dataTable.getRecordSet().getRecord(recordid);
  216 + i3GEOadmin.conexao.dataTable.updateRow(rec,YAHOO.lang.JSON.parse(o.responseText));
  217 + i3GEOadmin.conexao.dados = "";
  218 + core_carregando("desativa");
  219 + }
  220 + }
  221 + catch(e){core_handleFailure(e,o.responseText);}
  222 + },
  223 + failure:core_handleFailure,
  224 + argument: { foo:"foo", bar:"bar" }
213 225 };
214 226 core_makeRequest(sUrl,callback);
215 227 }
... ...
admin/js/estat_editor.js
... ... @@ -528,7 +528,7 @@ i3GEOadmin.editor = {
528 528 },
529 529 esvaziaFormsUpload: function(){
530 530 var csv = $i("i3GEOadmin_formuploadcsv"),
531   - shp = $i("i3GEOadmin_formupload")
  531 + shp = $i("i3GEOadmin_formupload");
532 532 if(csv){
533 533 csv.innerHTML = "";
534 534 }
... ...
admin/js/estat_fonteinfo.js
... ... @@ -34,7 +34,11 @@ i3GEOadmin.fonteinfo = {
34 34 YAHOO.namespace("fonteinfo");
35 35 YAHOO.namespace("admin.container");
36 36 core_ativaPainelAjuda("ajuda","botaoAjuda");
37   - core_ativaBotaoAdicionaLinha("../php/metaestat.php?funcao=alteraFonteinfo","adicionaNovaLinha","i3GEOadmin.fonteinfo.obtem");
  37 + var temp = function(o){
  38 + i3GEOadmin.fonteinfo.obtem();
  39 + return;
  40 + };
  41 + core_ativaBotaoAdicionaLinha("../php/metaestat.php?funcao=alteraFonteinfo","adicionaNovaLinha",temp);
38 42 i3GEOadmin.fonteinfo.obtem();
39 43 },
40 44 /*
... ... @@ -59,6 +63,14 @@ i3GEOadmin.fonteinfo = {
59 63 };
60 64 //i3GEOadmin.fonteinfo.dataTable = new YAHOO.widget.DataTable("tabela", i3GEOadmin.fonteinfo.defColunas(), myDataSource);
61 65 i3GEOadmin.fonteinfo.dataTable = new YAHOO.widget.ScrollingDataTable("tabela", i3GEOadmin.fonteinfo.defColunas(), myDataSource,{width:"100%"});
  66 + i3GEOadmin.fonteinfo.dataTable.subscribe('postRenderEvent',function(){
  67 + //abre o editor
  68 + if(i3GEOadmin.fonteinfo.dados[0].titulo == "" || i3GEOadmin.fonteinfo.dados[0].titulo == null ){
  69 + var rec = i3GEOadmin.fonteinfo.dataTable.getRecordSet().getRecord(0);
  70 + i3GEOadmin.fonteinfo.editor([i3GEOadmin.fonteinfo.dados[0]],i3GEOadmin.fonteinfo.dados[0].id_fonteinfo,rec.getId());
  71 + }
  72 + }
  73 + );
62 74 i3GEOadmin.fonteinfo.dataTable.subscribe('cellClickEvent',function(ev){
63 75 var sUrl, callback,$clicouId, $recordid,
64 76 target = YAHOO.util.Event.getTarget(ev),
... ... @@ -78,14 +90,14 @@ i3GEOadmin.fonteinfo = {
78 90 $recordid = registro.getId();
79 91 sUrl = "../php/metaestat.php?funcao=listaFonteinfo&id_fonteinfo="+$clicouId;
80 92 callback = {
81   - success:function(o){
82   - try{
83   - i3GEOadmin.fonteinfo.editor(YAHOO.lang.JSON.parse(o.responseText),$clicouId,$recordid);
84   - }
85   - catch(e){core_handleFailure(e,o.responseText);}
86   - },
87   - failure:core_handleFailure,
88   - argument: { foo:"foo", bar:"bar" }
  93 + success:function(o){
  94 + try{
  95 + i3GEOadmin.fonteinfo.editor(YAHOO.lang.JSON.parse(o.responseText),$clicouId,$recordid);
  96 + }
  97 + catch(e){core_handleFailure(e,o.responseText);}
  98 + },
  99 + failure:core_handleFailure,
  100 + argument: { foo:"foo", bar:"bar" }
89 101 };
90 102 core_makeRequest(sUrl,callback);
91 103 }
... ... @@ -186,23 +198,23 @@ i3GEOadmin.fonteinfo = {
186 198 core_carregando(" gravando o registro do id= "+id);
187 199 sUrl = "../php/metaestat.php?funcao=alteraFonteinfo"+par;
188 200 callback = {
189   - success:function(o){
190   - try {
191   - if(YAHOO.lang.JSON.parse(o.responseText) == "erro") {
192   - core_carregando("<span style=color:red >N&atilde;o foi poss&iacute;vel excluir. Verifique se n&atilde;o existem registros vinculados</span>");
193   - setTimeout("core_carregando('desativa')",3000);
194   - }
195   - else{
196   - var rec = i3GEOadmin.fonteinfo.dataTable.getRecordSet().getRecord(recordid);
197   - i3GEOadmin.fonteinfo.dataTable.updateRow(rec,YAHOO.lang.JSON.parse(o.responseText));
198   - i3GEOadmin.fonteinfo.dados = "";
199   - core_carregando("desativa");
200   - }
201   - }
202   - catch(e){core_handleFailure(e,o.responseText);}
203   - },
204   - failure:core_handleFailure,
205   - argument: { foo:"foo", bar:"bar" }
  201 + success:function(o){
  202 + try {
  203 + if(YAHOO.lang.JSON.parse(o.responseText) == "erro") {
  204 + core_carregando("<span style=color:red >N&atilde;o foi poss&iacute;vel excluir. Verifique se n&atilde;o existem registros vinculados</span>");
  205 + setTimeout("core_carregando('desativa')",3000);
  206 + }
  207 + else{
  208 + var rec = i3GEOadmin.fonteinfo.dataTable.getRecordSet().getRecord(recordid);
  209 + i3GEOadmin.fonteinfo.dataTable.updateRow(rec,YAHOO.lang.JSON.parse(o.responseText));
  210 + i3GEOadmin.fonteinfo.dados = "";
  211 + core_carregando("desativa");
  212 + }
  213 + }
  214 + catch(e){core_handleFailure(e,o.responseText);}
  215 + },
  216 + failure:core_handleFailure,
  217 + argument: { foo:"foo", bar:"bar" }
206 218 };
207 219 core_makeRequest(sUrl,callback);
208 220 }
... ...
admin/js/estat_mapa.js
... ... @@ -293,8 +293,8 @@ function montaDivTema(i){
293 293 ins = "",
294 294 callback = {
295 295 success:function(o){
296   - var o = YAHOO.lang.JSON.parse(o.responseText),
297   - n = o.length,
  296 + o = YAHOO.lang.JSON.parse(o.responseText);
  297 + var n = o.length,
298 298 m,i,j,filhos,a,b;
299 299 //monta os divs onde entrarao as arvores
300 300 for(i=0;i<n;i++){
... ...
admin/js/estat_tipo_periodo.js
... ... @@ -34,7 +34,11 @@ i3GEOadmin.periodo = {
34 34 YAHOO.namespace("periodo");
35 35 YAHOO.namespace("admin.container");
36 36 core_ativaPainelAjuda("ajuda","botaoAjuda");
37   - core_ativaBotaoAdicionaLinha("../php/metaestat.php?funcao=alterarTipoPeriodo","adicionaNovaLinha","i3GEOadmin.periodo.obtem");
  37 + var temp = function(o){
  38 + i3GEOadmin.periodo.obtem();
  39 + return;
  40 + };
  41 + core_ativaBotaoAdicionaLinha("../php/metaestat.php?funcao=alterarTipoPeriodo","adicionaNovaLinha",temp);
38 42 i3GEOadmin.periodo.obtem();
39 43 },
40 44 /*
... ... @@ -59,6 +63,14 @@ i3GEOadmin.periodo = {
59 63 };
60 64 //i3GEOadmin.periodo.dataTable = new YAHOO.widget.DataTable("tabela", i3GEOadmin.periodo.defColunas(), myDataSource);
61 65 i3GEOadmin.periodo.dataTable = new YAHOO.widget.ScrollingDataTable("tabela", i3GEOadmin.periodo.defColunas(), myDataSource,{width:"100%"});
  66 + i3GEOadmin.periodo.dataTable.subscribe('postRenderEvent',function(){
  67 + //abre o editor
  68 + if(i3GEOadmin.periodo.dados[0].nome == ""){
  69 + var rec = i3GEOadmin.periodo.dataTable.getRecordSet().getRecord(0);
  70 + i3GEOadmin.periodo.editor([i3GEOadmin.periodo.dados[0]],i3GEOadmin.periodo.dados[0].codigo_tipo_periodo,rec.getId());
  71 + }
  72 + }
  73 + );
62 74 i3GEOadmin.periodo.dataTable.subscribe('cellClickEvent',function(ev){
63 75 var sUrl, callback,$clicouId, $recordid,
64 76 target = YAHOO.util.Event.getTarget(ev),
... ... @@ -78,14 +90,14 @@ i3GEOadmin.periodo = {
78 90 $recordid = registro.getId();
79 91 sUrl = "../php/metaestat.php?funcao=listaTipoPeriodo&codigo_tipo_periodo="+$clicouId;
80 92 callback = {
81   - success:function(o){
82   - try{
83   - i3GEOadmin.periodo.editor(YAHOO.lang.JSON.parse(o.responseText),$clicouId,$recordid);
84   - }
85   - catch(e){core_handleFailure(e,o.responseText);}
86   - },
87   - failure:core_handleFailure,
88   - argument: { foo:"foo", bar:"bar" }
  93 + success:function(o){
  94 + try{
  95 + i3GEOadmin.periodo.editor(YAHOO.lang.JSON.parse(o.responseText),$clicouId,$recordid);
  96 + }
  97 + catch(e){core_handleFailure(e,o.responseText);}
  98 + },
  99 + failure:core_handleFailure,
  100 + argument: { foo:"foo", bar:"bar" }
89 101 };
90 102 core_makeRequest(sUrl,callback);
91 103 }
... ... @@ -186,23 +198,23 @@ i3GEOadmin.periodo = {
186 198 core_carregando(" gravando o registro do id= "+id);
187 199 sUrl = "../php/metaestat.php?funcao=alterarTipoPeriodo"+par;
188 200 callback = {
189   - success:function(o){
190   - try {
191   - if(YAHOO.lang.JSON.parse(o.responseText) == "erro") {
192   - core_carregando("<span style=color:red >N&atilde;o foi poss&iacute;vel excluir. Verifique se n&atilde;o existem registros vinculados</span>");
193   - setTimeout("core_carregando('desativa')",3000);
194   - }
195   - else{
196   - var rec = i3GEOadmin.periodo.dataTable.getRecordSet().getRecord(recordid);
197   - i3GEOadmin.periodo.dataTable.updateRow(rec,YAHOO.lang.JSON.parse(o.responseText));
198   - i3GEOadmin.periodo.dados = "";
199   - core_carregando("desativa");
200   - }
201   - }
202   - catch(e){core_handleFailure(e,o.responseText);}
203   - },
204   - failure:core_handleFailure,
205   - argument: { foo:"foo", bar:"bar" }
  201 + success:function(o){
  202 + try {
  203 + if(YAHOO.lang.JSON.parse(o.responseText) == "erro") {
  204 + core_carregando("<span style=color:red >N&atilde;o foi poss&iacute;vel excluir. Verifique se n&atilde;o existem registros vinculados</span>");
  205 + setTimeout("core_carregando('desativa')",3000);
  206 + }
  207 + else{
  208 + var rec = i3GEOadmin.periodo.dataTable.getRecordSet().getRecord(recordid);
  209 + i3GEOadmin.periodo.dataTable.updateRow(rec,YAHOO.lang.JSON.parse(o.responseText));
  210 + i3GEOadmin.periodo.dados = "";
  211 + core_carregando("desativa");
  212 + }
  213 + }
  214 + catch(e){core_handleFailure(e,o.responseText);}
  215 + },
  216 + failure:core_handleFailure,
  217 + argument: { foo:"foo", bar:"bar" }
206 218 };
207 219 core_makeRequest(sUrl,callback);
208 220 }
... ...
admin/js/estat_tipo_regiao.js
... ... @@ -12,7 +12,11 @@ core_makeRequest(&quot;../php/metaestat.php?funcao=listaDadosTabelasAuxiliares&quot;,callb
12 12  
13 13 function initEditor(){
14 14 YAHOO.namespace("admin.container");
15   - core_ativaBotaoAdicionaLinha("../php/metaestat.php?funcao=alterarTipoRegiao","adicionaNovaLinha","pegaDados");
  15 + var temp = function(o){
  16 + pegaDados();
  17 + return;
  18 + };
  19 + core_ativaBotaoAdicionaLinha("../php/metaestat.php?funcao=alterarTipoRegiao","adicionaNovaLinha",temp);
16 20 pegaDados();
17 21 }
18 22 function pegaDados(){
... ... @@ -58,32 +62,45 @@ function montaTabela(dados){
58 62 elCell.innerHTML = "<div class=download style='text-align:center' title='shape file' ></div>";
59 63 },
60 64 myColumnDefs = [
61   - {key:"excluir",label:"excluir",formatter:formatExclui},
62   - {key:"shapefile",label:"download",formatter:formatShp},
63   - {key:"rel",label:"agrega&ccedil;&otilde;es",formatter:formatRel},
64   - {key:"mais",label:"propriedades",formatter:formatMais},
65   - {label:"c&oacute;digo",key:"codigo_tipo_regiao", formatter:formatTexto},
66   - {label:"Nome",resizeable:true,key:"nome_tipo_regiao", formatter:formatTexto},
67   - {label:"Descri&ccedil;&atilde;o",resizeable:true,key:"descricao_tipo_regiao", formatter:formatTexto},
68   - {label:"Conex&atilde;o",key:"codigo_estat_conexao",formatter:formatTexto},
69   - {label:"Esquema",key:"esquemadb",formatter:formatTexto},
70   - {label:"Tabela",key:"tabela",formatter:formatTexto},
71   - {label:"Geometria",key:"colunageo",formatter:formatTexto},
72   - {label:"Centr&oacute;ide",key:"colunacentroide",formatter:formatTexto},
73   - {label:"Data",key:"data",formatter:formatTexto},
74   - {label:"Regi&atilde;o",key:"identificador",formatter:formatTexto},
75   - {label:"Nomes",resizeable:false,key:"colunanomeregiao",formatter:formatTexto},
76   - {label:"Colunas vis&iacute;veis (separa com v&iacute;rgula)",resizeable:false,key:"colunasvisiveis",formatter:formatTexto},
77   - {label:"Apelidos",resizeable:false,key:"apelidos",formatter:formatTexto},
78   - {label:"SRID",key:"srid",formatter:formatTexto}
79   - ];
80   - myDataSource = new YAHOO.util.DataSource(dados);
  65 + {key:"excluir",label:"excluir",formatter:formatExclui},
  66 + {key:"shapefile",label:"download",formatter:formatShp},
  67 + {key:"rel",label:"agrega&ccedil;&otilde;es",formatter:formatRel},
  68 + {key:"mais",label:"propriedades",formatter:formatMais},
  69 + {label:"c&oacute;digo",key:"codigo_tipo_regiao", formatter:formatTexto},
  70 + {label:"Nome",resizeable:true,key:"nome_tipo_regiao", formatter:formatTexto},
  71 + {label:"Descri&ccedil;&atilde;o",resizeable:true,key:"descricao_tipo_regiao", formatter:formatTexto},
  72 + {label:"Conex&atilde;o",key:"codigo_estat_conexao",formatter:formatTexto},
  73 + {label:"Esquema",key:"esquemadb",formatter:formatTexto},
  74 + {label:"Tabela",key:"tabela",formatter:formatTexto},
  75 + {label:"Geometria",key:"colunageo",formatter:formatTexto},
  76 + {label:"Centr&oacute;ide",key:"colunacentroide",formatter:formatTexto},
  77 + {label:"Data",key:"data",formatter:formatTexto},
  78 + {label:"Regi&atilde;o",key:"identificador",formatter:formatTexto},
  79 + {label:"Nomes",resizeable:false,key:"colunanomeregiao",formatter:formatTexto},
  80 + {label:"Colunas vis&iacute;veis (separa com v&iacute;rgula)",resizeable:false,key:"colunasvisiveis",formatter:formatTexto},
  81 + {label:"Apelidos",resizeable:false,key:"apelidos",formatter:formatTexto},
  82 + {label:"SRID",key:"srid",formatter:formatTexto}
  83 + ];
  84 + var myDataSource = new YAHOO.util.DataSource(dados);
81 85 myDataTable = new YAHOO.widget.ScrollingDataTable("tabela", myColumnDefs, myDataSource,{width:"100%"});
82 86  
83 87 myDataSource.responseType = YAHOO.util.DataSource.TYPE_JSARRAY;
84 88 myDataSource.responseSchema = {
85 89 fields: ["codigo_tipo_regiao","nome_tipo_regiao","descricao_tipo_regiao","esquemadb","tabela","colunageo","colunacentroide","data","identificador","codigo_estat_conexao","colunanomeregiao","colunasvisiveis","apelidos","srid"]
86 90 };
  91 + /**
  92 + * @FIXME nao funciona qd ativado
  93 + */
  94 + /*
  95 + myDataTable.subscribe('postRenderEvent',function(){
  96 + //abre o editor
  97 + var dados = myDataTable.getDataSource();
  98 + if(dados.liveData[0].nome_tipo_regiao == ""){
  99 + var rec = myDataTable.getRecordSet().getRecord(0);
  100 + montaEditor([dados.liveData[0]],dados.liveData[0].codigo_tipo_regiao,rec.getId());
  101 + }
  102 + });
  103 + */
87 104 myDataTable.subscribe(
88 105 'cellClickEvent',
89 106 function(ev){
... ... @@ -167,7 +184,7 @@ function montaTabelaAgregacoes(dados){
167 184 {label:"Pai",resizeable:true,key:"codigo_tipo_regiao_pai", formatter:formatTexto},
168 185 {label:"Coluna de ligacao",key:"colunaligacao_regiaopai",formatter:formatTexto}
169 186 ];
170   - myDataSource = new YAHOO.util.DataSource(dados);
  187 + var myDataSource = new YAHOO.util.DataSource(dados);
171 188 myDataTable = new YAHOO.widget.DataTable("tabelaAgrega", myColumnDefs, myDataSource);
172 189 myDataSource.responseType = YAHOO.util.DataSource.TYPE_JSARRAY;
173 190 myDataSource.responseSchema = {
... ...
admin/js/estat_unidade_medida.js
... ... @@ -36,7 +36,11 @@ i3GEOadmin.umedida = {
36 36 YAHOO.namespace("umedida");
37 37 YAHOO.namespace("admin.container");
38 38 core_ativaPainelAjuda("ajuda","botaoAjuda");
39   - core_ativaBotaoAdicionaLinha("../php/metaestat.php?funcao=alterarUnidadeMedida","adicionaNovaLinha","i3GEOadmin.umedida.obtem");
  39 + var temp = function(o){
  40 + i3GEOadmin.umedida.obtem();
  41 + return;
  42 + };
  43 + core_ativaBotaoAdicionaLinha("../php/metaestat.php?funcao=alterarUnidadeMedida","adicionaNovaLinha",temp);
40 44 i3GEOadmin.umedida.obtem();
41 45 },
42 46 /*
... ... @@ -61,6 +65,14 @@ i3GEOadmin.umedida = {
61 65 };
62 66 //i3GEOadmin.umedida.dataTable = new YAHOO.widget.DataTable("tabela", i3GEOadmin.umedida.defColunas(), myDataSource);
63 67 i3GEOadmin.umedida.dataTable = new YAHOO.widget.ScrollingDataTable("tabela", i3GEOadmin.umedida.defColunas(), myDataSource,{width:"100%"});
  68 + i3GEOadmin.umedida.dataTable.subscribe('postRenderEvent',function(){
  69 + //abre o editor
  70 + if(i3GEOadmin.umedida.dados[0].nome == ""){
  71 + var rec = i3GEOadmin.umedida.dataTable.getRecordSet().getRecord(0);
  72 + i3GEOadmin.umedida.editor([i3GEOadmin.umedida.dados[0]],i3GEOadmin.umedida.dados[0].codigo_unidade_medida,rec.getId());
  73 + }
  74 + }
  75 + );
64 76 i3GEOadmin.umedida.dataTable.subscribe('cellClickEvent',function(ev){
65 77 var sUrl, callback,$clicouId, $recordid,
66 78 target = YAHOO.util.Event.getTarget(ev),
... ... @@ -80,14 +92,14 @@ i3GEOadmin.umedida = {
80 92 $recordid = registro.getId();
81 93 sUrl = "../php/metaestat.php?funcao=listaUnidadeMedida&codigo_unidade_medida="+$clicouId;
82 94 callback = {
83   - success:function(o){
84   - try{
85   - i3GEOadmin.umedida.editor(YAHOO.lang.JSON.parse(o.responseText),$clicouId,$recordid);
86   - }
87   - catch(e){core_handleFailure(e,o.responseText);}
88   - },
89   - failure:core_handleFailure,
90   - argument: { foo:"foo", bar:"bar" }
  95 + success:function(o){
  96 + try{
  97 + i3GEOadmin.umedida.editor(YAHOO.lang.JSON.parse(o.responseText),$clicouId,$recordid);
  98 + }
  99 + catch(e){core_handleFailure(e,o.responseText);}
  100 + },
  101 + failure:core_handleFailure,
  102 + argument: { foo:"foo", bar:"bar" }
91 103 };
92 104 core_makeRequest(sUrl,callback);
93 105 }
... ... @@ -213,23 +225,23 @@ i3GEOadmin.umedida = {
213 225 core_carregando(" gravando o registro do id= "+id);
214 226 sUrl = "../php/metaestat.php?funcao=alterarUnidadeMedida"+par;
215 227 callback = {
216   - success:function(o){
217   - try {
218   - if(YAHOO.lang.JSON.parse(o.responseText) == "erro") {
219   - core_carregando("<span style=color:red >N&atilde;o foi poss&iacute;vel excluir. Verifique se n&atilde;o existem registros vinculados</span>");
220   - setTimeout("core_carregando('desativa')",3000);
221   - }
222   - else{
223   - var rec = i3GEOadmin.umedida.dataTable.getRecordSet().getRecord(recordid);
224   - i3GEOadmin.umedida.dataTable.updateRow(rec,YAHOO.lang.JSON.parse(o.responseText));
225   - i3GEOadmin.umedida.dados = "";
226   - core_carregando("desativa");
227   - }
228   - }
229   - catch(e){core_handleFailure(e,o.responseText);}
230   - },
231   - failure:core_handleFailure,
232   - argument: { foo:"foo", bar:"bar" }
  228 + success:function(o){
  229 + try {
  230 + if(YAHOO.lang.JSON.parse(o.responseText) == "erro") {
  231 + core_carregando("<span style=color:red >N&atilde;o foi poss&iacute;vel excluir. Verifique se n&atilde;o existem registros vinculados</span>");
  232 + setTimeout("core_carregando('desativa')",3000);
  233 + }
  234 + else{
  235 + var rec = i3GEOadmin.umedida.dataTable.getRecordSet().getRecord(recordid);
  236 + i3GEOadmin.umedida.dataTable.updateRow(rec,YAHOO.lang.JSON.parse(o.responseText));
  237 + i3GEOadmin.umedida.dados = "";
  238 + core_carregando("desativa");
  239 + }
  240 + }
  241 + catch(e){core_handleFailure(e,o.responseText);}
  242 + },
  243 + failure:core_handleFailure,
  244 + argument: { foo:"foo", bar:"bar" }
233 245 };
234 246 core_makeRequest(sUrl,callback);
235 247 }
... ...
admin/js/identifica.js
... ... @@ -56,7 +56,7 @@ i3GEOadmin.identifica = {
56 56 {label:"id",key:"id_i", formatter:i3GEOadmin.identifica.formatTexto},
57 57 {label:"nome",resizeable:true,key:"nome_i", formatter:i3GEOadmin.identifica.formatTexto},
58 58 {label:"publicado?",resizeable:true,key:"publicado_i", formatter:i3GEOadmin.identifica.formatTexto},
59   - {label:"programa",resizeable:true,key:"programa_i", formatter:i3GEOadmin.identifica.formatTexto},
  59 + {label:"programa",resizeable:true,key:"abrir_i", formatter:i3GEOadmin.identifica.formatTexto},
60 60 {label:"abrir como?",resizeable:true,key:"target_i", formatter:i3GEOadmin.identifica.formatTexto}
61 61 ];
62 62 },
... ... @@ -67,7 +67,11 @@ i3GEOadmin.identifica = {
67 67 YAHOO.namespace("identifica");
68 68 YAHOO.namespace("admin.container");
69 69 core_ativaPainelAjuda("ajuda","botaoAjuda");
70   - core_ativaBotaoAdicionaLinha("../php/identifica.php?funcao=alterarFuncoes","adicionaNovoIdentifica","i3GEOadmin.identifica.obtem");
  70 + var temp = function(o){
  71 + i3GEOadmin.identifica.obtem();
  72 + return;
  73 + };
  74 + core_ativaBotaoAdicionaLinha("../php/identifica.php?funcao=alterarFuncoes","adicionaNovoIdentifica",temp);
71 75 i3GEOadmin.identifica.obtem();
72 76 },
73 77 /*
... ... @@ -92,6 +96,14 @@ i3GEOadmin.identifica = {
92 96 };
93 97 //i3GEOadmin.identifica.dataTable = new YAHOO.widget.DataTable("tabela", i3GEOadmin.identifica.defColunas(), myDataSource);
94 98 i3GEOadmin.identifica.dataTable = new YAHOO.widget.ScrollingDataTable("tabela", i3GEOadmin.identifica.defColunas(), myDataSource,{width:"100%"});
  99 + i3GEOadmin.identifica.dataTable.subscribe('postRenderEvent',function(){
  100 + //abre o editor
  101 + if(i3GEOadmin.identifica.dados[0].nome_i == ""){
  102 + var rec = i3GEOadmin.identifica.dataTable.getRecordSet().getRecord(0);
  103 + i3GEOadmin.identifica.editor([i3GEOadmin.identifica.dados[0]],i3GEOadmin.identifica.dados[0].id_i,rec.getId());
  104 + }
  105 + }
  106 + );
95 107 i3GEOadmin.identifica.dataTable.subscribe('cellClickEvent',function(ev){
96 108 var sUrl, callback,$clicouId, $recordid,
97 109 target = YAHOO.util.Event.getTarget(ev),
... ... @@ -111,14 +123,14 @@ i3GEOadmin.identifica = {
111 123 $recordid = registro.getId();
112 124 sUrl = "../php/identifica.php?funcao=pegafuncoes&id_i="+$clicouId;
113 125 callback = {
114   - success:function(o){
115   - try{
116   - i3GEOadmin.identifica.editor(YAHOO.lang.JSON.parse(o.responseText),$clicouId,$recordid);
117   - }
118   - catch(e){core_handleFailure(e,o.responseText);}
119   - },
120   - failure:core_handleFailure,
121   - argument: { foo:"foo", bar:"bar" }
  126 + success:function(o){
  127 + try{
  128 + i3GEOadmin.identifica.editor(YAHOO.lang.JSON.parse(o.responseText),$clicouId,$recordid);
  129 + }
  130 + catch(e){core_handleFailure(e,o.responseText);}
  131 + },
  132 + failure:core_handleFailure,
  133 + argument: { foo:"foo", bar:"bar" }
122 134 };
123 135 core_makeRequest(sUrl,callback);
124 136 }
... ... @@ -231,23 +243,23 @@ i3GEOadmin.identifica = {
231 243 core_carregando(" gravando o registro do id= "+id);
232 244 sUrl = "../php/identifica.php?funcao=alterarFuncoes"+par;
233 245 callback = {
234   - success:function(o){
235   - try {
236   - if(YAHOO.lang.JSON.parse(o.responseText) == "erro") {
237   - core_carregando("<span style=color:red >N&atilde;o foi poss&iacute;vel excluir. Verifique se n&atilde;o existem registros vinculados</span>");
238   - setTimeout("core_carregando('desativa')",3000);
239   - }
240   - else{
241   - var rec = i3GEOadmin.identifica.dataTable.getRecordSet().getRecord(recordid);
242   - i3GEOadmin.identifica.dataTable.updateRow(rec,YAHOO.lang.JSON.parse(o.responseText)[0]);
243   - i3GEOadmin.identifica.dados = "";
244   - core_carregando("desativa");
245   - }
246   - }
247   - catch(e){core_handleFailure(e,o.responseText);}
248   - },
249   - failure:core_handleFailure,
250   - argument: { foo:"foo", bar:"bar" }
  246 + success:function(o){
  247 + try {
  248 + if(YAHOO.lang.JSON.parse(o.responseText) == "erro") {
  249 + core_carregando("<span style=color:red >N&atilde;o foi poss&iacute;vel excluir. Verifique se n&atilde;o existem registros vinculados</span>");
  250 + setTimeout("core_carregando('desativa')",3000);
  251 + }
  252 + else{
  253 + var rec = i3GEOadmin.identifica.dataTable.getRecordSet().getRecord(recordid);
  254 + i3GEOadmin.identifica.dataTable.updateRow(rec,YAHOO.lang.JSON.parse(o.responseText)[0]);
  255 + i3GEOadmin.identifica.dados = "";
  256 + core_carregando("desativa");
  257 + }
  258 + }
  259 + catch(e){core_handleFailure(e,o.responseText);}
  260 + },
  261 + failure:core_handleFailure,
  262 + argument: { foo:"foo", bar:"bar" }
251 263 };
252 264 core_makeRequest(sUrl,callback);
253 265 }
... ...
admin/js/mapas.js
... ... @@ -66,7 +66,11 @@ i3GEOadmin.mapas = {
66 66 YAHOO.namespace("mapas");
67 67 YAHOO.namespace("admin.container");
68 68 core_ativaPainelAjuda("ajuda","botaoAjuda");
69   - core_ativaBotaoAdicionaLinha("../php/mapas.php?funcao=alterarMapa","adicionaNovoMapa","i3GEOadmin.mapas.obtem");
  69 + var temp = function(o){
  70 + i3GEOadmin.mapas.obtem();
  71 + return;
  72 + };
  73 + core_ativaBotaoAdicionaLinha("../php/mapas.php?funcao=alterarMapa","adicionaNovoMapa",temp);
70 74 i3GEOadmin.mapas.obtem();
71 75 },
72 76 /*
... ... @@ -91,6 +95,14 @@ i3GEOadmin.mapas = {
91 95 };
92 96 //i3GEOadmin.mapas.dataTable = new YAHOO.widget.DataTable("tabela", i3GEOadmin.mapas.defColunas(), myDataSource);
93 97 i3GEOadmin.mapas.dataTable = new YAHOO.widget.ScrollingDataTable("tabela", i3GEOadmin.mapas.defColunas(), myDataSource,{width:"100%"});
  98 + i3GEOadmin.mapas.dataTable.subscribe('postRenderEvent',function(){
  99 + //abre o editor
  100 + if(i3GEOadmin.mapas.dados[0].nome_mapa == ""){
  101 + var rec = i3GEOadmin.mapas.dataTable.getRecordSet().getRecord(0);
  102 + i3GEOadmin.mapas.editor([i3GEOadmin.mapas.dados[0]],i3GEOadmin.mapas.dados[0].id_mapa,rec.getId());
  103 + }
  104 + }
  105 + );
94 106 i3GEOadmin.mapas.dataTable.subscribe('cellClickEvent',function(ev){
95 107 var sUrl, callback,$clicouId, $recordid,
96 108 target = YAHOO.util.Event.getTarget(ev),
... ... @@ -110,14 +122,14 @@ i3GEOadmin.mapas = {
110 122 $recordid = registro.getId();
111 123 sUrl = "../php/mapas.php?funcao=pegaDadosMapa&id_mapa="+$clicouId;
112 124 callback = {
113   - success:function(o){
114   - try{
115   - i3GEOadmin.mapas.editor(YAHOO.lang.JSON.parse(o.responseText),$clicouId,$recordid);
116   - }
117   - catch(e){core_handleFailure(e,o.responseText);}
118   - },
119   - failure:core_handleFailure,
120   - argument: { foo:"foo", bar:"bar" }
  125 + success:function(o){
  126 + try{
  127 + i3GEOadmin.mapas.editor(YAHOO.lang.JSON.parse(o.responseText),$clicouId,$recordid);
  128 + }
  129 + catch(e){core_handleFailure(e,o.responseText);}
  130 + },
  131 + failure:core_handleFailure,
  132 + argument: { foo:"foo", bar:"bar" }
121 133 };
122 134 core_makeRequest(sUrl,callback);
123 135 }
... ... @@ -255,23 +267,23 @@ i3GEOadmin.mapas = {
255 267 core_carregando(" gravando o registro do id= "+id);
256 268 sUrl = "../php/mapas.php?funcao=alterarMapa"+par;
257 269 callback = {
258   - success:function(o){
259   - try {
260   - if(YAHOO.lang.JSON.parse(o.responseText) == "erro") {
261   - core_carregando("<span style=color:red >N&atilde;o foi poss&iacute;vel excluir. Verifique se n&atilde;o existem registros vinculados</span>");
262   - setTimeout("core_carregando('desativa')",3000);
263   - }
264   - else{
265   - var rec = i3GEOadmin.mapas.dataTable.getRecordSet().getRecord(recordid);
266   - i3GEOadmin.mapas.dataTable.updateRow(rec,YAHOO.lang.JSON.parse(o.responseText)[0]);
267   - i3GEOadmin.mapas.dados = "";
268   - core_carregando("desativa");
269   - }
270   - }
271   - catch(e){core_handleFailure(e,o.responseText);}
272   - },
273   - failure:core_handleFailure,
274   - argument: { foo:"foo", bar:"bar" }
  270 + success:function(o){
  271 + try {
  272 + if(YAHOO.lang.JSON.parse(o.responseText) == "erro") {
  273 + core_carregando("<span style=color:red >N&atilde;o foi poss&iacute;vel excluir. Verifique se n&atilde;o existem registros vinculados</span>");
  274 + setTimeout("core_carregando('desativa')",3000);
  275 + }
  276 + else{
  277 + var rec = i3GEOadmin.mapas.dataTable.getRecordSet().getRecord(recordid);
  278 + i3GEOadmin.mapas.dataTable.updateRow(rec,YAHOO.lang.JSON.parse(o.responseText)[0]);
  279 + i3GEOadmin.mapas.dados = "";
  280 + core_carregando("desativa");
  281 + }
  282 + }
  283 + catch(e){core_handleFailure(e,o.responseText);}
  284 + },
  285 + failure:core_handleFailure,
  286 + argument: { foo:"foo", bar:"bar" }
275 287 };
276 288 core_makeRequest(sUrl,callback);
277 289 }
... ...
admin/js/webservices.js
... ... @@ -65,7 +65,11 @@ i3GEOadmin.webservices = {
65 65 YAHOO.namespace("webservices");
66 66 YAHOO.namespace("admin.container");
67 67 core_ativaPainelAjuda("ajuda","botaoAjuda");
68   - core_ativaBotaoAdicionaLinha("../php/webservices.php?funcao=alterarWS","adicionaNovoWebservice","i3GEOadmin.webservices.obtem");
  68 + var temp = function(o){
  69 + i3GEOadmin.webservices.obtem();
  70 + return;
  71 + };
  72 + core_ativaBotaoAdicionaLinha("../php/webservices.php?funcao=alterarWS","adicionaNovoWebservice",temp);
69 73 i3GEOadmin.webservices.obtem();
70 74 },
71 75 /*
... ... @@ -97,6 +101,14 @@ i3GEOadmin.webservices = {
97 101 };
98 102 //i3GEOadmin.webservices.dataTable = new YAHOO.widget.DataTable("tabela", i3GEOadmin.webservices.defColunas(), myDataSource);
99 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 + );
100 112 i3GEOadmin.webservices.dataTable.subscribe('cellClickEvent',function(ev){
101 113 var sUrl, callback,$clicouId, $recordid,
102 114 target = YAHOO.util.Event.getTarget(ev),
... ... @@ -116,14 +128,14 @@ i3GEOadmin.webservices = {
116 128 $recordid = registro.getId();
117 129 sUrl = "../php/webservices.php?funcao=pegaDados&id_ws="+$clicouId;
118 130 callback = {
119   - success:function(o){
120   - try{
121   - i3GEOadmin.webservices.editor(YAHOO.lang.JSON.parse(o.responseText),$clicouId,$recordid);
122   - }
123   - catch(e){core_handleFailure(e,o.responseText);}
124   - },
125   - failure:core_handleFailure,
126   - argument: { foo:"foo", bar:"bar" }
  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" }
127 139 };
128 140 core_makeRequest(sUrl,callback);
129 141 }
... ... @@ -260,23 +272,23 @@ i3GEOadmin.webservices = {
260 272 core_carregando(" gravando o registro do id= "+id);
261 273 sUrl = "../php/webservices.php?funcao=alterarWS"+par;
262 274 callback = {
263   - success:function(o){
264   - try {
265   - if(YAHOO.lang.JSON.parse(o.responseText) == "erro") {
266   - core_carregando("<span style=color:red >N&atilde;o foi poss&iacute;vel excluir. Verifique se n&atilde;o existem registros vinculados</span>");
267   - setTimeout("core_carregando('desativa')",3000);
268   - }
269   - else{
270   - var rec = i3GEOadmin.webservices.dataTable.getRecordSet().getRecord(recordid);
271   - i3GEOadmin.webservices.dataTable.updateRow(rec,YAHOO.lang.JSON.parse(o.responseText)[0]);
272   - i3GEOadmin.webservices.dados = "";
273   - core_carregando("desativa");
274   - }
275   - }
276   - catch(e){core_handleFailure(e,o.responseText);}
277   - },
278   - failure:core_handleFailure,
279   - argument: { foo:"foo", bar:"bar" }
  275 + success:function(o){
  276 + try {
  277 + if(YAHOO.lang.JSON.parse(o.responseText) == "erro") {
  278 + core_carregando("<span style=color:red >N&atilde;o foi poss&iacute;vel excluir. Verifique se n&atilde;o existem registros vinculados</span>");
  279 + setTimeout("core_carregando('desativa')",3000);
  280 + }
  281 + else{
  282 + var rec = i3GEOadmin.webservices.dataTable.getRecordSet().getRecord(recordid);
  283 + i3GEOadmin.webservices.dataTable.updateRow(rec,YAHOO.lang.JSON.parse(o.responseText)[0]);
  284 + i3GEOadmin.webservices.dados = "";
  285 + core_carregando("desativa");
  286 + }
  287 + }
  288 + catch(e){core_handleFailure(e,o.responseText);}
  289 + },
  290 + failure:core_handleFailure,
  291 + argument: { foo:"foo", bar:"bar" }
280 292 };
281 293 core_makeRequest(sUrl,callback);
282 294 }
... ...
admin/php/identifica.php
1 1 <?php
2 2 /*
3   - Title: identifica.php
  3 +Title: identifica.php
4 4  
5 5 Fun&ccedil;&otilde;es utilizadas pelo editor das op&ccedil;&otilde;es de identifica&ccedil;&atilde;o
6 6  
... ... @@ -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: PEGAFUNCOES
  63 + Valor: PEGAFUNCOES
64 64  
65 65 Lista de opera&ccedil;&otilde;es cadastradas
66 66  
... ... @@ -69,18 +69,17 @@ switch (strtoupper($funcao))
69 69 {JSON}
70 70 */
71 71 case "PEGAFUNCOES":
72   - if(isset($id_i) && $id_i != "")
73   - {
74   - $dados = pegaDados("SELECT * from ".$esquemaadmin."i3geoadmin_identifica where id_i = $id_i ");
  72 + if(isset($id_i) && $id_i != ""){
  73 + $dados = pegaDados("SELECT * from ".$esquemaadmin."i3geoadmin_identifica where id_i = $id_i order by nome_i");
75 74 }
76   - else
77   - {$dados = pegaDados("SELECT * from ".$esquemaadmin."i3geoadmin_identifica");
  75 + else{
  76 + $dados = pegaDados("SELECT * from ".$esquemaadmin."i3geoadmin_identifica order by nome_i");
78 77 }
79 78 retornaJSON($dados);
80 79 exit;
81 80 break;
82 81 /*
83   - Valor: ALTERARFUNCOES
  82 + Valor: ALTERARFUNCOES
84 83  
85 84 Altera uma opera&ccedil;&atilde;o cadastrada
86 85  
... ... @@ -107,7 +106,7 @@ switch (strtoupper($funcao))
107 106 exit;
108 107 break;
109 108 /*
110   - Valor: EXCLUIR
  109 + Valor: EXCLUIR
111 110  
112 111 Exclui uma opera&ccedil;&atilde;o cadastrada
113 112  
... ... @@ -125,7 +124,7 @@ switch (strtoupper($funcao))
125 124 break;
126 125 }
127 126 /*
128   - Altera o registro de um WS
  127 +Altera o registro de um WS
129 128 */
130 129 function alterarFuncoes()
131 130 {
... ... @@ -150,7 +149,7 @@ function alterarFuncoes()
150 149 $id_i = $dbh->query("SELECT id_i FROM ".$esquemaadmin."i3geoadmin_identifica WHERE nome_i = '$idtemp'");
151 150 $id_i = $id_i->fetchAll();
152 151 $id_i = $id_i[0]['id_i'];
153   - $dbhw->query("UPDATE ".$esquemaadmin."i3geoadmin_identifica SET nome_i = '' WHERE id_i = $id AND nome_i = '$idtemp'");
  152 + $dbhw->query("UPDATE ".$esquemaadmin."i3geoadmin_identifica SET nome_i = '' WHERE id_i = $id_i AND nome_i = '$idtemp'");
154 153 $retorna = $id_i;
155 154 }
156 155 $dbhw = null;
... ...
admin/php/mapas.php
1 1 <?php
2 2 /*
3   - Title: mapas.php
  3 +Title: mapas.php
4 4  
5 5 Fun&ccedil;&otilde;es utilizadas pelo editor do cadastro de mapas (links).
6 6  
... ... @@ -56,12 +56,12 @@ error_reporting(0);
56 56 switch (strtoupper($funcao))
57 57 {
58 58 /*
59   - Note:
  59 + Note:
60 60  
61 61 Valores que o par&acirc;metro &funcao pode receber. Os par&acirc;metros devem ser enviados na requisi&ccedil;&atilde;o em AJAX.
62 62 */
63 63 /*
64   - Valor: PEGAMAPAS
  64 + Valor: PEGAMAPAS
65 65  
66 66 Lista os links existentes
67 67  
... ... @@ -76,7 +76,7 @@ switch (strtoupper($funcao))
76 76 exit;
77 77 break;
78 78 /*
79   - Valor: PEGADADOSMAPA
  79 + Valor: PEGADADOSMAPA
80 80  
81 81 Lista os dados de um link
82 82  
... ... @@ -94,7 +94,7 @@ switch (strtoupper($funcao))
94 94 exit;
95 95 break;
96 96 /*
97   - Valor: ALTERARMAPA
  97 + Valor: ALTERARMAPA
98 98  
99 99 Altera os dados de um link
100 100  
... ... @@ -135,7 +135,7 @@ switch (strtoupper($funcao))
135 135 exit;
136 136 break;
137 137 /*
138   - Valor: EXCLUIRMAPA
  138 + Valor: EXCLUIRMAPA
139 139  
140 140 Exclui um link
141 141  
... ... @@ -152,7 +152,7 @@ switch (strtoupper($funcao))
152 152 exit;
153 153 break;
154 154 /*
155   - Valor: SALVAMAPFILE
  155 + Valor: SALVAMAPFILE
156 156  
157 157 Salva um mapfile no banco
158 158  
... ... @@ -211,7 +211,7 @@ function salvaMapfile(){
211 211 }
212 212 }
213 213 /*
214   - Altera o registro de um mapa
  214 +Altera o registro de um mapa
215 215 */
216 216 function alterarMapa(){
217 217 global $esquemaadmin,$publicado_mapa,$ordem_mapa,$id_mapa,$desc_mapa,$ext_mapa,$imagem_mapa,$outros_mapa,$nome_mapa,$linkdireto_mapa,$temas_mapa,$ligados_mapa,$perfil_mapa;
... ... @@ -235,7 +235,7 @@ function alterarMapa(){
235 235 $id = $dbh->query("SELECT * FROM ".$esquemaadmin."i3geoadmin_mapas WHERE nome_mapa = '$id_temp'");
236 236 $id = $id->fetchAll();
237 237 $id = $id[0]['id_mapa'];
238   - $dbhw->query("UPDATE ".$esquemaadmin."i3geoadmin_mapas SET nome_mapa = '' WHERE id_mapa = $id AND nome_mapa = '$idtemp'");
  238 + $dbhw->query("UPDATE ".$esquemaadmin."i3geoadmin_mapas SET nome_mapa = '' WHERE id_mapa = $id AND nome_mapa = '$id_temp'");
239 239 $retorna = $id;
240 240 }
241 241 $dbhw = null;
... ...