From 75160b12821f7f4299cce7f0b69c83c1502ae071 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Anton=20Luka=20=C5=A0ijanec?= Date: Mon, 27 May 2024 13:08:29 +0200 Subject: 2024-02-19 upstream --- .../Controllers/Vprasanja/ComputeController.php | 2 +- .../app/Controllers/Vprasanja/DatumController.php | 4 +- .../app/Controllers/Vprasanja/DoubleController.php | 4 +- .../Controllers/Vprasanja/DragDropController.php | 44 +-- .../Controllers/Vprasanja/DynamicController.php | 47 +++- .../Controllers/Vprasanja/HeatMapController.php | 30 +- .../Vprasanja/ImageHotSpotController.php | 124 +++----- .../Controllers/Vprasanja/MaxDiffController.php | 6 +- .../Controllers/Vprasanja/MultigridController.php | 85 +++--- .../Vprasanja/MultigridMobileController.php | 311 ++++++++++++++++++--- .../app/Controllers/Vprasanja/NumberController.php | 40 +-- .../Vprasanja/OneAgainstAnotherController.php | 76 +---- .../Vprasanja/RadioCheckboxSelectController.php | 38 ++- .../Controllers/Vprasanja/RankingController.php | 43 +-- .../app/Controllers/Vprasanja/TextController.php | 45 +-- .../Controllers/Vprasanja/VprasanjaController.php | 153 ++++++---- .../app/Controllers/Vprasanja/VsotaController.php | 20 +- 17 files changed, 644 insertions(+), 428 deletions(-) (limited to 'main/survey/app/Controllers/Vprasanja') diff --git a/main/survey/app/Controllers/Vprasanja/ComputeController.php b/main/survey/app/Controllers/Vprasanja/ComputeController.php index d3c9353..6a2b67b 100644 --- a/main/survey/app/Controllers/Vprasanja/ComputeController.php +++ b/main/survey/app/Controllers/Vprasanja/ComputeController.php @@ -48,7 +48,7 @@ class ComputeController extends Controller $sql1 = sisplet_query("SELECT text FROM srv_data_text" . get('db_table') . " WHERE spr_id='$spremenljivka' AND usr_id='" . get('usr_id') . "' AND loop_id $loop_id"); $row1 = mysqli_fetch_array($sql1); - echo ' '; + echo ' '; Js::getInstance()->generateCompute($spremenljivka); } diff --git a/main/survey/app/Controllers/Vprasanja/DatumController.php b/main/survey/app/Controllers/Vprasanja/DatumController.php index 21552b5..964f68c 100644 --- a/main/survey/app/Controllers/Vprasanja/DatumController.php +++ b/main/survey/app/Controllers/Vprasanja/DatumController.php @@ -67,8 +67,8 @@ class DatumController extends Controller $sql1 = sisplet_query("SELECT text FROM srv_data_text" . get('db_table') . " WHERE spr_id='$spremenljivka' AND usr_id='" . get('usr_id') . "' AND loop_id $loop_id"); $row1 = mysqli_fetch_array($sql1); - echo ' '; + $text = isset($row1['text']) ? $row1['text'] : ''; + echo ' '; echo '' . "\n"; diff --git a/main/survey/app/Controllers/Vprasanja/DoubleController.php b/main/survey/app/Controllers/Vprasanja/DoubleController.php index b357be3..83a68af 100644 --- a/main/survey/app/Controllers/Vprasanja/DoubleController.php +++ b/main/survey/app/Controllers/Vprasanja/DoubleController.php @@ -281,8 +281,8 @@ class DoubleController extends Controller $row1['naslov'] = $naslov; } # preverimo izbrano vrednost - $grid_id = $srv_data_grid[$row1['id']]['grd_id']; - $grid_id2 = $srv_data_grid2[$row1['id']]['grd_id']; + $grid_id = isset($srv_data_grid[$row1['id']]['grd_id']) ? $srv_data_grid[$row1['id']]['grd_id'] : ""; + $grid_id2 = isset($srv_data_grid2[$row1['id']]['grd_id']) ? $srv_data_grid2[$row1['id']]['grd_id'] : ""; # ugotovimo ali je na katerem gridu predhodno izbran missing $is_missing = false; diff --git a/main/survey/app/Controllers/Vprasanja/DragDropController.php b/main/survey/app/Controllers/Vprasanja/DragDropController.php index 4b4f4bc..aad911e 100644 --- a/main/survey/app/Controllers/Vprasanja/DragDropController.php +++ b/main/survey/app/Controllers/Vprasanja/DragDropController.php @@ -103,7 +103,8 @@ class DragDropController extends Controller echo '' . $srv_ranking_avaliable_categories . ':'; - echo '
'; + //echo '
'; + echo '
'; $sql1 = sisplet_query("SELECT id, naslov, other FROM srv_vrednost WHERE spr_id='$spremenljivka' AND id NOT IN(SELECT vre_id FROM srv_data_rating WHERE spr_id = '$spremenljivka' AND usr_id='" . get('usr_id') . "' AND loop_id $loop_id) ORDER BY FIELD(vrstni_red, $order)"); echo '
    '; @@ -209,7 +210,7 @@ class DragDropController extends Controller echo ''; } echo ''; - echo 'arrow'; + //echo 'arrow'; echo ''; //izris desne strani @@ -386,7 +387,8 @@ class DragDropController extends Controller echo '' . $srv_ranking_avaliable_categories . ':'; - echo '
    '; + //echo '
    '; + echo '
    '; $sql1 = sisplet_query("SELECT id, naslov, other FROM srv_vrednost WHERE spr_id='$spremenljivka' AND id NOT IN(SELECT vre_id FROM srv_data_rating WHERE spr_id = '$spremenljivka' AND usr_id='" . get('usr_id') . "' AND loop_id $loop_id) ORDER BY FIELD(vrstni_red, $order)"); if (get('mobile') == 0 || get('mobile') == 2) {// ce respondent uporablja PC ali tablico @@ -416,13 +418,9 @@ class DragDropController extends Controller $length = strlen($value); //dolzina teksta kategorije odgovora $style = ''; if (get('mobile') == 0 || get('mobile') == 2) {// ce respondent uporablja PC ali tablico - //if($display_drag_and_drop_new_look != 1){ - $class = 'ranking'; -/* }else if($display_drag_and_drop_new_look == 1){ - $class = 'drag_and_drop_box'; - } */ - - } else if (get('mobile') == 1) { + $class = 'ranking'; + } + else if (get('mobile') == 1) { $class = 'ranking_mobile'; } $c = ''; @@ -490,32 +488,12 @@ class DragDropController extends Controller $(document).ready(function () { - //if( == 0){ - GridDraggable(, , , , srv_meta_anketa_id, '', usr_id, , , , , ); //poklici funkcijo za ureditev draggable in droppable -/* } - else if( == 1){ - //GridDraggableBox(, , , , srv_meta_anketa_id, '', , , ); //poklici funkcijo za ureditev draggable in droppable - GridDraggableBox(, , , , srv_meta_anketa_id, '', usr_id, , ); //poklici funkcijo za ureditev draggable in droppable - } */ + GridDraggable(, , , , srv_meta_anketa_id, '', usr_id, , , , , ); //poklici funkcijo za ureditev draggable in droppable }); '; - //echo '
    '; //vrednost_if_ID - //div ki vsebuje vrednost - //if($length > 30) - // if($length > 90){ - // $niz = substr($value, 0, 90); - //echo '
    '.$niz.'...
    '."\n"; - // echo '
    '.$niz.'...
    '."\n"; - // } - // else - //echo '
    '.$value.'
    '."\n"; - // echo '
    '.$value.'
    '."\n"; - //else{ - //echo '
    '.$value.'
    '."\n"; + echo '
    ' . $value . '
    ' . "\n"; //'#spremenljivka_'+spremenljivka+'_vrednost_'+id - //} } echo '' . "\n"; @@ -530,7 +508,7 @@ class DragDropController extends Controller echo ''; } echo ''; - echo 'arrow'; + //echo 'arrow'; echo ''; //izris desne strani*********************************************************************************** diff --git a/main/survey/app/Controllers/Vprasanja/DynamicController.php b/main/survey/app/Controllers/Vprasanja/DynamicController.php index 57e0127..92acc2d 100644 --- a/main/survey/app/Controllers/Vprasanja/DynamicController.php +++ b/main/survey/app/Controllers/Vprasanja/DynamicController.php @@ -183,18 +183,21 @@ class DynamicController extends Controller echo ''; + //vrstica z nadnaslovi echo ''; echo ' '; echo ' '; - //for($j = 1; $j <= $trak_num_of_titles; $j++){ + for ($j = 1; $j <= $row['grids']; $j++) { - //echo ''.$j.''; + if($j == 1){ $nadnaslov_floating = 'left'; - }else if($j == $row['grids']){ + } + else if($j == $row['grids']){ $nadnaslov_floating = 'right'; - }else{ + } + else{ $nadnaslov_floating = 'none'; } echo '
    lang_id!=null ?' default="1"':'').'>' . $trak_nadnaslov[$j] . '
    '; @@ -203,6 +206,7 @@ class DynamicController extends Controller echo ''; //vrstica z nadnaslovi - konec + echo ' ' . "\n"; echo ' ' . "\n"; echo ' ' . "\n"; @@ -220,15 +224,20 @@ class DynamicController extends Controller // Datapiping $srv_grid['naslov'] = Helper::dataPiping($srv_grid['naslov']); - - if($diferencial_trak != 1){ //ce ni traku + //ce ni traku + if($diferencial_trak != 1){ # izpišemo labelo grida echo ' ' . $srv_grid['naslov'] . '' . "\n"; - }elseif($diferencial_trak == 1){ //ce je trak + } + //ce je trak + elseif($diferencial_trak == 1){ + # izpišemo ustrezno labelo grida if($srv_grid['other'] == 0){ //ce je labela za kategorijo odgovora, naj bo prazno echo ' ' . "\n"; - }else { //drugace, ce je labela za missing, izpisi labelo + } + //drugace, ce je labela za missing, izpisi labelo + else { echo ' ' . $srv_grid['naslov'] . '' . "\n"; } } @@ -263,15 +272,26 @@ class DynamicController extends Controller // Stevilo vseh vrednosti echo ''; + // Indikator da v js vemo ali smo ravnokar naloudali stran ali pa smo samo premaknili vrstico (potrebno zaradi prikazovanja glede na ife v dolocenih primerih) echo ''; while ($row1 = mysqli_fetch_array($sql1)) { + # po potrebi prevedemo naslov $naslov = Language::getInstance()->srv_language_vrednost($row1['id']); if ($naslov != '') { $row1['naslov'] = $naslov; } + + # po potrebi prevedemo naslov2 za diferencial + if ($row['enota'] == 1) { + $naslov2 = Language::getInstance()->srv_language_vrednost($row1['id'], true); + if ($naslov2 != '') { + $row1['naslov2'] = $naslov2; + } + } + # preverimo izbrano vrednost $grid_id = $srv_data_grid[$row1['id']]['grd_id']; @@ -545,11 +565,22 @@ class DynamicController extends Controller echo ''; while ($row1 = mysqli_fetch_array($sql1)) { + # po potrebi prevedemo naslov $naslov = Language::getInstance()->srv_language_vrednost($row1['id']); if ($naslov != '') { $row1['naslov'] = $naslov; } + + # po potrebi prevedemo naslov2 za diferencial + if ($row['enota'] == 1) { + $naslov2 = Language::getInstance()->srv_language_vrednost($row1['id'], true); + if ($naslov2 != '') { + $row1['naslov2'] = $naslov2; + } + } + + # preverimo izbrano vrednost $grid_id = $srv_data_grid[$row1['id']]['grd_id']; diff --git a/main/survey/app/Controllers/Vprasanja/HeatMapController.php b/main/survey/app/Controllers/Vprasanja/HeatMapController.php index 4a255dd..c3f1e2a 100644 --- a/main/survey/app/Controllers/Vprasanja/HeatMapController.php +++ b/main/survey/app/Controllers/Vprasanja/HeatMapController.php @@ -91,8 +91,8 @@ class HeatMapController extends Controller echo '
    '; //imena obmocij iz srv_vrednost - $sql1 = sisplet_query("SELECT id, naslov FROM srv_vrednost WHERE spr_id='$row[id]' ORDER BY vrstni_red"); - $sqlR = sisplet_query("SELECT region_coords, vre_id FROM srv_hotspot_regions WHERE spr_id='$row[id]' "); + $sql1 = sisplet_query("SELECT id, naslov FROM srv_vrednost WHERE spr_id='".$row['id']."' ORDER BY vrstni_red"); + $sqlR = sisplet_query("SELECT region_coords, vre_id FROM srv_hotspot_regions WHERE spr_id='".$row['id']."'"); //ce so podatki ze v bazi (rec. uporabnik klikne 'Prejsnja stran') //$sql1a = sisplet_query("SELECT lat, lng, address, text FROM srv_data_map WHERE spr_id='$spremenljivka' AND usr_id='" . get('usr_id') . "' AND loop_id $loop_id"); @@ -102,20 +102,20 @@ class HeatMapController extends Controller $heatmap_data[] = $row1a; } - echo '