From 2b4665d1c33cc4f5e73ac8bf3eefdea9f1d41391 Mon Sep 17 00:00:00 2001 From: Edmar Moretti Date: Fri, 3 Jan 2014 19:05:27 +0000 Subject: [PATCH] --- ferramentas/saiku/esquemaxml.php | 31 ++++++++++++++++++++++++++++++- 1 file changed, 30 insertions(+), 1 deletion(-) diff --git a/ferramentas/saiku/esquemaxml.php b/ferramentas/saiku/esquemaxml.php index d7bf459..96bfc80 100644 --- a/ferramentas/saiku/esquemaxml.php +++ b/ferramentas/saiku/esquemaxml.php @@ -13,9 +13,20 @@ foreach($regioes as $regiao){ } exit; */ + +//cria as dimensoes de tipo temporal +$sqlAno = "select nu_ano from i3geo_metaestat.dim_tempo group by nu_ano order by nu_ano"; +$xml .= " + + + $sqlAno + + + +"; foreach($regioes as $regiao){ $caminho = $m->hierarquiaPath($regiao["codigo_tipo_regiao"]); - // //verifica se a regiao tem hierarquia if(empty($caminho)){ @@ -138,6 +149,24 @@ foreach($tbs as $tb){ "; + //verifica as dimensoes do tipo tempo + $dimTempo = array(); + foreach($tb as $medida){ + $parametros = $m->listaParametro($medida["id_medida_variavel"],"","",$apenasTempo=true,$ordenaPeloPai=false); + foreach($parametros as $parametro){ + if($parametro["tipo"] == 1){ + $VirtualCubeDimension[] = " + + "; + $dimTempo[] = " + + "; + } + } + //echo "
";var_dump($parametro);exit;
+	}
+	$xml .= implode(" ",array_unique($dimTempo));
+
 	//inclui cada elemento em medida
 	foreach($tb as $medida){
 		$agregador = "sum";
--
libgit2 0.21.2