Commit 14e18472439ae6444fea67adb159bee02a723fe4
1 parent
8ad8c649
Exists in
master
and in
7 other branches
Removida coluna the_geom da string de select
Showing
1 changed file
with
8 additions
and
1 deletions
Show diff stats
admin/php/parsemapfile.php
@@ -259,6 +259,10 @@ function mapfile() | @@ -259,6 +259,10 @@ function mapfile() | ||
259 | $layer = $mapa->getlayerbyname($layer); | 259 | $layer = $mapa->getlayerbyname($layer); |
260 | $xml .= "<titulo>".$layer->getmetadata('tema')."</titulo>\n"; | 260 | $xml .= "<titulo>".$layer->getmetadata('tema')."</titulo>\n"; |
261 | $d = $layer->data; | 261 | $d = $layer->data; |
262 | + if (@$layer->open() == MS_SUCCESS) | ||
263 | + {$colunas = implode(",",$layer->getItems());} | ||
264 | + else | ||
265 | + {$colunas = "*";} | ||
262 | $ct = $objcontype[$layer->connectiontype]; | 266 | $ct = $objcontype[$layer->connectiontype]; |
263 | $tagLegenda = "parsemapfile.php?id=".$codigoLayer."&layername=".$layer->name."&tipoparse=legenda"; | 267 | $tagLegenda = "parsemapfile.php?id=".$codigoLayer."&layername=".$layer->name."&tipoparse=legenda"; |
264 | $nomeLayer = $layer->name; | 268 | $nomeLayer = $layer->name; |
@@ -314,7 +318,10 @@ function mapfile() | @@ -314,7 +318,10 @@ function mapfile() | ||
314 | $xml .= "</connection>\n"; | 318 | $xml .= "</connection>\n"; |
315 | $d = explode("(",$d); | 319 | $d = explode("(",$d); |
316 | $d = explode(")",$d[1]); | 320 | $d = explode(")",$d[1]); |
317 | - $xml .= "<select>$d[0]</select>\n"; | 321 | + $dstring = $d[0]; |
322 | + $dstring = str_replace("the_geom","",$dstring); | ||
323 | + $dstring = str_replace("*",$colunas,$dstring); | ||
324 | + $xml .= "<select>$dstring</select>\n"; | ||
318 | $string = preg_replace('/.*from\s*(.+).*/i', '\1', $d[0]); | 325 | $string = preg_replace('/.*from\s*(.+).*/i', '\1', $d[0]); |
319 | $s = explode("WHERE",$string); | 326 | $s = explode("WHERE",$string); |
320 | if(count($s) == 1) | 327 | if(count($s) == 1) |