Commit 04a4e81321635c5dece63bc85889fb6979c815a6

Authored by Edmar Moretti
1 parent 0e632b47

Correção na definição do título da camada no plugin parametrossql

ferramentas/parametrossql/exec.php
@@ -57,6 +57,7 @@ switch (strtoupper($funcao)) @@ -57,6 +57,7 @@ switch (strtoupper($funcao))
57 */ 57 */
58 case "APLICAR": 58 case "APLICAR":
59 $valores = $_GET["valores"]; 59 $valores = $_GET["valores"];
  60 + $titulos = $_GET["titulos"];
60 $map = ms_newMapObj($map_file); 61 $map = ms_newMapObj($map_file);
61 //pega o layer 62 //pega o layer
62 $layer = $map->getlayerbyname($tema); 63 $layer = $map->getlayerbyname($tema);
@@ -100,7 +101,7 @@ switch (strtoupper($funcao)) @@ -100,7 +101,7 @@ switch (strtoupper($funcao))
100 } 101 }
101 $layer->set("status",MS_DEFAULT); 102 $layer->set("status",MS_DEFAULT);
102 $layer->setmetadata("PLUGINI3GEO",'{"plugin":"parametrossql","ativo":"sim"}'); 103 $layer->setmetadata("PLUGINI3GEO",'{"plugin":"parametrossql","ativo":"sim"}');
103 - $layer->setmetadata("TEMA",$layer1->getmetadata("TEMA")." - ".implode(",",$valores)); 104 + $layer->setmetadata("TEMA",$layer1->getmetadata("TEMA")." - ".$titulos);
104 //$layer->set("name","plugin".nomeRandomico()); 105 //$layer->set("name","plugin".nomeRandomico());
105 $layer->setmetadata("nomeoriginal",$layer1->name); 106 $layer->setmetadata("nomeoriginal",$layer1->name);
106 if (connection_aborted()){ 107 if (connection_aborted()){
ferramentas/parametrossql/index.js
@@ -309,18 +309,20 @@ i3GEOF.parametrossql = { @@ -309,18 +309,20 @@ i3GEOF.parametrossql = {
309 }, 309 },
310 aplicar: function(camada){ 310 aplicar: function(camada){
311 var temp, fim,cp,p,onde = $i("i3GEOFparametrosSQLForm"), 311 var temp, fim,cp,p,onde = $i("i3GEOFparametrosSQLForm"),
312 - campos,n,i,chaves = [], valores = []; 312 + campos,n,i,chaves = [], valores = [], titulos = [];
313 campos = onde.getElementsByTagName("input"); 313 campos = onde.getElementsByTagName("input");
314 n = campos.length; 314 n = campos.length;
315 for (i = 0; i<n; i++) { 315 for (i = 0; i<n; i++) {
316 chaves.push(campos[i].name); 316 chaves.push(campos[i].name);
317 valores.push(campos[i].value); 317 valores.push(campos[i].value);
  318 + titulos.push(campos[i].options[campos[i].selectedIndex].text);
318 } 319 }
319 campos = onde.getElementsByTagName("select"); 320 campos = onde.getElementsByTagName("select");
320 n = campos.length; 321 n = campos.length;
321 for (i = 0; i<n; i++) { 322 for (i = 0; i<n; i++) {
322 chaves.push(campos[i].name); 323 chaves.push(campos[i].name);
323 valores.push(campos[i].value); 324 valores.push(campos[i].value);
  325 + titulos.push(campos[i].options[campos[i].selectedIndex].text);
324 } 326 }
325 //verifica os objetos pois essa funcao pode ter sido chamada do mashup 327 //verifica os objetos pois essa funcao pode ter sido chamada do mashup
326 if(typeof i3geoOL != 'undefined' || typeof i3GeoMap != 'undefined'){ 328 if(typeof i3geoOL != 'undefined' || typeof i3GeoMap != 'undefined'){
@@ -333,6 +335,7 @@ i3GEOF.parametrossql = { @@ -333,6 +335,7 @@ i3GEOF.parametrossql = {
333 + "&funcao=aplicar" 335 + "&funcao=aplicar"
334 + "&tema=" + camada 336 + "&tema=" + camada
335 + "&chaves=" + chaves.join(",") 337 + "&chaves=" + chaves.join(",")
  338 + + "&titulos=" + titulos.join(",")
336 + "&valores=" + valores.join(","); 339 + "&valores=" + valores.join(",");
337 cp = new cpaint(); 340 cp = new cpaint();
338 cp.set_response_type("JSON"); 341 cp.set_response_type("JSON");