From fafac959ff86556b9beb9837dc053171987dc024 Mon Sep 17 00:00:00 2001 From: patrik2020 Date: Sun, 26 Jun 2022 10:27:45 +0200 Subject: [PATCH] Latex za izvoze: Multitabele: ureditev delovanja izvoza v rtf --- .../Analize/AnalizaMultiCrosstab.php | 8 ++++---- .../latexclasses/class.LatexAnalysisElement.php | 16 +++++++++++++--- 2 files changed, 17 insertions(+), 7 deletions(-) diff --git a/admin/survey/export/latexclasses/Analize/AnalizaMultiCrosstab.php b/admin/survey/export/latexclasses/Analize/AnalizaMultiCrosstab.php index 156a3c2c0..e3f1a8889 100644 --- a/admin/survey/export/latexclasses/Analize/AnalizaMultiCrosstab.php +++ b/admin/survey/export/latexclasses/Analize/AnalizaMultiCrosstab.php @@ -512,7 +512,7 @@ class AnalizaMultiCrosstab extends LatexAnalysisElement { $tabela .= "\\cline{".($colspan+1)."-".$steviloStolpcevParameterTabular."}"; //prekinjena horizontalna vrstica na vrhu tabele } - $tabela .= $this->MultiColCellLatex($colspan, '', 1); //prazne celice v prvi vrstici + $tabela .= $this->MultiColCellLatex($colspan, '', 1, $export_format); //prazne celice v prvi vrstici //$tabela .= $this->tableRow($prvaVrsticaVert, 1, 0, 0, $steviloPodstolpcevV1); //izpis prve vrstice tabele $tabela .= $this->tableRow($prvaVrsticaVert, 1, 0, 0, '', $export_format, $steviloPodstolpcevV1); //izpis prve vrstice tabele @@ -523,7 +523,7 @@ class AnalizaMultiCrosstab extends LatexAnalysisElement { //prekinjena horizontalna vrstica po prvi vrstici - konec if(count($drugaVrsticaVert)){ - $tabela .= $this->MultiColCellLatex($colspan, '', 1); //prazne celice v drugi vrstici + $tabela .= $this->MultiColCellLatex($colspan, '', 1, $export_format); //prazne celice v drugi vrstici if(count($steviloPodstolpcevV2)){ //$tabela .= $this->tableRow($drugaVrsticaVert, 1, 0, 0, $steviloPodstolpcevV2); $tabela .= $this->tableRow($drugaVrsticaVert, 1, 0, 0, '', $export_format, $steviloPodstolpcevV2); @@ -539,7 +539,7 @@ class AnalizaMultiCrosstab extends LatexAnalysisElement { } if(count($tretjaVrsticaVert)){ - $tabela .= $this->MultiColCellLatex($colspan, '', 1); //prazne celice v drugi vrstici + $tabela .= $this->MultiColCellLatex($colspan, '', 1, $export_format); //prazne celice v drugi vrstici if(count($steviloPodstolpcevV3)){ //$tabela .= $this->tableRow($tretjaVrsticaVert, 1, 0, 0, $steviloPodstolpcevV3); $tabela .= $this->tableRow($tretjaVrsticaVert, 1, 0, 0, '', $export_format, $steviloPodstolpcevV3); @@ -552,7 +552,7 @@ class AnalizaMultiCrosstab extends LatexAnalysisElement { } if(count($cetrtaVrsticaVert)){ - $tabela .= $this->MultiColCellLatex($colspan, '', 1); //prazne celice v drugi vrstici + $tabela .= $this->MultiColCellLatex($colspan, '', 1, $export_format); //prazne celice v drugi vrstici $tabela .= $this->tableRow($cetrtaVrsticaVert, 1); } diff --git a/admin/survey/export/latexclasses/class.LatexAnalysisElement.php b/admin/survey/export/latexclasses/class.LatexAnalysisElement.php index d30024d1a..a5b57be12 100644 --- a/admin/survey/export/latexclasses/class.LatexAnalysisElement.php +++ b/admin/survey/export/latexclasses/class.LatexAnalysisElement.php @@ -1516,9 +1516,10 @@ class LatexAnalysisElement{ } //funkcija skrbi za izpis multicol celice - function MultiColCellLatex($steviloVmesnihStolpcevPodvrstic=null, $text='', $odZacetka=0){ + function MultiColCellLatex($steviloVmesnihStolpcevPodvrstic=null, $text='', $odZacetka=0, $export_format=null){ $tabela = ''; //echo "steviloVmesnihStolpcevPodvrstic: $steviloVmesnihStolpcevPodvrstic
"; + //echo "format: $export_format
"; if($steviloVmesnihStolpcevPodvrstic==1){ //ce je 1, ne sme biti multicolumn{1}, saj so drugace tezave z izpisom $tabela .= " & ".$text." "; }else{ @@ -1526,10 +1527,19 @@ class LatexAnalysisElement{ $steviloArrayrulewidth = ($steviloVmesnihStolpcevPodvrstic-1); if($odZacetka==0){ //$tabela .= " & \multicolumn{".$steviloVmesnihStolpcevPodvrstic."}{X|}{";//zacetek multicol - $tabela .= " & \multicolumn{".$steviloVmesnihStolpcevPodvrstic."}{>{\hsize=\dimexpr".$steviloVmesnihStolpcevPodvrstic."\hsize+".$steviloTabColSep."\\tabcolsep+".$steviloArrayrulewidth."\arrayrulewidth\\relax}C|}{";//zacetek multicol + if($export_format=='pdf'){ + $tabela .= " & \multicolumn{".$steviloVmesnihStolpcevPodvrstic."}{>{\hsize=\dimexpr".$steviloVmesnihStolpcevPodvrstic."\hsize+".$steviloTabColSep."\\tabcolsep+".$steviloArrayrulewidth."\arrayrulewidth\\relax}C|}{";//zacetek multicol + }elseif($export_format=='rtf'){ + $tabela .= " & \multicolumn{".$steviloVmesnihStolpcevPodvrstic."}{C|}{";//zacetek multicol + } + }else{ //$tabela .= " \multicolumn{".$steviloVmesnihStolpcevPodvrstic."}{X|}{";//zacetek multicol - $tabela .= " \multicolumn{".$steviloVmesnihStolpcevPodvrstic."}{>{\hsize=\dimexpr".$steviloVmesnihStolpcevPodvrstic."\hsize+".$steviloTabColSep."\\tabcolsep+".$steviloArrayrulewidth."\arrayrulewidth\\relax}C|}{";//zacetek multicol + if($export_format=='pdf'){ + $tabela .= " \multicolumn{".$steviloVmesnihStolpcevPodvrstic."}{>{\hsize=\dimexpr".$steviloVmesnihStolpcevPodvrstic."\hsize+".$steviloTabColSep."\\tabcolsep+".$steviloArrayrulewidth."\arrayrulewidth\\relax}C|}{";//zacetek multicol + }elseif($export_format=='rtf'){ + $tabela .= " \multicolumn{".$steviloVmesnihStolpcevPodvrstic."}{C|}{";//zacetek multicol + } } $tabela .= $text; if($odZacetka==0){