summaryrefslogtreecommitdiffstats
path: root/admin/survey/export/latexclasses/Analize/AnalizaFreq.php
diff options
context:
space:
mode:
Diffstat (limited to 'admin/survey/export/latexclasses/Analize/AnalizaFreq.php')
-rw-r--r--admin/survey/export/latexclasses/Analize/AnalizaFreq.php85
1 files changed, 43 insertions, 42 deletions
diff --git a/admin/survey/export/latexclasses/Analize/AnalizaFreq.php b/admin/survey/export/latexclasses/Analize/AnalizaFreq.php
index 8945266..8926858 100644
--- a/admin/survey/export/latexclasses/Analize/AnalizaFreq.php
+++ b/admin/survey/export/latexclasses/Analize/AnalizaFreq.php
@@ -8,39 +8,39 @@
include_once('../exportclases/class.pdfIzvozAnalizaFunctions.php');
require_once('../exportclases/class.enka.pdf.php'); */
- define("ALLOW_HIDE_ZERRO_REGULAR", false); // omogočimo delovanje prikazovanja/skrivanja ničelnih vnosti za navadne odgovore
- define("ALLOW_HIDE_ZERRO_MISSING", true); // omogočimo delovanje prikazovanja/skrivanja ničelnih vnosti za missinge
+ if(!defined("ALLOW_HIDE_ZERRO_REGULAR"))define("ALLOW_HIDE_ZERRO_REGULAR", false); // omogočimo delovanje prikazovanja/skrivanja ničelnih vnosti za navadne odgovore
+ if(!defined("ALLOW_HIDE_ZERRO_MISSING"))define("ALLOW_HIDE_ZERRO_MISSING", true); // omogočimo delovanje prikazovanja/skrivanja ničelnih vnosti za missinge
- define("NUM_DIGIT_AVERAGE", 2); // stevilo digitalnih mest za povprecje
- define("NUM_DIGIT_DEVIATION", 2); // stevilo digitalnih mest za povprecje
+ if(!defined("NUM_DIGIT_AVERAGE"))define("NUM_DIGIT_AVERAGE", 2); // stevilo digitalnih mest za povprecje
+ if(!defined("NUM_DIGIT_DEVIATION"))define("NUM_DIGIT_DEVIATION", 2); // stevilo digitalnih mest za povprecje
- define("M_ANALIZA_DESCRIPTOR", "descriptor");
- define("M_ANALIZA_FREQUENCY", "frequency");
+ if(!defined("M_ANALIZA_DESCRIPTOR"))define("M_ANALIZA_DESCRIPTOR", "descriptor");
+ if(!defined("M_ANALIZA_FREQUENCY"))define("M_ANALIZA_FREQUENCY", "frequency");
- define("FNT_FREESERIF", "freeserif");
- define("FNT_FREESANS", "freesans");
- define("FNT_HELVETICA", "helvetica");
+ if(!defined("FNT_FREESERIF"))define("FNT_FREESERIF", "freeserif");
+ if(!defined("FNT_FREESANS"))define("FNT_FREESANS", "freesans");
+ if(!defined("FNT_HELVETICA"))define("FNT_HELVETICA", "helvetica");
- define("FNT_MAIN_TEXT", FNT_FREESANS);
- define("FNT_QUESTION_TEXT", FNT_FREESANS);
- define("FNT_HEADER_TEXT", FNT_FREESANS);
+ if(!defined("FNT_MAIN_TEXT"))define("FNT_MAIN_TEXT", FNT_FREESANS);
+ if(!defined("FNT_QUESTION_TEXT"))define("FNT_QUESTION_TEXT", FNT_FREESANS);
+ if(!defined("FNT_HEADER_TEXT"))define("FNT_HEADER_TEXT", FNT_FREESANS);
- define("FNT_MAIN_SIZE", 10);
- define("FNT_QUESTION_SIZE", 9);
- define("FNT_HEADER_SIZE", 10);
+ if(!defined("FNT_MAIN_SIZE"))define("FNT_MAIN_SIZE", 10);
+ if(!defined("FNT_QUESTION_SIZE"))define("FNT_QUESTION_SIZE", 9);
+ if(!defined("FNT_HEADER_SIZE"))define("FNT_HEADER_SIZE", 10);
- define("RADIO_BTN_SIZE", 3);
- define("CHCK_BTN_SIZE", 3);
- define("LINE_BREAK", 6);
+ if(!defined("RADIO_BTN_SIZE"))define("RADIO_BTN_SIZE", 3);
+ if(!defined("CHCK_BTN_SIZE"))define("CHCK_BTN_SIZE", 3);
+ if(!defined("LINE_BREAK"))define("LINE_BREAK", 6);
- define ('PDF_MARGIN_HEADER', 8);
- define ('PDF_MARGIN_FOOTER', 12);
- define ('PDF_MARGIN_TOP', 18);
- define ('PDF_MARGIN_BOTTOM', 18);
- define ('PDF_MARGIN_LEFT', 15);
- define ('PDF_MARGIN_RIGHT', 15);
+ if(!defined("PDF_MARGIN_HEADER"))define ('PDF_MARGIN_HEADER', 8);
+ if(!defined("PDF_MARGIN_FOOTER"))define ('PDF_MARGIN_FOOTER', 12);
+ if(!defined("PDF_MARGIN_TOP"))define ('PDF_MARGIN_TOP', 18);
+ if(!defined("PDF_MARGIN_BOTTOM"))define ('PDF_MARGIN_BOTTOM', 18);
+ if(!defined("PDF_MARGIN_LEFT"))define ('PDF_MARGIN_LEFT', 15);
+ if(!defined("PDF_MARGIN_RIGHT"))define ('PDF_MARGIN_RIGHT', 15);
- define ('MEJA_DOLZINA_VPRASANJA', 132);
+ if(!defined("MEJA_DOLZINA_VPRASANJA"))define ('MEJA_DOLZINA_VPRASANJA', 132);
/**
* @desc Class za generacijo izvoza v Latex
@@ -69,7 +69,6 @@ class AnalizaFreq extends LatexAnalysisElement{
protected $texBigSkip = '\bigskip';
protected $spaceBetweenTables = ' \newline \vspace*{1 cm} \newline';
-
/**
* @desc konstruktor
*/
@@ -169,7 +168,9 @@ class AnalizaFreq extends LatexAnalysisElement{
case 5:
# nagovor
//pdfIzvozAnalizaSums::sumNagovor($spid,'freq');
- $tabela .= $this->sumNagovor($spid,'freq');
+ //$tabela .= $this->sumNagovor($spid,'freq');
+ $analizaSums = new AnalizaSums;
+ $tabela .= $analizaSums->sumNagovor($spid,'freq');
//$tabela .= $this->spaceBetweenTables;
break;
}
@@ -212,7 +213,7 @@ class AnalizaFreq extends LatexAnalysisElement{
//Priprava parametrov za tabelo - konec
//zacetek latex tabele z obrobo za prvo tabelo
- $pdfTable = 'tabularx';
+ $pdfTable = 'xltabular';
$rtfTable = 'tabular';
$pdfTableWidth = 1;
$rtfTableWidth = 1;
@@ -228,14 +229,14 @@ class AnalizaFreq extends LatexAnalysisElement{
/*Naslovni vrstici tabele*/
//prva vrstica tabele
- //$tex .= $this->encodeText($spremenljivka['variable'])." & \multicolumn{".$steviloOstalihStolpcev."}{X|}{".$this->encodeText($spremenljivka['naslov'])."} ".$this->texNewLine;
- //$tex .= $this->encodeText($spremenljivka['variable'])." & \multicolumn{".$steviloOstalihStolpcev."}{l|}{".$this->encodeText($spremenljivka['naslov'])."} ".$this->texNewLine;
- //$tex .= $this->encodeText($spremenljivka['variable']).' & \multicolumn{'.$steviloOstalihStolpcev.'}{>{\hsize=\dimexpr '.($steviloOstalihStolpcev+1).'\hsize + '.($steviloOstalihStolpcev+1).'\tabcolsep + \arrayrulewidth}X|}{'.$this->encodeText($spremenljivka['naslov']).'} '.$this->texNewLine;
- $dolzinaVprasanja = strlen($this->encodeText($spremenljivka['naslov']));
- if($dolzinaVprasanja > MEJA_DOLZINA_VPRASANJA){ //ce je dolzina vprasanja daljsa od ene vrstice v tabeli
- $tex .= $this->encodeText($spremenljivka['variable'])." & \multicolumn{".$steviloOstalihStolpcev."}{X|}{".$this->encodeText($spremenljivka['naslov'])."} ".$this->texNewLine;
+ //$tex .= LatexDocument::encodeText($spremenljivka['variable'])." & \multicolumn{".$steviloOstalihStolpcev."}{X|}{".LatexDocument::encodeText($spremenljivka['naslov'])."} ".$this->texNewLine;
+ //$tex .= LatexDocument::encodeText($spremenljivka['variable'])." & \multicolumn{".$steviloOstalihStolpcev."}{l|}{".LatexDocument::encodeText($spremenljivka['naslov'])."} ".$this->texNewLine;
+ //$tex .= LatexDocument::encodeText($spremenljivka['variable']).' & \multicolumn{'.$steviloOstalihStolpcev.'}{>{\hsize=\dimexpr '.($steviloOstalihStolpcev+1).'\hsize + '.($steviloOstalihStolpcev+1).'\tabcolsep + \arrayrulewidth}X|}{'.LatexDocument::encodeText($spremenljivka['naslov']).'} '.$this->texNewLine;
+ $dolzinaVprasanja = strlen(LatexDocument::encodeText($spremenljivka['naslov']));
+ if($dolzinaVprasanja > MEJA_DOLZINA_VPRASANJA){ //ce je dolzina vprasanja daljsa od ene vrstice v tabeli
+ $tex .= LatexDocument::encodeText($spremenljivka['variable'])." & \multicolumn{".$steviloOstalihStolpcev."}{X|}{".LatexDocument::encodeText($spremenljivka['naslov'])."} ".$this->texNewLine;
}else{
- $tex .= $this->encodeText($spremenljivka['variable'])." & \multicolumn{".$steviloOstalihStolpcev."}{l|}{".$this->encodeText($spremenljivka['naslov'])."} ".$this->texNewLine;
+ $tex .= LatexDocument::encodeText($spremenljivka['variable'])." & \multicolumn{".$steviloOstalihStolpcev."}{l|}{".LatexDocument::encodeText($spremenljivka['naslov'])."} ".$this->texNewLine;
}
@@ -273,9 +274,9 @@ class AnalizaFreq extends LatexAnalysisElement{
$maxAnswer = (SurveyDataSettingProfiles :: getSetting('numOpenAnswers') > 0) ? SurveyDataSettingProfiles :: getSetting('numOpenAnswers') : 30;
$counter = 0;
$_kumulativa = 0;
- //SurveyAnalysis::$_FREQUENCYS[$_sequence]
- if (count(SurveyAnalysis::$_FREQUENCYS[$_sequence]['valid'])> 0 ) {
- foreach (SurveyAnalysis::$_FREQUENCYS[$_sequence]['valid'] AS $vkey => $vAnswer) {
+ $surveyAnalisysFreqValid = isset(SurveyAnalysis::$_FREQUENCYS[$_sequence]['valid'])?SurveyAnalysis::$_FREQUENCYS[$_sequence]['valid']:0;
+ if (is_countable($surveyAnalisysFreqValid) && count($surveyAnalisysFreqValid)> 0 ) {
+ foreach ($surveyAnalisysFreqValid AS $vkey => $vAnswer) {
if ($vAnswer['cnt'] > 0 /*&& $counter < $maxAnswer*/ || true) { # izpisujemo samo tiste ki nisno 0
if (in_array($spremenljivka['tip'],array(4,7,8,19,20,21))) { // text, number, datum, mtext, mnumber, text*
$options['isTextAnswer'] = true;
@@ -297,7 +298,7 @@ class AnalizaFreq extends LatexAnalysisElement{
if (count(SurveyAnalysis::$_FREQUENCYS[$_sequence]['invalid'])> 0 ) {
$_Z_MV = !$this->hideEmpty;
if($_Z_MV){ //ce je potrebno izpisati tudi manjkajoce
- $tex .= $this->encodeText($lang['srv_anl_missing1']);
+ $tex .= LatexDocument::encodeText($lang['srv_anl_missing1']);
}
foreach (SurveyAnalysis::$_FREQUENCYS[$_sequence]['invalid'] AS $ikey => $iAnswer) {
if ($iAnswer['cnt'] > 0 ) { # izpisujemo samo tiste ki nisno 0
@@ -319,7 +320,7 @@ class AnalizaFreq extends LatexAnalysisElement{
}
//zaljucek latex tabele z obrobo za prvo tabelo
- $tex .= ($export_format == 'pdf' ? "\\end{tabularx}" : "\\end{tabular}");
+ $tex .= ($export_format == 'pdf' ? "\\end{xltabular}" : "\\end{tabular}");
//zaljucek latex tabele z obrobo za prvo tabelo - konec
# izpišemo še tekstovne odgovore za polja drugo
@@ -347,9 +348,9 @@ class AnalizaFreq extends LatexAnalysisElement{
$options[$_oKey] = $_option;
}
- $text[] = $this->encodeText($variable['variable']);
+ $text[] = LatexDocument::encodeText($variable['variable']);
- $text[] = $this->encodeText($variable['naslov']);
+ $text[] = LatexDocument::encodeText($variable['naslov']);
$text[] = '';
$text[] = '';