Commit 2decabb79bc4e9704987bd6fd7813906844215da
1 parent
09e11b93
Exists in
master
and in
7 other branches
-
Showing
2 changed files
with
19 additions
and
18 deletions
Show diff stats
admin/js/editormapfile.js
| @@ -662,7 +662,7 @@ Altera um mapfile conforme o editor específico de uma característi | @@ -662,7 +662,7 @@ Altera um mapfile conforme o editor específico de uma característi | ||
| 662 | */ | 662 | */ |
| 663 | function salvarDadosEditor(tipo,codigoMap,codigoLayer,indiceClasse,indiceEstilo,testar) | 663 | function salvarDadosEditor(tipo,codigoMap,codigoLayer,indiceClasse,indiceEstilo,testar) |
| 664 | { | 664 | { |
| 665 | - var campos = [], par = "", prog = "", temp, re; | 665 | + var callback,sUrl,i,valor,teste1, valorTeste,campos = [], par = "", prog = "", temp; |
| 666 | if(arguments.length < 6){testar = false;} | 666 | if(arguments.length < 6){testar = false;} |
| 667 | if(tipo == "grupousr"){ | 667 | if(tipo == "grupousr"){ |
| 668 | campos = []; | 668 | campos = []; |
| @@ -692,9 +692,9 @@ function salvarDadosEditor(tipo,codigoMap,codigoLayer,indiceClasse,indiceEstilo, | @@ -692,9 +692,9 @@ function salvarDadosEditor(tipo,codigoMap,codigoLayer,indiceClasse,indiceEstilo, | ||
| 692 | // | 692 | // |
| 693 | //validação | 693 | //validação |
| 694 | // | 694 | // |
| 695 | - var valorTeste = $i("extensao").value; | 695 | + valorTeste = $i("extensao").value; |
| 696 | if(valorTeste != ""){ | 696 | if(valorTeste != ""){ |
| 697 | - var teste1 = valorTeste.split(" "); | 697 | + teste1 = valorTeste.split(" "); |
| 698 | if(teste1.length != 4) | 698 | if(teste1.length != 4) |
| 699 | {alert("Sao necessarios 4 valores em extensao");return;} | 699 | {alert("Sao necessarios 4 valores em extensao");return;} |
| 700 | if(teste1[0]*1 > teste1[2]*1) | 700 | if(teste1[0]*1 > teste1[2]*1) |
| @@ -702,9 +702,9 @@ function salvarDadosEditor(tipo,codigoMap,codigoLayer,indiceClasse,indiceEstilo, | @@ -702,9 +702,9 @@ function salvarDadosEditor(tipo,codigoMap,codigoLayer,indiceClasse,indiceEstilo, | ||
| 702 | if(teste1[1]*1 > teste1[3]*1) | 702 | if(teste1[1]*1 > teste1[3]*1) |
| 703 | {alert("ymin maior que ymax em extensao");return;} | 703 | {alert("ymin maior que ymax em extensao");return;} |
| 704 | } | 704 | } |
| 705 | - var valorTeste = $i("escala").value; | 705 | + valorTeste = $i("escala").value; |
| 706 | if(valorTeste != ""){ | 706 | if(valorTeste != ""){ |
| 707 | - var teste1 = valorTeste * 1; | 707 | + teste1 = valorTeste * 1; |
| 708 | if(teste1 <= 0){ | 708 | if(teste1 <= 0){ |
| 709 | alert("Valor de escala incorreto"); | 709 | alert("Valor de escala incorreto"); |
| 710 | return; | 710 | return; |
| @@ -720,7 +720,7 @@ function salvarDadosEditor(tipo,codigoMap,codigoLayer,indiceClasse,indiceEstilo, | @@ -720,7 +720,7 @@ function salvarDadosEditor(tipo,codigoMap,codigoLayer,indiceClasse,indiceEstilo, | ||
| 720 | par = "&codigoMap="+codigoMap+"&codigoLayer="+codigoLayer; | 720 | par = "&codigoMap="+codigoMap+"&codigoLayer="+codigoLayer; |
| 721 | prog = "../php/editormapfile.php?funcao=alterarConexao"; | 721 | prog = "../php/editormapfile.php?funcao=alterarConexao"; |
| 722 | //codifica o valor de data | 722 | //codifica o valor de data |
| 723 | - var temp = ""; | 723 | + temp = ""; |
| 724 | if($i("data") && $i("data").value != ""){ | 724 | if($i("data") && $i("data").value != ""){ |
| 725 | temp = i3GEO.util.base64encode($i("data").value); | 725 | temp = i3GEO.util.base64encode($i("data").value); |
| 726 | } | 726 | } |
| @@ -755,9 +755,9 @@ function salvarDadosEditor(tipo,codigoMap,codigoLayer,indiceClasse,indiceEstilo, | @@ -755,9 +755,9 @@ function salvarDadosEditor(tipo,codigoMap,codigoLayer,indiceClasse,indiceEstilo, | ||
| 755 | } | 755 | } |
| 756 | prog += "&testar="+testar; | 756 | prog += "&testar="+testar; |
| 757 | try{ | 757 | try{ |
| 758 | - for (var i=0;i<campos.length;i++){ | 758 | + for (i=0;i<campos.length;i++){ |
| 759 | if($i(campos[i])){ | 759 | if($i(campos[i])){ |
| 760 | - var valor = ""; | 760 | + valor = ""; |
| 761 | if($i(campos[i]).disabled === false){ | 761 | if($i(campos[i]).disabled === false){ |
| 762 | valor = $i(campos[i]).value; | 762 | valor = $i(campos[i]).value; |
| 763 | } | 763 | } |
| @@ -767,8 +767,8 @@ function salvarDadosEditor(tipo,codigoMap,codigoLayer,indiceClasse,indiceEstilo, | @@ -767,8 +767,8 @@ function salvarDadosEditor(tipo,codigoMap,codigoLayer,indiceClasse,indiceEstilo, | ||
| 767 | }catch(e){alert(e);} | 767 | }catch(e){alert(e);} |
| 768 | core_carregando("ativa"); | 768 | core_carregando("ativa"); |
| 769 | core_carregando(" gravando o registro do layer= "+codigoLayer); | 769 | core_carregando(" gravando o registro do layer= "+codigoLayer); |
| 770 | - var sUrl = prog+par; | ||
| 771 | - var callback = { | 770 | + sUrl = prog+par; |
| 771 | + callback = { | ||
| 772 | success:function(o) { | 772 | success:function(o) { |
| 773 | try{ | 773 | try{ |
| 774 | if(YAHOO.lang.JSON.parse(o.responseText) == "erro") { | 774 | if(YAHOO.lang.JSON.parse(o.responseText) == "erro") { |
admin/js/editormapfile_conexao.js
| @@ -17,13 +17,15 @@ function editorDados(codigoMap,codigoLayer) | @@ -17,13 +17,15 @@ function editorDados(codigoMap,codigoLayer) | ||
| 17 | 17 | ||
| 18 | function montaEditorDados(dados) | 18 | function montaEditorDados(dados) |
| 19 | { | 19 | { |
| 20 | - var temp = function(){ | ||
| 21 | - salvarDadosEditor('conexao',dados.codigoMap,dados.codigoLayer,false); | ||
| 22 | - }; | ||
| 23 | //nao use modal aqui!!!! | 20 | //nao use modal aqui!!!! |
| 24 | - core_montaEditor(temp,"500px","650px","","Conexão",false,true,false); | 21 | + core_montaEditor( |
| 22 | + function(){ | ||
| 23 | + salvarDadosEditor('conexao',dados.codigoMap,dados.codigoLayer,false); | ||
| 24 | + }, | ||
| 25 | + "500px","650px","","Conexão",false,true,false | ||
| 26 | + ); | ||
| 25 | 27 | ||
| 26 | - var d = [],valor = "",idsForms = ["connection","data","tileitem","tileindex","type","tipooriginal","metaestat_id_medida_variavel"], | 28 | + var ins = "",idsForms = ["connection","data","tileitem","tileindex","type","tipooriginal","metaestat_id_medida_variavel"], |
| 27 | idsMetaestat = ["connection","data","tileitem","tileindex","tipooriginal"], | 29 | idsMetaestat = ["connection","data","tileitem","tileindex","tipooriginal"], |
| 28 | limg = i3GEO.configura.locaplic+"/imagens/ic_zoom.png", | 30 | limg = i3GEO.configura.locaplic+"/imagens/ic_zoom.png", |
| 29 | param = { | 31 | param = { |
| @@ -60,7 +62,6 @@ function montaEditorDados(dados) | @@ -60,7 +62,6 @@ function montaEditorDados(dados) | ||
| 60 | titulo:"Tipo de representação (tipooriginal) - para temas do tipo WMS",id:"",value:dados.tipooriginal,tipo:"text",div:"<div id=cTipoOriginal ></div>"} | 62 | titulo:"Tipo de representação (tipooriginal) - para temas do tipo WMS",id:"",value:dados.tipooriginal,tipo:"text",div:"<div id=cTipoOriginal ></div>"} |
| 61 | ] | 63 | ] |
| 62 | }; | 64 | }; |
| 63 | - var ins = ""; | ||
| 64 | 65 | ||
| 65 | if(dados.colunas != "" && dados.colunas != undefined){ | 66 | if(dados.colunas != "" && dados.colunas != undefined){ |
| 66 | ins += "<p>O layer possui as seguintes colunas na tabela de atributos: "; | 67 | ins += "<p>O layer possui as seguintes colunas na tabela de atributos: "; |
| @@ -149,8 +150,8 @@ function montaEditorDados(dados) | @@ -149,8 +150,8 @@ function montaEditorDados(dados) | ||
| 149 | }; | 150 | }; |
| 150 | $i("metaestat").onchange = function(){ | 151 | $i("metaestat").onchange = function(){ |
| 151 | core_desativaforms(idsMetaestat); | 152 | core_desativaforms(idsMetaestat); |
| 152 | - valor = $i("metaestat").value, | ||
| 153 | - d = []; | 153 | + var valor = $i("metaestat").value, |
| 154 | + d; | ||
| 154 | if(valor === "SIM"){ | 155 | if(valor === "SIM"){ |
| 155 | d = ["metaestat_id_medida_variavel"]; | 156 | d = ["metaestat_id_medida_variavel"]; |
| 156 | } | 157 | } |