summaryrefslogtreecommitdiffstats
path: root/admin/survey/export/latexclasses/Vprasanja/HeatmapLatex.php
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--admin/survey/export/latexclasses/Vprasanja/HeatmapLatex.php59
1 files changed, 36 insertions, 23 deletions
diff --git a/admin/survey/export/latexclasses/Vprasanja/HeatmapLatex.php b/admin/survey/export/latexclasses/Vprasanja/HeatmapLatex.php
index 94e86fb..f65b419 100644
--- a/admin/survey/export/latexclasses/Vprasanja/HeatmapLatex.php
+++ b/admin/survey/export/latexclasses/Vprasanja/HeatmapLatex.php
@@ -9,9 +9,10 @@
* Datum: 09/2017
*****************************************/
//use enkaParameters;
-define("PIC_SIZE", "\includegraphics[width=10cm]"); //slika sirine 50mm
-define("ICON_SIZE", "\includegraphics[width=0.5cm]"); //za ikone @ slikovni tip
-define("RADIO_BTN_SIZE", 0.13);
+
+if (!defined('PIC_SIZE')) define("PIC_SIZE", "\includegraphics[width=5cm]"); //slika sirine 50mm
+if (!defined('ICON_SIZE')) define("ICON_SIZE", "\includegraphics[width=0.5cm]"); //za ikone @ slikovni tip
+if (!defined('RADIO_BTN_SIZE')) define("RADIO_BTN_SIZE", 0.13);
class HeatmapLatex extends LatexSurveyElement
{
@@ -74,15 +75,19 @@ class HeatmapLatex extends LatexSurveyElement
//pregled vseh moznih vrednosti (kategorij) po $sqlVrednosti
while ($rowVrednost = mysqli_fetch_assoc($sqlVrednosti)){
$stringTitleRow = $rowVrednost['naslov']; //odgovori na levi strani
- array_push($navpicniOdgovori, $this->encodeText($stringTitleRow) ); //filanje polja z navpicnimi odgovori (po vrsticah)
+ if($usr_id){
+ $stringTitleRow = Common::getInstance()->dataPiping($stringTitleRow, $usr_id, $loop_id);
+ }
+ array_push($navpicniOdgovori, LatexDocument::encodeText($stringTitleRow) ); //filanje polja z navpicnimi odgovori (po vrsticah)
}
//pregled vseh moznih vrednosti (kategorij) po $sqlVrednosti - konec
//$tex .= $this->IzrisVsotaTabela($spremenljivke, $numRowsSql, $navpicniOdgovori, $texNewLine, $texNewLineAfterTable, $export_format, 0);
- $imageName = $this->getImageName('hotspot', $spremenljivke['id'], 'hotspot_image=');
- //echo("iz heatmap ime slike: ".$imageName."</br>");
+ //html slike
+ //$imageName = ($spremenljivkaParams->get('hotspot_image') ? $spremenljivkaParams->get('hotspot_image') : "");
+ $imageName = LatexDocument::getImageName('hotspot', $spremenljivke['id'], 'hotspot_image=');
$path2Images = $this->path2Images;
$imageNameTest = $path2Images.$imageName.'.png'; //za preveriti, ali obstaja slikovna datoteka na strezniku
@@ -92,7 +97,7 @@ class HeatmapLatex extends LatexSurveyElement
$imageName = $path2Images.$imageName;
- if(filesize($imageNameTest) > 0){
+ if(filesize(file_exists($imageNameTest)) > 0){
$image = PIC_SIZE."{".$imageName."}"; //priprave slike predefinirane dimenzije
}else{
//$image = 'ni slike';
@@ -110,22 +115,29 @@ class HeatmapLatex extends LatexSurveyElement
if($whileIndeks == 0){ //ce so prisotna imena obmocij, izpisi besedilo "Obmocja na sliki"
$tex .= $lang['srv_export_hotspot_regions_names'].': '.$texNewLine; //izpis besedila "Obmocja na sliki"
}
- $tex .= $rowHotSpotRegions['region_name'].''.$texNewLine;
- if($rowHotSpotRegions['region_name']){
- array_push($obmocjaNaSliki, $rowHotSpotRegions['region_name']);
- //array_push($coordsObmocijNaSliki, $rowHotSpotRegions['region_coords']);
- $coordsObmocijNaSliki[$rowHotSpotRegions['region_name']]=$rowHotSpotRegions['region_coords'];
- $point[$rowHotSpotRegions['region_name']] = 0;
+
+ $regionName = $rowHotSpotRegions['region_name'];
+ if($usr_id){
+ $regionName = Common::getInstance()->dataPiping($regionName, $usr_id, $loop_id);
+ }
+ $regionName = LatexDocument::encodeText($regionName);
+ $tex .= $regionName.''.$texNewLine;
+ //echo "ime: $regionName </br>";
+
+ if($regionName){
+ array_push($obmocjaNaSliki, $regionName);
+ $coordsObmocijNaSliki[$regionName]=$rowHotSpotRegions['region_coords'];
+ $point[$regionName] = 0;
}
$whileIndeks++;
}
$tex .= $texNewLine;
- //ureditev missing-ov
- if(count($missingOdgovori)!=0){ //ce so missing-i
+ //ureditev missing-ov - pokomentiranje missing-ov ob preurejanju kode za PHP8 - Patrik
+/* if(count($missingOdgovori)!=0){ //ce so missing-i
$vodoravniOdgovori = $this->AddMissingsToAnswers($vodoravniOdgovori, $missingOdgovori);
- }
+ } */
//ureditev missing-ov - konec
@@ -152,6 +164,7 @@ class HeatmapLatex extends LatexSurveyElement
$textboxHeightOdgovori = 0; //visina okvirja z odgovorom
$noBordersOdgovori = 0;
$parameterTabular = 'l';
+ $textboxAllignment = null;
//za ureditev stevila tock v izbranih obmocjih
$dataPointValue = array();
$data = array();
@@ -221,7 +234,7 @@ class HeatmapLatex extends LatexSurveyElement
$point[$obmocjaNaSliki[$o]]++;
}
}
- //echo "stevilo tock znotraj obmocja: ".$point["Besedilo"]."</br>";
+ //echo "stevilo tock znotraj obmocja: ".$point["Besedilo"]."</br>";
}
#pridobitev podatkov o obmocjih in podatka o prisotnosti tocke v obmocju - konec
//echo $answer."</br>";
@@ -230,13 +243,13 @@ class HeatmapLatex extends LatexSurveyElement
//zacetek tabele
- $tex .= $this->StartLatexTable($export_format, $parameterTabular, 'tabularx', 'tabular', 1, 1);
+ $tex .= $this->StartLatexTable($export_format, $parameterTabular, 'xltabular', 'tabular', 1, 1);
//izpis latex kode za prazen okvir oz. okvir z odgovori respondenta
$tex .= $this->LatexTextBox($export_format, $textboxHeightOdgovori, $textboxWidthOdgovori, $answer, $textboxAllignment, $noBordersOdgovori);
//zakljucek tabele
- $tex .= $this->EndLatexTable($export_format, 'tabularx', 'tabular');
+ $tex .= $this->EndLatexTable($export_format, 'xltabular', 'tabular');
//$tex .= $texNewLine;
}
@@ -256,13 +269,13 @@ class HeatmapLatex extends LatexSurveyElement
}
//zacetek tabele
- $tex .= $this->StartLatexTable($export_format, $parameterTabular, 'tabularx', 'tabular', 1, 1);
+ $tex .= $this->StartLatexTable($export_format, $parameterTabular, 'xltabular', 'tabular', 1, 1);
//izpis latex kode za prazen okvir oz. okvir z odgovori respondenta
$tex .= $this->LatexTextBox($export_format, $textboxHeightOdgovori, $textboxWidthOdgovori, $answerRegions, $textboxAllignment, $noBordersOdgovori);
//zakljucek tabele
- $tex .= $this->EndLatexTable($export_format, 'tabularx', 'tabular');
+ $tex .= $this->EndLatexTable($export_format, 'xltabular', 'tabular');
//$tex .= $texNewLine;
}
@@ -298,8 +311,8 @@ class HeatmapLatex extends LatexSurveyElement
#funkcija, ki skrbi za pretvorbo stringa koordinat obmocja v polja
function convertPolyString($polypoints=null){
$poly = [];
- //$tmpX;
- //$tmpY;
+ $tmpX = null;
+ $tmpY = null;
$j = 0;
$poly = explode(",", $polypoints);