]> git.llucax.com Git - mecon/meconlib.git/blobdiff - lib/MLIB/PDF/Tabla.php
Bug Fix en MLIB_PDF_Tabla. Faltaba inicializar una variable, lo que hacia fallar...
[mecon/meconlib.git] / lib / MLIB / PDF / Tabla.php
index 3934abd590b5ea5d6524c7d16e1111ec5232134d..b7d16d197846c955f0a2bbb88b060adff15e00d9 100644 (file)
@@ -290,49 +290,50 @@ class MLIB_PDF_Tabla extends MLIB_PDF_Contenido {
             {
                 $this->_newPage();               
                 $alto = $this->_marco->espacioDisponible;
-                
-                foreach ($repetir as $ii => $value) {
-                    $alto -= $repetir[$ii]['max'];
-                    for ($jj = 0; $jj < $this->_tabla->getColCount(); $jj++) {
-                        $estilo = $this->_obtenerEstiloCelda($ii, $jj);
 
-                        //Actuo por el colspan
-                        if (@$estilo['colspan']) {
-                            if ($estilo['colspan'] > $this->_tabla->getColCount()) {
-                                $estilo['colspan'] =
-                                    $this->_tabla->getColCount() - $jj;
+                if (@$repetir)
+                {
+                    foreach ($repetir as $ii => $value) {
+                        $alto -= $repetir[$ii]['max'];
+                        for ($jj = 0; $jj < $this->_tabla->getColCount(); $jj++) {
+                            $estilo = $this->_obtenerEstiloCelda($ii, $jj);
+
+                            //Actuo por el colspan
+                            if (@$estilo['colspan']) {
+                                if ($estilo['colspan'] > $this->_tabla->getColCount()) {
+                                    $estilo['colspan'] =
+                                        $this->_tabla->getColCount() - $jj;
+                                }
+                                $der = $attr2[$jj+$estilo['colspan']];
+                                $izq = $attr2[$jj];
+                            }
+                            else {
+                                $der = $attr2[$jj+1];
+                                $izq = $attr2[$jj];
                             }
-                            $der = $attr2[$jj+$estilo['colspan']];
-                            $izq = $attr2[$jj];
-                        }
-                        else {
-                           $der = $attr2[$jj+1];
-                           $izq = $attr2[$jj];
-                        }
 
-                        
-                        $this->_marco->addRectangle($izq, $alto, $der, 
-                                $alto+$repetir[$ii]['max'], @$estilo['fill'], 
-                                null, $orientacion);
-                        $alto1 = $alto + $repetir[$ii]['max'];
-                        foreach ($repetir[$ii][$jj] as $t) {
-                            $alto1 -= $estilo['alto_linea'];
 
-                            //Ubico el texto segun su alineacion
-                            $init = $this->_obtenerAlineacionTexto($ii, $jj, $t, $attr2,
-                                    $estilo);
-                            
-                            $this->_marco->addText($init, $alto1 + 2,
-                                    $t, $estilo, null, $orientacion);
-                        }
+                            $this->_marco->addRectangle($izq, $alto, $der, 
+                                    $alto+$repetir[$ii]['max'], @$estilo['fill'], 
+                                    null, $orientacion);
+                            $alto1 = $alto + $repetir[$ii]['max'];
+                            foreach ($repetir[$ii][$jj] as $t) {
+                                $alto1 -= $estilo['alto_linea'];
+
+                                //Ubico el texto segun su alineacion
+                                $init = $this->_obtenerAlineacionTexto($ii, $jj, $t, $attr2,
+                                        $estilo);
+
+                                $this->_marco->addText($init, $alto1 + 2,
+                                        $t, $estilo, null, $orientacion);
+                            }
 
-                        if (@$estilo['colspan']) {
-                            $jj += $estilo['colspan'] -1;
+                            if (@$estilo['colspan']) {
+                                $jj += $estilo['colspan'] -1;
+                            }
                         }
-                        
                     }
                 }
-                
             }
             
             $alto -= $max;