summaryrefslogtreecommitdiffstats
path: root/admin/survey/export/latexclasses/class.LatexStatus.php
diff options
context:
space:
mode:
authorAnton Luka Šijanec <anton@sijanec.eu>2024-05-27 13:08:29 +0200
committerAnton Luka Šijanec <anton@sijanec.eu>2024-05-27 13:08:29 +0200
commit75160b12821f7f4299cce7f0b69c83c1502ae071 (patch)
tree27e25e4ccaef45f0c58b22831164050d1af1d4db /admin/survey/export/latexclasses/class.LatexStatus.php
parentprvi-commit (diff)
download1ka-75160b12821f7f4299cce7f0b69c83c1502ae071.tar
1ka-75160b12821f7f4299cce7f0b69c83c1502ae071.tar.gz
1ka-75160b12821f7f4299cce7f0b69c83c1502ae071.tar.bz2
1ka-75160b12821f7f4299cce7f0b69c83c1502ae071.tar.lz
1ka-75160b12821f7f4299cce7f0b69c83c1502ae071.tar.xz
1ka-75160b12821f7f4299cce7f0b69c83c1502ae071.tar.zst
1ka-75160b12821f7f4299cce7f0b69c83c1502ae071.zip
Diffstat (limited to 'admin/survey/export/latexclasses/class.LatexStatus.php')
-rw-r--r--admin/survey/export/latexclasses/class.LatexStatus.php494
1 files changed, 173 insertions, 321 deletions
diff --git a/admin/survey/export/latexclasses/class.LatexStatus.php b/admin/survey/export/latexclasses/class.LatexStatus.php
index 522e843..62e9c83 100644
--- a/admin/survey/export/latexclasses/class.LatexStatus.php
+++ b/admin/survey/export/latexclasses/class.LatexStatus.php
@@ -9,11 +9,11 @@
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
- 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");
@@ -50,7 +50,7 @@
* @desc: po novem je potrebno form elemente generirati ro�no kot slike
*
*/
-class LatexStatus {
+class LatexStatus{
var $anketa;// = array(); // trenutna anketa
@@ -79,7 +79,7 @@ class LatexStatus {
if ( is_numeric($anketa) )
{
$this->anketa['id'] = $anketa;
- $this->anketa['podstran'] = $podstran;
+ //$this->anketa['podstran'] = $podstran;
// create new PDF document
//$this->pdf = new enka_TCPDF('L', PDF_UNIT, PDF_PAGE_FORMAT, true, 'UTF-8', false);
}
@@ -148,7 +148,6 @@ class LatexStatus {
$this->ss->PrepareStatusView();
//naslov izvoza
- //$texStatus .= $this->returnBold('Status').$this->texNewLine.$this->texNewLine;
$texStatus .= '\MakeUppercase{\huge \textbf{Status - '.$lang['srv_status_summary'].'}}'.$this->texBigSkip.$this->texNewLine;
@@ -203,7 +202,7 @@ class LatexStatus {
$texStatusInfo = '';
//naslov okvirja
- $titleText = $this->encodeText($lang['srv_statistic_info_title']).$this->texNewLine;
+ $titleText = LatexDocument::encodeText($lang['srv_statistic_info_title']).$this->texNewLine;
$title = $this->returnBoldAndRed($titleText);
//Priprava parametrov za tabelo s podatki o anketi
@@ -241,89 +240,89 @@ class LatexStatus {
//ime ankete
$prvaVrstica = array();
- $prvaVrstica[] = $this->encodeText($lang['srv_info_name'].':');
- //$prvaVrstica[] = '\multicolumn{2}{l}{ '.$this->encodeText(SurveyInfo::getSurveyTitle()).'} ';
- $prvaVrstica[] = $this->encodeText(SurveyInfo::getSurveyTitle());
+ $prvaVrstica[] = LatexDocument::encodeText($lang['srv_info_name'].':');
+ //$prvaVrstica[] = '\multicolumn{2}{l}{ '.LatexDocument::encodeText(SurveyInfo::getSurveyTitle()).'} ';
+ $prvaVrstica[] = LatexDocument::encodeText(SurveyInfo::getSurveyTitle());
//katere napredne možnosti so vklopljene
- $row = SurveyInfo::getSurveyRow();
+ $row = SurveyInfo::getSurveyModules();
$enabled_advanced = null;
$prefix = '';
- if ($row['uporabnost'] == 1) {
+ if (isset($row['uporabnost'])) {
$enabled_advanced .= $prefix . $lang['srv_vrsta_survey_type_4'];
$prefix = ', ';
}
- if ($row['user_from_cms'] == 1) {
+ if (isset($row['user_from_cms'])) {
$enabled_advanced .= $prefix . $lang['srv_vrsta_survey_type_5'];
$prefix = ', ';
}
- if ($row['quiz'] == 1) {
+ if (isset($row['quiz'])) {
$enabled_advanced .= $prefix . $lang['srv_vrsta_survey_type_6'];
$prefix = ', ';
}
- if ($row['voting'] == 1) {
+ if (isset($row['voting'])) {
$enabled_advanced .= $prefix . $lang['srv_vrsta_survey_type_18'];
$prefix = ', ';
}
- if ($row['phone'] == 1) {
+ if (isset($row['phone'])) {
$enabled_advanced .= $prefix . $lang['srv_vrsta_survey_type_7'];
$prefix = ', ';
}
- if ($row['social_network'] == 1) {
+ if (isset($row['social_network'])) {
$enabled_advanced .= $prefix . $lang['srv_vrsta_survey_type_8'];
$prefix = ', ';
}
//tip ankete
$drugaVrstica = array();
- $drugaVrstica[] = $this->encodeText($lang['srv_info_type'].':');
+ $drugaVrstica[] = LatexDocument::encodeText($lang['srv_info_type'].':');
//$drugaVrstica[] = '\multicolumn{2}{l}{ '.$lang['srv_vrsta_survey_type_'.SurveyInfo::getSurveyType()] . ($enabled_advanced != null ? ' ('.$enabled_advanced.')' : '' ).'} ';
$drugaVrstica[] = $lang['srv_vrsta_survey_type_'.SurveyInfo::getSurveyType()] . ($enabled_advanced != null ? ' ('.$enabled_advanced.')' : '' );
/* //vprašanj, variabel
$tretjaVrstica = array();
- //$tretjaVrstica[] = $this->encodeText($lang['srv_info_questions1'].': ').$this->encodeText(SurveyInfo::getSurveyQuestionCount());
- $tretjaVrstica[] = $this->encodeText($lang['srv_info_questions1'].': ');
- $tretjaVrstica[] = $this->encodeText(SurveyInfo::getSurveyQuestionCount());
- //$tretjaVrstica[] = '\multicolumn{2}{l}{ '.$this->encodeText($lang['srv_info_variables'].': ').$this->encodeText(SurveyInfo::getSurveyVariableCount()).'} ';
- $tretjaVrstica[] = $this->encodeText($lang['srv_info_variables'].': ').$this->encodeText(SurveyInfo::getSurveyVariableCount()); */
+ //$tretjaVrstica[] = LatexDocument::encodeText($lang['srv_info_questions1'].': ').LatexDocument::encodeText(SurveyInfo::getSurveyQuestionCount());
+ $tretjaVrstica[] = LatexDocument::encodeText($lang['srv_info_questions1'].': ');
+ $tretjaVrstica[] = LatexDocument::encodeText(SurveyInfo::getSurveyQuestionCount());
+ //$tretjaVrstica[] = '\multicolumn{2}{l}{ '.LatexDocument::encodeText($lang['srv_info_variables'].': ').LatexDocument::encodeText(SurveyInfo::getSurveyVariableCount()).'} ';
+ $tretjaVrstica[] = LatexDocument::encodeText($lang['srv_info_variables'].': ').LatexDocument::encodeText(SurveyInfo::getSurveyVariableCount()); */
//vprašanj
$tretjaVrsticaA = array();
- //$tretjaVrstica[] = $this->encodeText($lang['srv_info_questions1'].': ').$this->encodeText(SurveyInfo::getSurveyQuestionCount());
- $tretjaVrsticaA[] = $this->encodeText($lang['srv_info_questions1'].': ');
- $tretjaVrsticaA[] = $this->encodeText(SurveyInfo::getSurveyQuestionCount());
+ //$tretjaVrstica[] = LatexDocument::encodeText($lang['srv_info_questions1'].': ').LatexDocument::encodeText(SurveyInfo::getSurveyQuestionCount());
+ $tretjaVrsticaA[] = LatexDocument::encodeText($lang['srv_info_questions1'].': ');
+ $tretjaVrsticaA[] = LatexDocument::encodeText(SurveyInfo::getSurveyQuestionCount());
//variabel
$tretjaVrsticaB = array();
- $tretjaVrsticaB[] = $this->encodeText($lang['srv_info_variables'].': ');
- $tretjaVrsticaB[] = $this->encodeText(SurveyInfo::getSurveyVariableCount());
+ $tretjaVrsticaB[] = LatexDocument::encodeText($lang['srv_info_variables'].': ');
+ $tretjaVrsticaB[] = LatexDocument::encodeText(SurveyInfo::getSurveyVariableCount());
/* //uporabnikov, odgovorov
$cetrtaVrstica = array();
- $cetrtaVrstica[] = $this->encodeText($lang['srv_analiza_stUporabnikov'].':');
- $cetrtaVrstica[] = $this->encodeText(SurveyInfo::getSurveyAnswersCount());
- $cetrtaVrstica[] = $this->encodeText($lang['srv_info_answers_valid'].': ').$this->encodeText(SurveyInfo::getSurveyApropriateAnswersCount()); */
+ $cetrtaVrstica[] = LatexDocument::encodeText($lang['srv_analiza_stUporabnikov'].':');
+ $cetrtaVrstica[] = LatexDocument::encodeText(SurveyInfo::getSurveyAnswersCount());
+ $cetrtaVrstica[] = LatexDocument::encodeText($lang['srv_info_answers_valid'].': ').LatexDocument::encodeText(SurveyInfo::getSurveyApropriateAnswersCount()); */
//uporabnikov
$cetrtaVrsticaA = array();
- $cetrtaVrsticaA[] = $this->encodeText($lang['srv_analiza_stUporabnikov'].':');
- $cetrtaVrsticaA[] = $this->encodeText(SurveyInfo::getSurveyAnswersCount());
+ $cetrtaVrsticaA[] = LatexDocument::encodeText($lang['srv_analiza_stUporabnikov'].':');
+ $cetrtaVrsticaA[] = LatexDocument::encodeText(SurveyInfo::getSurveyAnswersCount());
//odgovorov
$cetrtaVrsticaB = array();
- $cetrtaVrsticaB[] = $this->encodeText($lang['srv_info_answers_valid'].': ');
- $cetrtaVrsticaB[] = $this->encodeText(SurveyInfo::getSurveyApropriateAnswersCount());
+ $cetrtaVrsticaB[] = LatexDocument::encodeText($lang['srv_info_answers_valid'].': ');
+ $cetrtaVrsticaB[] = LatexDocument::encodeText(SurveyInfo::getSurveyApropriateAnswersCount());
//jezik ankete
$petaVrstica = array();
- $petaVrstica[] = $this->encodeText($lang['srv_info_language'].':');
- //$petaVrstica[] = '\multicolumn{2}{l}{ '.$this->encodeText(SurveyInfo::getRespondentLanguage()).'} ';
- $petaVrstica[] = $this->encodeText(SurveyInfo::getRespondentLanguage());
+ $petaVrstica[] = LatexDocument::encodeText($lang['srv_info_language'].':');
+ //$petaVrstica[] = '\multicolumn{2}{l}{ '.LatexDocument::encodeText(SurveyInfo::getRespondentLanguage()).'} ';
+ $petaVrstica[] = LatexDocument::encodeText(SurveyInfo::getRespondentLanguage());
//avtor
$sestaVrstica = array();
- $sestaVrstica[] = $this->encodeText($lang['srv_info_creator'].':');
+ $sestaVrstica[] = LatexDocument::encodeText($lang['srv_info_creator'].':');
$text = '';
$text .= SurveyInfo::getSurveyInsertName();
if (SurveyInfo::getSurveyInsertDate() && SurveyInfo::getSurveyInsertDate() != "00.00.0000")
@@ -331,12 +330,12 @@ class LatexStatus {
if (SurveyInfo::getSurveyInsertTime() && SurveyInfo::getSurveyInsertTime() != "00:00:00")
$text .= SurveyInfo::getDateTimeSeperator() . $this->ss->dateFormat(SurveyInfo::getSurveyInsertTime(),TIME_FORMAT_SHORT);
- //$sestaVrstica[] = '\multicolumn{2}{l}{ '.$this->encodeText($text).'} ';
- $sestaVrstica[] = $this->encodeText($text);
+ //$sestaVrstica[] = '\multicolumn{2}{l}{ '.LatexDocument::encodeText($text).'} ';
+ $sestaVrstica[] = LatexDocument::encodeText($text);
//spreminjal
$sedmaVrstica = array();
- $sedmaVrstica[] = $this->encodeText($lang['srv_info_modify'].':');
+ $sedmaVrstica[] = LatexDocument::encodeText($lang['srv_info_modify'].':');
$text = '';
$text .= SurveyInfo::getSurveyEditName();
if (SurveyInfo::getSurveyEditDate() && SurveyInfo::getSurveyEditDate() != "00.00.0000")
@@ -344,49 +343,49 @@ class LatexStatus {
if (SurveyInfo::getSurveyEditTime() && SurveyInfo::getSurveyEditTime() != "00:00:00")
$text .= SurveyInfo::getDateTimeSeperator() . $this->ss->dateFormat(SurveyInfo::getSurveyEditTime(),TIME_FORMAT_SHORT);
- //$sedmaVrstica[] = '\multicolumn{2}{l}{ '.$this->encodeText($text).'} ';
- $sedmaVrstica[] = $this->encodeText($text);
+ //$sedmaVrstica[] = '\multicolumn{2}{l}{ '.LatexDocument::encodeText($text).'} ';
+ $sedmaVrstica[] = LatexDocument::encodeText($text);
//dostop, Kdo razen avtorja ima dostop
$dostop = SurveyInfo::getSurveyAccessUsers();
if ($dostop) {
- //$this->pdf->Cell(20, 3, $this->encodeText($lang['srv_info_access'].':'), 0, 0, 'L', 0);
+ //$this->pdf->Cell(20, 3, LatexDocument::encodeText($lang['srv_info_access'].':'), 0, 0, 'L', 0);
$osmaVrstica = array();
- $osmaVrstica[] = $this->encodeText($lang['srv_info_access'].':');
+ $osmaVrstica[] = LatexDocument::encodeText($lang['srv_info_access'].':');
$prefix='';
foreach ( $dostop as $user) {
$prefix .= $user['name'].'; ';
}
$prefix = substr($prefix, 0, -2);
- //$osmaVrstica[] = '\multicolumn{2}{l}{ '.$this->encodeText($prefix).'} ';
- $osmaVrstica[] = $this->encodeText($prefix);
+ //$osmaVrstica[] = '\multicolumn{2}{l}{ '.LatexDocument::encodeText($prefix).'} ';
+ $osmaVrstica[] = LatexDocument::encodeText($prefix);
}
//aktivnost
$devetaVrstica = array();
$activity = SurveyInfo:: getSurveyActivity();
$_last_active = end($activity);
- $devetaVrstica[] = $this->encodeText($lang['srv_displaydata_status'].':');
+ $devetaVrstica[] = LatexDocument::encodeText($lang['srv_displaydata_status'].':');
if (SurveyInfo::getSurveyColumn('active') == 1) {
- //$devetaVrstica[] = '\multicolumn{2}{l}{ '.$this->encodeText($lang['srv_anketa_active2']).'} ';
- $devetaVrstica[] = $this->encodeText($lang['srv_anketa_active2']);
+ //$devetaVrstica[] = '\multicolumn{2}{l}{ '.LatexDocument::encodeText($lang['srv_anketa_active2']).'} ';
+ $devetaVrstica[] = LatexDocument::encodeText($lang['srv_anketa_active2']);
} else {
# preverimo ali je bila anketa že aktivirana
if (!isset($_last_active['starts'])) {
# anketa še sploh ni bila aktivirana
- //$devetaVrstica[] = '\multicolumn{2}{l}{ '.$this->encodeText($lang['srv_survey_non_active_notActivated1']).'} ';
- $devetaVrstica[] = $this->encodeText($lang['srv_survey_non_active_notActivated1']);
+ //$devetaVrstica[] = '\multicolumn{2}{l}{ '.LatexDocument::encodeText($lang['srv_survey_non_active_notActivated1']).'} ';
+ $devetaVrstica[] = LatexDocument::encodeText($lang['srv_survey_non_active_notActivated1']);
} else {
# anketa je že bila aktivirna ampak je sedaj neaktivna
- //$devetaVrstica[] = '\multicolumn{2}{l}{ '.$this->encodeText($lang['srv_survey_non_active1']).'} ';
- $devetaVrstica[] = $this->encodeText($lang['srv_survey_non_active1']);
+ //$devetaVrstica[] = '\multicolumn{2}{l}{ '.LatexDocument::encodeText($lang['srv_survey_non_active1']).'} ';
+ $devetaVrstica[] = LatexDocument::encodeText($lang['srv_survey_non_active1']);
}
}
//trajanje: datumi aktivnosti
- if ( count($activity) > 0 ) {
+ if (is_countable($activity) && count($activity) > 0 ) {
$desetaVrstica = array();
- $desetaVrstica[] = $this->encodeText($lang['srv_info_activity'].':');
+ $desetaVrstica[] = LatexDocument::encodeText($lang['srv_info_activity'].':');
$prefix = '';
foreach ($activity as $active) {
$_starts = explode('-',$active['starts']);
@@ -395,8 +394,8 @@ class LatexStatus {
$prefix .= $_starts[2].'.'.$_starts[1].'.'.$_starts[0].'-'.$_expire[2].'.'.$_expire[1].'.'.$_expire[0];
$prefix .= '; ';
}
- //$desetaVrstica[] = '\multicolumn{2}{l}{ '.$this->encodeText($prefix).'} ';
- $desetaVrstica[] = $this->encodeText($prefix);
+ //$desetaVrstica[] = '\multicolumn{2}{l}{ '.LatexDocument::encodeText($prefix).'} ';
+ $desetaVrstica[] = LatexDocument::encodeText($prefix);
}
# predviceni cas trajanja enkete
@@ -407,12 +406,12 @@ class LatexStatus {
//predviceni cas trajanja enkete
$enajstaVrstica = array();
- $enajstaVrstica[] = $this->encodeText($lang['srv_info_duration'].':');
+ $enajstaVrstica[] = LatexDocument::encodeText($lang['srv_info_duration'].':');
$text = '';
$text .= ($skupni_cas != '') ? $skupni_cas.', ' : '';
$text .= $lang['srv_predvideno'].': '.$skupni_predvideni_cas;
- //$enajstaVrstica[] = '\multicolumn{2}{l}{ '.$this->encodeText($text).'} ';
- $enajstaVrstica[] = $this->encodeText($text);
+ //$enajstaVrstica[] = '\multicolumn{2}{l}{ '.LatexDocument::encodeText($text).'} ';
+ $enajstaVrstica[] = LatexDocument::encodeText($text);
//VNOSI - prvi / zadnji vnos
@@ -423,22 +422,22 @@ class LatexStatus {
$dvanajstaVrstica = array();
$dvanajstaVrsticaA = array();
if ($prvi_vnos_date != null) {
- $dvanajstaVrstica[] = $this->encodeText($lang['srv_info_first_entry'].':');
+ $dvanajstaVrstica[] = LatexDocument::encodeText($lang['srv_info_first_entry'].':');
$text = '';
$text .= $this->ss->dateFormat($prvi_vnos_date,DATE_FORMAT_SHORT);
$text .= $prvi_vnos_time != null ? (SurveyInfo::$dateTimeSeperator .$this->ss->dateFormat($prvi_vnos_time,TIME_FORMAT_SHORT)) : '';
- $dvanajstaVrstica[] = $this->encodeText($text);
+ $dvanajstaVrstica[] = LatexDocument::encodeText($text);
}else{
$dvanajstaVrstica[] = '';
$dvanajstaVrstica[] = '';
}
if ($zadnji_vnos_date != null) {
- $dvanajstaVrsticaA[] = $this->encodeText($lang['srv_info_last_entry'].':');
+ $dvanajstaVrsticaA[] = LatexDocument::encodeText($lang['srv_info_last_entry'].':');
$text = '';
$text .= $this->ss->dateFormat($zadnji_vnos_date,DATE_FORMAT_SHORT);
$text .= $zadnji_vnos_time != null ? (SurveyInfo::$dateTimeSeperator .$this->ss->dateFormat($zadnji_vnos_time,TIME_FORMAT_SHORT)) : '';
- //$dvanajstaVrsticaA[] = $this->encodeText($lang['srv_info_last_entry'].': '.$this->encodeText($text));
- $dvanajstaVrsticaA[] = $this->encodeText($text);
+ //$dvanajstaVrsticaA[] = LatexDocument::encodeText($lang['srv_info_last_entry'].': '.LatexDocument::encodeText($text));
+ $dvanajstaVrsticaA[] = LatexDocument::encodeText($text);
}else{
$dvanajstaVrsticaA[] = '';
}
@@ -463,17 +462,17 @@ class LatexStatus {
$trinajstaVrsticaB = array();
$trinajstaVrsticaC = array();
- $trinajstaVrsticaA[] = $this->encodeText($lang['srv_diagnostic_4_element_0'].':');
- //$trinajstaVrsticaA[] = '\multicolumn{2}{l}{ '.$this->encodeText($lang['srv_diagnostic_4_element_1'].': '.(int)$commentsAll.' / '.(int)$commentsUnresolved).'} ';
- $trinajstaVrsticaA[] = $this->encodeText($lang['srv_diagnostic_4_element_1'].': '.(int)$commentsAll.' / '.(int)$commentsUnresolved);
+ $trinajstaVrsticaA[] = LatexDocument::encodeText($lang['srv_diagnostic_4_element_0'].':');
+ //$trinajstaVrsticaA[] = '\multicolumn{2}{l}{ '.LatexDocument::encodeText($lang['srv_diagnostic_4_element_1'].': '.(int)$commentsAll.' / '.(int)$commentsUnresolved).'} ';
+ $trinajstaVrsticaA[] = LatexDocument::encodeText($lang['srv_diagnostic_4_element_1'].': '.(int)$commentsAll.' / '.(int)$commentsUnresolved);
$trinajstaVrsticaB[] = '';
- //$trinajstaVrsticaB[] = '\multicolumn{2}{l}{ '.$this->encodeText($lang['srv_diagnostic_4_element_6'].': '.(int)$commentsQuestionAll.' / '.(int)$commentsQuestionUnresolved).'} ';
- $trinajstaVrsticaB[] = $this->encodeText($lang['srv_diagnostic_4_element_6'].': '.(int)$commentsQuestionAll.' / '.(int)$commentsQuestionUnresolved);
+ //$trinajstaVrsticaB[] = '\multicolumn{2}{l}{ '.LatexDocument::encodeText($lang['srv_diagnostic_4_element_6'].': '.(int)$commentsQuestionAll.' / '.(int)$commentsQuestionUnresolved).'} ';
+ $trinajstaVrsticaB[] = LatexDocument::encodeText($lang['srv_diagnostic_4_element_6'].': '.(int)$commentsQuestionAll.' / '.(int)$commentsQuestionUnresolved);
$trinajstaVrsticaC[] = '';
- //$trinajstaVrsticaC[] = '\multicolumn{2}{l}{ '.$this->encodeText($lang['srv_diagnostic_4_element_7'].': '.(int)$commentsUser.' / '.(int)$commentsUserUnresolved).'} ';
- $trinajstaVrsticaC[] = $this->encodeText($lang['srv_diagnostic_4_element_7'].': '.(int)$commentsUser.' / '.(int)$commentsUserUnresolved);
+ //$trinajstaVrsticaC[] = '\multicolumn{2}{l}{ '.LatexDocument::encodeText($lang['srv_diagnostic_4_element_7'].': '.(int)$commentsUser.' / '.(int)$commentsUserUnresolved).'} ';
+ $trinajstaVrsticaC[] = LatexDocument::encodeText($lang['srv_diagnostic_4_element_7'].': '.(int)$commentsUser.' / '.(int)$commentsUserUnresolved);
$komentarji = 1;
}
@@ -496,7 +495,7 @@ class LatexStatus {
$texStatusInfo .= $this->tableRow($osmaVrstica, 1);
}
$texStatusInfo .= $this->tableRow($devetaVrstica, 1);
- if ( count($activity) > 0 ) {
+ if ( is_countable($activity) && count($activity) > 0 ) {
$texStatusInfo .= $this->tableRow($desetaVrstica, 1);
}
$texStatusInfo .= $this->tableRow($enajstaVrstica, 1);
@@ -537,7 +536,7 @@ class LatexStatus {
$texStatusView = '';
//naslov okvirja
- $titleText = $this->encodeText($lang['srv_statistic_status_title1']).$this->texNewLine;
+ $titleText = LatexDocument::encodeText($lang['srv_statistic_status_title1']).$this->texNewLine;
$title = $this->returnBoldAndRed($titleText);
//Priprava parametrov za tabelo s podatki o anketi
@@ -556,6 +555,7 @@ class LatexStatus {
$rtfTable = 'tabular';
$pdfTableWidth = 1;
$rtfTableWidth = 1;
+ $cntInvitation = 0;
$texStatusView .= $this->StartLatexTable($export_format, $parameterTabular, $pdfTable, $rtfTable, $pdfTableWidth, $rtfTableWidth); /*zacetek tabele*/
@@ -570,8 +570,8 @@ class LatexStatus {
foreach ($this->ss->appropriateStatus as $status) {
$vrsticaA = array();
if (!($this->ss->hideNullValues_status && $this->ss->userByStatus['valid'][$status] == 0)) {// da ne delamo po neporebnem
- $vrsticaA[] = $this->encodeText($lang['srv_userstatus_'.$status] . ' ('.$status.') :');
- $vrsticaA[] = $this->encodeText($this->ss->userByStatus['valid'][$status]);
+ $vrsticaA[] = LatexDocument::encodeText($lang['srv_userstatus_'.$status] . ' ('.$status.') :');
+ $vrsticaA[] = LatexDocument::encodeText($this->ss->userByStatus['valid'][$status]);
$texStatusView .= $this->tableRow($vrsticaA,1);
$cntValid++;
}
@@ -581,15 +581,15 @@ class LatexStatus {
if ($cntValid > 0 || !$this->ss->hideNullValues_status) {
$vrsticaB = array();
/* $this->pdf->setFont('','B','6');
- $this->pdf->Cell(45, 0, $this->encodeText($lang['srv_statistic_redirection_sum_valid']), 'T', 0, 'L', 0);
- $this->pdf->Cell(45, 0, $this->encodeText($this->ss->cntUserByStatus['valid']), 'T', 1, 'L', 0);
+ $this->pdf->Cell(45, 0, LatexDocument::encodeText($lang['srv_statistic_redirection_sum_valid']), 'T', 0, 'L', 0);
+ $this->pdf->Cell(45, 0, LatexDocument::encodeText($this->ss->cntUserByStatus['valid']), 'T', 1, 'L', 0);
$this->pdf->setY($this->pdf->getY() + 3);
$this->pdf->setX($X);
$this->pdf->setFont('','','6'); */
$texStatusView .= $this->horizontalLineTex;
- $vrsticaB[] = $this->encodeText($lang['srv_statistic_redirection_sum_valid']);
- $vrsticaB[] = $this->encodeText($this->ss->cntUserByStatus['valid']);
+ $vrsticaB[] = LatexDocument::encodeText($lang['srv_statistic_redirection_sum_valid']);
+ $vrsticaB[] = LatexDocument::encodeText($this->ss->cntUserByStatus['valid']);
$texStatusView .= $this->tableRow($vrsticaB,1);
$texStatusView .= $this->texNewLine;
}
@@ -598,10 +598,10 @@ class LatexStatus {
foreach ($this->ss->unAppropriateStatus as $status) {
$vrsticaC = array();
if (!($this->ss->hideNullValues_status && $this->ss->userByStatus['nonvalid'][$status] == 0)) {// da ne delamo po neporebnem
- //$this->pdf->Cell(45, 0, $this->encodeText($lang['srv_userstatus_'.$status] . ' ('.$status.') :'), 0, 0, 'L', 0);
- //$this->pdf->Cell(45, 0, $this->encodeText($this->ss->userByStatus['nonvalid'][$status]), 0, 1, 'L', 0);
- $vrsticaC[] = $this->encodeText($lang['srv_userstatus_'.$status] . ' ('.$status.') :');
- $vrsticaC[] = $this->encodeText($this->ss->userByStatus['nonvalid'][$status]);
+ //$this->pdf->Cell(45, 0, LatexDocument::encodeText($lang['srv_userstatus_'.$status] . ' ('.$status.') :'), 0, 0, 'L', 0);
+ //$this->pdf->Cell(45, 0, LatexDocument::encodeText($this->ss->userByStatus['nonvalid'][$status]), 0, 1, 'L', 0);
+ $vrsticaC[] = LatexDocument::encodeText($lang['srv_userstatus_'.$status] . ' ('.$status.') :');
+ $vrsticaC[] = LatexDocument::encodeText($this->ss->userByStatus['nonvalid'][$status]);
$texStatusView .= $this->tableRow($vrsticaC,1);
$cntNonValid++;
//$this->pdf->setX($X);
@@ -610,12 +610,12 @@ class LatexStatus {
// se status null (neznan status)
if (!($this->ss->hideNullValues_status && $this->ss->userByStatus['nonvalid'][-1] == 0)) {// da ne delamo po neporebnem
$vrsticaD = array();
- //$this->pdf->Cell(45, 0, $this->encodeText($lang['srv_userstatus_null']), 0, 0, 'L', 0);
- //$this->pdf->Cell(45, 0, $this->encodeText(isset($this->ss->userByStatus['nonvalid'][-1]) ? $this->ss->userByStatus['nonvalid'][-1] : '0'), 0, 1, 'L', 0);
+ //$this->pdf->Cell(45, 0, LatexDocument::encodeText($lang['srv_userstatus_null']), 0, 0, 'L', 0);
+ //$this->pdf->Cell(45, 0, LatexDocument::encodeText(isset($this->ss->userByStatus['nonvalid'][-1]) ? $this->ss->userByStatus['nonvalid'][-1] : '0'), 0, 1, 'L', 0);
//$texStatusView .= $this->horizontalLineTex;
- $vrsticaD[] = $this->encodeText($lang['srv_userstatus_null']);
- $vrsticaD[] = $this->encodeText(isset($this->ss->userByStatus['nonvalid'][-1]) ? $this->ss->userByStatus['nonvalid'][-1] : '0');
+ $vrsticaD[] = LatexDocument::encodeText($lang['srv_userstatus_null']);
+ $vrsticaD[] = LatexDocument::encodeText(isset($this->ss->userByStatus['nonvalid'][-1]) ? $this->ss->userByStatus['nonvalid'][-1] : '0');
$texStatusView .= $this->tableRow($vrsticaD,1);
//$texStatusView .= $this->texNewLine;
$cntNonValid++;
@@ -626,29 +626,29 @@ class LatexStatus {
if ($cntNonValid > 0 || !$this->ss->hideNullValues_status) {
$vrsticaE = array();
/* $this->pdf->setFont('','B','6');
- $this->pdf->Cell(45, 0, $this->encodeText($lang['srv_statistic_redirection_sum_nonvalid']), 'T', 0, 'L', 0);
- $this->pdf->Cell(45, 0, $this->encodeText($this->ss->cntUserByStatus['nonvalid']), 'T', 1, 'L', 0);
+ $this->pdf->Cell(45, 0, LatexDocument::encodeText($lang['srv_statistic_redirection_sum_nonvalid']), 'T', 0, 'L', 0);
+ $this->pdf->Cell(45, 0, LatexDocument::encodeText($this->ss->cntUserByStatus['nonvalid']), 'T', 1, 'L', 0);
$this->pdf->setY($this->pdf->getY() + 3);
$this->pdf->setX($X);
$this->pdf->setFont('','','6'); */
- $vrsticaE[] = $this->encodeText($lang['srv_statistic_redirection_sum_nonvalid']);
- $vrsticaE[] = $this->encodeText($this->ss->cntUserByStatus['nonvalid']);
+ $vrsticaE[] = LatexDocument::encodeText($lang['srv_statistic_redirection_sum_nonvalid']);
+ $vrsticaE[] = LatexDocument::encodeText($this->ss->cntUserByStatus['nonvalid']);
$texStatusView .= $this->horizontalLineTex;
$texStatusView .= $this->tableRow($vrsticaE,1);
$texStatusView .= $this->texNewLine;
}
/* $this->pdf->setFont('','B','6');
- $this->pdf->Cell(45, 0, $this->encodeText($lang['srv_statistic_redirection_sum']), 'T', 0, 'L', 0);
- $this->pdf->Cell(45, 0, $this->encodeText($this->ss->cntUserByStatus['valid']+$this->ss->cntUserByStatus['nonvalid']), 'T', 1, 'L', 0);
+ $this->pdf->Cell(45, 0, LatexDocument::encodeText($lang['srv_statistic_redirection_sum']), 'T', 0, 'L', 0);
+ $this->pdf->Cell(45, 0, LatexDocument::encodeText($this->ss->cntUserByStatus['valid']+$this->ss->cntUserByStatus['nonvalid']), 'T', 1, 'L', 0);
$this->pdf->setFont('','','6');
$this->pdf->setX($X); */
$texStatusView .= $this->horizontalLineTex;
$vrsticaF = array();
- $vrsticaF[] = $this->encodeText($lang['srv_statistic_redirection_sum']);
- if(($this->encodeText($this->ss->cntUserByStatus['valid']+$this->ss->cntUserByStatus['nonvalid']))){
- $vrsticaF[] = $this->encodeText($this->ss->cntUserByStatus['valid']+$this->ss->cntUserByStatus['nonvalid']);
+ $vrsticaF[] = LatexDocument::encodeText($lang['srv_statistic_redirection_sum']);
+ if((LatexDocument::encodeText($this->ss->cntUserByStatus['valid']+$this->ss->cntUserByStatus['nonvalid']))){
+ $vrsticaF[] = LatexDocument::encodeText($this->ss->cntUserByStatus['valid']+$this->ss->cntUserByStatus['nonvalid']);
}else{
$vrsticaF[] = 0;
}
@@ -665,10 +665,10 @@ class LatexStatus {
foreach ($this->ss->invitationStatus as $status){
$vrsticaG = array();
if (!($this->ss->hideNullValues_status && $this->ss->userByStatus['invitation'][$status] == 0)){// da ne delamo po neporebnem
- //$this->pdf->Cell(45, 0, $this->encodeText($lang['srv_userstatus_'.$status] . ' ('.$status.') :'), 0, 0, 'L', 0);
- //$this->pdf->Cell(45, 0, $this->encodeText($this->ss->userByStatus['invitation'][$status]), 0, 1, 'L', 0);
- $vrsticaG[] = $this->encodeText($lang['srv_userstatus_'.$status] . ' ('.$status.') :');
- $vrsticaG[] = $this->encodeText($this->ss->userByStatus['invitation'][$status]);
+ //$this->pdf->Cell(45, 0, LatexDocument::encodeText($lang['srv_userstatus_'.$status] . ' ('.$status.') :'), 0, 0, 'L', 0);
+ //$this->pdf->Cell(45, 0, LatexDocument::encodeText($this->ss->userByStatus['invitation'][$status]), 0, 1, 'L', 0);
+ $vrsticaG[] = LatexDocument::encodeText($lang['srv_userstatus_'.$status] . ' ('.$status.') :');
+ $vrsticaG[] = LatexDocument::encodeText($this->ss->userByStatus['invitation'][$status]);
$texStatusView .= $this->tableRow($vrsticaG,1);
$cntInvitation++;
}
@@ -678,14 +678,14 @@ class LatexStatus {
if ($cntInvitation > 0 || !$this->ss->hideNullValues_status) {
$vrsticaH = array();
/* $this->pdf->setFont('','B','6');
- $this->pdf->Cell(45, 0, $this->encodeText($lang['srv_statistic_redirection_sum_invitation']), 'T', 0, 'L', 0);
- $this->pdf->Cell(45, 0, $this->encodeText($this->ss->cntUserByStatus['invitation']), 'T', 1, 'L', 0);
+ $this->pdf->Cell(45, 0, LatexDocument::encodeText($lang['srv_statistic_redirection_sum_invitation']), 'T', 0, 'L', 0);
+ $this->pdf->Cell(45, 0, LatexDocument::encodeText($this->ss->cntUserByStatus['invitation']), 'T', 1, 'L', 0);
$this->pdf->setY($this->pdf->getY() + 3);
$this->pdf->setX($X);
$this->pdf->setFont('','','6'); */
- $vrsticaH[] = $this->encodeText($lang['srv_statistic_redirection_sum_invitation']);
- $vrsticaH[] = $this->encodeText($this->ss->cntUserByStatus['invitation']);
+ $vrsticaH[] = LatexDocument::encodeText($lang['srv_statistic_redirection_sum_invitation']);
+ $vrsticaH[] = LatexDocument::encodeText($this->ss->cntUserByStatus['invitation']);
$texStatusView .= $this->horizontalLineTex;
$texStatusView .= $this->tableRow($vrsticaH,1);
$texStatusView .= $this->texNewLine;
@@ -699,14 +699,14 @@ class LatexStatus {
$this->pdf->Cell(90, 6, '', 'B', 1, 'L', 0);
$this->pdf->setX($X);
- $this->pdf->Cell(45, 0, $this->encodeText($lang['srv_statistic_redirection_test']), 'T', 0, 'L', 0);
- $this->pdf->Cell(45, 0, $this->encodeText((int)$this->ss->testDataCount), 'T', 1, 'L', 0);
+ $this->pdf->Cell(45, 0, LatexDocument::encodeText($lang['srv_statistic_redirection_test']), 'T', 0, 'L', 0);
+ $this->pdf->Cell(45, 0, LatexDocument::encodeText((int)$this->ss->testDataCount), 'T', 1, 'L', 0);
$this->pdf->setX($X);
$this->pdf->setFont('','','6'); */
- $vrsticaI[] = $this->encodeText($lang['srv_statistic_redirection_test']);
- $vrsticaI[] = $this->encodeText((int)$this->ss->testDataCount);
+ $vrsticaI[] = LatexDocument::encodeText($lang['srv_statistic_redirection_test']);
+ $vrsticaI[] = LatexDocument::encodeText((int)$this->ss->testDataCount);
$texStatusView .= $this->horizontalLineTex;
$texStatusView .= $this->tableRow($vrsticaI,1);
$texStatusView .= $this->texNewLine;
@@ -719,13 +719,13 @@ class LatexStatus {
if ($view_count > 0 || !$this->ss->hideNullValues_status){
$vrsticaJ = array();
/* $this->pdf->setFont('','B','6');
- $this->pdf->Cell(45, 0, $this->encodeText($lang['srv_statistic_redirection_sum_view']), 'T', 0, 'L', 0);
- $this->pdf->Cell(45, 0, $this->encodeText($view_count), 'T', 1, 'L', 0);
+ $this->pdf->Cell(45, 0, LatexDocument::encodeText($lang['srv_statistic_redirection_sum_view']), 'T', 0, 'L', 0);
+ $this->pdf->Cell(45, 0, LatexDocument::encodeText($view_count), 'T', 1, 'L', 0);
$this->pdf->setX($X);
$this->pdf->setFont('','','6'); */
- $vrsticaJ[] = $this->encodeText($lang['srv_statistic_redirection_sum_view']);
- $vrsticaJ[] = $this->encodeText($view_count);
+ $vrsticaJ[] = LatexDocument::encodeText($lang['srv_statistic_redirection_sum_view']);
+ $vrsticaJ[] = LatexDocument::encodeText($view_count);
$texStatusView .= $this->horizontalLineTex;
$texStatusView .= $this->tableRow($vrsticaJ,1);
$texStatusView .= $this->texNewLine;
@@ -751,7 +751,7 @@ class LatexStatus {
$texAnswerStateView = '';
//naslov okvirja
- $titleText = $this->encodeText($lang['srv_statistic_answer_state_title']).$this->texNewLine;
+ $titleText = LatexDocument::encodeText($lang['srv_statistic_answer_state_title']).$this->texNewLine;
$title = $this->returnBoldAndRed($titleText);
//Priprava parametrov za tabelo s podatki o anketi
@@ -784,9 +784,9 @@ class LatexStatus {
//prva vrstica
$prvaVrstica = array();
- $prvaVrstica[] = $this->encodeText($lang['srv_statistic_answer_state_status']);
- $prvaVrstica[] = $this->encodeText($lang['srv_statistic_answer_state_frequency']);
- $prvaVrstica[] = $this->encodeText($lang['srv_statistic_answer_state_percent']);
+ $prvaVrstica[] = LatexDocument::encodeText($lang['srv_statistic_answer_state_status']);
+ $prvaVrstica[] = LatexDocument::encodeText($lang['srv_statistic_answer_state_frequency']);
+ $prvaVrstica[] = LatexDocument::encodeText($lang['srv_statistic_answer_state_percent']);
$texAnswerStateView .= $this->tableRow($prvaVrstica,1);
$texAnswerStateView .= $this->horizontalLineTex;
@@ -795,9 +795,9 @@ class LatexStatus {
foreach ($order as $key) {
$vrstica2N = array();
- $vrstica2N[] = $this->encodeText($lang['srv_userstatus_'.$key]);
- $vrstica2N[] = $this->encodeText($this->ss->realUsersByStatus[$key]['cnt'] > 0 ? $this->ss->realUsersByStatus[$key]['cnt'] : '0');
- $vrstica2N[] = $this->encodeText( ((float)$this->ss->realUsersByStatus[$key]['percent'] > 1.0) ? '--' : $this->formatNumber($this->ss->realUsersByStatus[$key]['percent']*100,NUM_DIGIT_PERCENT,'%') );
+ $vrstica2N[] = LatexDocument::encodeText($lang['srv_userstatus_'.$key]);
+ $vrstica2N[] = LatexDocument::encodeText($this->ss->realUsersByStatus[$key]['cnt'] > 0 ? $this->ss->realUsersByStatus[$key]['cnt'] : '0');
+ $vrstica2N[] = LatexDocument::encodeText( ((float)$this->ss->realUsersByStatus[$key]['percent'] > 1.0) ? '--' : $this->formatNumber($this->ss->realUsersByStatus[$key]['percent']*100,NUM_DIGIT_PERCENT,'%') );
$texAnswerStateView .= $this->tableRow($vrstica2N,1);
}
@@ -823,7 +823,7 @@ class LatexStatus {
$texReferalsView = '';
//naslov okvirja
- $titleText = $this->encodeText($lang['srv_statistic_redirection_title']).$this->texNewLine;
+ $titleText = LatexDocument::encodeText($lang['srv_statistic_redirection_title']).$this->texNewLine;
$title = $this->returnBoldAndRed($titleText);
// izrisemo graf
@@ -857,8 +857,8 @@ class LatexStatus {
//naslovna vrstica
$naslovnaVrstica = array();
- $naslovnaVrstica[] = $this->encodeText($lang['srv_statistic_redirection_site']);
- $naslovnaVrstica[] = $this->encodeText($lang['srv_statistic_redirection_click']);
+ $naslovnaVrstica[] = LatexDocument::encodeText($lang['srv_statistic_redirection_site']);
+ $naslovnaVrstica[] = LatexDocument::encodeText($lang['srv_statistic_redirection_click']);
$texReferalsView .= $this->tableRow($naslovnaVrstica);
//pridobitev skupnega stevila klikov $value_sum za izris grafov
@@ -884,10 +884,10 @@ class LatexStatus {
if (count($this->ss->userRedirections["valid"])) {
foreach ($this->ss->userRedirections["valid"] as $key => $value) {
$vmesnaVrsticaA = array();
- $vmesnaVrsticaA[] = $this->encodeText($key);
- if($this->encodeText($value)){ //ce vrednost ni nula
- $graphLineLength = (GRAPH_LINE_LENGTH_MAX/$value_sum)*$this->encodeText($value);
- $vmesnaVrsticaA[] = $this->drawGraphLatex($graphLineLength, $this->encodeText($value));
+ $vmesnaVrsticaA[] = LatexDocument::encodeText($key);
+ if(LatexDocument::encodeText($value)){ //ce vrednost ni nula
+ $graphLineLength = (GRAPH_LINE_LENGTH_MAX/$value_sum)*LatexDocument::encodeText($value);
+ $vmesnaVrsticaA[] = $this->drawGraphLatex($graphLineLength, LatexDocument::encodeText($value));
}else{
$vmesnaVrsticaA[] = 0;
}
@@ -899,10 +899,10 @@ class LatexStatus {
if ($this->ss->userRedirections["direct"] > 0) {
$value = $this->ss->userRedirections["direct"];
$vmesnaVrsticaB = array();
- $vmesnaVrsticaB[] = $this->encodeText($lang['srv_statistic_redirection_direct']);
- if($this->encodeText($value)){ //ce vrednost ni nula
- $graphLineLength = (GRAPH_LINE_LENGTH_MAX/$value_sum)*$this->encodeText($value);
- $vmesnaVrsticaB[] = $this->drawGraphLatex($graphLineLength, $this->encodeText($value));
+ $vmesnaVrsticaB[] = LatexDocument::encodeText($lang['srv_statistic_redirection_direct']);
+ if(LatexDocument::encodeText($value)){ //ce vrednost ni nula
+ $graphLineLength = (GRAPH_LINE_LENGTH_MAX/$value_sum)*LatexDocument::encodeText($value);
+ $vmesnaVrsticaB[] = $this->drawGraphLatex($graphLineLength, LatexDocument::encodeText($value));
}else{
$vmesnaVrsticaB[] = 0;
}
@@ -913,10 +913,10 @@ class LatexStatus {
if ($this->ss->userRedirections["email"] > 0) {
$value = $this->ss->userRedirections["email"];
$vmesnaVrsticaC = array();
- $vmesnaVrsticaC[] = $this->encodeText($lang['srv_statistic_redirection_email']);
- if($this->encodeText($value)){ //ce vrednost ni nula
- $graphLineLength = (GRAPH_LINE_LENGTH_MAX/$value_sum)*$this->encodeText($value);
- $vmesnaVrsticaC[] = $this->drawGraphLatex($graphLineLength, $this->encodeText($value));
+ $vmesnaVrsticaC[] = LatexDocument::encodeText($lang['srv_statistic_redirection_email']);
+ if(LatexDocument::encodeText($value)){ //ce vrednost ni nula
+ $graphLineLength = (GRAPH_LINE_LENGTH_MAX/$value_sum)*LatexDocument::encodeText($value);
+ $vmesnaVrsticaC[] = $this->drawGraphLatex($graphLineLength, LatexDocument::encodeText($value));
}else{
$vmesnaVrsticaC[] = 0;
}
@@ -926,8 +926,8 @@ class LatexStatus {
// dodamo sumo
$texReferalsView .= $this->horizontalLineTex;
$vrsticaSuma = array();
- $vrsticaSuma[] = $this->encodeText($lang['srv_statistic_redirection_sum_clicked']);
- $vrsticaSuma[] = $this->encodeText($value_sum);
+ $vrsticaSuma[] = LatexDocument::encodeText($lang['srv_statistic_redirection_sum_clicked']);
+ $vrsticaSuma[] = LatexDocument::encodeText($value_sum);
$texReferalsView .= $this->tableRow($vrsticaSuma,1);
// dodamo se neveljavne *******************************************
@@ -945,10 +945,10 @@ class LatexStatus {
$value = $this->ss->userRedirections["$key"];
if ($value > 0) {
$vrsticaNeveljavni = array();
- $vrsticaNeveljavni[] = $this->encodeText($lang['srv_userstatus_'.$key]);
- if($this->encodeText($value)){ //ce vrednost ni nula
- $graphLineLength = (GRAPH_LINE_LENGTH_MAX/$value_sum)*$this->encodeText($value);
- $vrsticaNeveljavni[] = $this->drawGraphLatex($graphLineLength, $this->encodeText($value));
+ $vrsticaNeveljavni[] = LatexDocument::encodeText($lang['srv_userstatus_'.$key]);
+ if(LatexDocument::encodeText($value)){ //ce vrednost ni nula
+ $graphLineLength = (GRAPH_LINE_LENGTH_MAX/$value_sum)*LatexDocument::encodeText($value);
+ $vrsticaNeveljavni[] = $this->drawGraphLatex($graphLineLength, LatexDocument::encodeText($value));
}else{
$vrsticaNeveljavni[] = 0;
}
@@ -959,15 +959,15 @@ class LatexStatus {
if ($value_sum_nonvalid > 0 ) {
$texReferalsView .= $this->horizontalLineTex;
$vrsticaSumaNeveljavni = array();
- $vrsticaSumaNeveljavni[] = $this->encodeText($lang['srv_statistic_redirection_sum_nonvalid']);
- $vrsticaSumaNeveljavni[] = $this->encodeText($value_sum_nonvalid);
+ $vrsticaSumaNeveljavni[] = LatexDocument::encodeText($lang['srv_statistic_redirection_sum_nonvalid']);
+ $vrsticaSumaNeveljavni[] = LatexDocument::encodeText($value_sum_nonvalid);
$texReferalsView .= $this->tableRow($vrsticaSumaNeveljavni,1);
}
if (!($value_sum_nonvalid == 0 || $value_sum == 0 )) {
$texReferalsView .= $this->horizontalLineTex;
$vrsticaSumaNeveljavni = array();
- $vrsticaSumaNeveljavni[] = $this->encodeText($lang['srv_statistic_redirection_sum']);
- $vrsticaSumaNeveljavni[] = $this->encodeText($value_sum+$value_sum_nonvalid);
+ $vrsticaSumaNeveljavni[] = LatexDocument::encodeText($lang['srv_statistic_redirection_sum']);
+ $vrsticaSumaNeveljavni[] = LatexDocument::encodeText($value_sum+$value_sum_nonvalid);
$texReferalsView .= $this->tableRow($vrsticaSumaNeveljavni,1);
}
// dodamo se neveljavne - konec *******************************************
@@ -977,19 +977,19 @@ class LatexStatus {
//zaljucek latex tabele s podatki - konec
}
else {
- $texReferalsView .= $this->encodeText($lang['srv_statistic_show_no_referals']).$this->texNewLine;
+ $texReferalsView .= LatexDocument::encodeText($lang['srv_statistic_show_no_referals']).$this->texNewLine;
}
//stevilo razlicnih IP stevilk
$texReferalsView .= $this->texBigSkip.' ';
//$texReferalsView .= $this->texNewLine;
- $texReferalsView .= $this->encodeText($lang['srv_count_ip_list'].': '.count($this->ss->ip_list));
+ $texReferalsView .= LatexDocument::encodeText($lang['srv_count_ip_list'].': '.count($this->ss->ip_list));
if ($admin_type==0 && count($this->ss->ip_list) > 0) {
$texReferalsView .= ' '.$this->texBigSkip;
$texReferalsView .= $this->texNewLine;
- $titleTextIP = $this->encodeText($lang['srv_detail_ip_list']);
+ $titleTextIP = LatexDocument::encodeText($lang['srv_detail_ip_list']);
$titleIP = $this->returnBoldAndRed($titleTextIP);
$texReferalsView .= $this->returnBoldAndRed($titleIP).$this->texNewLine;
@@ -1016,8 +1016,8 @@ class LatexStatus {
//Izpis vrstic
foreach($this->ss->ip_list AS $key => $val) {
$vrsticaIP = array();
- $vrsticaIP[] = $this->encodeText($val);
- $vrsticaIP[] = $this->encodeText($key);
+ $vrsticaIP[] = LatexDocument::encodeText($val);
+ $vrsticaIP[] = LatexDocument::encodeText($key);
$texReferalsView .= $this->tableRow($vrsticaIP,1);
}
@@ -1040,7 +1040,7 @@ class LatexStatus {
$texDateView = '';
//naslov okvirja
- $titleText = $this->encodeText($lang['srv_statistic_timeline_title']).$this->texNewLine;
+ $titleText = LatexDocument::encodeText($lang['srv_statistic_timeline_title']).$this->texNewLine;
$title = $this->returnBoldAndRed($titleText);
$this->ss->maxValue *= GRAPH_REDUCE;
@@ -1084,11 +1084,11 @@ class LatexStatus {
foreach ($this->ss->arrayRange as $key => $value) {
$label = $this->ss->formatStatsString($key, $this->ss->period);
$vmesnaVrstica = array();
- $vmesnaVrstica[] = $this->encodeText($label);
- //if($this->encodeText($value)){ //ce vrednost ni nula
+ $vmesnaVrstica[] = LatexDocument::encodeText($label);
+ //if(LatexDocument::encodeText($value)){ //ce vrednost ni nula
if($value){ //ce vrednost ni nula
- $graphLineLength = (GRAPH_LINE_LENGTH_MAX/$cnt)*$this->encodeText($value);
- //$vmesnaVrstica[] = $this->drawGraphLatex($graphLineLength, $this->encodeText($value));
+ $graphLineLength = (GRAPH_LINE_LENGTH_MAX/$cnt)*LatexDocument::encodeText($value);
+ //$vmesnaVrstica[] = $this->drawGraphLatex($graphLineLength, LatexDocument::encodeText($value));
$vmesnaVrstica[] = $this->drawGraphLatex($graphLineLength, $value);
}else{
$vmesnaVrstica[] = 0;
@@ -1100,8 +1100,8 @@ class LatexStatus {
// dodamo sumo
$texDateView .= $this->horizontalLineTex;
$vrsticaSuma = array();
- $vrsticaSuma[] = $this->encodeText($lang['srv_statistic_redirection_sum']);
- $vrsticaSuma[] = $this->encodeText($cnt);
+ $vrsticaSuma[] = LatexDocument::encodeText($lang['srv_statistic_redirection_sum']);
+ $vrsticaSuma[] = LatexDocument::encodeText($cnt);
$texDateView .= $this->tableRow($vrsticaSuma,1);
//zaljucek latex tabele s podatki
@@ -1109,7 +1109,7 @@ class LatexStatus {
//zaljucek latex tabele s podatki - konec
}
else {
- $texDateView .= $this->encodeText($lang['srv_no_data']).$this->texNewLine;
+ $texDateView .= LatexDocument::encodeText($lang['srv_no_data']).$this->texNewLine;
}
//izpis tabele in beedila v okvir
@@ -1127,7 +1127,7 @@ class LatexStatus {
$texPagesStateView = '';
//naslov okvirja
- $titleText = $this->encodeText($lang['srv_statistic_pages_state_title']).$this->texNewLine;
+ $titleText = LatexDocument::encodeText($lang['srv_statistic_pages_state_title']).$this->texNewLine;
$title = $this->returnBoldAndRed($titleText);
//ali lovimo samo strani ki niso bile preskočene
@@ -1173,21 +1173,21 @@ class LatexStatus {
//Priprava podatkov za izpis vrstic tabele in izpis vrstic
//naslovna vrstica
$naslovnaVrstica = array();
- $naslovnaVrstica[] = $this->encodeText($lang['srv_statistic_answer_state_status']);
- $naslovnaVrstica[] = $this->encodeText($lang['srv_statistic_redirection_click']);
+ $naslovnaVrstica[] = LatexDocument::encodeText($lang['srv_statistic_answer_state_status']);
+ $naslovnaVrstica[] = LatexDocument::encodeText($lang['srv_statistic_redirection_click']);
$texPagesStateView .= $this->tableRow($naslovnaVrstica);
# status 3 - "Klik na anketo"
$value = $this->ss->realUsersByStatus['3ll']['cnt'];
- $texPagesStateView .= $this->displayStatusLine($this->encodeText($lang['srv_userstatus_3']), $this->encodeText($value), $maxValue);
+ $texPagesStateView .= $this->displayStatusLine(LatexDocument::encodeText($lang['srv_userstatus_3']), LatexDocument::encodeText($value), $maxValue);
# status 4 - "Klik na prvo stran"
$value = $this->ss->realUsersByStatus['4ll']['cnt'];
- $texPagesStateView .= $this->displayStatusLine($this->encodeText($lang['srv_userstatus_4']), $this->encodeText($value), $maxValue);
+ $texPagesStateView .= $this->displayStatusLine(LatexDocument::encodeText($lang['srv_userstatus_4']), LatexDocument::encodeText($value), $maxValue);
# status 5 - "Zacel izpolnjevati",
$value = $this->ss->realUsersByStatus[5]['cnt'];
- $texPagesStateView .= $this->displayStatusLine($this->encodeText($lang['srv_userstatus_5']), $this->encodeText($value), $maxValue);
+ $texPagesStateView .= $this->displayStatusLine(LatexDocument::encodeText($lang['srv_userstatus_5']), LatexDocument::encodeText($value), $maxValue);
$texPagesStateView .= $this->horizontalLineTex; //horizontalna crta
$texPagesStateView .= $this->texNewLine; //prazna crta
@@ -1195,7 +1195,7 @@ class LatexStatus {
#strani
foreach ($pages as $key => $page) {
$value = $page['cnt'];
- $texPagesStateView .= $this->displayStatusLine($this->encodeText($page['naslov']), $this->encodeText($value), $maxValue);
+ $texPagesStateView .= $this->displayStatusLine(LatexDocument::encodeText($page['naslov']), LatexDocument::encodeText($value), $maxValue);
}
$texPagesStateView .= $this->horizontalLineTex; //horizontalna crta
@@ -1203,7 +1203,7 @@ class LatexStatus {
# status 6 - "Koncal",
$value6 = $this->ss->realUsersByStatus[6]['cnt'];
- $texPagesStateView .= $this->displayStatusLine($this->encodeText($lang['srv_userstatus_6']), $this->encodeText($value6), $maxValue);
+ $texPagesStateView .= $this->displayStatusLine(LatexDocument::encodeText($lang['srv_userstatus_6']), LatexDocument::encodeText($value6), $maxValue);
#če imamo lurkerje 6l dodamo skupaj konačal anketo (to je 6 + 6l) in nato še koliko jih je samo s statusom 6 (končal anketo)
# status 6l - "Koncal - lurker", izpišemo samo če obstajajo 6l
@@ -1212,13 +1212,13 @@ class LatexStatus {
$valueall = $this->ss->realUsersByStatus['6ll']['cnt'] ;
# končal s tem da je lurker (6l)
- $texPagesStateView .= $this->displayStatusLine($this->encodeText($lang['srv_userstatus_6l']), $this->encodeText($lurkerjev), $maxValue);
+ $texPagesStateView .= $this->displayStatusLine(LatexDocument::encodeText($lang['srv_userstatus_6l']), LatexDocument::encodeText($lurkerjev), $maxValue);
#črta
$texPagesStateView .= $this->horizontalLineTex; //horizontalna crta
# končal ne glede na to ali je lurker
- $texPagesStateView .= $this->displayStatusLine($this->encodeText($lang['srv_userstatus_all']), $this->encodeText($valueall), $maxValue);
+ $texPagesStateView .= $this->displayStatusLine(LatexDocument::encodeText($lang['srv_userstatus_all']), LatexDocument::encodeText($valueall), $maxValue);
}
//zaljucek latex tabele s podatki
@@ -1269,151 +1269,7 @@ class LatexStatus {
return $result;
}
-
- #moja funkcija encodeText
- function encodeText($text=''){
- // popravimo sumnike ce je potrebno
- //$text = html_entity_decode($text, ENT_NOQUOTES, 'UTF-8');
- //$text = str_replace("&scaron;","š",$text);
- //echo "Encoding ".$text."</br>";
- if($text == ''){ //ce ni teksta, vrni se
- return;
- }
- $textOrig = $text;
- $findme = '<br />';
- $findmeLength = strlen($findme);
- $findImg = '<img';
- $findImgLength = strlen($findImg);
-
- $pos = strpos($text, $findme);
- $posImg = strpos($text, $findImg);
-
- //ureditev izrisa slike
- if($posImg !== false){
- $numOfImgs = substr_count($text, $findImg); //stevilo '<br />' v tekstu
- $posImg = strpos($text, $findImg);
- $textPrej = '';
- $textPotem = '';
- for($i=0; $i<$numOfImgs; $i++){
- $posImg = strpos($text, $findImg);
- $textPrej = substr($text, 0, $posImg); //tekst do img
- $textPotem = substr($text, $posImg); //tekst po img, z vkljuceno hmlt kodo z img
- $posImgEnd = strpos($textPotem, '/>'); //pozicija, kjer se konca html koda za img
- $textPotem = substr($textPotem, $posImgEnd+strlen('/>')); //tekst od konca html kode za img dalje
-
- $text = $textPrej.' '.PIC_SIZE_ANS."{".$this->getImageName($text, 0, '<img')."}".' '.$textPotem;
- //$text2Return = $textPrej.' '.PIC_SIZE_ANS."{".$this->getImageName($text2Return, 0, 'img')."}".' '.$textPotem;
- }
-
- //pred ureditvijo posebnih karakterjev, odstrani del teksta s kodo za sliko, da se ne pojavijo tezave zaradi imena datoteke od slike
- $findImgCode = '\includegraphics';
- $posOfImgCode = strpos($text, $findImgCode);
- //echo $posOfImgCode."</br>";
- $textToImgCode = substr($text, 0, $posOfImgCode); //tekst do $findImgCode
- //echo $textToImgCode."</br>";
- $textFromImgCode = substr($text, $posOfImgCode); //tekst po $findImgCode
- //echo $textFromImgCode."</br>";
- $findImgCodeEnd = '}';
- //$posOfImgCodeEnd = strpos($text, $findImgCodeEnd);
- $posOfImgCodeEnd = strpos($textFromImgCode, $findImgCodeEnd);
- //echo $posOfImgCodeEnd."</br>";
- $textAfterImgCode = substr($textFromImgCode, $posOfImgCodeEnd+1); //tekst po $findImgCodeEnd
- //echo $textAfterImgCode."</br>";
- $textOfImgCode = substr($text, $posOfImgCode, $posOfImgCodeEnd+1);
- //echo $textOfImgCode."</br>";
-
- $text = $textToImgCode.$textAfterImgCode;
-
- //pred ureditvijo posebnih karakterjev, odstrani del teksta s kodo za sliko, da se ne pojavijo tezave zaradi imena datoteke od slike - konec
- }
- //ureditev izrisa slike - konec
-
- //ureditev posebnih karakterjev za Latex http://www.cespedes.org/blog/85/how-to-escape-latex-special-characters, https://en.wikibooks.org/wiki/LaTeX/Special_Characters#Other_symbols
- $text = str_replace('\\','\textbackslash{} ',$text);
- //$text = str_replace('{','\{',$text);
- //$text = str_replace('}','\}',$text);
- $text = str_replace('$','\$ ',$text);
- $text = str_replace('#','\# ',$text);
- $text = str_replace('%','\% ',$text);
- $text = str_replace('€','\euro',$text);
- $text = str_replace('^','\textasciicircum{} ',$text);
- //$text = str_replace('_','\_ ',$text);
- $text = str_replace('_','\_',$text);
- $text = str_replace('~','\textasciitilde{} ',$text);
- $text = str_replace('&amp;','\&',$text);
- $text = str_replace('&','\&',$text);
- //$text = str_replace('&lt;','\textless ',$text);
- $text = str_replace('&lt;','\textless',$text);
- //$text = str_replace('&gt;','\textgreater ',$text);
- $text = str_replace('&gt;','\textgreater',$text);
- $text = str_replace('&nbsp;',' ',$text);
- //ureditev posebnih karakterjev za Latex - konec
-
- //po ureditvi posebnih karakterjev, dodati del teksta s kodo za sliko, ce je slika prisotna
- if($posImg !== false){
- $text = substr_replace($text, $textOfImgCode, $posOfImgCode, 0);
- }
- //po ureditvi posebnih karakterjev, dodati del teksta s kodo za sliko, ce je slika prisotna
-
- if($pos === false && $posImg === false) { //v tekstu ni br in img
- //return $text;
-/* echo "encode pred strip: ".$text."</br>";
- echo "encode po strip: ".strip_tags($text)."</br>";
- return strip_tags($text); */
- }else { //v tekstu sta prisotna br ali img
- $text2Return = ''; //tekst ki bo vrnjen
-
- //ureditev preureditev html kode za novo vrstico v latex, ureditev prenosa v novo vrstico
- if($pos !== false){
- $pos = strpos($text, $findme);
- $numOfBr = substr_count($text, $findme); //stevilo '<br />' v tekstu
- for($i=0; $i<$numOfBr; $i++){
- if($i == 0){ //ce je prvi najdeni '<br />'
- $textPrej = substr($text, 0, $pos);
- $textPotem = substr($text, $pos+$findmeLength);
- if($i == $numOfBr-1){
- $text2Return .= $textPrej.' \break '.$textPotem;
- }else{
- $text2Return .= $textPrej.' \break ';
- }
- }else{ //drugace
- $pos = strpos($textPotem, $findme);
- $textPrej = substr($textPotem, 0, $pos);
- $textPotem = substr($textPotem, $pos+$findmeLength);
- if($i == $numOfBr-1){
- $text2Return .= $textPrej.' \break '.$textPotem;
- }else{
- $text2Return .= $textPrej.' \break ';
- }
- }
- }
- $text = $text2Return;
- }
- //ureditev preureditev html kode za novo vrstico v latex, ureditev prenosa v novo vrstico - konec
-/* echo "encode pred strip: ".$text."</br>";
- echo "encode po strip: ".strip_tags($text)."</br>";
- return strip_tags($text); //vrni tekst brez html tag-ov */
- }
- //preveri, ce je url v besedilu (http:// ... ) in uredi Latex izpis le-tega
- $findHttp = 'http://';
- $findHttps = 'https://';
- $posHttp = strpos($text, $findHttp);
- $posHttps = strpos($text, $findHttps);
-
- if($posHttp !== false || $posHttps !== false) { //v imamo URL naslov
- $space = ' ';
- if($posHttp !== false){
- $text = substr_replace($text, $space, ($posHttp+7), 0);
- }elseif($posHttps !== false){
- $text = substr_replace($text, $space, ($posHttps+8), 0);
- }
- }
- //preveri, ce je url v besedilu (http:// ... ) in uredi Latex izpis le-tega - konec
-
- return strip_tags($text); //vrni tekst brez html tag-ov
- }
-
function returnBold($text=''){
$boldedText = '';
$boldedText .= '\textbf{'.$text.'}';
@@ -1460,13 +1316,9 @@ class LatexStatus {
function tableRow($arrayText=[], $brezHline=0){
$tableRow = '';
- /*$linecount = $this->pdf->getNumLines($this->encodeText($arrayText[1]), 90);
+ /*$linecount = $this->pdf->getNumLines(LatexDocument::encodeText($arrayText[1]), 90);
$linecount == 1 ? $height = 4.7 : $height = 4.7 + ($linecount-1)*3.3;*/
- $height = 1; //$height = $this->getCellHeight($this->encodeText($arrayText[1]), 90);
-
- if($arrayParams['align2'] != 'C')
- $arrayParams['align2'] = 'L';
- //echo "velikost polja s tekstom: ".count($arrayText)."</br>";
+ $height = 1; //$height = $this->getCellHeight(LatexDocument::encodeText($arrayText[1]), 90);
for($i=0;$i<count($arrayText);$i++){
//echo "array text: ".$arrayText[$i]."</br>";