diff options
Diffstat (limited to 'admin/survey/export/latexclasses/Analize/AnalizaCReport.php')
-rw-r--r-- | admin/survey/export/latexclasses/Analize/AnalizaCReport.php | 62 |
1 files changed, 32 insertions, 30 deletions
diff --git a/admin/survey/export/latexclasses/Analize/AnalizaCReport.php b/admin/survey/export/latexclasses/Analize/AnalizaCReport.php index 03291c7..df423ec 100644 --- a/admin/survey/export/latexclasses/Analize/AnalizaCReport.php +++ b/admin/survey/export/latexclasses/Analize/AnalizaCReport.php @@ -7,14 +7,14 @@ /* 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");
@@ -150,6 +150,7 @@ class AnalizaCReport extends LatexAnalysisElement{ // Izpisemo sumarnik element
function displaySum($element=null){
+ global $global_user_id;
$sumLatex = '';
$spid = $element['spr1'];
$spremenljivka = SurveyAnalysis::$_HEADERS[$spid];
@@ -256,6 +257,7 @@ class AnalizaCReport extends LatexAnalysisElement{ // Izpisemo frekvence element
function displayFreq($element=null){
+ global $global_user_id;
$freqLatex = '';
$spid = $element['spr1'];
$spremenljivka = SurveyAnalysis::$_HEADERS[$spid];
@@ -329,7 +331,7 @@ class AnalizaCReport 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;
@@ -346,15 +348,15 @@ class AnalizaCReport extends LatexAnalysisElement{ /*priprava polja z naslovi stolpcev*/
$text = array();
- $text[] = $this->encodeText($lang['srv_analiza_opisne_variable']);
- $text[] = $this->encodeText($lang['srv_analiza_opisne_variable_text1']);
+ $text[] = LatexDocument::encodeText($lang['srv_analiza_opisne_variable']);
+ $text[] = LatexDocument::encodeText($lang['srv_analiza_opisne_variable_text1']);
- $text[] = $this->encodeText($lang['srv_analiza_opisne_m']);
- $text[] = $this->encodeText($lang['srv_analiza_num_units']);
- $text[] = $this->encodeText($lang['srv_analiza_opisne_povprecje1']);
- $text[] = $this->encodeText($lang['srv_analiza_opisne_odklon']);
- $text[] = $this->encodeText($lang['srv_analiza_opisne_min']);
- $text[] = $this->encodeText($lang['srv_analiza_opisne_max']);
+ $text[] = LatexDocument::encodeText($lang['srv_analiza_opisne_m']);
+ $text[] = LatexDocument::encodeText($lang['srv_analiza_num_units']);
+ $text[] = LatexDocument::encodeText($lang['srv_analiza_opisne_povprecje1']);
+ $text[] = LatexDocument::encodeText($lang['srv_analiza_opisne_odklon']);
+ $text[] = LatexDocument::encodeText($lang['srv_analiza_opisne_min']);
+ $text[] = LatexDocument::encodeText($lang['srv_analiza_opisne_max']);
/*priprava polja z naslovi stolpcev - konec*/
$descLatex .= $this->tableRow($text);
@@ -369,7 +371,7 @@ class AnalizaCReport extends LatexAnalysisElement{ $show_enota = false;
/* preverimo ali imamo samo eno variablo in če iammo enoto*/
- if ((int)$spremenljivka['enota'] != 0 || $spremenljivka['cnt_all'] > 1 ) {
+ if (isset($spremenljivka['enota'])&&(int)$spremenljivka['enota'] != 0 || $spremenljivka['cnt_all'] > 1 ) {
$show_enota = true;
}
@@ -405,7 +407,7 @@ class AnalizaCReport extends LatexAnalysisElement{ ? false
: true;
if ($do_show) {
- $descLatex .= $this->displayDescriptivesVariablaRow($spremenljivka,$grid,$variable,$_css);
+ $descLatex .= $this->displayDescriptivesVariablaRow($spremenljivka,$grid,$variable);
}
$grid['new_grid'] = false;
@@ -415,7 +417,7 @@ class AnalizaCReport extends LatexAnalysisElement{ } // end if $spremenljivka['tip'] != 'm'
/*zakljucek latex tabele*/
- $descLatex .= ($this->export_format == 'pdf' ? "\\end{tabularx}" : "\\end{tabular}");
+ $descLatex .= ($this->export_format == 'pdf' ? "\\end{xltabular}" : "\\end{tabular}");
/*zaljucek latex tabele - konec */
//echo "</br> Tex celotne tabele: ".$descLatex."</br>";
return $descLatex;
@@ -880,7 +882,7 @@ class AnalizaCReport extends LatexAnalysisElement{ function displayText($text=''){
global $lang;
$texTitle = '';
- $texTitle .= $this->encodeText($text).$this->texNewLine;
+ $texTitle .= LatexDocument::encodeText($text).$this->texNewLine;
return $texTitle;
}
@@ -961,7 +963,7 @@ class AnalizaCReport extends LatexAnalysisElement{ # za multicheckboxe popravimo naslov, na podtip
$sub_q1 = null;
$sub_q2 = null;
- if ($spr1['tip'] == '6' || $spr1['tip'] == '7' || $spr1['tip'] == '16' || $spr1['tip'] == '17' || $spr1['tip'] == '18' || $spr1['tip'] == '19' || $spr1['tip'] == '20' || $spr1['tip'] == '21' ) {
+ /* if ($spr1['tip'] == '6' || $spr1['tip'] == '7' || $spr1['tip'] == '16' || $spr1['tip'] == '17' || $spr1['tip'] == '18' || $spr1['tip'] == '19' || $spr1['tip'] == '20' || $spr1['tip'] == '21' ) {
foreach ($spr1['grids'] AS $grid) {
foreach ($grid['variables'] AS $variable) {
if ($variable['sequence'] == $v_first['seq']) {
@@ -977,12 +979,12 @@ class AnalizaCReport extends LatexAnalysisElement{ }
}
}
- }
+ } */
if ($sub_q1 == null) {
$sub_q1 .= strip_tags($spr1['naslov']);
$sub_q1 .= ($show_variables_values == true ? ' ('.strip_tags($spr1['variable']).')' : '');
}
- if ($spr2['tip'] == '6' || $spr2['tip'] == '7' || $spr2['tip'] == '16' || $spr2['tip'] == '17' || $spr2['tip'] == '18' || $spr2['tip'] == '19' || $spr2['tip'] == '20' || $spr2['tip'] == '21') {
+ /* if ($spr2['tip'] == '6' || $spr2['tip'] == '7' || $spr2['tip'] == '16' || $spr2['tip'] == '17' || $spr2['tip'] == '18' || $spr2['tip'] == '19' || $spr2['tip'] == '20' || $spr2['tip'] == '21') {
foreach ($spr2['grids'] AS $grid) {
foreach ($grid['variables'] AS $variable) {
if ($variable['sequence'] == $v_second['seq']) {
@@ -998,7 +1000,7 @@ class AnalizaCReport extends LatexAnalysisElement{ }
}
}
- }
+ } */
if ($sub_q2 == null) {
$sub_q2 .= strip_tags($spr2['naslov']);
$sub_q2 .= ($show_variables_values == true ? ' ('.strip_tags($spr2['variable']).')' : '');
@@ -1077,7 +1079,7 @@ class AnalizaCReport extends LatexAnalysisElement{ $variables = $breakClass->getVariableList(2);
foreach ($variables as $variable) {
- if($breakData1[0] == $variable['sequence']){
+ if(isset($variable['sequence'])&&$breakData1[0] == $variable['sequence']){
$label1 = ( (int)$variable['sub'] == 0 ? '' : ( (int)$variable['sub'] == 1 ? ' ' : ' ' )) . $variable['variableNaslov'];
$label1 = (strlen($label1) > 60) ? substr($label1, 0, 57).'...' : $label1;
@@ -1089,7 +1091,7 @@ class AnalizaCReport extends LatexAnalysisElement{ $variables = $this->getBreakDependentVariableList($breakClass);
foreach ($variables as $variable) {
- if($breakData2[0] == $variable['sequence']){
+ if(isset($variable['sequence'])&&$breakData2[0] == $variable['sequence']){
//$label2 = $variable['variableNaslov'];
$label2 = (strlen($variable['variableNaslov']) > 60) ? substr($variable['variableNaslov'], 0, 57).'...' : $variable['variableNaslov'];
@@ -1105,7 +1107,7 @@ class AnalizaCReport extends LatexAnalysisElement{ //TODO: Potrebno je v LATEX določiti ali je stran obrnjena landscape
$width = $this->landscapeTest() ? 270 : 165;
- $boldedTitle = $this->returnBold($this->encodeText($this->encodeText($title . $subtitle)));
+ $boldedTitle = $this->returnBold(LatexDocument::encodeText(LatexDocument::encodeText($title . $subtitle)));
$texTitle .= $this->returnCentered($boldedTitle);
return $texTitle;
@@ -1150,13 +1152,13 @@ class AnalizaCReport extends LatexAnalysisElement{ # zloopamo skozi header in dodamo variable (potrebujemo posamezne sekvence)
foreach ($breakClass->_HEADERS AS $skey => $spremenljivka) {
- $tip = $spremenljivka['tip'];
+ $tip = isset($spremenljivka['tip'])?$spremenljivka['tip']:null;
$_dropdown_condition = (is_numeric($tip) && $tip != 5 && $tip != 8 && $tip != 9) ? true : false;
if ($_dropdown_condition) {
$cnt_all = (int)$spremenljivka['cnt_all'];
- if ( $cnt_all == '1' || in_array($tip, array(1,2,3,4,7,17,18,21,22)) || ($tip == 6 && $spremenljivka['enota'] == 2) ) {
+ if ( $cnt_all == '1' || in_array($tip, array(1,2,3,4,7,17,18,21,22)) || ($tip == 6 && isset($spremenljivka['enota']) && $spremenljivka['enota'] == 2) ) {
# pri tipu radio ali select dodamo tisto variablo ki ni polje "drugo"
if ($tip == 1 || $tip == 3 ) {
@@ -1223,7 +1225,7 @@ class AnalizaCReport extends LatexAnalysisElement{ # imamo več gridov - tabele
foreach($spremenljivka['grids'] AS $gid => $grid) {
$sub = 0;
- if ($grid['variable'] != '') {
+ if (isset($grid['variable']) && $grid['variable'] != '') {
$sub++;
$variablesList[] = array(
'tip'=>$tip,
@@ -1277,7 +1279,7 @@ class AnalizaCReport extends LatexAnalysisElement{ $texTitle = '';
if($text != ''){
- $texTitle .= $this->encodeText($text).$this->texNewLine;
+ $texTitle .= LatexDocument::encodeText($text).$this->texNewLine;
}
return $texTitle;
}
|