Commit 26fda42ed3f1ce7879cc6143266aee6a1818d355
1 parent
c6068252
Exists in
master
and in
7 other branches
--no commit message
Showing
1 changed file
with
17 additions
and
4 deletions
Show diff stats
ferramentas/saiku/esquemaxml.php
@@ -61,6 +61,20 @@ $c = $mapa->numlayers; | @@ -61,6 +61,20 @@ $c = $mapa->numlayers; | ||
61 | $codigo_tipo_regiao = ""; | 61 | $codigo_tipo_regiao = ""; |
62 | for ($i=0;$i < $c;++$i){ | 62 | for ($i=0;$i < $c;++$i){ |
63 | $l = $mapa->getlayer($i); | 63 | $l = $mapa->getlayer($i); |
64 | + //verifica o alias na conexao | ||
65 | + if (!empty($postgis_mapa)){ | ||
66 | + if ($l->connectiontype == MS_POSTGIS){ | ||
67 | + $lcon = $l->connection; | ||
68 | + if (($lcon == " ") || ($lcon == "") || (in_array($lcon,array_keys($postgis_mapa)))){ | ||
69 | + if(($lcon == " ") || ($lcon == "")) //para efeitos de compatibilidade | ||
70 | + {$l->set("connection",$postgis_mapa);} | ||
71 | + else{ | ||
72 | + $l->set("connection",$postgis_mapa[$lcon]); | ||
73 | + } | ||
74 | + } | ||
75 | + } | ||
76 | + } | ||
77 | + // | ||
64 | $registros = array(); | 78 | $registros = array(); |
65 | if($l->status == MS_DEFAULT && $l->getmetadata("METAESTAT_CODIGO_TIPO_REGIAO") != ""){ | 79 | if($l->status == MS_DEFAULT && $l->getmetadata("METAESTAT_CODIGO_TIPO_REGIAO") != ""){ |
66 | $codigo_tipo_regiao = $l->getmetadata("METAESTAT_CODIGO_TIPO_REGIAO"); | 80 | $codigo_tipo_regiao = $l->getmetadata("METAESTAT_CODIGO_TIPO_REGIAO"); |
@@ -80,6 +94,7 @@ for ($i=0;$i < $c;++$i){ | @@ -80,6 +94,7 @@ for ($i=0;$i < $c;++$i){ | ||
80 | "item" => $item, | 94 | "item" => $item, |
81 | "sql" => $reg | 95 | "sql" => $reg |
82 | ); | 96 | ); |
97 | + break; //mantem a primeira ocorrencia de regiao que possui selecao | ||
83 | } | 98 | } |
84 | else{ | 99 | else{ |
85 | $selecaoRegiao[$codigo_tipo_regiao] = ""; | 100 | $selecaoRegiao[$codigo_tipo_regiao] = ""; |
@@ -90,14 +105,12 @@ if($codigo_tipo_regiao == ""){ | @@ -90,14 +105,12 @@ if($codigo_tipo_regiao == ""){ | ||
90 | $regioes = $m->listaTipoRegiao(); | 105 | $regioes = $m->listaTipoRegiao(); |
91 | } | 106 | } |
92 | else{ | 107 | else{ |
93 | - $regioes[] = $m->listaTipoRegiao($codigo_tipo_regiao); | 108 | + $regioes = array($m->listaTipoRegiao($codigo_tipo_regiao)); |
94 | } | 109 | } |
95 | - | ||
96 | $regiao = ""; | 110 | $regiao = ""; |
97 | $item = ""; | 111 | $item = ""; |
98 | $registros = ""; | 112 | $registros = ""; |
99 | - | ||
100 | - | 113 | +//echo "<pre>";var_dump($regioes);exit; |
101 | $xml = "<Schema name='i3Geo Metaestat'>"; | 114 | $xml = "<Schema name='i3Geo Metaestat'>"; |
102 | //cria as dimensoes de tipo temporal | 115 | //cria as dimensoes de tipo temporal |
103 | $sqlAno = "select nu_ano from ".$saikuConfigDataSource['tabelaDimensaoTempo']." group by nu_ano order by nu_ano"; | 116 | $sqlAno = "select nu_ano from ".$saikuConfigDataSource['tabelaDimensaoTempo']." group by nu_ano order by nu_ano"; |