Commit b5ae8482ee601cad421997f6c4c1d4ace02c3629
1 parent
e00621bd
Exists in
master
and in
7 other branches
$1
Showing
15 changed files
with
428 additions
and
329 deletions
Show diff stats
admin/admin.db
No preview for this file type
admin/html/subirshapefile.html
@@ -5,18 +5,18 @@ | @@ -5,18 +5,18 @@ | ||
5 | <title>Shape file</title> | 5 | <title>Shape file</title> |
6 | <style type="text/css"> | 6 | <style type="text/css"> |
7 | /*margin and padding on body element | 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 | body { | 12 | body { |
13 | margin: 0; | 13 | margin: 0; |
14 | padding: 0; | 14 | padding: 0; |
15 | } | 15 | } |
16 | </style> | 16 | </style> |
17 | <script type="text/javascript" src="../../classesjs/i3geo.js"></script> | 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 | <script type="text/javascript" src="../js/core.js"></script> | 20 | <script type="text/javascript" src="../js/core.js"></script> |
21 | <link rel="stylesheet" type="text/css" href="admin.css"> | 21 | <link rel="stylesheet" type="text/css" href="admin.css"> |
22 | </head> | 22 | </head> |
admin/js/arvore.js
@@ -156,8 +156,8 @@ function montaArvore(dados) | @@ -156,8 +156,8 @@ function montaArvore(dados) | ||
156 | } | 156 | } |
157 | buildTree(); | 157 | buildTree(); |
158 | }(); | 158 | }(); |
159 | - montaNosMenus(dados); | ||
160 | - tree.draw(); | 159 | + montaNosMenus(dados); |
160 | + tree.draw(); | ||
161 | } | 161 | } |
162 | function temaIconMode() | 162 | function temaIconMode() |
163 | { | 163 | { |
@@ -445,8 +445,8 @@ function novoTemaRaiz(id) | @@ -445,8 +445,8 @@ function novoTemaRaiz(id) | ||
445 | tree.draw(); | 445 | tree.draw(); |
446 | core_carregando("desativa"); | 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 | core_makeRequest(sUrl,callback); | 451 | core_makeRequest(sUrl,callback); |
452 | } | 452 | } |
@@ -477,8 +477,8 @@ function novoTemaRaizGrupo(idmenu,id) | @@ -477,8 +477,8 @@ function novoTemaRaizGrupo(idmenu,id) | ||
477 | tree.draw(); | 477 | tree.draw(); |
478 | core_carregando("desativa"); | 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 | core_makeRequest(sUrl,callback); | 483 | core_makeRequest(sUrl,callback); |
484 | } | 484 | } |
@@ -511,8 +511,8 @@ function novoGrupo(id_menu) | @@ -511,8 +511,8 @@ function novoGrupo(id_menu) | ||
511 | core_carregando("desativa"); | 511 | core_carregando("desativa"); |
512 | editar('grupo',dados.id_n1); | 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 | core_makeRequest(sUrl,callback); | 517 | core_makeRequest(sUrl,callback); |
518 | } | 518 | } |
@@ -545,8 +545,8 @@ function novoSubGrupo(id_menu,id_n1) | @@ -545,8 +545,8 @@ function novoSubGrupo(id_menu,id_n1) | ||
545 | core_carregando("desativa"); | 545 | core_carregando("desativa"); |
546 | editar("subgrupo",dados.id_n2); | 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 | core_makeRequest(sUrl,callback); | 551 | core_makeRequest(sUrl,callback); |
552 | } | 552 | } |
@@ -578,8 +578,8 @@ function novoTema(id_menu,id_n2) | @@ -578,8 +578,8 @@ function novoTema(id_menu,id_n2) | ||
578 | core_carregando("desativa"); | 578 | core_carregando("desativa"); |
579 | editar('tema',dados.id_n3); | 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 | core_makeRequest(sUrl,callback); | 584 | core_makeRequest(sUrl,callback); |
585 | } | 585 | } |
@@ -786,89 +786,88 @@ function gravaDados(tipo,id) | @@ -786,89 +786,88 @@ function gravaDados(tipo,id) | ||
786 | var sUrl = prog+par; | 786 | var sUrl = prog+par; |
787 | var callback = | 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 | if(tipo == "raizmenu" || tipo == "raizgrupo") | 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 | YAHOO.admin.container.panelEditor.destroy(); | 864 | YAHOO.admin.container.panelEditor.destroy(); |
866 | YAHOO.admin.container.panelEditor = null; | 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 | core_makeRequest(sUrl,callback,'POST'); | 872 | core_makeRequest(sUrl,callback,'POST'); |
874 | } | 873 | } |
@@ -900,8 +899,8 @@ function sobeDesce(movimento,tipo,id) | @@ -900,8 +899,8 @@ function sobeDesce(movimento,tipo,id) | ||
900 | { | 899 | { |
901 | success: function(oResponse) | 900 | success: function(oResponse) |
902 | {core_carregando("desativa");}, | 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 | if(movimenta) | 905 | if(movimenta) |
907 | { | 906 | { |
admin/js/estat_conexao.js
@@ -40,7 +40,11 @@ i3GEOadmin.conexao = { | @@ -40,7 +40,11 @@ i3GEOadmin.conexao = { | ||
40 | YAHOO.namespace("conexao"); | 40 | YAHOO.namespace("conexao"); |
41 | YAHOO.namespace("admin.container"); | 41 | YAHOO.namespace("admin.container"); |
42 | core_ativaPainelAjuda("ajuda","botaoAjuda"); | 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 | i3GEOadmin.conexao.obtem(); | 48 | i3GEOadmin.conexao.obtem(); |
45 | }, | 49 | }, |
46 | /* | 50 | /* |
@@ -65,6 +69,14 @@ i3GEOadmin.conexao = { | @@ -65,6 +69,14 @@ i3GEOadmin.conexao = { | ||
65 | }; | 69 | }; |
66 | //i3GEOadmin.conexao.dataTable = new YAHOO.widget.DataTable("tabela", i3GEOadmin.conexao.defColunas(), myDataSource); | 70 | //i3GEOadmin.conexao.dataTable = new YAHOO.widget.DataTable("tabela", i3GEOadmin.conexao.defColunas(), myDataSource); |
67 | i3GEOadmin.conexao.dataTable = new YAHOO.widget.ScrollingDataTable("tabela", i3GEOadmin.conexao.defColunas(), myDataSource,{width:"100%"}); | 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 | i3GEOadmin.conexao.dataTable.subscribe('cellClickEvent',function(ev){ | 80 | i3GEOadmin.conexao.dataTable.subscribe('cellClickEvent',function(ev){ |
69 | var sUrl, callback,$clicouId, $recordid, | 81 | var sUrl, callback,$clicouId, $recordid, |
70 | target = YAHOO.util.Event.getTarget(ev), | 82 | target = YAHOO.util.Event.getTarget(ev), |
@@ -84,14 +96,14 @@ i3GEOadmin.conexao = { | @@ -84,14 +96,14 @@ i3GEOadmin.conexao = { | ||
84 | $recordid = registro.getId(); | 96 | $recordid = registro.getId(); |
85 | sUrl = "../php/metaestat.php?funcao=listaConexao&codigo_estat_conexao="+$clicouId; | 97 | sUrl = "../php/metaestat.php?funcao=listaConexao&codigo_estat_conexao="+$clicouId; |
86 | callback = { | 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 | core_makeRequest(sUrl,callback); | 108 | core_makeRequest(sUrl,callback); |
97 | } | 109 | } |
@@ -193,23 +205,23 @@ i3GEOadmin.conexao = { | @@ -193,23 +205,23 @@ i3GEOadmin.conexao = { | ||
193 | core_carregando(" gravando o registro do id= "+id); | 205 | core_carregando(" gravando o registro do id= "+id); |
194 | sUrl = "../php/metaestat.php?funcao=alterarConexao"+par; | 206 | sUrl = "../php/metaestat.php?funcao=alterarConexao"+par; |
195 | callback = { | 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ão foi possível excluir. Verifique se nã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ão foi possível excluir. Verifique se nã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 | core_makeRequest(sUrl,callback); | 226 | core_makeRequest(sUrl,callback); |
215 | } | 227 | } |
admin/js/estat_editor.js
@@ -528,7 +528,7 @@ i3GEOadmin.editor = { | @@ -528,7 +528,7 @@ i3GEOadmin.editor = { | ||
528 | }, | 528 | }, |
529 | esvaziaFormsUpload: function(){ | 529 | esvaziaFormsUpload: function(){ |
530 | var csv = $i("i3GEOadmin_formuploadcsv"), | 530 | var csv = $i("i3GEOadmin_formuploadcsv"), |
531 | - shp = $i("i3GEOadmin_formupload") | 531 | + shp = $i("i3GEOadmin_formupload"); |
532 | if(csv){ | 532 | if(csv){ |
533 | csv.innerHTML = ""; | 533 | csv.innerHTML = ""; |
534 | } | 534 | } |
admin/js/estat_fonteinfo.js
@@ -34,7 +34,11 @@ i3GEOadmin.fonteinfo = { | @@ -34,7 +34,11 @@ i3GEOadmin.fonteinfo = { | ||
34 | YAHOO.namespace("fonteinfo"); | 34 | YAHOO.namespace("fonteinfo"); |
35 | YAHOO.namespace("admin.container"); | 35 | YAHOO.namespace("admin.container"); |
36 | core_ativaPainelAjuda("ajuda","botaoAjuda"); | 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 | i3GEOadmin.fonteinfo.obtem(); | 42 | i3GEOadmin.fonteinfo.obtem(); |
39 | }, | 43 | }, |
40 | /* | 44 | /* |
@@ -59,6 +63,14 @@ i3GEOadmin.fonteinfo = { | @@ -59,6 +63,14 @@ i3GEOadmin.fonteinfo = { | ||
59 | }; | 63 | }; |
60 | //i3GEOadmin.fonteinfo.dataTable = new YAHOO.widget.DataTable("tabela", i3GEOadmin.fonteinfo.defColunas(), myDataSource); | 64 | //i3GEOadmin.fonteinfo.dataTable = new YAHOO.widget.DataTable("tabela", i3GEOadmin.fonteinfo.defColunas(), myDataSource); |
61 | i3GEOadmin.fonteinfo.dataTable = new YAHOO.widget.ScrollingDataTable("tabela", i3GEOadmin.fonteinfo.defColunas(), myDataSource,{width:"100%"}); | 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 | i3GEOadmin.fonteinfo.dataTable.subscribe('cellClickEvent',function(ev){ | 74 | i3GEOadmin.fonteinfo.dataTable.subscribe('cellClickEvent',function(ev){ |
63 | var sUrl, callback,$clicouId, $recordid, | 75 | var sUrl, callback,$clicouId, $recordid, |
64 | target = YAHOO.util.Event.getTarget(ev), | 76 | target = YAHOO.util.Event.getTarget(ev), |
@@ -78,14 +90,14 @@ i3GEOadmin.fonteinfo = { | @@ -78,14 +90,14 @@ i3GEOadmin.fonteinfo = { | ||
78 | $recordid = registro.getId(); | 90 | $recordid = registro.getId(); |
79 | sUrl = "../php/metaestat.php?funcao=listaFonteinfo&id_fonteinfo="+$clicouId; | 91 | sUrl = "../php/metaestat.php?funcao=listaFonteinfo&id_fonteinfo="+$clicouId; |
80 | callback = { | 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 | core_makeRequest(sUrl,callback); | 102 | core_makeRequest(sUrl,callback); |
91 | } | 103 | } |
@@ -186,23 +198,23 @@ i3GEOadmin.fonteinfo = { | @@ -186,23 +198,23 @@ i3GEOadmin.fonteinfo = { | ||
186 | core_carregando(" gravando o registro do id= "+id); | 198 | core_carregando(" gravando o registro do id= "+id); |
187 | sUrl = "../php/metaestat.php?funcao=alteraFonteinfo"+par; | 199 | sUrl = "../php/metaestat.php?funcao=alteraFonteinfo"+par; |
188 | callback = { | 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ão foi possível excluir. Verifique se nã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ão foi possível excluir. Verifique se nã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 | core_makeRequest(sUrl,callback); | 219 | core_makeRequest(sUrl,callback); |
208 | } | 220 | } |
admin/js/estat_mapa.js
@@ -293,8 +293,8 @@ function montaDivTema(i){ | @@ -293,8 +293,8 @@ function montaDivTema(i){ | ||
293 | ins = "", | 293 | ins = "", |
294 | callback = { | 294 | callback = { |
295 | success:function(o){ | 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 | m,i,j,filhos,a,b; | 298 | m,i,j,filhos,a,b; |
299 | //monta os divs onde entrarao as arvores | 299 | //monta os divs onde entrarao as arvores |
300 | for(i=0;i<n;i++){ | 300 | for(i=0;i<n;i++){ |
admin/js/estat_tipo_periodo.js
@@ -34,7 +34,11 @@ i3GEOadmin.periodo = { | @@ -34,7 +34,11 @@ i3GEOadmin.periodo = { | ||
34 | YAHOO.namespace("periodo"); | 34 | YAHOO.namespace("periodo"); |
35 | YAHOO.namespace("admin.container"); | 35 | YAHOO.namespace("admin.container"); |
36 | core_ativaPainelAjuda("ajuda","botaoAjuda"); | 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 | i3GEOadmin.periodo.obtem(); | 42 | i3GEOadmin.periodo.obtem(); |
39 | }, | 43 | }, |
40 | /* | 44 | /* |
@@ -59,6 +63,14 @@ i3GEOadmin.periodo = { | @@ -59,6 +63,14 @@ i3GEOadmin.periodo = { | ||
59 | }; | 63 | }; |
60 | //i3GEOadmin.periodo.dataTable = new YAHOO.widget.DataTable("tabela", i3GEOadmin.periodo.defColunas(), myDataSource); | 64 | //i3GEOadmin.periodo.dataTable = new YAHOO.widget.DataTable("tabela", i3GEOadmin.periodo.defColunas(), myDataSource); |
61 | i3GEOadmin.periodo.dataTable = new YAHOO.widget.ScrollingDataTable("tabela", i3GEOadmin.periodo.defColunas(), myDataSource,{width:"100%"}); | 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 | i3GEOadmin.periodo.dataTable.subscribe('cellClickEvent',function(ev){ | 74 | i3GEOadmin.periodo.dataTable.subscribe('cellClickEvent',function(ev){ |
63 | var sUrl, callback,$clicouId, $recordid, | 75 | var sUrl, callback,$clicouId, $recordid, |
64 | target = YAHOO.util.Event.getTarget(ev), | 76 | target = YAHOO.util.Event.getTarget(ev), |
@@ -78,14 +90,14 @@ i3GEOadmin.periodo = { | @@ -78,14 +90,14 @@ i3GEOadmin.periodo = { | ||
78 | $recordid = registro.getId(); | 90 | $recordid = registro.getId(); |
79 | sUrl = "../php/metaestat.php?funcao=listaTipoPeriodo&codigo_tipo_periodo="+$clicouId; | 91 | sUrl = "../php/metaestat.php?funcao=listaTipoPeriodo&codigo_tipo_periodo="+$clicouId; |
80 | callback = { | 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 | core_makeRequest(sUrl,callback); | 102 | core_makeRequest(sUrl,callback); |
91 | } | 103 | } |
@@ -186,23 +198,23 @@ i3GEOadmin.periodo = { | @@ -186,23 +198,23 @@ i3GEOadmin.periodo = { | ||
186 | core_carregando(" gravando o registro do id= "+id); | 198 | core_carregando(" gravando o registro do id= "+id); |
187 | sUrl = "../php/metaestat.php?funcao=alterarTipoPeriodo"+par; | 199 | sUrl = "../php/metaestat.php?funcao=alterarTipoPeriodo"+par; |
188 | callback = { | 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ão foi possível excluir. Verifique se nã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ão foi possível excluir. Verifique se nã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 | core_makeRequest(sUrl,callback); | 219 | core_makeRequest(sUrl,callback); |
208 | } | 220 | } |
admin/js/estat_tipo_regiao.js
@@ -12,7 +12,11 @@ core_makeRequest("../php/metaestat.php?funcao=listaDadosTabelasAuxiliares",callb | @@ -12,7 +12,11 @@ core_makeRequest("../php/metaestat.php?funcao=listaDadosTabelasAuxiliares",callb | ||
12 | 12 | ||
13 | function initEditor(){ | 13 | function initEditor(){ |
14 | YAHOO.namespace("admin.container"); | 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 | pegaDados(); | 20 | pegaDados(); |
17 | } | 21 | } |
18 | function pegaDados(){ | 22 | function pegaDados(){ |
@@ -58,32 +62,45 @@ function montaTabela(dados){ | @@ -58,32 +62,45 @@ function montaTabela(dados){ | ||
58 | elCell.innerHTML = "<div class=download style='text-align:center' title='shape file' ></div>"; | 62 | elCell.innerHTML = "<div class=download style='text-align:center' title='shape file' ></div>"; |
59 | }, | 63 | }, |
60 | myColumnDefs = [ | 64 | myColumnDefs = [ |
61 | - {key:"excluir",label:"excluir",formatter:formatExclui}, | ||
62 | - {key:"shapefile",label:"download",formatter:formatShp}, | ||
63 | - {key:"rel",label:"agregações",formatter:formatRel}, | ||
64 | - {key:"mais",label:"propriedades",formatter:formatMais}, | ||
65 | - {label:"código",key:"codigo_tipo_regiao", formatter:formatTexto}, | ||
66 | - {label:"Nome",resizeable:true,key:"nome_tipo_regiao", formatter:formatTexto}, | ||
67 | - {label:"Descrição",resizeable:true,key:"descricao_tipo_regiao", formatter:formatTexto}, | ||
68 | - {label:"Conexã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óide",key:"colunacentroide",formatter:formatTexto}, | ||
73 | - {label:"Data",key:"data",formatter:formatTexto}, | ||
74 | - {label:"Região",key:"identificador",formatter:formatTexto}, | ||
75 | - {label:"Nomes",resizeable:false,key:"colunanomeregiao",formatter:formatTexto}, | ||
76 | - {label:"Colunas visíveis (separa com ví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ções",formatter:formatRel}, | ||
68 | + {key:"mais",label:"propriedades",formatter:formatMais}, | ||
69 | + {label:"código",key:"codigo_tipo_regiao", formatter:formatTexto}, | ||
70 | + {label:"Nome",resizeable:true,key:"nome_tipo_regiao", formatter:formatTexto}, | ||
71 | + {label:"Descrição",resizeable:true,key:"descricao_tipo_regiao", formatter:formatTexto}, | ||
72 | + {label:"Conexã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óide",key:"colunacentroide",formatter:formatTexto}, | ||
77 | + {label:"Data",key:"data",formatter:formatTexto}, | ||
78 | + {label:"Região",key:"identificador",formatter:formatTexto}, | ||
79 | + {label:"Nomes",resizeable:false,key:"colunanomeregiao",formatter:formatTexto}, | ||
80 | + {label:"Colunas visíveis (separa com ví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 | myDataTable = new YAHOO.widget.ScrollingDataTable("tabela", myColumnDefs, myDataSource,{width:"100%"}); | 85 | myDataTable = new YAHOO.widget.ScrollingDataTable("tabela", myColumnDefs, myDataSource,{width:"100%"}); |
82 | 86 | ||
83 | myDataSource.responseType = YAHOO.util.DataSource.TYPE_JSARRAY; | 87 | myDataSource.responseType = YAHOO.util.DataSource.TYPE_JSARRAY; |
84 | myDataSource.responseSchema = { | 88 | myDataSource.responseSchema = { |
85 | fields: ["codigo_tipo_regiao","nome_tipo_regiao","descricao_tipo_regiao","esquemadb","tabela","colunageo","colunacentroide","data","identificador","codigo_estat_conexao","colunanomeregiao","colunasvisiveis","apelidos","srid"] | 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 | myDataTable.subscribe( | 104 | myDataTable.subscribe( |
88 | 'cellClickEvent', | 105 | 'cellClickEvent', |
89 | function(ev){ | 106 | function(ev){ |
@@ -167,7 +184,7 @@ function montaTabelaAgregacoes(dados){ | @@ -167,7 +184,7 @@ function montaTabelaAgregacoes(dados){ | ||
167 | {label:"Pai",resizeable:true,key:"codigo_tipo_regiao_pai", formatter:formatTexto}, | 184 | {label:"Pai",resizeable:true,key:"codigo_tipo_regiao_pai", formatter:formatTexto}, |
168 | {label:"Coluna de ligacao",key:"colunaligacao_regiaopai",formatter:formatTexto} | 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 | myDataTable = new YAHOO.widget.DataTable("tabelaAgrega", myColumnDefs, myDataSource); | 188 | myDataTable = new YAHOO.widget.DataTable("tabelaAgrega", myColumnDefs, myDataSource); |
172 | myDataSource.responseType = YAHOO.util.DataSource.TYPE_JSARRAY; | 189 | myDataSource.responseType = YAHOO.util.DataSource.TYPE_JSARRAY; |
173 | myDataSource.responseSchema = { | 190 | myDataSource.responseSchema = { |
admin/js/estat_unidade_medida.js
@@ -36,7 +36,11 @@ i3GEOadmin.umedida = { | @@ -36,7 +36,11 @@ i3GEOadmin.umedida = { | ||
36 | YAHOO.namespace("umedida"); | 36 | YAHOO.namespace("umedida"); |
37 | YAHOO.namespace("admin.container"); | 37 | YAHOO.namespace("admin.container"); |
38 | core_ativaPainelAjuda("ajuda","botaoAjuda"); | 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 | i3GEOadmin.umedida.obtem(); | 44 | i3GEOadmin.umedida.obtem(); |
41 | }, | 45 | }, |
42 | /* | 46 | /* |
@@ -61,6 +65,14 @@ i3GEOadmin.umedida = { | @@ -61,6 +65,14 @@ i3GEOadmin.umedida = { | ||
61 | }; | 65 | }; |
62 | //i3GEOadmin.umedida.dataTable = new YAHOO.widget.DataTable("tabela", i3GEOadmin.umedida.defColunas(), myDataSource); | 66 | //i3GEOadmin.umedida.dataTable = new YAHOO.widget.DataTable("tabela", i3GEOadmin.umedida.defColunas(), myDataSource); |
63 | i3GEOadmin.umedida.dataTable = new YAHOO.widget.ScrollingDataTable("tabela", i3GEOadmin.umedida.defColunas(), myDataSource,{width:"100%"}); | 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 | i3GEOadmin.umedida.dataTable.subscribe('cellClickEvent',function(ev){ | 76 | i3GEOadmin.umedida.dataTable.subscribe('cellClickEvent',function(ev){ |
65 | var sUrl, callback,$clicouId, $recordid, | 77 | var sUrl, callback,$clicouId, $recordid, |
66 | target = YAHOO.util.Event.getTarget(ev), | 78 | target = YAHOO.util.Event.getTarget(ev), |
@@ -80,14 +92,14 @@ i3GEOadmin.umedida = { | @@ -80,14 +92,14 @@ i3GEOadmin.umedida = { | ||
80 | $recordid = registro.getId(); | 92 | $recordid = registro.getId(); |
81 | sUrl = "../php/metaestat.php?funcao=listaUnidadeMedida&codigo_unidade_medida="+$clicouId; | 93 | sUrl = "../php/metaestat.php?funcao=listaUnidadeMedida&codigo_unidade_medida="+$clicouId; |
82 | callback = { | 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 | core_makeRequest(sUrl,callback); | 104 | core_makeRequest(sUrl,callback); |
93 | } | 105 | } |
@@ -213,23 +225,23 @@ i3GEOadmin.umedida = { | @@ -213,23 +225,23 @@ i3GEOadmin.umedida = { | ||
213 | core_carregando(" gravando o registro do id= "+id); | 225 | core_carregando(" gravando o registro do id= "+id); |
214 | sUrl = "../php/metaestat.php?funcao=alterarUnidadeMedida"+par; | 226 | sUrl = "../php/metaestat.php?funcao=alterarUnidadeMedida"+par; |
215 | callback = { | 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ão foi possível excluir. Verifique se nã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ão foi possível excluir. Verifique se nã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 | core_makeRequest(sUrl,callback); | 246 | core_makeRequest(sUrl,callback); |
235 | } | 247 | } |
admin/js/identifica.js
@@ -56,7 +56,7 @@ i3GEOadmin.identifica = { | @@ -56,7 +56,7 @@ i3GEOadmin.identifica = { | ||
56 | {label:"id",key:"id_i", formatter:i3GEOadmin.identifica.formatTexto}, | 56 | {label:"id",key:"id_i", formatter:i3GEOadmin.identifica.formatTexto}, |
57 | {label:"nome",resizeable:true,key:"nome_i", formatter:i3GEOadmin.identifica.formatTexto}, | 57 | {label:"nome",resizeable:true,key:"nome_i", formatter:i3GEOadmin.identifica.formatTexto}, |
58 | {label:"publicado?",resizeable:true,key:"publicado_i", formatter:i3GEOadmin.identifica.formatTexto}, | 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 | {label:"abrir como?",resizeable:true,key:"target_i", formatter:i3GEOadmin.identifica.formatTexto} | 60 | {label:"abrir como?",resizeable:true,key:"target_i", formatter:i3GEOadmin.identifica.formatTexto} |
61 | ]; | 61 | ]; |
62 | }, | 62 | }, |
@@ -67,7 +67,11 @@ i3GEOadmin.identifica = { | @@ -67,7 +67,11 @@ i3GEOadmin.identifica = { | ||
67 | YAHOO.namespace("identifica"); | 67 | YAHOO.namespace("identifica"); |
68 | YAHOO.namespace("admin.container"); | 68 | YAHOO.namespace("admin.container"); |
69 | core_ativaPainelAjuda("ajuda","botaoAjuda"); | 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 | i3GEOadmin.identifica.obtem(); | 75 | i3GEOadmin.identifica.obtem(); |
72 | }, | 76 | }, |
73 | /* | 77 | /* |
@@ -92,6 +96,14 @@ i3GEOadmin.identifica = { | @@ -92,6 +96,14 @@ i3GEOadmin.identifica = { | ||
92 | }; | 96 | }; |
93 | //i3GEOadmin.identifica.dataTable = new YAHOO.widget.DataTable("tabela", i3GEOadmin.identifica.defColunas(), myDataSource); | 97 | //i3GEOadmin.identifica.dataTable = new YAHOO.widget.DataTable("tabela", i3GEOadmin.identifica.defColunas(), myDataSource); |
94 | i3GEOadmin.identifica.dataTable = new YAHOO.widget.ScrollingDataTable("tabela", i3GEOadmin.identifica.defColunas(), myDataSource,{width:"100%"}); | 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 | i3GEOadmin.identifica.dataTable.subscribe('cellClickEvent',function(ev){ | 107 | i3GEOadmin.identifica.dataTable.subscribe('cellClickEvent',function(ev){ |
96 | var sUrl, callback,$clicouId, $recordid, | 108 | var sUrl, callback,$clicouId, $recordid, |
97 | target = YAHOO.util.Event.getTarget(ev), | 109 | target = YAHOO.util.Event.getTarget(ev), |
@@ -111,14 +123,14 @@ i3GEOadmin.identifica = { | @@ -111,14 +123,14 @@ i3GEOadmin.identifica = { | ||
111 | $recordid = registro.getId(); | 123 | $recordid = registro.getId(); |
112 | sUrl = "../php/identifica.php?funcao=pegafuncoes&id_i="+$clicouId; | 124 | sUrl = "../php/identifica.php?funcao=pegafuncoes&id_i="+$clicouId; |
113 | callback = { | 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 | core_makeRequest(sUrl,callback); | 135 | core_makeRequest(sUrl,callback); |
124 | } | 136 | } |
@@ -231,23 +243,23 @@ i3GEOadmin.identifica = { | @@ -231,23 +243,23 @@ i3GEOadmin.identifica = { | ||
231 | core_carregando(" gravando o registro do id= "+id); | 243 | core_carregando(" gravando o registro do id= "+id); |
232 | sUrl = "../php/identifica.php?funcao=alterarFuncoes"+par; | 244 | sUrl = "../php/identifica.php?funcao=alterarFuncoes"+par; |
233 | callback = { | 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ão foi possível excluir. Verifique se nã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ão foi possível excluir. Verifique se nã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 | core_makeRequest(sUrl,callback); | 264 | core_makeRequest(sUrl,callback); |
253 | } | 265 | } |
admin/js/mapas.js
@@ -66,7 +66,11 @@ i3GEOadmin.mapas = { | @@ -66,7 +66,11 @@ i3GEOadmin.mapas = { | ||
66 | YAHOO.namespace("mapas"); | 66 | YAHOO.namespace("mapas"); |
67 | YAHOO.namespace("admin.container"); | 67 | YAHOO.namespace("admin.container"); |
68 | core_ativaPainelAjuda("ajuda","botaoAjuda"); | 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 | i3GEOadmin.mapas.obtem(); | 74 | i3GEOadmin.mapas.obtem(); |
71 | }, | 75 | }, |
72 | /* | 76 | /* |
@@ -91,6 +95,14 @@ i3GEOadmin.mapas = { | @@ -91,6 +95,14 @@ i3GEOadmin.mapas = { | ||
91 | }; | 95 | }; |
92 | //i3GEOadmin.mapas.dataTable = new YAHOO.widget.DataTable("tabela", i3GEOadmin.mapas.defColunas(), myDataSource); | 96 | //i3GEOadmin.mapas.dataTable = new YAHOO.widget.DataTable("tabela", i3GEOadmin.mapas.defColunas(), myDataSource); |
93 | i3GEOadmin.mapas.dataTable = new YAHOO.widget.ScrollingDataTable("tabela", i3GEOadmin.mapas.defColunas(), myDataSource,{width:"100%"}); | 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 | i3GEOadmin.mapas.dataTable.subscribe('cellClickEvent',function(ev){ | 106 | i3GEOadmin.mapas.dataTable.subscribe('cellClickEvent',function(ev){ |
95 | var sUrl, callback,$clicouId, $recordid, | 107 | var sUrl, callback,$clicouId, $recordid, |
96 | target = YAHOO.util.Event.getTarget(ev), | 108 | target = YAHOO.util.Event.getTarget(ev), |
@@ -110,14 +122,14 @@ i3GEOadmin.mapas = { | @@ -110,14 +122,14 @@ i3GEOadmin.mapas = { | ||
110 | $recordid = registro.getId(); | 122 | $recordid = registro.getId(); |
111 | sUrl = "../php/mapas.php?funcao=pegaDadosMapa&id_mapa="+$clicouId; | 123 | sUrl = "../php/mapas.php?funcao=pegaDadosMapa&id_mapa="+$clicouId; |
112 | callback = { | 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 | core_makeRequest(sUrl,callback); | 134 | core_makeRequest(sUrl,callback); |
123 | } | 135 | } |
@@ -255,23 +267,23 @@ i3GEOadmin.mapas = { | @@ -255,23 +267,23 @@ i3GEOadmin.mapas = { | ||
255 | core_carregando(" gravando o registro do id= "+id); | 267 | core_carregando(" gravando o registro do id= "+id); |
256 | sUrl = "../php/mapas.php?funcao=alterarMapa"+par; | 268 | sUrl = "../php/mapas.php?funcao=alterarMapa"+par; |
257 | callback = { | 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ão foi possível excluir. Verifique se nã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ão foi possível excluir. Verifique se nã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 | core_makeRequest(sUrl,callback); | 288 | core_makeRequest(sUrl,callback); |
277 | } | 289 | } |
admin/js/webservices.js
@@ -65,7 +65,11 @@ i3GEOadmin.webservices = { | @@ -65,7 +65,11 @@ i3GEOadmin.webservices = { | ||
65 | YAHOO.namespace("webservices"); | 65 | YAHOO.namespace("webservices"); |
66 | YAHOO.namespace("admin.container"); | 66 | YAHOO.namespace("admin.container"); |
67 | core_ativaPainelAjuda("ajuda","botaoAjuda"); | 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 | i3GEOadmin.webservices.obtem(); | 73 | i3GEOadmin.webservices.obtem(); |
70 | }, | 74 | }, |
71 | /* | 75 | /* |
@@ -97,6 +101,14 @@ i3GEOadmin.webservices = { | @@ -97,6 +101,14 @@ i3GEOadmin.webservices = { | ||
97 | }; | 101 | }; |
98 | //i3GEOadmin.webservices.dataTable = new YAHOO.widget.DataTable("tabela", i3GEOadmin.webservices.defColunas(), myDataSource); | 102 | //i3GEOadmin.webservices.dataTable = new YAHOO.widget.DataTable("tabela", i3GEOadmin.webservices.defColunas(), myDataSource); |
99 | i3GEOadmin.webservices.dataTable = new YAHOO.widget.ScrollingDataTable("tabela", i3GEOadmin.webservices.defColunas(), myDataSource,{width:"100%"}); | 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 | i3GEOadmin.webservices.dataTable.subscribe('cellClickEvent',function(ev){ | 112 | i3GEOadmin.webservices.dataTable.subscribe('cellClickEvent',function(ev){ |
101 | var sUrl, callback,$clicouId, $recordid, | 113 | var sUrl, callback,$clicouId, $recordid, |
102 | target = YAHOO.util.Event.getTarget(ev), | 114 | target = YAHOO.util.Event.getTarget(ev), |
@@ -116,14 +128,14 @@ i3GEOadmin.webservices = { | @@ -116,14 +128,14 @@ i3GEOadmin.webservices = { | ||
116 | $recordid = registro.getId(); | 128 | $recordid = registro.getId(); |
117 | sUrl = "../php/webservices.php?funcao=pegaDados&id_ws="+$clicouId; | 129 | sUrl = "../php/webservices.php?funcao=pegaDados&id_ws="+$clicouId; |
118 | callback = { | 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 | core_makeRequest(sUrl,callback); | 140 | core_makeRequest(sUrl,callback); |
129 | } | 141 | } |
@@ -260,23 +272,23 @@ i3GEOadmin.webservices = { | @@ -260,23 +272,23 @@ i3GEOadmin.webservices = { | ||
260 | core_carregando(" gravando o registro do id= "+id); | 272 | core_carregando(" gravando o registro do id= "+id); |
261 | sUrl = "../php/webservices.php?funcao=alterarWS"+par; | 273 | sUrl = "../php/webservices.php?funcao=alterarWS"+par; |
262 | callback = { | 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ão foi possível excluir. Verifique se nã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ão foi possível excluir. Verifique se nã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 | core_makeRequest(sUrl,callback); | 293 | core_makeRequest(sUrl,callback); |
282 | } | 294 | } |
admin/php/identifica.php
1 | <?php | 1 | <?php |
2 | /* | 2 | /* |
3 | - Title: identifica.php | 3 | +Title: identifica.php |
4 | 4 | ||
5 | Funções utilizadas pelo editor das opções de identificação | 5 | Funções utilizadas pelo editor das opções de identificação |
6 | 6 | ||
@@ -55,12 +55,12 @@ error_reporting(0); | @@ -55,12 +55,12 @@ error_reporting(0); | ||
55 | switch (strtoupper($funcao)) | 55 | switch (strtoupper($funcao)) |
56 | { | 56 | { |
57 | /* | 57 | /* |
58 | - Note: | 58 | + Note: |
59 | 59 | ||
60 | Valores que o parâmetro &funcao pode receber. Os parâmetros devem ser enviados na requisição em AJAX. | 60 | Valores que o parâmetro &funcao pode receber. Os parâmetros devem ser enviados na requisição em AJAX. |
61 | */ | 61 | */ |
62 | /* | 62 | /* |
63 | - Valor: PEGAFUNCOES | 63 | + Valor: PEGAFUNCOES |
64 | 64 | ||
65 | Lista de operações cadastradas | 65 | Lista de operações cadastradas |
66 | 66 | ||
@@ -69,18 +69,17 @@ switch (strtoupper($funcao)) | @@ -69,18 +69,17 @@ switch (strtoupper($funcao)) | ||
69 | {JSON} | 69 | {JSON} |
70 | */ | 70 | */ |
71 | case "PEGAFUNCOES": | 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 | retornaJSON($dados); | 78 | retornaJSON($dados); |
80 | exit; | 79 | exit; |
81 | break; | 80 | break; |
82 | /* | 81 | /* |
83 | - Valor: ALTERARFUNCOES | 82 | + Valor: ALTERARFUNCOES |
84 | 83 | ||
85 | Altera uma operação cadastrada | 84 | Altera uma operação cadastrada |
86 | 85 | ||
@@ -107,7 +106,7 @@ switch (strtoupper($funcao)) | @@ -107,7 +106,7 @@ switch (strtoupper($funcao)) | ||
107 | exit; | 106 | exit; |
108 | break; | 107 | break; |
109 | /* | 108 | /* |
110 | - Valor: EXCLUIR | 109 | + Valor: EXCLUIR |
111 | 110 | ||
112 | Exclui uma operação cadastrada | 111 | Exclui uma operação cadastrada |
113 | 112 | ||
@@ -125,7 +124,7 @@ switch (strtoupper($funcao)) | @@ -125,7 +124,7 @@ switch (strtoupper($funcao)) | ||
125 | break; | 124 | break; |
126 | } | 125 | } |
127 | /* | 126 | /* |
128 | - Altera o registro de um WS | 127 | +Altera o registro de um WS |
129 | */ | 128 | */ |
130 | function alterarFuncoes() | 129 | function alterarFuncoes() |
131 | { | 130 | { |
@@ -150,7 +149,7 @@ function alterarFuncoes() | @@ -150,7 +149,7 @@ function alterarFuncoes() | ||
150 | $id_i = $dbh->query("SELECT id_i FROM ".$esquemaadmin."i3geoadmin_identifica WHERE nome_i = '$idtemp'"); | 149 | $id_i = $dbh->query("SELECT id_i FROM ".$esquemaadmin."i3geoadmin_identifica WHERE nome_i = '$idtemp'"); |
151 | $id_i = $id_i->fetchAll(); | 150 | $id_i = $id_i->fetchAll(); |
152 | $id_i = $id_i[0]['id_i']; | 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 | $retorna = $id_i; | 153 | $retorna = $id_i; |
155 | } | 154 | } |
156 | $dbhw = null; | 155 | $dbhw = null; |
admin/php/mapas.php
1 | <?php | 1 | <?php |
2 | /* | 2 | /* |
3 | - Title: mapas.php | 3 | +Title: mapas.php |
4 | 4 | ||
5 | Funções utilizadas pelo editor do cadastro de mapas (links). | 5 | Funções utilizadas pelo editor do cadastro de mapas (links). |
6 | 6 | ||
@@ -56,12 +56,12 @@ error_reporting(0); | @@ -56,12 +56,12 @@ error_reporting(0); | ||
56 | switch (strtoupper($funcao)) | 56 | switch (strtoupper($funcao)) |
57 | { | 57 | { |
58 | /* | 58 | /* |
59 | - Note: | 59 | + Note: |
60 | 60 | ||
61 | Valores que o parâmetro &funcao pode receber. Os parâmetros devem ser enviados na requisição em AJAX. | 61 | Valores que o parâmetro &funcao pode receber. Os parâmetros devem ser enviados na requisição em AJAX. |
62 | */ | 62 | */ |
63 | /* | 63 | /* |
64 | - Valor: PEGAMAPAS | 64 | + Valor: PEGAMAPAS |
65 | 65 | ||
66 | Lista os links existentes | 66 | Lista os links existentes |
67 | 67 | ||
@@ -76,7 +76,7 @@ switch (strtoupper($funcao)) | @@ -76,7 +76,7 @@ switch (strtoupper($funcao)) | ||
76 | exit; | 76 | exit; |
77 | break; | 77 | break; |
78 | /* | 78 | /* |
79 | - Valor: PEGADADOSMAPA | 79 | + Valor: PEGADADOSMAPA |
80 | 80 | ||
81 | Lista os dados de um link | 81 | Lista os dados de um link |
82 | 82 | ||
@@ -94,7 +94,7 @@ switch (strtoupper($funcao)) | @@ -94,7 +94,7 @@ switch (strtoupper($funcao)) | ||
94 | exit; | 94 | exit; |
95 | break; | 95 | break; |
96 | /* | 96 | /* |
97 | - Valor: ALTERARMAPA | 97 | + Valor: ALTERARMAPA |
98 | 98 | ||
99 | Altera os dados de um link | 99 | Altera os dados de um link |
100 | 100 | ||
@@ -135,7 +135,7 @@ switch (strtoupper($funcao)) | @@ -135,7 +135,7 @@ switch (strtoupper($funcao)) | ||
135 | exit; | 135 | exit; |
136 | break; | 136 | break; |
137 | /* | 137 | /* |
138 | - Valor: EXCLUIRMAPA | 138 | + Valor: EXCLUIRMAPA |
139 | 139 | ||
140 | Exclui um link | 140 | Exclui um link |
141 | 141 | ||
@@ -152,7 +152,7 @@ switch (strtoupper($funcao)) | @@ -152,7 +152,7 @@ switch (strtoupper($funcao)) | ||
152 | exit; | 152 | exit; |
153 | break; | 153 | break; |
154 | /* | 154 | /* |
155 | - Valor: SALVAMAPFILE | 155 | + Valor: SALVAMAPFILE |
156 | 156 | ||
157 | Salva um mapfile no banco | 157 | Salva um mapfile no banco |
158 | 158 | ||
@@ -211,7 +211,7 @@ function salvaMapfile(){ | @@ -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 | function alterarMapa(){ | 216 | function alterarMapa(){ |
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; | 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,7 +235,7 @@ function alterarMapa(){ | ||
235 | $id = $dbh->query("SELECT * FROM ".$esquemaadmin."i3geoadmin_mapas WHERE nome_mapa = '$id_temp'"); | 235 | $id = $dbh->query("SELECT * FROM ".$esquemaadmin."i3geoadmin_mapas WHERE nome_mapa = '$id_temp'"); |
236 | $id = $id->fetchAll(); | 236 | $id = $id->fetchAll(); |
237 | $id = $id[0]['id_mapa']; | 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 | $retorna = $id; | 239 | $retorna = $id; |
240 | } | 240 | } |
241 | $dbhw = null; | 241 | $dbhw = null; |