diff options
author | Anton Luka Šijanec <anton@sijanec.eu> | 2024-05-27 13:08:29 +0200 |
---|---|---|
committer | Anton Luka Šijanec <anton@sijanec.eu> | 2024-05-27 13:08:29 +0200 |
commit | 75160b12821f7f4299cce7f0b69c83c1502ae071 (patch) | |
tree | 27e25e4ccaef45f0c58b22831164050d1af1d4db /main/survey/app/Controllers/Vprasanja | |
parent | prvi-commit (diff) | |
download | 1ka-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 'main/survey/app/Controllers/Vprasanja')
17 files changed, 644 insertions, 428 deletions
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 ' <input type="text" name="vrednost_' . $spremenljivka . '" id="vrednost_' . $spremenljivka . '" value="' . $row1['text'] . '">';
+ echo ' <input type="text" name="vrednost_' . $spremenljivka . '" id="vrednost_' . $spremenljivka . '" value="' . ($row1 != null ? $row1['text'] : '') . '">';
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 '<input type="text" id="vrednost_' . $spremenljivka . '" name="vrednost_' . $spremenljivka . '" value="' . $row1['text'] . '"
- onkeyup="checkBranching();" ' . ($is_missing ? ' disabled' : '') . ' readonly="true"> ';
+ $text = isset($row1['text']) ? $row1['text'] : '';
+ echo '<input type="text" id="vrednost_' . $spremenljivka . '" name="vrednost_' . $spremenljivka . '" value="'.$text.'" onkeyup="checkBranching();" ' . ($is_missing ? ' disabled' : '') . ' readonly="true"> ';
echo '</div>' . "\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 '<b>' . $srv_ranking_avaliable_categories . ':</b>';
- echo '<div id="half_' . $spremenljivka . '" class="dropzone" style="height:' . $size . 'px">';
+ //echo '<div id="half_' . $spremenljivka . '" class="dropzone" style="height:' . $size . 'px">';
+ echo '<div id="half_' . $spremenljivka . '" class="dropzone" style="min-height:' . $size . 'px">';
$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 '<ul>';
@@ -209,7 +210,7 @@ class DragDropController extends Controller echo '<td class="middle_mobile">';
}
echo '<b></b>';
- echo '<img src="' . self::$site_url . 'main/survey/skins/Modern/arrow.png" alt="arrow">';
+ //echo '<img src="' . self::$site_url . 'main/survey/skins/Modern/arrow.png" alt="arrow">';
echo '</td>';
//izris desne strani
@@ -386,7 +387,8 @@ class DragDropController extends Controller echo '<b>' . $srv_ranking_avaliable_categories . ':</b>';
- echo '<div id="half_' . $spremenljivka . '" class="dropzone" style="height:' . $size . 'px">';
+ //echo '<div id="half_' . $spremenljivka . '" class="dropzone" style="height:' . $size . 'px">';
+ echo '<div id="half_' . $spremenljivka . '" class="dropzone" style="min-height:' . $size . 'px">';
$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(<?=$display_drag_and_drop_new_look?> == 0){
- GridDraggable(<?=$row['tip']?>, <?=$spremenljivka?>, <?=$vre_id?>, <?=$ajax?>, srv_meta_anketa_id, '<?=self::$site_url?>', usr_id, <?=$other?>, <?=get('mobile')?>, <?=$display_drag_and_drop_new_look?>, <?=$quick_view?>, <?=$preview_spremenljivka?>); //poklici funkcijo za ureditev draggable in droppable
-/* }
- else if(<?=$display_drag_and_drop_new_look?> == 1){
- //GridDraggableBox(<?=$row['tip']?>, <?=$spremenljivka?>, <?=$vre_id?>, <?=$ajax?>, srv_meta_anketa_id, '<?=self::$site_url?>', <?=$usr_id?>, <?=$other?>, <?=get('mobile')?>); //poklici funkcijo za ureditev draggable in droppable
- GridDraggableBox(<?=$row['tip']?>, <?=$spremenljivka?>, <?=$vre_id?>, <?=$ajax?>, srv_meta_anketa_id, '<?=self::$site_url?>', usr_id, <?=$other?>, <?=get('mobile')?>); //poklici funkcijo za ureditev draggable in droppable
- } */
+ GridDraggable(<?=$row['tip']?>, <?=$spremenljivka?>, <?=$vre_id?>, <?=$ajax?>, srv_meta_anketa_id, '<?=self::$site_url?>', usr_id, <?=$other?>, <?=get('mobile')?>, <?=$display_drag_and_drop_new_look?>, <?=$quick_view?>, <?=$preview_spremenljivka?>); //poklici funkcijo za ureditev draggable in droppable
});
</script>
<?
- //echo '<div id="vrednost_if_'.$id.'" class="variabla">';
- //echo '</div>'; //vrednost_if_ID
- //div ki vsebuje vrednost
- //if($length > 30)
- // if($length > 90){
- // $niz = substr($value, 0, 90);
- //echo '<div title="'.strip_tags($value).'" id="'.$class.'_'.$id.'" class="'.$class.'_long '.$c.'">'.$niz.'...</div>'."\n";
- // echo '<div title="'.strip_tags($value).'" id="'.$class.'_'.$vre_id.'" class="'.$class.'_long '.$c.'">'.$niz.'...</div>'."\n";
- // }
- // else
- //echo '<div title="'.strip_tags($value).'" id="'.$class.'_'.$id.'" class="'.$class.'_long '.$c.'">'.$value.'</div>'."\n";
- // echo '<div title="'.strip_tags($value).'" id="'.$class.'_'.$vre_id.'" class="'.$class.'_long '.$c.'">'.$value.'</div>'."\n";
- //else{
- //echo '<div id="'.$class.'_'.$id.'" class="'.$class.' '.$c.'">'.$value.'</div>'."\n";
+
echo '<div id="spremenljivka_' . $spremenljivka . '_vrednost_' . $vre_id . '" class="' . $class . ' ' . $c . '">' . $value . '</div>' . "\n"; //'#spremenljivka_'+spremenljivka+'_vrednost_'+id
- //}
}
echo '</li>' . "\n";
@@ -530,7 +508,7 @@ class DragDropController extends Controller echo '<td class="middle_mobile">';
}
echo '<b></b>';
- echo '<img src="' . self::$site_url . 'main/survey/skins/Modern/arrow.png" alt="arrow">';
+ //echo '<img src="' . self::$site_url . 'main/survey/skins/Modern/arrow.png" alt="arrow">';
echo '</td>';
//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 '<thead>';
+
//vrstica z nadnaslovi
echo '<tr '.$display_trak_num_of_titles.' class="display_trak_num_of_titles_respondent_'.$row['id'].'">';
echo ' <td></td>';
echo ' <td></td>';
- //for($j = 1; $j <= $trak_num_of_titles; $j++){
+
for ($j = 1; $j <= $row['grids']; $j++) {
- //echo '<td>'.$j.'</td>';
+
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 '<td class="trak_inline_nadnaslov" grd="gr_'.$j.'"><div id="trak_nadnaslov_'.$j.'_'.$spremenljivka.'" name="trak_nadnaslov_'.$j.'" class="trak_inline_nadnaslov" style="float:'.$nadnaslov_floating.'; display:inline" '.(strpos($trak_nadnaslov[$j], $lang['srv_new_text'])!==false || $this->lang_id!=null ?' default="1"':'').'>' . $trak_nadnaslov[$j] . '</div></td>';
@@ -203,6 +206,7 @@ class DynamicController extends Controller echo '</tr>';
//vrstica z nadnaslovi - konec
+
echo ' <tr>' . "\n";
echo ' <td></td>' . "\n";
echo ' <td></td>' . "\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 ' <td class="' . ($srv_grid['other'] == 0 ? 'category' : 'missing') . '">' . $srv_grid['naslov'] . '</td>' . "\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 ' <td class="' . ($srv_grid['other'] == 0 ? 'category' : 'missing') . ' ' . $cssAlign . '"></td>' . "\n";
- }else { //drugace, ce je labela za missing, izpisi labelo
+ }
+ //drugace, ce je labela za missing, izpisi labelo
+ else {
echo ' <td class="' . ($srv_grid['other'] == 0 ? 'category' : 'missing') . ' ' . $cssAlign . '">' . $srv_grid['naslov'] . '</td>' . "\n";
}
}
@@ -263,15 +272,26 @@ class DynamicController extends Controller // Stevilo vseh vrednosti
echo '<input type="hidden" id="dynamic_multigrid_' . $spremenljivka . '" value="' . $countVar . '" />';
+
// 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 '<input type="hidden" id="dynamic_multigrid_' . $spremenljivka . '_load" value="1" />';
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 '<input type="hidden" id="dynamic_multigrid_' . $spremenljivka . '_load" value="1" />';
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 '<div id="heatmap_'.$spremenljivka.'" class="hotspot" style="width: 40%; float: left;">';
//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 '<div id="hotspot_regions_hidden_menu_'.$row[id].'" style="display:none; ">';
- //echo '<div id="hotspot_regions_hidden_menu_'.$row[id].'">';
- //echo ' <div class="variabla" id="variabla_'.$row1['id'].'">';
- if (mysqli_num_rows($sql1) == 0){
- echo ' <div class="variabla">';
+ echo '<div id="hotspot_regions_hidden_menu_'.$row['id'].'" style="display:none; ">';
+
+ if (mysqli_num_rows($sql1) == 0){
+ echo ' <div class="variabla">';
+ echo '</div>';
+ }
+ else{
+ while ($row1 = mysqli_fetch_array($sql1)) {
+
+ echo ' <div class="variabla" id="variabla_'.$row1['id'].'">';
+ echo '<div id="vre_id_'.$row1['id'].'" class="vrednost_inline" contenteditable="'.(!$locked?'true':'false').'" tabindex="1" vre_id="'.$row1['id'].'" '.(strpos($row1['naslov'], $lang['srv_new_vrednost'])!==false || strpos($row1['naslov'], $lang1['srv_new_vrednost'])!==false || $this->lang_id!=null ? ' default="1"':'').'>' . $row1['naslov'].'</div>';
echo '</div>';
- }else{
- while ($row1 = mysqli_fetch_array($sql1)) {
-
- echo ' <div class="variabla" id="variabla_'.$row1['id'].'">';
- echo '<div id="vre_id_'.$row1['id'].'" class="vrednost_inline" contenteditable="'.(!$locked?'true':'false').'" tabindex="1" vre_id="'.$row1['id'].'" '.(strpos($row1['naslov'], $lang['srv_new_vrednost'])!==false || strpos($row1['naslov'], $lang1['srv_new_vrednost'])!==false || $this->lang_id!=null ? ' default="1"':'').'>' . $row1['naslov'].'</div>';
- echo '</div>';
- }
- }
+ }
+ }
echo '</div>';
diff --git a/main/survey/app/Controllers/Vprasanja/ImageHotSpotController.php b/main/survey/app/Controllers/Vprasanja/ImageHotSpotController.php index 3e0b953..c706d39 100644 --- a/main/survey/app/Controllers/Vprasanja/ImageHotSpotController.php +++ b/main/survey/app/Controllers/Vprasanja/ImageHotSpotController.php @@ -82,11 +82,11 @@ class ImageHotSpotController extends Controller //imena obmocij iz srv_vrednost
- $sql1 = sisplet_query("SELECT id, naslov FROM srv_vrednost WHERE spr_id='$row[id]' ORDER BY vrstni_red");
+ $sql1 = sisplet_query("SELECT id, naslov FROM srv_vrednost WHERE spr_id='".$row['id']."' ORDER BY vrstni_red");
//$sqlR = sisplet_query("SELECT * FROM srv_hotspot_regions WHERE spr_id='$row[id]' ");
- $sqlR = sisplet_query("SELECT region_coords, vre_id FROM srv_hotspot_regions WHERE spr_id='$row[id]' ");
+ $sqlR = sisplet_query("SELECT region_coords, vre_id FROM srv_hotspot_regions WHERE spr_id='".$row['id']."'");
- echo '<div id="hotspot_regions_hidden_menu_'.$row[id].'" style="display:none; ">';
+ echo '<div id="hotspot_regions_hidden_menu_'.$row['id'].'" style="display:none; ">';
if (mysqli_num_rows($sql1) == 0){
echo ' <div class="variabla">';
echo '</div>';
@@ -184,8 +184,9 @@ class ImageHotSpotController extends Controller if ($naslov != '') {
$row1['naslov'] = $naslov;
}
+
# preverimo izbrano vrednost
- $grid_id = $srv_data_grid[$row1['id']]['grd_id'];
+ $grid_id = isset($srv_data_grid[$row1['id']]['grd_id']) ? $srv_data_grid[$row1['id']]['grd_id'] : '';
# ugotovimo ali je na katerem gridu predhodno izbran missing
$is_missing = false;
@@ -353,7 +354,7 @@ class ImageHotSpotController extends Controller $mv_count = 0; # koliko je stolpcev z manjkajočimi vrednostmi
# če polje other != 0 je grid kot missing
//$sql_grid = sisplet_query("SELECT * FROM srv_grid WHERE spr_id='$row[id]' ORDER BY vrstni_red");
- $sql_grid = sisplet_query("SELECT id, naslov, other FROM srv_grid WHERE spr_id='$row[id]' ORDER BY vrstni_red");
+ $sql_grid = sisplet_query("SELECT id, naslov, other, variable FROM srv_grid WHERE spr_id='$row[id]' ORDER BY vrstni_red");
while ($row_grid = mysqli_fetch_assoc($sql_grid)) {
# priredimo naslov če prevajamo anketo
@@ -410,7 +411,7 @@ class ImageHotSpotController extends Controller $row1['naslov'] = $naslov;
}
// preverimo izbrano vrednost
- $grid_id = $srv_data_grid[$row1['id']]['grd_id'];
+ $grid_id = isset($srv_data_grid[$row1['id']]['grd_id']) ? $srv_data_grid[$row1['id']]['grd_id'] : '';
// ugotovimo ali je na katerem gridu predhodno izbran missing
$is_missing = false;
@@ -464,11 +465,10 @@ class ImageHotSpotController extends Controller # izpišemo radio grida
if ($srv_grid['other'] != 0) {
- $htmltootip[$row1['id']] = $htmltootip[$row1['id']].'<div class=\"missing ' . $cssAlign . '\">';
+ $htmltootip[$row1['id']] = $htmltootip[$row1['id']].'<div class=\"missing\">';
# imamo missing vrednost
$htmltootip[$row1['id']] = $htmltootip[$row1['id']].'<label for=\"im_grid_missing_value_' . $row1['id'] . '_grid_' . $value . '\">';
- //$htmltootip[$row1['id']] = $htmltootip[$row1['id']].'<input type=\"radio\" ' . (!$hideName ? ' name=\"vrednost_' . $row1['id'] . '\"' : '') . ' id=\"im_grid_missing_value_' . $row1['id'] . '_grid_' . $value . '\" value=\"' . $value . '\"' . (($grid_id == $value && $grid_id != '') ? ' checked' : '') . ' data-calculation=\"0\" onclick=\"checkChecked(this); checkTableMissing(this); checkBranching(); setCheckedClass(this, null, ' . $row1['id'] . '); mapdelovanjeRadioGrid(this, ' . $row1['id'] . ');\">';
$htmltootip[$row1['id']] = $htmltootip[$row1['id']].'<input type=\"radio\" ' . (!$hideName ? ' name=\"vrednost_' . $row1['id'] . '\"' : '') . ' id=\"im_grid_missing_value_' . $row1['id'] . '_grid_' . $value . '\" value=\"' . $value . '\"' . (($grid_id == $value && $grid_id != '') ? ' checked' : '') . ' data-calculation=\"0\" onclick=\"checkChecked(this); checkTableMissing(this); if (typeof checkBranching == \'function\'){checkBranching();} setCheckedClass(this, null, ' . $row1['id'] . '); mapdelovanjeRadioGrid(this, ' . $row1['id'] . ');\">';
//$htmltootip[$row1['id']] = $htmltootip[$row1['id']].'<span class="enka-checkbox-radio ' . (($row1['hidden'] == 2) ? ' answer-disabled' : '') .'"'.
@@ -479,7 +479,7 @@ class ImageHotSpotController extends Controller $htmltootip[$row1['id']] = $htmltootip[$row1['id']].'</label>';
$htmltootip[$row1['id']] = $htmltootip[$row1['id']].'</div>';
} else {
- $htmltootip[$row1['id']] = $htmltootip[$row1['id']].'<div class=\"category ' . $cssAlign . '\">';
+ $htmltootip[$row1['id']] = $htmltootip[$row1['id']].'<div class=\"category\">';
# ni missing vrednost
$htmltootip[$row1['id']] = $htmltootip[$row1['id']].'<label for=\"im_vrednost_' . $row1['id'] . '_grid_' . $value . '\">';
$htmltootip[$row1['id']] = $htmltootip[$row1['id']].'<input type=\"radio\" ' . (!$hideName ? ' name=\"vrednost_' . $row1['id'] . '\"' : '') . ' id=\"im_vrednost_' . $row1['id'] . '_grid_' . $value . '\" value=\"' . $value . '\"' . (($grid_id == $value && $grid_id != '' && !$is_missing) ? ' checked' : '') . ($is_missing ? ' disabled' : '') . ' data-calculation=\"' . $srv_grids[$i]['variable'] . '\" onclick=\"checkChecked(this); if (typeof checkBranching == \'function\'){checkBranching();} setCheckedClass(this, null, ' . $row1['id'] . '); mapdelovanjeRadioGrid(this, ' . $row1['id'] . ');\">';
@@ -576,7 +576,7 @@ class ImageHotSpotController extends Controller $sql1 = sisplet_query("SELECT id, naslov, vrstni_red 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]' ");
- echo '<div id="hotspot_regions_hidden_menu_'.$row[id].'" style="display:none; ">';
+ echo '<div id="hotspot_regions_hidden_menu_'.$row['id'].'" style="display:none; ">';
// Ali gre za sazu anketo
if(SurveyInfo::getInstance()->checkSurveyModule('sazu'))
@@ -621,35 +621,30 @@ class ImageHotSpotController extends Controller # polovimo vrednosti gridov, prevedemo naslove in hkrati preverimo ali imamo missinge
$srv_grids = array();
$mv_count = 0; # koliko je stolpcev z manjkajočimi vrednostmi
- # če polje other != 0 je grid kot missing
- $sql_grid = sisplet_query("SELECT * FROM srv_hotspot_regions WHERE spr_id='$row[id]' ORDER BY vrstni_red");
+
+ $sql_grid = sisplet_query("SELECT * FROM srv_hotspot_regions WHERE spr_id='".$row['id']."' ORDER BY vrstni_red");
while ($row_grid = mysqli_fetch_assoc($sql_grid)) {
+
# priredimo naslov če prevajamo anketo
$naslov = Language::srv_language_grid($row['id'], $row_grid['id']);
+
if ($naslov != '') {
//$row_grid['naslov'] = $naslov;
$row_grid['vrstni_red'] = $naslov;
}
- $srv_grids[$row_grid['id']] = $row_grid;
- # če je označena kot manjkajoča jo prištejemo k manjkajočim
- if ($row_grid['other'] != 0) {
- $mv_count++;
- }
+ $srv_grids[$row_grid['id']] = $row_grid;
}
# Izpišemo TOP vrstico z labelami
if (count($srv_grids) > 0) {
+
$first_missing_value = true;
+
foreach ($srv_grids AS $i => $srv_grid) {
- if ((string)$srv_grid['other'] != '0' && $first_missing_value == true) {
- # dodamo spejs pred manjkajočimi vrednostmi
- echo ' <td></td>' . "\n";
- $first_missing_value = false;
- }
// Datapiping
- $srv_grid['naslov'] = Helper::dataPiping($srv_grid['naslov']);
+ $srv_grid['region_name'] = Helper::dataPiping($srv_grid['region_name']);
}
}
@@ -674,18 +669,12 @@ class ImageHotSpotController extends Controller if ($naslov != '') {
$row1['naslov'] = $naslov;
}
+
# preverimo izbrano vrednost
- $grid_id = $srv_data_grid[$row1['id']]['grd_id'];
+ $grid_id = isset($srv_data_grid[$row1['id']]['grd_id']) ? $srv_data_grid[$row1['id']]['grd_id'] : '';
# ugotovimo ali je na katerem gridu predhodno izbran missing
$is_missing = false;
- if (count($srv_grids) > 0) {
- foreach ($srv_grids AS $i => $srv_grid) {
- if ($srv_grid['other'] != 0 && $srv_grids[$i]['id'] == $grid_id) {
- $is_missing = true;
- }
- }
- }
// Datapiping
$row1['naslov'] = Helper::dataPiping($row1['naslov']);
@@ -704,62 +693,41 @@ class ImageHotSpotController extends Controller $first_missing_value = true;
foreach ($srv_grids AS $i => $srv_grid) {
-
- if ((string)$srv_grid['other'] != '0' && $first_missing_value == true) {
- $first_missing_value = false;
- }
$value = $srv_grids[$i]['id'];
- # izpišemo radio grida
- if ($srv_grid['other'] != 0) {
- $htmltootip[$row1['id']] .= '<div class=\"missing ' . $cssAlign . '\">';
- # imamo missing vrednost
- $htmltootip[$row1['id']] .= '<label for=\"im_grid_missing_value_' . $row1['id'] . '_grid_' . $value . '\">';
-
- $htmltootip[$row1['id']] .= '<input type=\"radio\" ' . (!$hideName ? ' name=\"vrednost_' . $row1['id'] . '\"' : '') . ' id=\"im_grid_missing_value_' . $row1['id'] . '_grid_' . $value . '\" value=\"' . $value . '\"' . (($grid_id == $value && $grid_id != '') ? ' checked' : '') . ' data-calculation=\"0\" onclick=\"checkChecked(this); checkTableMissing(this); if (typeof checkBranching == \'function\'){checkBranching();} setCheckedClass(this, null, ' . $row1['id'] . '); mapdelovanjeRadioGrid(this, ' . $row1['id'] . ');\">';
+ $htmltootip[$row1['id']] .= '<div class=\"category\">';
+
+ // Za SAZU moramo posebej obarvati
+ if(SurveyInfo::getInstance()->checkSurveyModule('sazu')){
+ # ni missing vrednost
+ $htmltootip[$row1['id']] .= '<label for=\"im_vrednost_' . $row1['id'] . '_grid_' . $value . '\">';
+ $htmltootip[$row1['id']] .= '<input vrstni_red='.$srv_grid['vrstni_red'].' type=\"radio\" ' . (!$hideName ? ' name=\"vrednost_' . $row1['id'] . '\"' : '') . ' id=\"im_vrednost_' . $row1['id'] . '_grid_' . $value . '\" value=\"' . $value . '\"' . (($grid_id == $value && $grid_id != '' && !$is_missing) ? ' checked' : '') . ($is_missing ? ' disabled' : '') . ' data-calculation=\"' . $srv_grids[$i]['variable'] . '\" onclick=\"checkChecked(this); if (typeof checkBranching == \'function\'){checkBranching();} setCheckedClass(this, null, ' . $row1['id'] . '); mapdelovanjeRankingSazu(this, ' . $row1['id'] . ');\">';
$htmltootip[$row1['id']] .= '<span class=\"enka-checkbox-radio ' . (($row1['hidden'] == 2) ? ' answer-disabled' : '') .'\"'.
((Helper::getCustomCheckbox() != 0) ? (' style="font-size:' . Helper::getCustomCheckbox().'px;"') : '').
'></span>';
- $htmltootip[$row1['id']] .= $srv_grid['naslov'];
+ //besedilo ob radio buttonu
+ $htmltootip[$row1['id']] .= $srv_grid['vrstni_red'];
+
+ //besedilo ob radio buttonu - konec
+ $htmltootip[$row1['id']] .= '</label>';
+ }
+ else{
+ # ni missing vrednost
+ $htmltootip[$row1['id']] .= '<label for=\"im_vrednost_' . $row1['id'] . '_grid_' . $value . '\">';
+
+ $htmltootip[$row1['id']] .= '<input vrstni_red='.$srv_grid['vrstni_red'].' type=\"radio\" ' . (!$hideName ? ' name=\"vrednost_' . $row1['id'] . '\"' : '') . ' id=\"im_vrednost_' . $row1['id'] . '_grid_' . $value . '\" value=\"' . $value . '\"' . (($grid_id == $value && $grid_id != '' && !$is_missing) ? ' checked' : '') . ($is_missing ? ' disabled' : '') . ' data-calculation=\"' . $srv_grids[$i]['variable'] . '\" onclick=\"checkChecked(this); if (typeof checkBranching == \'function\'){checkBranching();} setCheckedClass(this, null, ' . $row1['id'] . '); mapdelovanjeRanking(this, ' . $row1['id'] . ');\">';
+ $htmltootip[$row1['id']] .= '<span class=\"enka-checkbox-radio ' . (($row1['hidden'] == 2) ? ' answer-disabled' : '') .'\"'.
+ ((Helper::getCustomCheckbox() != 0) ? (' style="font-size:' . Helper::getCustomCheckbox().'px;"') : '').
+ '></span>';
+ //besedilo ob radio buttonu
+ $htmltootip[$row1['id']] .= $srv_grid['vrstni_red'];
+ //besedilo ob radio buttonu - konec
$htmltootip[$row1['id']] .= '</label>';
- $htmltootip[$row1['id']] .= '</div>';
- }
- else {
- $htmltootip[$row1['id']] .= '<div class=\"category ' . $cssAlign . '\">';
-
-
- // Za SAZU moramo posebej obarvati
- if(SurveyInfo::getInstance()->checkSurveyModule('sazu')){
- # ni missing vrednost
- $htmltootip[$row1['id']] .= '<label for=\"im_vrednost_' . $row1['id'] . '_grid_' . $value . '\">';
-
- $htmltootip[$row1['id']] .= '<input vrstni_red='.$srv_grid['vrstni_red'].' type=\"radio\" ' . (!$hideName ? ' name=\"vrednost_' . $row1['id'] . '\"' : '') . ' id=\"im_vrednost_' . $row1['id'] . '_grid_' . $value . '\" value=\"' . $value . '\"' . (($grid_id == $value && $grid_id != '' && !$is_missing) ? ' checked' : '') . ($is_missing ? ' disabled' : '') . ' data-calculation=\"' . $srv_grids[$i]['variable'] . '\" onclick=\"checkChecked(this); if (typeof checkBranching == \'function\'){checkBranching();} setCheckedClass(this, null, ' . $row1['id'] . '); mapdelovanjeRankingSazu(this, ' . $row1['id'] . ');\">';
- $htmltootip[$row1['id']] .= '<span class=\"enka-checkbox-radio ' . (($row1['hidden'] == 2) ? ' answer-disabled' : '') .'\"'.
- ((Helper::getCustomCheckbox() != 0) ? (' style="font-size:' . Helper::getCustomCheckbox().'px;"') : '').
- '></span>';
- //besedilo ob radio buttonu
- $htmltootip[$row1['id']] .= $srv_grid['vrstni_red'];
-
- //besedilo ob radio buttonu - konec
- $htmltootip[$row1['id']] .= '</label>';
- }
- else{
- # ni missing vrednost
- $htmltootip[$row1['id']] .= '<label for=\"im_vrednost_' . $row1['id'] . '_grid_' . $value . '\">';
-
- $htmltootip[$row1['id']] .= '<input vrstni_red='.$srv_grid['vrstni_red'].' type=\"radio\" ' . (!$hideName ? ' name=\"vrednost_' . $row1['id'] . '\"' : '') . ' id=\"im_vrednost_' . $row1['id'] . '_grid_' . $value . '\" value=\"' . $value . '\"' . (($grid_id == $value && $grid_id != '' && !$is_missing) ? ' checked' : '') . ($is_missing ? ' disabled' : '') . ' data-calculation=\"' . $srv_grids[$i]['variable'] . '\" onclick=\"checkChecked(this); if (typeof checkBranching == \'function\'){checkBranching();} setCheckedClass(this, null, ' . $row1['id'] . '); mapdelovanjeRanking(this, ' . $row1['id'] . ');\">';
- $htmltootip[$row1['id']] .= '<span class=\"enka-checkbox-radio ' . (($row1['hidden'] == 2) ? ' answer-disabled' : '') .'\"'.
- ((Helper::getCustomCheckbox() != 0) ? (' style="font-size:' . Helper::getCustomCheckbox().'px;"') : '').
- '></span>';
- //besedilo ob radio buttonu
- $htmltootip[$row1['id']] .= $srv_grid['vrstni_red'];
- //besedilo ob radio buttonu - konec
- $htmltootip[$row1['id']] .= '</label>';
- }
- $htmltootip[$row1['id']] .= '</div>';
}
+
+ $htmltootip[$row1['id']] .= '</div>';
}
}
diff --git a/main/survey/app/Controllers/Vprasanja/MaxDiffController.php b/main/survey/app/Controllers/Vprasanja/MaxDiffController.php index e1807b9..20f991e 100644 --- a/main/survey/app/Controllers/Vprasanja/MaxDiffController.php +++ b/main/survey/app/Controllers/Vprasanja/MaxDiffController.php @@ -163,7 +163,7 @@ class MaxDiffController extends Controller $row1['naslov'] = $naslov;
}
# preverimo izbrano vrednost
- $grid_id = $srv_data_grid[$row1['id']]['grd_id'];
+ $grid_id = isset($srv_data_grid[$row1['id']]['grd_id']) ? $srv_data_grid[$row1['id']]['grd_id'] : null;
# ugotovimo ali je na katerem gridu predhodno izbran missing
$is_missing = false;
@@ -271,9 +271,9 @@ class MaxDiffController extends Controller $otherHeight = ($spremenljivkaParams->get('otherHeight') ? $spremenljivkaParams->get('otherHeight') : 1);
if ($otherHeight > 1)
- echo ' <textarea name="textfield_' . $row1['id'] . '" rows="' . $otherHeight . '" style="' . ($otherWidth != -1 ? ' width:' . $otherWidth . '%;' : '') . '" ' . ($is_missing ? ' disabled' : '') . '>' . ($is_missing ? '' : $row3['text']) . '</textarea>';
+ echo ' <textarea name="textfield_' . $row1['id'] . '" rows="' . $otherHeight . '" style="' . ($otherWidth != -1 ? ' width:' . $otherWidth . '%;' : '') . '" ' . ($is_missing ? ' disabled' : '') . '>' . ((!isset($row3['text']) || $is_missing) ? '' : $row3['text']) . '</textarea>';
else
- echo ' <input type="text" name="textfield_' . $row1['id'] . '" value="' . ($is_missing ? '' : $row3['text']) . '" style="' . ($otherWidth != -1 ? ' width:' . $otherWidth . '%;' : '') . '" ' . ($is_missing ? ' disabled' : '') . ' />';
+ echo ' <input type="text" name="textfield_' . $row1['id'] . '" value="' . ((!isset($row3['text']) || $is_missing) ? '' : $row3['text']) . '" style="' . ($otherWidth != -1 ? ' width:' . $otherWidth . '%;' : '') . '" ' . ($is_missing ? ' disabled' : '') . ' />';
}
echo '</td>';
diff --git a/main/survey/app/Controllers/Vprasanja/MultigridController.php b/main/survey/app/Controllers/Vprasanja/MultigridController.php index 85fd49d..cd8887c 100644 --- a/main/survey/app/Controllers/Vprasanja/MultigridController.php +++ b/main/survey/app/Controllers/Vprasanja/MultigridController.php @@ -113,6 +113,7 @@ class MultigridController extends Controller $display_trak_num_of_titles = 'style="display:none;"';
}
+ $trak_nadnaslov = array();
for($i = 1; $i <= $trak_num_of_titles; $i++){
$trak_nadnaslov[$i] = ($spremenljivkaParams->get('trak_nadnaslov_'.$i.'') ? $spremenljivkaParams->get('trak_nadnaslov_'.$i.'') : $lang['srv_new_text']);
}
@@ -159,8 +160,6 @@ class MultigridController extends Controller $spacesize = round(80 / $size / 4);
- $bg = 1;
-
// IZRIS TABELE
echo '<table class="grid_table multigrid">' . "\n";
@@ -220,8 +219,6 @@ class MultigridController extends Controller // Body tabele
echo '<tbody>';
- $bg++;
-
$orderby = Model::generate_order_by_field($spremenljivka, get('usr_id'));
# cache tabele srv_data_grid, da se ne dela vsakic posebej nov query (preberemo enkrat vse odgovore userja)
@@ -253,7 +250,7 @@ class MultigridController extends Controller }
# preverimo izbrano vrednost
- $grid_id = $srv_data_grid[$row1['id']]['grd_id'];
+ $grid_id = isset($srv_data_grid[$row1['id']]['grd_id']) ? $srv_data_grid[$row1['id']]['grd_id']: '';
# ugotovimo ali je na katerem gridu predhodno izbran missing
$is_missing = false;
@@ -351,7 +348,7 @@ class MultigridController extends Controller echo '<td class="category '.$tabelaSmeski. $_checked.' ' . $cssAlign . '">';
# ni missing vrednost
echo '<label for="vrednost_' . $row1['id'] . '_grid_' . $value . '">';
- echo '<input type="radio" ' . (!$hideName ? ' name="vrednost_' . $row1['id'] . '"' : '') . ' id="vrednost_' . $row1['id'] . '_grid_' . $value . '" value="' . $value . '"' . $_checked . ($is_missing ? ' disabled' : '') . ' data-calculation="' . $srv_grids[$i]['variable'] . '" vre_id = '.$row1['id'].' onclick="checkChecked(this); checkBranching(); setCheckedClass(this, null, ' . $row1['id'] . '); customRadioTableSelect(' . $row1['id'] . ', ' . $value. ');">';
+ echo '<input type="radio" ' . (!$hideName ? ' name="vrednost_' . $row1['id'] . '"' : '') . ' id="vrednost_' . $row1['id'] . '_grid_' . $value . '" value="' . $value . '"' . $_checked . ' data-calculation="' . $srv_grids[$i]['variable'] . '" vre_id = '.$row1['id'].' onclick="checkChecked(this); checkBranching(); setCheckedClass(this, null, ' . $row1['id'] . '); customRadioTableSelect(' . $row1['id'] . ', ' . $value. ');">';
if($row['enota'] == 11){
echo '<span class="enka-vizualna-skala siv-'.$row['grids'].$value.'"></span>';
@@ -377,6 +374,7 @@ class MultigridController extends Controller }
}
}
+
# dodamo še enoto
if ($row['enota'] == 1) {
// Datapiping
@@ -385,9 +383,8 @@ class MultigridController extends Controller echo ' <td></td>' . "\n";
echo ' <td class="differential question_trak">' . $row1['naslov2'] . '</td>' . "\n";
}
+
echo ' </tr>' . "\n";
-
- $bg++;
}
echo '</tbody>';
@@ -472,8 +469,6 @@ class MultigridController extends Controller echo '<tbody>';
- $bg++;
-
$orderby = Model::generate_order_by_field($spremenljivka, get('usr_id'));
// cache tabele srv_grid, da se ne bere vsakic znova
@@ -527,7 +522,7 @@ class MultigridController extends Controller }
- $grid_id = $srv_data_grid[$row1['id']]['grd_id'];
+ $grid_id = isset($srv_data_grid[$row1['id']]['grd_id']) ? $srv_data_grid[$row1['id']]['grd_id'] : '';
echo '<td ' . $cssAlign . '>';
@@ -568,8 +563,6 @@ class MultigridController extends Controller echo '</td>' . "\n";
echo '</tr>' . "\n";
-
- $bg++;
}
echo '</tbody>';
@@ -631,8 +624,6 @@ class MultigridController extends Controller echo '<tbody>';
- $bg++;
-
$orderby = Model::generate_order_by_field($spremenljivka, get('usr_id'));
$missingi = array();
@@ -681,9 +672,9 @@ class MultigridController extends Controller $otherHeight = ($spremenljivkaParams->get('otherHeight') ? $spremenljivkaParams->get('otherHeight') : 1);
if ($otherHeight > 1)
- echo ' <textarea name="textfield_' . $row1['id'] . '" rows="' . $otherHeight . '" style="' . ($otherWidth != -1 ? ' width:' . $otherWidth . '%;' : '') . '">' . $row3['text'] . '</textarea>';
+ echo ' <textarea name="textfield_' . $row1['id'] . '" rows="' . $otherHeight . '" style="' . ($otherWidth != -1 ? ' width:' . $otherWidth . '%;' : '') . '">' . (isset($row3['text']) ? $row3['text'] : '') . '</textarea>';
else
- echo ' <input type="text" name="textfield_' . $row1['id'] . '" value="' . $row3['text'] . '" style="' . ($otherWidth != -1 ? ' width:' . $otherWidth . '%;' : '') . '" />';
+ echo ' <input type="text" name="textfield_' . $row1['id'] . '" value="' . (isset($row3['text']) ? $row3['text'] : '') . '" style="' . ($otherWidth != -1 ? ' width:' . $otherWidth . '%;' : '') . '" />';
//echo ' <input type="text" name="textfield_'.$row1['id'].'" value="'.$row3['text'].'">';
}
@@ -692,7 +683,7 @@ class MultigridController extends Controller }
- $grid_id = $srv_data_grid[$row1['id']]['grd_id'];
+ $grid_id = isset($srv_data_grid[$row1['id']]['grd_id']) ? $srv_data_grid[$row1['id']]['grd_id'] : '';
echo '<td ' . $cssAlign . '>';
@@ -771,8 +762,6 @@ class MultigridController extends Controller echo '</td>' . "\n";
echo '</tr>' . "\n";
-
- $bg++;
}
echo '</tbody>';
@@ -893,8 +882,6 @@ class MultigridController extends Controller //$taWidth = 10;
$taWidth = round(50 / $size);
- $bg = 1;
-
// Header tabele
echo '<thead>';
@@ -905,8 +892,6 @@ class MultigridController extends Controller // Body tabele
echo '<tbody>';
- $bg++;
-
$orderby = Model::generate_order_by_field($spremenljivka, get('usr_id'));
$srv_data_cache = array();
@@ -924,7 +909,7 @@ class MultigridController extends Controller if ($naslov != '') $row1['naslov'] = $naslov;
# preverimo izbrano vrednost
- $grid_id = $srv_data_grid[$row1['id']]['grd_id'];
+ $grid_id = isset($srv_data_grid[$row1['id']]['grd_id']) ? $srv_data_grid[$row1['id']]['grd_id'] : '';
# ugotovimo ali je na katerem gridu predhodno izbran missing
$is_missing = false;
@@ -966,7 +951,7 @@ class MultigridController extends Controller $first_missing_value = true;
foreach ($srv_grids AS $i => $srv_grid) {
- $grid_id = $srv_data_cache[$row1['id']][$i]['grd_id'];
+ $grid_id = isset($srv_data_cache[$row1['id']][$i]['grd_id']) ? $srv_data_cache[$row1['id']][$i]['grd_id'] : '';
$value = $srv_grid['id'];
$vsebina = '';
@@ -1009,8 +994,6 @@ class MultigridController extends Controller }
echo ' </tr>' . "\n";
-
- $bg++;
}
echo '</tbody>';
@@ -1040,13 +1023,16 @@ class MultigridController extends Controller $row = Model::select_from_srv_spremenljivka($spremenljivka);
+ $multiple=array();
$sql1 = sisplet_query("SELECT spr_id FROM srv_grid_multiple WHERE parent='$spremenljivka' ORDER BY vrstni_red");
while ($row1 = mysqli_fetch_array($sql1)) {
$multiple[] = $row1['spr_id'];
}
- if (count($multiple) == 0)
+
+ if (count($multiple) == 0) {
return;
+ }
$spremenljivkaParams = new enkaParameters($row['params']);
// $gridWidth = (($spremenljivkaParams->get('gridWidth') > 0) ? $spremenljivkaParams->get('gridWidth') : 30);
@@ -1136,7 +1122,6 @@ class MultigridController extends Controller $spacesize = round(80 / $size / 4);
- $bg = 1;
echo '<table class="grid_table multigrid">' . "\n";
@@ -1153,7 +1138,7 @@ class MultigridController extends Controller /*for ($i = 1; $i <= $size; $i++)
echo '<col>';*/
foreach ($srv_grids as $grid){
- if($grid['gridmultiple_width'] > 0)
+ if(isset($grid['gridmultiple_width']) && $grid['gridmultiple_width'] > 0)
echo '<col style="width:'.$grid['gridmultiple_width'].'%;">';
else
echo '<col>';
@@ -1231,8 +1216,6 @@ class MultigridController extends Controller echo '<tbody>';
- $bg++;
-
$orderby = Model::generate_order_by_field($multiple[0], get('usr_id'));
# cache tabele srv_data_grid, da se ne dela vsakic posebej nov query (preberemo enkrat vse odgovore userja)
@@ -1323,7 +1306,8 @@ class MultigridController extends Controller $sbSize = ($spr_Params->get('sbSize') ? $spr_Params->get('sbSize') : 3);
$prvaVrstica = ($spr_Params->get('prvaVrstica') ? $spr_Params->get('prvaVrstica') : 1);
$prvaVrstica_roleta = ($spr_Params->get('prvaVrstica_roleta') ? $spr_Params->get('prvaVrstica_roleta') : 1);
- $grid_id = $srv_data_grid[$row_spr['id']][$row2['id']]['grd_id'];
+
+ $grid_id = isset($srv_data_grid[$row_spr['id']][$row2['id']]['grd_id']) ? $srv_data_grid[$row_spr['id']][$row2['id']]['grd_id'] : '';
echo '<td class="category ' . ($srv_grid['vrstni_red'] == 1 && $jj > 1 ? 'double' : '') . ' ' . $cssAlign . '">';
if ($row_spr['enota'] == 2) {//roleta
@@ -1369,9 +1353,9 @@ class MultigridController extends Controller }
echo '</select>';
echo '</td>';
- } else {
-
- $grid_id = $srv_data_grid[$row_spr['id']][$row2['id']]['grd_id'];
+ }
+ else {
+ $grid_id = isset($srv_data_grid[$row_spr['id']][$row2['id']]['grd_id']) ? $srv_data_grid[$row_spr['id']][$row2['id']]['grd_id'] : '';
echo '<td class="category ' . ($srv_grid['vrstni_red'] == 1 && $jj > 1 ? 'double' : '') . ' ' . $cssAlign . '">';
# ni missing vrednost
@@ -1384,7 +1368,6 @@ class MultigridController extends Controller echo '</label>';
echo '</td>' . "\n";
-
}
// multi
@@ -1398,7 +1381,8 @@ class MultigridController extends Controller if ($prvaVrstica != 1) {
$sbSize = $sbSize + 1;
}
- $grid_id = $srv_data_grid[$row_spr['id']][$row2['id']]['grd_id'];
+
+ $grid_id = isset($srv_data_grid[$row_spr['id']][$row2['id']]['grd_id']) ? $srv_data_grid[$row_spr['id']][$row2['id']]['grd_id'] : '';
echo '<td class="category ' . ($srv_grid['vrstni_red'] == 1 && $jj > 1 ? 'double' : '') . ' ' . $cssAlign . '">';
@@ -1427,9 +1411,11 @@ class MultigridController extends Controller }
echo '</select>';
echo '</td>';
- }//multi checkbox
+ }
+ //multi checkbox
elseif ($row_spr['enota'] != 6) {
- $grid_id = $srv_data_checkgrid[$row_spr['id']][$row2['id']][$value]['grd_id'];
+
+ $grid_id = isset($srv_data_checkgrid[$row_spr['id']][$row2['id']][$value]['grd_id']) ? $srv_data_checkgrid[$row_spr['id']][$row2['id']][$value]['grd_id'] : '';
echo '<td class="category ' . ($srv_grid['vrstni_red'] == 1 && $jj > 1 ? 'double' : '') . ' ' . $cssAlign . '">';
echo '<label for="multi_' . $row_spr['id'] . '_' . $row2['id'] . '_grid_' . $value . '">';
@@ -1456,7 +1442,7 @@ class MultigridController extends Controller $taWidth = $taWidth * 10; // da dobimo % (opcije se od 1 - 9)
}
- $vsebina = $srv_data_cache[$row_spr['id']][$row2['id']][$srv_grid['id']]['text'];
+ $vsebina = isset($srv_data_cache[$row_spr['id']][$row2['id']][$srv_grid['id']]['text']) ? $srv_data_cache[$row_spr['id']][$row2['id']][$srv_grid['id']]['text'] : "";
// datum
if ($spr_Params->get('multigrid-datum') == '1') {
@@ -1528,14 +1514,14 @@ class MultigridController extends Controller }
}
}
+
# dodamo še enoto
if ($row['enota'] == 1) {
echo ' <td></td>' . "\n";
echo ' <td class="differential">' . $row1['naslov2'] . '</td>' . "\n";
}
- echo ' </tr>' . "\n";
- $bg++;
+ echo ' </tr>' . "\n";
}
echo '</tbody>';
@@ -1552,9 +1538,9 @@ class MultigridController extends Controller echo '<tr '.$display_trak_num_of_titles.' class="display_trak_num_of_titles_respondent_'.$row['id'].'">';
if ($hideLabels == false) {
- echo ' <td></td>';
- echo ' <td></td>';
- }
+ echo ' <td></td>';
+ echo ' <td></td>';
+ }
for ($j = 1; $j <= $row['grids']; $j++) {
@@ -1568,7 +1554,8 @@ class MultigridController extends Controller $nadnaslov_floating = 'none';
}
- echo '<td class="trak_inline_nadnaslov" grd="gr_'.$j.'"><div id="trak_nadnaslov_'.$j.'_'.$spremenljivka.'" name="trak_nadnaslov_'.$j.'" class="trak_inline_nadnaslov" style="float:'.$nadnaslov_floating.'; display:inline" '.(strpos($trak_nadnaslov[$j], $lang['srv_new_text'])!==false || $this->lang_id!=null ?' default="1"':'').'>' . $trak_nadnaslov[$j] . '</div></td>';
+ if(isset($trak_nadnaslov[$j]))
+ echo '<td class="trak_inline_nadnaslov" grd="gr_'.$j.'"><div id="trak_nadnaslov_'.$j.'_'.$spremenljivka.'" name="trak_nadnaslov_'.$j.'" class="trak_inline_nadnaslov" style="float:'.$nadnaslov_floating.'; display:inline" '.(strpos($trak_nadnaslov[$j], $lang['srv_new_text'])!==false || get('lang_id')!=null ?' default="1"':'').'>' . $trak_nadnaslov[$j] . '</div></td>';
}
// Ce je diferencial
@@ -1644,7 +1631,7 @@ class MultigridController extends Controller }
// Izris naslovne vrstice tabele za checkbox tabelo
- private function displayMulticheckboxHeader($spremenljivka, $row, $srv_grids, $mv_count, $cssAlign, $middle_row=false, $hideLabels){
+ private function displayMulticheckboxHeader($spremenljivka, $row, $srv_grids, $mv_count, $cssAlign, $middle_row, $hideLabels){
global $lang;
// Preverimo, ce ponavljamo glavo - potem ji dodamo class in jo z JS ponovimo
diff --git a/main/survey/app/Controllers/Vprasanja/MultigridMobileController.php b/main/survey/app/Controllers/Vprasanja/MultigridMobileController.php index eaf7eb2..b51f303 100644 --- a/main/survey/app/Controllers/Vprasanja/MultigridMobileController.php +++ b/main/survey/app/Controllers/Vprasanja/MultigridMobileController.php @@ -61,7 +61,9 @@ class MultigridMobileController extends Controller{ // Nastavitev za prilagoditev mobilnih tabel (z razpiranjem ali brez)
SurveySetting::getInstance()->Init(get('anketa'));
- $mobile_tables = SurveySetting::getInstance()->getSurveyMiscSetting('mobile_tables');
+
+ // Pridobimo nastavitve za prikaz tabele
+ $tables_setting = self::getInstance()->getTableSettings($spremenljivkaParams);
$gridAlign = (($spremenljivkaParams->get('gridAlign') > 0) ? $spremenljivkaParams->get('gridAlign') : 0);
@@ -95,7 +97,7 @@ class MultigridMobileController extends Controller{ // Izrisemo celotno vsebino tabele za mobietl
- echo '<div class="grid_mobile radio '.($row['enota'] == 11 ? 'visual_scale' : '').' '.($row['enota'] == 12 ? 'smiley_scale' : '').' '.($mobile_tables == 2 ? 'mobile_expanding' : '').'">';
+ echo '<div class="grid_mobile radio '.($row['enota'] == 11 ? 'visual_scale' : '').' '.($row['enota'] == 12 ? 'smiley_scale' : '').' '.($tables_setting == 2 ? 'mobile_expanding' : '').'">';
$orderby = Model::generate_order_by_field($spremenljivka, get('usr_id'));
@@ -133,7 +135,7 @@ class MultigridMobileController extends Controller{ echo $row1['naslov'];
// preverimo izbrano vrednost
- $grid_id = $srv_data_grid[$row1['id']]['grd_id'];
+ $grid_id = isset($srv_data_grid[$row1['id']]['grd_id']) ? $srv_data_grid[$row1['id']]['grd_id'] : '';
// Ugotovimo ali je na katerem gridu predhodno izbran missing oz. pridobimo text. vrednost izpolnjenega odg.
$is_missing = false;
@@ -169,14 +171,14 @@ class MultigridMobileController extends Controller{ echo ' </div>';
// Puscica za razpiranje ce imamo vklopljene mobilne tabele z razpiranjem
- if($mobile_tables == 2)
+ if($tables_setting == 2)
echo '<span class="faicon arrow_up mobile_expanding_arrow"></span>';
echo '</div>';
// IZPOLNJENA VREDNOST, ce obstaja in ce imamo vklopljene mobilne tabele z razpiranjem
- if($mobile_tables == 2){
+ if($tables_setting == 2){
echo '<div class="grid_mobile_result">'.($grid_id != '' ? $grid_data_value : '').'</div>';
}
@@ -386,8 +388,10 @@ class MultigridMobileController extends Controller{ // Nastavitev za prilagoditev mobilnih tabel (z razpiranjem ali brez)
SurveySetting::getInstance()->Init(get('anketa'));
- $mobile_tables = SurveySetting::getInstance()->getSurveyMiscSetting('mobile_tables');
-
+
+ // Pridobimo nastavitve za prikaz tabele
+ $tables_setting = self::getInstance()->getTableSettings($spremenljivkaParams);
+
$gridAlign = (($spremenljivkaParams->get('gridAlign') > 0) ? $spremenljivkaParams->get('gridAlign') : 0);
$cssAlign = '';
@@ -439,7 +443,7 @@ class MultigridMobileController extends Controller{ // Izrisemo celotno vsebino tabele za mobietl
- echo '<div class="grid_mobile radio double '.($mobile_tables == 2 ? 'mobile_expanding' : '').'">';
+ echo '<div class="grid_mobile radio double '.($tables_setting == 2 ? 'mobile_expanding' : '').'">';
$orderby = Model::generate_order_by_field($spremenljivka, get('usr_id'));
@@ -483,8 +487,8 @@ class MultigridMobileController extends Controller{ echo $row1['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;
@@ -511,10 +515,6 @@ class MultigridMobileController extends Controller{ echo ' </div>';
- // Puscica za razpiranje ce imamo vklopljene mobilne tabele z razpiranjem
- /*if($mobile_tables == 2)
- echo '<span class="faicon arrow_up mobile_expanding_arrow"></span>';*/
-
echo '</div>';
@@ -699,6 +699,218 @@ class MultigridMobileController extends Controller{ echo '</div>';
}
+ /**
+ * @desc prikaze vnosno polje za dinamicen multigrid (vcash postopno resevanje)
+ */
+ public function radioHorizontalDynamicMultigrid($spremenljivka){
+
+ $loop_id = get('loop_id') == null ? " IS NULL" : " = '" . get('loop_id') . "'";
+
+ $row = Model::select_from_srv_spremenljivka($spremenljivka);
+
+ $spremenljivkaParams = new enkaParameters($row['params']);
+ $gridWidth = (($spremenljivkaParams->get('gridWidth') > 0) ? $spremenljivkaParams->get('gridWidth') : 30);
+
+ $diferencial_trak = ($spremenljivkaParams->get('diferencial_trak') ? $spremenljivkaParams->get('diferencial_trak') : 0); //za checkbox trak
+
+
+ // izracuni za sirino celic
+ $size = $row['grids'];
+
+ # polovimo vrednosti gridov, prevedmo naslove in hkrati preverimo ali imamo missinge
+ $srv_grids = array();
+ $mv_count = 0; # koliko je stolpcev z manjkajočimi vrednostmi
+ # če polje other != 0 je grid kot missing
+ $sql_grid = sisplet_query("SELECT * FROM srv_grid WHERE spr_id='$row[id]' ORDER BY vrstni_red");
+
+ while ($row_grid = mysqli_fetch_assoc($sql_grid)) {
+ # priredimo naslov če prevajamo anketo
+ $naslov = Language::srv_language_grid($row['id'], $row_grid['id']);
+ if ($naslov != '') {
+ $row_grid['naslov'] = $naslov;
+ }
+ $srv_grids[$row_grid['id']] = $row_grid;
+ # če je označena kot manjkajoča jo prištejemo k manjkajočim
+ if ($row_grid['other'] != 0) {
+ $mv_count++;
+ }
+
+ }
+
+ # če imamo mankajoče potem dodamo še en prazen stolpec za razmak
+ if ($mv_count > 0) {
+ $size += 1 + $mv_count;
+ }
+ if ($row['enota'] == 1) {
+ $size += 2;
+ }
+
+ $size += 1;
+
+
+ $orderby = Model::generate_order_by_field($spremenljivka, get('usr_id'));
+
+ # cache tabele srv_data_grid, da se ne dela vsakic posebej nov query (preberemo enkrat vse odgovore userja)
+ $srv_data_grid = array();
+ $sql_grid = sisplet_query("SELECT * FROM srv_data_grid" . get('db_table') . " WHERE spr_id='$row[id]' AND usr_id='" . get('usr_id') . "' AND loop_id $loop_id");
+ while ($row_grid = mysqli_fetch_array($sql_grid)) {
+ $srv_data_grid[$row_grid['vre_id']] = $row_grid;
+ }
+
+ # loop skozi srv_vrednost, da izpišemo vrstice z vrednostmi
+ $gridRow = 1;
+ $hide = false;
+ $sql1 = sisplet_query("SELECT * FROM srv_vrednost WHERE spr_id='$row[id]' ORDER BY FIELD(vrstni_red, $orderby)");
+ $countVar = mysqli_num_rows($sql1);
+
+ // Stevilo vseh vrednosti
+ echo '<input type="hidden" id="dynamic_multigrid_' . $spremenljivka . '" value="' . $countVar . '" />';
+ // 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 '<input type="hidden" id="dynamic_multigrid_' . $spremenljivka . '_load" value="1" />';
+
+ while ($row1 = mysqli_fetch_array($sql1)) {
+ # po potrebi prevedemo naslov
+ $naslov = Language::getInstance()->srv_language_vrednost($row1['id']);
+ if ($naslov != '') {
+ $row1['naslov'] = $naslov;
+ }
+
+ # preverimo izbrano vrednost
+ $grid_id = isset($srv_data_grid[$row1['id']]['grd_id']) ? $srv_data_grid[$row1['id']]['grd_id'] : '';
+
+ # ugotovimo ali je na katerem gridu predhodno izbran missing
+ $is_missing = false;
+ if (count($srv_grids) > 0) {
+ foreach ($srv_grids AS $i => $srv_grid) {
+ if ($srv_grid['other'] != 0 && $srv_grids[$i]['id'] == $grid_id) {
+ $is_missing = true;
+ }
+ }
+ }
+
+ // Datapiping
+ $row1['naslov'] = Helper::dataPiping($row1['naslov']);
+
+ $ifDisplay = ($row1['if_id'] > 0 ? ' if_hide' : '');
+ // Ce lahko prikazemo vrstico (se ni nobena izrisana in ni skrita z ifom) -> naslednjih ne izrisujemo vec
+ if ($hide == false && $row1['hidden'] == 0 && $row1['if_id'] == 0) {
+ $gridRowDisplay = '';
+ $hide = true;
+ } else
+ $gridRowDisplay = ' style="display:none;"';
+
+ echo ' <div id="vrednost_if_'.$row1['id'].'" seq="'.$gridRow.'" class="'.$spremenljivka.'_gridRow '.$spremenljivka.'_gridRow_'.$gridRow.' '.$ifDisplay.'" '.$gridRowDisplay.'>' . "\n";
+
+ echo '<div>';
+
+ echo '<div class="dynamic_mg_vrednost">';
+ echo $row1['naslov'];
+ if ($row1['other'] == 1) {
+ $sql3 = sisplet_query("SELECT text FROM srv_data_text" . get('db_table') . " WHERE spr_id='$spremenljivka' AND vre_id='$row1[id]' AND usr_id='" . get('usr_id') . "' AND loop_id $loop_id");
+ $row3 = mysqli_fetch_array($sql3);
+
+ $otherWidth = ($spremenljivkaParams->get('otherWidth') ? $spremenljivkaParams->get('otherWidth') : -1);
+ $otherHeight = ($spremenljivkaParams->get('otherHeight') ? $spremenljivkaParams->get('otherHeight') : 1);
+
+ if ($otherHeight > 1)
+ echo ' <textarea name="textfield_' . $row1['id'] . '" rows="' . $otherHeight . '" style="' . ($otherWidth != -1 ? ' width:' . $otherWidth . '%;' : '') . '" ' . ($is_missing ? ' disabled' : '') . '>' . ($is_missing ? '' : $row3['text']) . '</textarea>';
+ else
+ echo ' <input type="text" name="textfield_' . $row1['id'] . '" value="' . ($is_missing ? '' : $row3['text']) . '" style="' . ($otherWidth != -1 ? ' width:' . $otherWidth . '%;' : '') . '" ' . ($is_missing ? ' disabled' : '') . ' />';
+
+
+ //echo ' <input type="text" name="textfield_'.$row1['id'].'" value="'.($is_missing ? '' : $row3['text']).'" '.($is_missing ? ' disabled' :'').'>';
+ }
+ echo '</div>';
+
+ if (count($srv_grids) > 0) {
+ $first_missing_value = true;
+ foreach ($srv_grids AS $i => $srv_grid) {
+ if ((string)$srv_grid['other'] != '0' && $first_missing_value == true) {
+ # dodamo spejs pred manjkajočimi vrednostmi
+ $first_missing_value = false;
+ }
+ $value = $srv_grids[$i]['id'];
+ $grid_title = $srv_grids[$i]['naslov'];
+
+ // Datapiping
+ $grid_title = Helper::dataPiping($grid_title);
+
+ $smeski ='';
+ if(in_array($row['enota'], [11,12])){
+ $smeski = 'visual-radio-scale visual-radio-block';
+ }
+
+ # izpišemo radio grida
+ echo '<div class="variabla '.$smeski.'">';
+ if ($srv_grid['other'] != 0) {
+ # imamo missing vrednost
+ echo '<label for="grid_missing_value_' . $row1['id'] . '_grid_' . $value . '">';
+ if ($gridRow < $countVar)
+ echo '<input type="radio" name="vrednost_' . $row1['id'] . '" id="grid_missing_value_' . $row1['id'] . '_grid_' . $value . '" value="' . $value . '"' . (($grid_id == $value && $grid_id != '') ? ' checked' : '') . ' data-calculation="0" onclick="checkChecked(this); checkTableMissing(this); checkBranching(); setCheckedClass(this, \'mm\', ' . $row1['id'] . '); rowSlide(\'' . $spremenljivka . '\', \'' . $gridRow . '\', \'' . ($gridRow + 1) . '\');">';
+ else
+ echo '<input type="radio" name="vrednost_' . $row1['id'] . '" id="grid_missing_value_' . $row1['id'] . '_grid_' . $value . '" value="' . $value . '"' . (($grid_id == $value && $grid_id != '') ? ' checked' : '') . ' data-calculation="0" onclick="checkChecked(this); checkTableMissing(this); checkBranching(); setCheckedClass(this, \'mm\', ' . $row1['id'] . ');' . ($row['onchange_submit'] == 1 ? ' submitForm();' : '') . '">';
+
+ // Font awesome
+ echo '<span class="enka-checkbox-radio ' . (($row1['hidden'] == 2) ? ' answer-disabled' : '') .'"'.
+ ((Helper::getCustomCheckbox() != 0) ? (' style="font-size:' . Helper::getCustomCheckbox().'px;"') : '').
+ '></span>';
+
+ echo ' ' . $grid_title . '</label>';
+ } else {
+ # ni missing vrednost
+ echo '<label for="vrednost_' . $row1['id'] . '_grid_' . $value . '">';
+ if ($gridRow < $countVar)
+ echo '<input type="radio" name="vrednost_' . $row1['id'] . '" id="vrednost_' . $row1['id'] . '_grid_' . $value . '" value="' . $value . '"' . (($grid_id == $value && $grid_id != '' && !$is_missing) ? ' checked' : '') . ($is_missing ? ' disabled' : '') . ' data-calculation="' . $srv_grids[$i]['variable'] . '" onclick="checkChecked(this); checkBranching(); setCheckedClass(this, \'mm\', ' . $row1['id'] . '); rowSlide(\'' . $spremenljivka . '\', \'' . $gridRow . '\', \'' . ($gridRow + 1) . '\');">';
+ else
+ echo '<input type="radio" name="vrednost_' . $row1['id'] . '" id="vrednost_' . $row1['id'] . '_grid_' . $value . '" value="' . $value . '"' . (($grid_id == $value && $grid_id != '' && !$is_missing) ? ' checked' : '') . ($is_missing ? ' disabled' : '') . ' data-calculation="' . $srv_grids[$i]['variable'] . '" onclick="checkChecked(this); checkBranching(); setCheckedClass(this, \'mm\', ' . $row1['id'] . '); ' . ($row['onchange_submit'] == 1 ? ' submitForm();' : '') . '">';
+
+ // Font awesome
+ if($row['enota'] == 11){
+ echo '<span class="enka-vizualna-skala siv-'.$row['grids'].$value.'"></span>';
+ }elseif($row['enota'] == 12){
+ echo '<span class="enka-custom-radio '.$spremenljivkaParams->get('customRadio').'"></span>';
+ }else {
+ echo '<span class="enka-checkbox-radio ' . (($row1['hidden'] == 2) ? ' answer-disabled' : '') . '"' .
+ ((Helper::getCustomCheckbox() != 0) ? (' style="font-size:' . Helper::getCustomCheckbox() . 'px;"') : '') .
+ '></span>';
+ }
+
+ echo ' ' . $grid_title . '</label>';
+ }
+ echo '</div>';
+ }
+ }
+
+ // Dodamo se drug naslov ce imamo semanticni diferencial
+ if ($row['enota'] == 1) {
+
+ // Datapiping
+ $row1['naslov2'] = Helper::dataPiping($row1['naslov2']);
+
+ echo '<div class="dynamic_mg_vrednost">';
+ echo $row1['naslov2'];
+ echo '</div>';
+ }
+
+ echo '</div>';
+
+
+ echo '</tr><tr class="gridRowArrows ' . $spremenljivka . '_gridRowArrows_' . $gridRow . ' ' . $ifDisplay . '" ' . $gridRowDisplay . '><td colspan="' . $colspan . '">';
+ echo ' <table class="dynamic_mg_orientation"><tr>' . "\n";
+ for ($i = 1; $i <= $countVar; $i++) {
+ echo ' <td><div title="' . $i . '" id="sequence_number_' . $i . '" class="sequence_number sequence_number_'.$i.' ' . ($i == $gridRow ? ' active' : '') . '" onClick="rowSlide(\'' . $spremenljivka . '\', \'' . $gridRow . '\', \'' . $i . '\');">' . $i . '</div></td>';
+ }
+ echo ' </tr></table>' . "\n";
+ echo '</td>';
+
+
+ echo ' </div>' . "\n";
+
+ $bg++;
+ $gridRow++;
+ }
+ }
+
/**
* @desc prikaze vnosno polje za tabelo checkbox
@@ -714,8 +926,10 @@ class MultigridMobileController extends Controller{ // Nastavitev za prilagoditev mobilnih tabel (z razpiranjem ali brez)
SurveySetting::getInstance()->Init(get('anketa'));
- $mobile_tables = SurveySetting::getInstance()->getSurveyMiscSetting('mobile_tables');
-
+
+ // Pridobimo nastavitve za prikaz tabele
+ $tables_setting = self::getInstance()->getTableSettings($spremenljivkaParams);
+
$gridAlign = (($spremenljivkaParams->get('gridAlign') > 0) ? $spremenljivkaParams->get('gridAlign') : 0);
@@ -750,7 +964,7 @@ class MultigridMobileController extends Controller{ // Izrisemo celotno vsebino tabele za mobitel
- echo '<div class="grid_mobile checkbox '.($mobile_tables == 2 ? 'mobile_expanding' : '').'">';
+ echo '<div class="grid_mobile checkbox '.($tables_setting == 2 ? 'mobile_expanding' : '').'">';
$orderby = Model::generate_order_by_field($spremenljivka, get('usr_id'));
@@ -788,7 +1002,7 @@ class MultigridMobileController extends Controller{ echo $row1['naslov'];
# preverimo izbrano vrednost
- $grid_id = $srv_data_grid[$row1['id']]['grd_id'];
+ $grid_id = isset($srv_data_grid[$row1['id']]['grd_id']) ? $srv_data_grid[$row1['id']]['grd_id'] : '';
# ugotovimo ali je na katerem gridu predhodno izbran missing
$is_missing = false;
@@ -819,7 +1033,7 @@ class MultigridMobileController extends Controller{ echo '</div>';
// Puscica za razpiranje ce imamo vklopljene mobilne tabele z razpiranjem
- if($mobile_tables == 2)
+ if($tables_setting == 2)
echo '<span class="faicon arrow_up mobile_expanding_arrow"></span>';
echo '</div>';
@@ -834,7 +1048,7 @@ class MultigridMobileController extends Controller{ foreach ($srv_grids AS $i => $srv_grid) {
- $grid_id = $srv_data_cache[$row1['id']][$i]['grd_id'];
+ $grid_id = isset($srv_data_cache[$row1['id']][$i]['grd_id']) ? $srv_data_cache[$row1['id']][$i]['grd_id'] : '';
$value = $srv_grid['id'];
@@ -931,8 +1145,10 @@ class MultigridMobileController extends Controller{ // Nastavitev za prilagoditev mobilnih tabel (z razpiranjem ali brez)
SurveySetting::getInstance()->Init(get('anketa'));
- $mobile_tables = SurveySetting::getInstance()->getSurveyMiscSetting('mobile_tables');
-
+
+ // Pridobimo nastavitve za prikaz tabele
+ $tables_setting = self::getInstance()->getTableSettings($spremenljivkaParams);
+
$gridAlign = (($spremenljivkaParams->get('gridAlign') > 0) ? $spremenljivkaParams->get('gridAlign') : 0);
$cssAlign = '';
@@ -985,7 +1201,7 @@ class MultigridMobileController extends Controller{ // Izrisemo celotno vsebino tabele za mobietl
- echo '<div class="grid_mobile checkbox double '.($mobile_tables == 2 ? 'mobile_expanding' : '').'">';
+ echo '<div class="grid_mobile checkbox double '.($tables_setting == 2 ? 'mobile_expanding' : '').'">';
$orderby = Model::generate_order_by_field($spremenljivka, get('usr_id'));
@@ -1059,11 +1275,7 @@ class MultigridMobileController extends Controller{ echo ' <input type="text" name="textfield_' . $row1['id'] . '" value="' . ($is_missing ? '' : $row3['text']) . '" style="' . ($otherWidth != -1 ? ' width:' . $otherWidth . '%;' : '') . '" ' . ($is_missing ? ' disabled' : '') . ' />';
}
- echo ' </div>';
-
- // Puscica za razpiranje ce imamo vklopljene mobilne tabele z razpiranjem
- /*if($mobile_tables == 2)
- echo '<span class="faicon arrow_up mobile_expanding_arrow"></span>';*/
+ echo ' </div>';
echo '</div>';
@@ -1078,8 +1290,8 @@ class MultigridMobileController extends Controller{ if (count($srv_grids) > 0) {
foreach ($srv_grids AS $i => $srv_grid) {
-
- $grid_id = $srv_data_cache[$row1['id']][$i]['grd_id'];
+
+ $grid_id = isset($srv_data_cache[$row1['id']][$i]['grd_id']) ? $srv_data_cache[$row1['id']][$i]['grd_id'] : '';
// izpišemo radio grida
// Other oz. missing
@@ -1169,7 +1381,7 @@ class MultigridMobileController extends Controller{ foreach ($srv_grids2 AS $j => $srv_grid) {
- $grid_id = $srv_data_cache[$row1['id']][$j]['grd_id'];
+ $grid_id = isset($srv_data_cache[$row1['id']][$j]['grd_id']) ? $srv_data_cache[$row1['id']][$j]['grd_id'] : '';
// izpišemo radio grida
// Other oz. missing
@@ -1269,8 +1481,10 @@ class MultigridMobileController extends Controller{ // Nastavitev za prilagoditev mobilnih tabel (z razpiranjem ali brez)
SurveySetting::getInstance()->Init(get('anketa'));
- $mobile_tables = SurveySetting::getInstance()->getSurveyMiscSetting('mobile_tables');
-
+
+ // Pridobimo nastavitve za prikaz tabele
+ $tables_setting = self::getInstance()->getTableSettings($spremenljivkaParams);
+
$gridAlign = (($spremenljivkaParams->get('gridAlign') > 0) ? $spremenljivkaParams->get('gridAlign') : 0);
$cssAlign = '';
@@ -1325,7 +1539,7 @@ class MultigridMobileController extends Controller{ // Izrisemo celotno vsebino tabele za mobitel
- echo '<div class="grid_mobile text '.($mobile_tables == 2 ? 'mobile_expanding' : '').'">';
+ echo '<div class="grid_mobile text '.($tables_setting == 2 ? 'mobile_expanding' : '').'">';
$orderby = Model::generate_order_by_field($spremenljivka, get('usr_id'));
@@ -1361,7 +1575,7 @@ class MultigridMobileController extends Controller{ if ($naslov != '') $row1['naslov'] = $naslov;
# preverimo izbrano vrednost
- $grid_id = $srv_data_grid[$row1['id']]['grd_id'];
+ $grid_id = isset($srv_data_grid[$row1['id']]['grd_id']) ? $srv_data_grid[$row1['id']]['grd_id'] : '';
# ugotovimo ali je na katerem gridu predhodno izbran missing
$is_missing = false;
@@ -1397,7 +1611,7 @@ class MultigridMobileController extends Controller{ echo ' </div>';
// Puscica za razpiranje ce imamo vklopljene mobilne tabele z razpiranjem
- if($mobile_tables == 2)
+ if($tables_setting == 2)
echo '<span class="faicon arrow_up mobile_expanding_arrow"></span>';
echo '</div>';
@@ -1618,4 +1832,29 @@ class MultigridMobileController extends Controller{ // END grid_mobile
echo '</div>';
}
+
+
+ // Pridobimo nastavitve tabele (prikaz na mobile ali pc)
+ public function getTableSettings($spremenljivkaParams){
+
+ // Pridobimo nastavitve za mobile tabele
+ if(get('mobile') == 1){
+ $tables_setting = $spremenljivkaParams->get('mobile_tables','-1');
+
+ // Ce nimamo individualnih nastavitev pridobimo splosne nastavitve tabel
+ if($tables_setting == -1)
+ $tables_setting = SurveySetting::getInstance()->getSurveyMiscSetting('mobile_tables');
+
+ }
+ // Pridobimo nastavitve za pc tabele
+ else{
+ $tables_setting = $spremenljivkaParams->get('pc_tables','-1');
+
+ // Ce nimamo individualnih nastavitev pridobimo splosne nastavitve tabel
+ if($tables_setting == -1)
+ $tables_setting = SurveySetting::getInstance()->getSurveyMiscSetting('pc_tables');
+ }
+
+ return $tables_setting;
+ }
}
\ No newline at end of file diff --git a/main/survey/app/Controllers/Vprasanja/NumberController.php b/main/survey/app/Controllers/Vprasanja/NumberController.php index 13f312c..d8adf4b 100644 --- a/main/survey/app/Controllers/Vprasanja/NumberController.php +++ b/main/survey/app/Controllers/Vprasanja/NumberController.php @@ -60,6 +60,7 @@ class NumberController extends Controller //**************************************************************************************************
//***************************
+ $limit = ''; $limit2 = '';
if ($row['num_useMin'] == 1 && $row['num_useMax'] == 1 && $row['vsota_min'] == $row['vsota_limit'])
$limit = '(' . $row['vsota_min'] . ')';
@@ -69,8 +70,6 @@ class NumberController extends Controller $limit = '(min ' . $row['vsota_min'] . ')';
elseif ($row['num_useMax'] == 1)
$limit = '(max ' . $row['vsota_limit'] . ')';
- else
- $limit = '';
if ($row['size'] == 2) {
if ($row['num_useMin2'] == 1 && $row['num_useMax2'] == 1 && $row['num_min2'] == $row['num_max2'])
@@ -81,8 +80,6 @@ class NumberController extends Controller $limit2 = '(min ' . $row['num_min2'] . ')';
elseif ($row['num_useMax2'] == 1)
$limit2 = '(max ' . $row['num_max2'] . ')';
- else
- $limit2 = '';
}
# preverimo ali je vrednost v bazi missing
@@ -102,11 +99,11 @@ class NumberController extends Controller $taWidth = 10;
//preverjanje praznega vnosa (-1)
- $row1['text'] != -1 ? $text = $row1['text'] : $text = '';
- $row1['text2'] != -1 ? $text2 = $row1['text2'] : $text2 = '';
+ $text = (isset($row1['text']) && $row1['text'] != -1) ? $row1['text'] : '';
+ $text2 = (isset($row1['text2']) && $row1['text2'] != -1) ? $row1['text2'] : '';
- $row1['text'] != -1 ? $value[1] = $row1['text'] : $value[1] = '';
- $row1['text2'] != -1 ? $value[2] = $row1['text2'] : $value[2] = '';
+ $value[1] = (isset($row1['text']) && $row1['text'] != -1) ? $row1['text']: '';
+ $value[2] = (isset($row1['text2']) && $row1['text2'] != -1) ? $row1['text2']: '';
$sql2 = sisplet_query("SELECT id, naslov, vrstni_red, other FROM srv_vrednost WHERE spr_id='$spremenljivka' order BY vrstni_red");
$array_others = array();
@@ -130,11 +127,11 @@ class NumberController extends Controller echo '<br>';
}
- echo '<label for="spremenljivka_' . $spremenljivka . '_vrednost_' . $row2['vrstni_red'] . '" ' . ($row['ranking_k'] == '1' && get('mobile') == 0 ? ' style="display:none;"' : '') . '>';
-
# če imamo enoto na levi jo izpišemo
if ($row['enota'] == 1) {
+ echo '<label for="spremenljivka_' . $spremenljivka . '_vrednost_' . $row2['vrstni_red'] . '" ' . ($row['ranking_k'] == '1' && get('mobile') == 0 ? ' style="display:none;"' : '') . '>';
echo $naslov;
+ echo '</label>';
}
echo ' <input type="text" class="width_' . $taWidth . '" name="vrednost_' . $spremenljivka . '[]"'
@@ -143,19 +140,20 @@ class NumberController extends Controller . ' onkeypress="checkNumber(this, ' . $row['cela'] . ', ' . $row['decimalna'] . ');"'
. ' onkeyup="checkNumber(this, ' . $row['cela'] . ', ' . $row['decimalna'] . '); checkBranching();"'
. (!$missing ? '' : ' disabled') . '> ' . "\n";
+
# če imamo enoto na desni jo izpišemo
if ($row['enota'] == 2) {
+ echo '<label for="spremenljivka_' . $spremenljivka . '_vrednost_' . $row2['vrstni_red'] . '" ' . ($row['ranking_k'] == '1' && get('mobile') == 0 ? ' style="display:none;"' : '') . '>';
echo $naslov;
- }
-
- echo '</label>';
+ echo '</label>';
+ }
} else {
# imamo polje drugo - ne vem, zavrnil...
$array_others[$row2['id']] = array(
'naslov' => $naslov,
'vrstni_red' => $row2['vrstni_red'],
- 'value' => $text[$row2['vrstni_red']],
+ 'value' => (isset($text[$row2['vrstni_red']]) ? $text[$row2['vrstni_red']] : ''),
);
}
@@ -226,7 +224,8 @@ class NumberController extends Controller //za custom opisne labele
//moznosti urejanja opisnih label drsnika
- if($slider_VmesneDescrLabel){
+ if($slider_VmesneDescrLabel){
+ $slider_CustomDescriptiveLabels = '';
for($i=1; $i<=$slider_NumofDescrLabels; $i++){
if($custom == ''){ //ce nimamo prevoda opisnih label za drsnika
$slider_CustomDescriptiveLabelsTmp = ($spremenljivkaParams->get('slider_Labela_opisna_'.$i) ? $spremenljivkaParams->get('slider_Labela_opisna_'.$i) : '');
@@ -327,7 +326,7 @@ class NumberController extends Controller # missing vrednost
$_id = 'missing_value_spremenljivka_' . $spremenljivka . '_vrednost_' . $oKey;
- if ($srv_data_vrednost[$oKey]) {
+ if (isset($srv_data_vrednost[$oKey]) && $srv_data_vrednost[$oKey]) {
$sel = true;
} else {
$sel = false;
@@ -357,11 +356,12 @@ class NumberController extends Controller $hide_missing = true;
echo '<div class="variabla' . $oblika['cssFloat'] . ' missing" id="vrednost_if_' . $oKey . '"' . ' ' . ($hide_missing ? ' style="display:none"' : '') . '>';
- echo '<label for="' . $_id . '">';
- echo '<input type="checkbox" name="vrednost_mv_' . $spremenljivka . '[]" id="' . $_id . '" value="' . $oKey . '"' . $_checked . ($_disabled ? ' disabled' : '') . ' data-calculation="0" onclick="checkBranching(); ' . ($checkbox_limit > 0 ? 'checkboxLimit(\'' . $spremenljivka . '\', \'' . $oKey . '\', \'' . $checkbox_limit . '\');' : '') . ' checkMissing(this);"> ';
+ echo ' <label for="'.$_id.'">';
+ echo ' <input type="checkbox" name="vrednost_mv_' . $spremenljivka . '[]" id="' . $_id . '" value="' . $oKey . '"' . $_checked . ($_disabled ? ' disabled' : '') . ' data-calculation="0" onclick="checkBranching(); ' . ($checkbox_limit > 0 ? 'checkboxLimit(\'' . $spremenljivka . '\', \'' . $oKey . '\', \'' . $checkbox_limit . '\');' : '') . ' checkMissing(this);"> ';
// Font awesome checkbox
- echo '<span class="enka-checkbox-radio" '.((Helper::getCustomCheckbox() != 0) ? 'style="font-size:' . Helper::getCustomCheckbox() . 'px;"' : '').'></span>';
- echo '' . $other['naslov'] . '</label>';
+ echo ' <span class="enka-checkbox-radio" '.((Helper::getCustomCheckbox() != 0) ? 'style="font-size:' . Helper::getCustomCheckbox() . 'px;"' : '').'></span>';
+ echo $other['naslov'];
+ echo ' </label>';
echo '</div>';
}
}
diff --git a/main/survey/app/Controllers/Vprasanja/OneAgainstAnotherController.php b/main/survey/app/Controllers/Vprasanja/OneAgainstAnotherController.php index de5581d..9da537e 100644 --- a/main/survey/app/Controllers/Vprasanja/OneAgainstAnotherController.php +++ b/main/survey/app/Controllers/Vprasanja/OneAgainstAnotherController.php @@ -42,11 +42,7 @@ class OneAgainstAnotherController extends Controller /**
* @desc prikaze vnosno polje za one against another
*/
- function display($spremenljivka)
- {
-
- //echo "One against another!";
-
+ function display($spremenljivka){
$loop_id = get('loop_id') == null ? " IS NULL" : " = '" . get('loop_id') . "'";
@@ -59,13 +55,12 @@ class OneAgainstAnotherController extends Controller $gridWidth = (($spremenljivkaParams->get('gridWidth') > 0) ? $spremenljivkaParams->get('gridWidth') : 30);
$gridAlign = (($spremenljivkaParams->get('gridAlign') > 0) ? $spremenljivkaParams->get('gridAlign') : 0);
$cssAlign = '';
- //$gridAlign = 1;
+
if ($gridAlign == 1)
$cssAlign = ' alignLeft';
elseif ($gridAlign == 2)
$cssAlign = ' alignRight';
- //$css = ' style = "width: '.$gridWidth.'%;" ';
// izracuni za sirino celic
$size = $row['grids'];
@@ -94,10 +89,9 @@ class OneAgainstAnotherController extends Controller if ($mv_count > 0) {
$size += 1 + $mv_count;
}
+
// diferencial
- //if ($row['enota'] == 1) {
$size += 2;
- //}
# če imamo nastavljno sirino prvega grida ostalih ne nastavljamo
if ($gridWidth == 30) {
@@ -112,39 +106,6 @@ class OneAgainstAnotherController extends Controller echo '<table class="grid_table multigrid" >' . "\n";
-
- // echo '<colgroup class="question">';
- // //echo '<col class="width_'.$gridWidth.'">';
- // echo '<col class="width_15">';
- // echo '</colgroup>';
- // echo '<colgroup>';
- // //echo '<col class="space">';
- // echo '<col class="width_20">';
- // echo '</colgroup>';
- // echo '<colgroup class="category">';
- // for ($i=1; $i<=$row['grids']; $i++)
- // echo '<col>';
- // echo '</colgroup>';
- // if ($mv_count > 0) {
- // echo '<colgroup>';
- // echo '<col class="space">';
- // echo '</colgroup>';
- // echo '<colgroup class="missing">';
- // for ($i=1; $i<=$mv_count; $i++)
- // echo '<col>';
- // echo '</colgroup>';
- // }
- // if ($row['enota'] > 0) {
- // echo '<colgroup>';
- // //echo '<col class="space">';
- // echo '<col class="width_20">';
- // echo '</colgroup>';
- // //echo '<colgroup class="differential">';
- // //echo '<col class="width_'.$gridWidth.'">';
-
- // //echo '</colgroup>';
- // }
-
echo '<tbody>';
$bg++;
@@ -161,11 +122,19 @@ class OneAgainstAnotherController extends Controller # loop skozi srv_vrednost, da izpišemo vrstice z vrednostmi
$sql1 = sisplet_query("SELECT * FROM srv_vrednost WHERE spr_id='$row[id]' ORDER BY FIELD(vrstni_red, $orderby)");
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
+ $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'];
@@ -193,37 +162,20 @@ class OneAgainstAnotherController extends Controller //radio buttoni
-
if (count($srv_grids) > 0) {
$first_missing_value = true;
foreach ($srv_grids AS $i => $srv_grid) {
-/* if ((string)$srv_grid['other'] != '0' && $first_missing_value == true) {
- # dodamo spejs pred manjkajočimi vrednostmi
- echo ' <td></td>' . "\n";
- $first_missing_value = false;
- } */
$value = $srv_grids[$i]['id'];
# izpišemo radio grida
if ($srv_grid['other'] != 0) {
-/* echo '<td class="missing' . ((Helper::getCustomCheckbox() != 0) ? ' custom-radio custom-size-' . Helper::getCustomCheckbox() : '') . ' ' . $cssAlign . '">';
- # imamo missing vrednost
- echo '<label for="grid_missing_value_' . $row1['id'] . '_grid_' . $value . '">';
- echo '<input type="radio" ' . (!$hideName ? ' name="vrednost_' . $row1['id'] . '"' : '') . ' id="grid_missing_value_' . $row1['id'] . '_grid_' . $value . '" value="' . $value . '"' . (($grid_id == $value && $grid_id != '') ? ' checked' : '') . ' data-calculation="0" onclick="checkChecked(this); checkTableMissing(this); checkBranching(); setCheckedClass(this, null, ' . $row1['id'] . ');">';
- echo '<span ' . (($row1['hidden'] == 2) ? 'class="answer-disabled"' : '') . '></span>';
- echo '</label>';
- echo '</td>' . "\n";
- if ($i == 1) { //ce je to prvi radio button, dodaj ali
- //echo '<td style="text-align: center;"> ali </td>';
- echo '<td style="text-align: center;"> ' . self::$lang['srv_tip_sample_t6_4_vmes'] . ' </td>';
- }
+ }
+ else {
- */
- }else {
- //echo '<td class="category ' . $cssAlign . '">';
echo '<td class="category style="text-align: center;">';
+
# ni missing vrednost
echo '<label for="vrednost_' . $row1['id'] . '_grid_' . $value . '">';
echo '<input type="radio" ' . (!$hideName ? ' name="vrednost_' . $row1['id'] . '"' : '') . ' id="vrednost_' . $row1['id'] . '_grid_' . $value . '" value="' . $value . '"' . (($grid_id == $value && $grid_id != '' && !$is_missing) ? ' checked' : '') . ($is_missing ? ' disabled' : '') . ' data-calculation="' . $srv_grids[$i]['variable'] . '" onclick="checkChecked(this); checkBranching(); setCheckedClass(this, null, ' . $row1['id'] . ');">';
diff --git a/main/survey/app/Controllers/Vprasanja/RadioCheckboxSelectController.php b/main/survey/app/Controllers/Vprasanja/RadioCheckboxSelectController.php index 9de8d5f..5c93cf7 100644 --- a/main/survey/app/Controllers/Vprasanja/RadioCheckboxSelectController.php +++ b/main/survey/app/Controllers/Vprasanja/RadioCheckboxSelectController.php @@ -182,7 +182,7 @@ class RadioCheckboxSelectController extends Controller while ($row1 = mysqli_fetch_array($sql1)) {
if ($row1['other'] == 0 || $row1['other'] == 1) {
} else {
- if ($srv_data_vrednost[$row1['id']]) {
+ if (isset($srv_data_vrednost[$row1['id']])) {
$is_missing = true;
}
}
@@ -272,7 +272,7 @@ class RadioCheckboxSelectController extends Controller echo '<table class="width_30">';
echo '<tr>';
- echo '<td><label for="' . $_id . '">' . $row1['naslov'] . ' </label>';
+ echo '<td><label for="' . $_id . '"><span class="variabla_text">' . $row1['naslov'] . '</span></label>';
if ($row1['other'] == 1) {
$sql3 = sisplet_query("SELECT text FROM srv_data_text" . get('db_table') . " WHERE spr_id='$spremenljivka' AND vre_id='$row1[id]' AND usr_id='" . get('usr_id') . "' AND loop_id $loop_id");
@@ -282,11 +282,9 @@ class RadioCheckboxSelectController extends Controller $otherHeight = ($spremenljivkaParams->get('otherHeight') ? $spremenljivkaParams->get('otherHeight') : 1);
if ($otherHeight > 1)
- echo ' <textarea name="textfield_' . $row1['id'] . '" id="spremenljivka_' . $spremenljivka . '_textfield_' . $row1['id'] . '" rows="' . $otherHeight . '" style="' . ($otherWidth != -1 ? ' width:' . $otherWidth . '%;' : '') . '" ' . ($_disabled ? ' disabled' : '') . ' onclick="$(\'#spremenljivka_' . $spremenljivka . '_vrednost_' . $row1['id'] . '\').attr(\'checked\',true); checkBranching();">' . $row3['text'] . '</textarea>';
+ echo ' <textarea name="textfield_' . $row1['id'] . '" id="spremenljivka_' . $spremenljivka . '_textfield_' . $row1['id'] . '" class="input_other" rows="' . $otherHeight . '" style="' . ($otherWidth != -1 ? ' width:' . $otherWidth . '%;' : '') . '" ' . ($_disabled ? ' disabled' : '') . ' onclick="$(\'#spremenljivka_' . $spremenljivka . '_vrednost_' . $row1['id'] . '\').attr(\'checked\',true); checkBranching();">' . $row3['text'] . '</textarea>';
else
- echo ' <input type="text" name="textfield_' . $row1['id'] . '" id="spremenljivka_' . $spremenljivka . '_textfield_' . $row1['id'] . '" value="' . $row3['text'] . '" style="' . ($otherWidth != -1 ? ' width:' . $otherWidth . '%;' : '') . '" ' . ($_disabled ? ' disabled' : '') . ' onclick="$(\'#spremenljivka_' . $spremenljivka . '_vrednost_' . $row1['id'] . '\').attr(\'checked\',true); checkBranching();" />';
-
- //echo ' <input type="text" name="textfield_'.$row1['id'].'" id="spremenljivka_'.$spremenljivka.'_textfield_'.$row1['id'].'" value="'.$row3['text'].'" '.($_disabled ? ' disabled' : '').' onclick="$(\'#spremenljivka_'.$spremenljivka.'_vrednost_'.$row1['id'].'\').attr(\'checked\',true); checkBranching();">';
+ echo ' <input type="text" name="textfield_' . $row1['id'] . '" id="spremenljivka_' . $spremenljivka . '_textfield_' . $row1['id'] . '" class="input_other" value="' . $row3['text'] . '" style="' . ($otherWidth != -1 ? ' width:' . $otherWidth . '%;' : '') . '" ' . ($_disabled ? ' disabled' : '') . ' onclick="$(\'#spremenljivka_' . $spremenljivka . '_vrednost_' . $row1['id'] . '\').attr(\'checked\',true); checkBranching();" />';
}
echo '</td>';
@@ -326,10 +324,12 @@ class RadioCheckboxSelectController extends Controller // Vizualna analogna skala
elseif ($row['orientation'] == 11) {
$stOdgovorov = mysqli_num_rows($sql1);
+ //ali so smeskoti pobarvani ali samo sivi
+ $colored = ($spremenljivkaParams->get('visual_type') == 1 ? 'colored' : '');
echo '<div class="variabla custom_radio visual-radio-scale ' . (($row1['hidden'] == 2) ? ' answer-disabled ' : '') . $oblika['cssFloat'] . ' ' . ($missing == 1 ? 'missing' : '') . ' ' . $_checked . ' ' . $hideRadio . '" id="vrednost_if_' . $row1['id'] . '"' . ($row1['if_id'] > 0 ? ' style="display:none"' : '') . ($hide_missing ? ' style="display:none"' : '') . '>';
echo '<label for="' . $_id . '"><input type="radio" ' . (!$hideName ? ' name="vrednost_' . $spremenljivka . '"' : '') . ' id="' . $_id . '" value="' . $row1['id'] . '"' . $_checked . ($_disabled ? ' disabled' : '') . ' data-calculation="' . ($missing == 1 ? '0' : $row1['variable']) . '" onclick="checkChecked(this); checkBranching(); ' . ($row['onchange_submit'] == 1 ? ' submitForm();' : '') . ' setCheckedClass(this, \'1\');"> ';
- echo '<span class="enka-vizualna-skala siv-'.$stOdgovorov.$row1['naslov'].' '.((Helper::getCustomCheckbox() != 0) ? 'size-' . Helper::getCustomCheckbox(): '').'"></span>';
+ echo '<span class="enka-vizualna-skala siv-'.$stOdgovorov.$row1['naslov'].' '.((Helper::getCustomCheckbox() != 0) ? 'size-' . Helper::getCustomCheckbox(): '').' '.$colored.'"></span>';
echo '<div class="custom_radio_answer '.((Helper::getCustomCheckbox() != 0) ? 'size-' . Helper::getCustomCheckbox(): '').'">(' . $row1['naslov'] . ')</div>';
echo '</label>';
}
@@ -342,7 +342,7 @@ class RadioCheckboxSelectController extends Controller echo '<span class="enka-checkbox-radio ' . (($row1['hidden'] == 2) ? ' answer-disabled' : '') . '"' .
((Helper::getCustomCheckbox() != 0) ? 'style="font-size:' . Helper::getCustomCheckbox() . 'px;"' : '') .
'></span>';
- echo '' . $row1['naslov'] . '</label>';
+ echo '<span class="variabla_text">' . $row1['naslov'] . '</span></label>';
// Ce je vprasanje disabled moramo vseeno postati vrednost
if($disabled_vprasanje){
@@ -370,7 +370,7 @@ class RadioCheckboxSelectController extends Controller ((Helper::getCustomCheckbox() != 0) ? (' style="font-size:' . Helper::getCustomCheckbox() . 'px;"') : '') .
'></span>';
- echo '' . $row1['naslov'] . '</label>';
+ echo '<span class="variabla_text">' . $row1['naslov'] . '</span></label>';
//v kolikor je odgovor skrit(1) ali disable(2), mu damo vrednost -2
if ($row1['hidden'] == 1 || $row1['hidden'] == 2)
echo '<input id="branch_' . $_id . '" name="cond_vrednost_' . $spremenljivka . '[]" value="' . $row1['id'] . '" type="hidden">';
@@ -382,12 +382,12 @@ class RadioCheckboxSelectController extends Controller }
// Checkbox - navpicno - text levo
elseif ($row['orientation'] == 7) {
+
echo '<div class="variabla' . $oblika['cssFloat'] . ' ' . ($missing == 1 ? 'missing' : '') . ' ' . $_checked . ' ' . $hideRadio . '" id="vrednost_if_' . $row1['id'] . '"' . ($row1['if_id'] > 0 ? ' style="display:none"' : '') . ($hide_missing ? ' style="display:none"' : '') . (($row1['hidden'] == 2) ? ' disabled' : '') . '>';
+
echo '<table class="width_30">';
- //echo '<table style="width:30%">';
echo '<tr>';
- //echo '<td><label for="'.$_id.'">'.$row1['naslov'].' </label></td>';
- echo '<td><label for="' . $_id . '">' . $row1['naslov'] . ' </label>';
+ echo '<td><label for="' . $_id . '"><span class="variabla_text">' . $row1['naslov'] . '</span></label>';
if ($row1['other'] == 1) {
$sql3 = sisplet_query("SELECT text FROM srv_data_text" . get('db_table') . " WHERE spr_id='$spremenljivka' AND vre_id='$row1[id]' AND usr_id='" . get('usr_id') . "' AND loop_id $loop_id");
@@ -397,11 +397,9 @@ class RadioCheckboxSelectController extends Controller $otherHeight = ($spremenljivkaParams->get('otherHeight') ? $spremenljivkaParams->get('otherHeight') : 1);
if ($otherHeight > 1)
- echo ' <textarea name="textfield_' . $row1['id'] . '" id="spremenljivka_' . $spremenljivka . '_textfield_' . $row1['id'] . '" rows="' . $otherHeight . '" style="' . ($otherWidth != -1 ? ' width:' . $otherWidth . '%;' : '') . '" ' . ($_disabled ? ' disabled' : '') . ' onclick="$(\'#spremenljivka_' . $spremenljivka . '_vrednost_' . $row1['id'] . '\').attr(\'checked\',true); checkBranching();">' . $row3['text'] . '</textarea>';
+ echo ' <textarea name="textfield_' . $row1['id'] . '" id="spremenljivka_' . $spremenljivka . '_textfield_' . $row1['id'] . '" class="input_other" rows="' . $otherHeight . '" style="' . ($otherWidth != -1 ? ' width:' . $otherWidth . '%;' : '') . '" ' . ($_disabled ? ' disabled' : '') . ' onclick="$(\'#spremenljivka_' . $spremenljivka . '_vrednost_' . $row1['id'] . '\').attr(\'checked\',true); checkBranching();">' . $row3['text'] . '</textarea>';
else
- echo ' <input type="text" name="textfield_' . $row1['id'] . '" id="spremenljivka_' . $spremenljivka . '_textfield_' . $row1['id'] . '" value="' . $row3['text'] . '" style="' . ($otherWidth != -1 ? ' width:' . $otherWidth . '%;' : '') . '" ' . ($_disabled ? ' disabled' : '') . ' onclick="$(\'#spremenljivka_' . $spremenljivka . '_vrednost_' . $row1['id'] . '\').attr(\'checked\',true); checkBranching();" />';
-
- //echo ' <input type="text" name="textfield_'.$row1['id'].'" id="spremenljivka_'.$spremenljivka.'_textfield_'.$row1['id'].'" value="'.$row3['text'].'" '.($_disabled ? ' disabled' : '').' onclick="$(\'#spremenljivka_'.$spremenljivka.'_vrednost_'.$row1['id'].'\').attr(\'checked\',true); checkBranching();">';
+ echo ' <input type="text" name="textfield_' . $row1['id'] . '" id="spremenljivka_' . $spremenljivka . '_textfield_' . $row1['id'] . '" class="input_other" value="' . $row3['text'] . '" style="' . ($otherWidth != -1 ? ' width:' . $otherWidth . '%;' : '') . '" ' . ($_disabled ? ' disabled' : '') . ' onclick="$(\'#spremenljivka_' . $spremenljivka . '_vrednost_' . $row1['id'] . '\').attr(\'checked\',true); checkBranching();" />';
}
echo '</td>';
echo '<td align="right">';
@@ -438,9 +436,9 @@ class RadioCheckboxSelectController extends Controller $otherHeight = ($spremenljivkaParams->get('otherHeight') ? $spremenljivkaParams->get('otherHeight') : 1);
if ($otherHeight > 1)
- echo ' <textarea name="textfield_' . $row1['id'] . '" id="spremenljivka_' . $spremenljivka . '_textfield_' . $row1['id'] . '" rows="' . $otherHeight . '" style="' . ($otherWidth != -1 ? ' width:' . $otherWidth . '%;' : '') . '" ' . ($_disabled ? ' disabled' : '') . ' onclick="$(\'#spremenljivka_' . $spremenljivka . '_vrednost_' . $row1['id'] . '\').attr(\'checked\',true); checkBranching(); '.($checkbox_limit > 0 ? 'checkboxLimitTextbox(\'' . $spremenljivka . '\', \'' . $row1['id'] . '\', \'' . $checkbox_limit . '\');' : '').'" >' . $row3['text'] . '</textarea>';
+ echo ' <textarea name="textfield_' . $row1['id'] . '" id="spremenljivka_' . $spremenljivka . '_textfield_' . $row1['id'] . '" class="input_other" rows="' . $otherHeight . '" style="' . ($otherWidth != -1 ? ' width:' . $otherWidth . '%;' : '') . '" ' . ($_disabled ? ' disabled' : '') . ' onclick="$(\'#spremenljivka_' . $spremenljivka . '_vrednost_' . $row1['id'] . '\').attr(\'checked\',true); checkBranching(); '.($checkbox_limit > 0 ? 'checkboxLimitTextbox(\'' . $spremenljivka . '\', \'' . $row1['id'] . '\', \'' . $checkbox_limit . '\');' : '').'" >' . $row3['text'] . '</textarea>';
else
- echo ' <input type="text" name="textfield_' . $row1['id'] . '" id="spremenljivka_' . $spremenljivka . '_textfield_' . $row1['id'] . '" value="' . $row3['text'] . '" style="' . ($otherWidth != -1 ? ' width:' . $otherWidth . '%;' : '') . '" ' . ($_disabled ? ' disabled' : '') . ' onclick="$(\'#spremenljivka_' . $spremenljivka . '_vrednost_' . $row1['id'] . '\').attr(\'checked\',true); checkBranching(); '.($checkbox_limit > 0 ? 'checkboxLimitTextbox(\'' . $spremenljivka . '\', \'' . $row1['id'] . '\', \'' . $checkbox_limit . '\');' : '').'" />';
+ echo ' <input type="text" name="textfield_' . $row1['id'] . '" id="spremenljivka_' . $spremenljivka . '_textfield_' . $row1['id'] . '" class="input_other" value="' . $row3['text'] . '" style="' . ($otherWidth != -1 ? ' width:' . $otherWidth . '%;' : '') . '" ' . ($_disabled ? ' disabled' : '') . ' onclick="$(\'#spremenljivka_' . $spremenljivka . '_vrednost_' . $row1['id'] . '\').attr(\'checked\',true); checkBranching(); '.($checkbox_limit > 0 ? 'checkboxLimitTextbox(\'' . $spremenljivka . '\', \'' . $row1['id'] . '\', \'' . $checkbox_limit . '\');' : '').'" />';
}
}
echo '</div>' . "\n";
@@ -485,9 +483,9 @@ class RadioCheckboxSelectController extends Controller $otherHeight = ($spremenljivkaParams->get('otherHeight') ? $spremenljivkaParams->get('otherHeight') : 1);
if ($otherHeight > 1)
- echo '<br /><textarea name="textfield_' . $row1['id'] . '" id="spremenljivka_' . $spremenljivka . '_textfield_' . $row1['id'] . '" class="drugo_' . $spremenljivka . '" rows="' . $otherHeight . '" style="display:none; ' . ($otherWidth != -1 ? ' width:' . $otherWidth . '%;' : '') . '" ' . ($_disabled ? ' disabled' : '') . ' onclick="checkBranching();">' . $row3['text'] . '</textarea>';
+ echo '<br /><textarea name="textfield_' . $row1['id'] . '" id="spremenljivka_' . $spremenljivka . '_textfield_' . $row1['id'] . '" class="input_other drugo_' . $spremenljivka . '" rows="' . $otherHeight . '" style="display:none; ' . ($otherWidth != -1 ? ' width:' . $otherWidth . '%;' : '') . '" ' . ($_disabled ? ' disabled' : '') . ' onclick="checkBranching();">' . $row3['text'] . '</textarea>';
else
- echo '<br /><input type="text" name="textfield_' . $row1['id'] . '" id="spremenljivka_' . $spremenljivka . '_textfield_' . $row1['id'] . '" class="drugo_' . $spremenljivka . '" value="' . $row3['text'] . '" style="display:none; ' . ($otherWidth != -1 ? ' width:' . $otherWidth . '%;' : '') . '" ' . ($_disabled ? ' disabled' : '') . ' onclick="checkBranching();" />';
+ echo '<br /><input type="text" name="textfield_' . $row1['id'] . '" id="spremenljivka_' . $spremenljivka . '_textfield_' . $row1['id'] . '" class="input_other drugo_' . $spremenljivka . '" value="' . $row3['text'] . '" style="display:none; ' . ($otherWidth != -1 ? ' width:' . $otherWidth . '%;' : '') . '" ' . ($_disabled ? ' disabled' : '') . ' onclick="checkBranching();" />';
}
}
diff --git a/main/survey/app/Controllers/Vprasanja/RankingController.php b/main/survey/app/Controllers/Vprasanja/RankingController.php index 014bb37..b91bd6f 100644 --- a/main/survey/app/Controllers/Vprasanja/RankingController.php +++ b/main/survey/app/Controllers/Vprasanja/RankingController.php @@ -94,7 +94,7 @@ class RankingController extends Controller // prestavljanje za SAZU - n>k
else if ($row['design'] == 0 && get('mobile') == 0
&& SurveyInfo::getInstance()->checkSurveyModule('sazu')
- && in_array($spremenljivka, array('11092569','11092563'))
+ && in_array($spremenljivka, array('11092569','11092563','763259','763254'))
)
$this->displayPrestavljanjeSAZU($spremenljivka, $preview_spremenljivka, $quick_view, $ajax);
@@ -196,7 +196,8 @@ class RankingController extends Controller // Datapiping
$row2['naslov'] = Helper::dataPiping($row2['naslov']);
- $value = $row2['naslov'];
+ $value = strip_tags($row2['naslov'], '<p><br>');
+
$vre_id = $row2['id'];
array_push($vre_idCache1, $vre_id);
$length = strlen($value); //dolzina teksta kategorije odgovora
@@ -286,7 +287,8 @@ class RankingController extends Controller // Datapiping
$row2['naslov'] = Helper::dataPiping($row2['naslov']);
- $value = $row2['naslov'];
+ $value = strip_tags($row2['naslov'], '<p><br>');
+
$vre_id = $row2['id'];
array_push($vre_idCache2, $vre_id);
$length = strlen($value); //dolzina teksta kategorije odgovora
@@ -372,7 +374,7 @@ class RankingController extends Controller //izracun visine
$num = mysqli_num_rows($sql1);
- $size = $num * 37;
+ $size = $num * 40;
//nastavimo $max (maximum prenesenih vrednosti) -> ce lahko nosimo vse vrednosti ($row['ranking_k'] == 0) je $max stevilo vseh vrednotsti
if ($row['ranking_k'] == 0)
@@ -394,7 +396,6 @@ class RankingController extends Controller echo "<script>
$(document).ready(
function(){
-
$('#half_$spremenljivka div').dblclick(function() {
var litem = $(this).clone();
litem.appendTo($('#half2_$spremenljivka'));
@@ -419,7 +420,7 @@ class RankingController extends Controller $('#half_$spremenljivka, #half2_$spremenljivka').sortable({
opacity: '0.7',
connectWith: ['#half_$spremenljivka, #half2_$spremenljivka'],
-
+
placeholder: 'frame_ranking_hover',
//stop: function (){
@@ -493,7 +494,7 @@ class RankingController extends Controller echo '<table class="ranking_table">';
echo '<tr>';
//zaslon razdelimo na dva dela - izris leve strani
- echo '<td>';
+ echo '<td class="first">';
if (get('lang_id') != null) $_lang = '_' . get('lang_id'); else $_lang = '';
$srv_ranking_avaliable_categories = SurveySetting::getInstance()->getSurveyMiscSetting('srvlang_srv_ranking_avaliable_categories' . $_lang);
@@ -501,7 +502,8 @@ class RankingController extends Controller echo '<b>' . $srv_ranking_avaliable_categories . ':</b>';
- echo '<div id="half_' . $spremenljivka . '" class="dropzone" style="height:' . $size . 'px">';
+ //echo '<div id="half_' . $spremenljivka . '" class="dropzone" style="height:' . $size . 'px">';
+ echo '<div id="half_' . $spremenljivka . '" class="dropzone" style="min-height:' . $size . 'px">';
$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)");
$vre_idCacheL = array();
@@ -515,7 +517,8 @@ class RankingController extends Controller // Datapiping
$row1['naslov'] = Helper::dataPiping($row1['naslov']);
- $value = $row1['naslov'];
+ $value = strip_tags($row1['naslov'], '<p><br>');
+
$vre_id = $row1['id'];
array_push($vre_idCacheL, $vre_id);
$other = $row1['other']; //drugo, po navadi missing
@@ -529,7 +532,9 @@ class RankingController extends Controller $class = 'ranking_mobile';
}
- $c = '';
+ $c = '';
+
+
echo '<div id="spremenljivka_' . $spremenljivka . '_vrednost_' . $vre_id . '" class="' . $class . ' ' . $c . '">' . $value . '</div>' . "\n"; //'#spremenljivka_'+spremenljivka+'_vrednost_'+id
}
@@ -544,7 +549,7 @@ class RankingController extends Controller ?>
<script>
$(document).ready(function () {
- customizeImageView4Respondent(<?=$row['tip']?>, <?=$spremenljivka?>, <?=$vre_id?>, <?=$ajax?>, srv_meta_anketa_id, '<?=self::$site_url?>', usr_id, <?=$otherCacheL[$indeksVre_idCacheL]?>, <?=get('mobile')?>, <?=$quick_view?>, <?=$preview_spremenljivka?>); //poklici funkcijo za ureditev draggable in droppable
+ customizeImageView4Respondent(<?=$row['tip']=0?>, <?=$spremenljivka?>, <?=$vre_id?>, <?=$ajax?>, srv_meta_anketa_id, '<?=self::$site_url?>', usr_id, <?=$otherCacheL[$indeksVre_idCacheL]?>, <?=get('mobile')?>, <?=$quick_view?>, <?=$preview_spremenljivka?>); //poklici funkcijo za ureditev ureditev draggable in droppable
});
</script>
<?
@@ -553,10 +558,11 @@ class RankingController extends Controller //ureditev gladkega delovanja prikazovanja visjih blokov odgovorov (vecvrsticni, s slikami, ipd.) - konec
//srednja celica (stevilo prenesenih in spodaj puscica)
- echo '<td class="middle">';
+ /* echo '<td class="middle">';
echo '<b>' . $count . '/' . $max . '</b>';
- echo '<img src="' . self::$site_url . 'main/survey/skins/Modern/arrow.png" alt="arrow">';
- echo '</td>';
+ //echo '<img src="' . self::$site_url . 'main/survey/skins/Modern/arrow.png" alt="arrow">';
+ echo '<div class="arrow_dnd"> </div>';
+ echo '</td>'; */
//izris desne strani
echo '<td>';
@@ -565,7 +571,7 @@ class RankingController extends Controller $srv_ranking_ranked_categories = SurveySetting::getInstance()->getSurveyMiscSetting('srvlang_srv_ranking_ranked_categories' . $_lang);
if ($srv_ranking_ranked_categories == '') $srv_ranking_ranked_categories = self::$lang['srv_ranking_ranked_categories'];
- echo '<b>' . $srv_ranking_ranked_categories . ':</b>';
+ echo '<b>' . $srv_ranking_ranked_categories . '(' . $count . '/' . $max . '):</b>';
echo '<div class="dropholder">'; // ker na td ne primer position relative za nastavit position absolute na dropzone
@@ -586,8 +592,8 @@ class RankingController extends Controller // Datapiping
$row1['naslov'] = Helper::dataPiping($row1['naslov']);
+ $value = strip_tags($row1['naslov'], '<p><br>');
- $value = $row1['naslov'];
$vre_id = $row1['id'];
array_push($vre_idCacheD, $vre_id);
$length = strlen($value); //dolzina teksta kategorije odgovora
@@ -626,6 +632,7 @@ class RankingController extends Controller <script>
$(document).ready(function () {
question_height_ranking(<?=$spremenljivka?>);
+ //console.log("tukaj!");
});
</script>
<?
@@ -965,7 +972,7 @@ class RankingController extends Controller type="hidden"
name="spremenljivka_' . $spremenljivka . '_vrednost_' . $row1['id'] . '"
id="spremenljivka_' . $spremenljivka . '_ranking_cifre_' . $counter . '"
- value="' . $row2['vrstni_red'] . '"
+ value="' . (isset($row2['vrstni_red']) ? $row2['vrstni_red'] : '') . '"
> ';
echo '<br />';
@@ -985,7 +992,7 @@ class RankingController extends Controller type="hidden"
name="spremenljivka_' . $spremenljivka . '_vrednost_' . $row1['id'] . '"
id="spremenljivka_' . $spremenljivka . '_ranking_cifre_' . $counter . '"
- value="' . $row2['vrstni_red'] . '"
+ value="' . (isset($row2['vrstni_red']) ? $row2['vrstni_red'] : '') . '"
> ';
echo '<br />';
diff --git a/main/survey/app/Controllers/Vprasanja/TextController.php b/main/survey/app/Controllers/Vprasanja/TextController.php index 03c3fd3..ae0ca9d 100644 --- a/main/survey/app/Controllers/Vprasanja/TextController.php +++ b/main/survey/app/Controllers/Vprasanja/TextController.php @@ -21,6 +21,7 @@ use App\Controllers\LanguageController as Language; use App\Controllers\Vprasanja\SystemVariableController as SystemVariable;
use App\Models\Model;
use enkaParameters;
+use AppSettings;
class TextController extends Controller
{
@@ -229,7 +230,7 @@ class TextController extends Controller if ($naslov != '') $row1['naslov'] = $naslov;
# preverimo izbrano vrednost
- $grid_id = $srv_data_grid[$row1['id']]['grd_id'];
+ $grid_id = isset($srv_data_grid[$row1['id']]['grd_id']) ? $srv_data_grid[$row1['id']]['grd_id'] : '';
# ugotovimo ali je na katerem gridu predhodno izbran missing
$is_missing = false;
@@ -272,19 +273,18 @@ class TextController extends Controller $first_missing_value = true;
foreach ($srv_grids AS $i => $srv_grid) {
- if ($srv_grid['other'] != 0)
- $grid_id = $srv_data_grid[$row1['id']]['grd_id'];
- else
- $grid_id = $srv_data_cache[$row1['id']][$i]['grd_id'];
+ if ($srv_grid['other'] != 0){
+ $grid_id = isset($srv_data_grid[$row1['id']]['grd_id']) ? $srv_data_grid[$row1['id']]['grd_id'] : '';
+ }
+ else{
+ $grid_id = isset($srv_data_cache[$row1['id']][$i]['grd_id']) ? $srv_data_cache[$row1['id']][$i]['grd_id'] : '';
+ }
$value = $srv_grid['id'];
$vsebina = '';
if ($grid_id == $value) {
-
$vsebina = $srv_data_cache[$row1['id']][$i]['text'];
-
- //$row2 = mysqli_fetch_array($sql2);
}
if ((string)$srv_grid['other'] != '0' && $first_missing_value == true) {
@@ -480,7 +480,6 @@ class TextController extends Controller ************************************************/
public function textbox($spremenljivka, $oblika)
{
- global $recaptcha_sitekey;
global $lang;
$row = Model::select_from_srv_spremenljivka($spremenljivka);
@@ -575,7 +574,7 @@ class TextController extends Controller $captcha = ($spremenljivkaParams->get('captcha') ? $spremenljivkaParams->get('captcha') : 0);
if ($captcha == 1) {
- echo '<div class="g-recaptcha" data-sitekey="' .$recaptcha_sitekey .'"></div>';
+ echo '<div class="g-recaptcha" data-sitekey="'.AppSettings::getInstance()->getSetting('google-recaptcha_sitekey').'"></div>';
}
else {
$char_counter_events = $limit ? 'charCounter(this);' : '';
@@ -583,12 +582,11 @@ class TextController extends Controller // Ce gre za email preverjamo pravilnost na blur in ne na keyup
$js_trigger = ($email_verify == 1) ? 'onBlur' : 'onKeyUp';
- echo '<label for="spremenljivka_' . $spremenljivka . '_vrednost_' . $i . '">';
if ($taSize > 1) {
echo '<textarea name="vrednost_' . $spremenljivka . '_kos_' . $row1['id'] . '" id="spremenljivka_' . $spremenljivka . '_vrednost_' . $i . '" '.($disabled_vprasanje ? ' disabled="disabled"' : '').' rows="' . $taSize . '" class="width_' . $input . '" onkeyup="checkBranching();'.$char_counter_events.'"' . (!$missing && !$disabled_vprasanje ? '' : ' disabled') . $max_text_length. '>' . (!$missing ? $row2['text'] : '') . '</textarea>';
} else {
- echo '<input type="text" name="vrednost_' . $spremenljivka . '_kos_' . $row1['id'] . '" id="spremenljivka_' . $spremenljivka . '_vrednost_' . $i . '" class="width_' . $input . '" '.($disabled_vprasanje ? ' disabled="disabled"' : '').' '.$js_trigger.'="checkBranching();'.$char_counter_events.'" value="' . (!$missing ? $row2['text'] : '') . '" ' . (!$missing && !$disabled_vprasanje ? '' : ' disabled') . $max_text_length. '>';
+ echo '<input type="text" name="vrednost_' . $spremenljivka . '_kos_' . $row1['id'] . '" id="spremenljivka_' . $spremenljivka . '_vrednost_' . $i . '" class="width_' . $input . '" '.($disabled_vprasanje ? ' disabled="disabled"' : '').' '.$js_trigger.'="checkBranching();'.$char_counter_events.'" value="' . (!$missing && isset($row2['text']) ? $row2['text'] : '') . '" ' . (!$missing && !$disabled_vprasanje ? '' : ' disabled') . $max_text_length. '>';
}
// Ce je vprasanje disabled moramo vseeno postati vrednost
@@ -602,6 +600,7 @@ class TextController extends Controller echo '<script>set_charCounter(\'spremenljivka_' . $spremenljivka . '_vrednost_' . $i . '\');</script>';
}
+ echo '<label for="spremenljivka_' . $spremenljivka . '_vrednost_' . $i . '">';
echo '</label>';
}
@@ -632,9 +631,9 @@ class TextController extends Controller //***novo
- //$sqlSignature = sisplet_query("SELECT filename FROM srv_data_upload WHERE usr_id = '" . get('usr_id') . "'");
$sqlSignature = sisplet_query("SELECT filename FROM srv_data_upload WHERE usr_id = '" . get('usr_id') . "' AND code='" . $spremenljivka . "' ");
if (mysqli_num_rows($sqlSignature) > 0) {
+
$rowSignature = mysqli_fetch_array($sqlSignature);
$signaturefile = $rowSignature[0];
@@ -752,22 +751,24 @@ class TextController extends Controller <div id="canvas_' . $spremenljivka . '">
<div class="sig sigWrapper">
- <canvas width="'.$width.'" height="'.$height.'" style="border:1px solid black"></canvas>
+ <canvas width="'.$width.'" height="'.$height.'"></canvas>
</div>
</div>
<div id="podpis_slika_' . $spremenljivka . '" hidden>
<img src="' . self::$site_url . 'main/survey/uploads/' . $signaturefile . '" style="width: '.$width.'px; height: '.$height.'px; border:1px solid black">
</div>
- <div>
-
- <input id="clear_spremenljivka_' . $spremenljivka . '" type="button" value="' . self::$lang['srv_signature_clear'] . '" class="sig_clear_button" style="width: '.$width.'px;">
-
- <input id="signature-data_spremenljivka_' . $spremenljivka . '" type="text" value="" name="signature-data_spremenljivka_' . $spremenljivka . '" hidden><br />
+
+ <div class="sig_clear_button_wrapper">
+ <input id="clear_spremenljivka_' . $spremenljivka . '" type="button" value="' . self::$lang['srv_signature_clear'] . '" class="sig_clear_button" >
+
+ <input id="signature-data_spremenljivka_' . $spremenljivka . '" type="text" value="" name="signature-data_spremenljivka_' . $spremenljivka . '" hidden>
+ </div>
';
echo '
- ' . self::$lang['srv_signature_name'] . ' ' . '<input type="text" name="vrednost_' . $spremenljivka . '_kos_' . $row1['id'] . '" id="spremenljivka_' . $spremenljivka . '_vrednost_' . $i . '" ' . (!$missing ? '' : ' disabled') . '><br />
+ <div class="sig_input_wrapper">
+ ' . self::$lang['srv_signature_name'] . ' ' . '<input type="text" name="vrednost_' . $spremenljivka . '_kos_' . $row1['id'] . '" id="spremenljivka_' . $spremenljivka . '_vrednost_' . $i . '" ' . (!$missing ? '' : ' disabled') . '><br />
</div>
</div>
@@ -775,7 +776,7 @@ class TextController extends Controller }
// Smo v admin podatkih in uplodamo datoteko ali fotografijo
- elseif( ($row['upload'] == 1 || $row['upload'] == 2) && ($_GET['t'] == 'postprocess' || $_GET['m'] == 'quick_edit') ){
+ elseif( ($row['upload'] == 1 || $row['upload'] == 2) && ((isset($_GET['t']) && $_GET['t'] == 'postprocess') || (isset($_GET['m']) && $_GET['m'] == 'quick_edit')) ){
$sqlUpload = sisplet_query("SELECT filename FROM srv_data_upload WHERE usr_id='".get('usr_id')."' AND code='".$row2['text']."'");
@@ -937,7 +938,7 @@ class TextController extends Controller # missing vrednost
$_id = 'missing_value_spremenljivka_' . $spremenljivka . '_vrednost_' . $oKey;
- if ($srv_data_vrednost[$oKey]) {
+ if (isset($srv_data_vrednost[$oKey]) && $srv_data_vrednost[$oKey]) {
$sel = true;
} else {
$sel = false;
diff --git a/main/survey/app/Controllers/Vprasanja/VprasanjaController.php b/main/survey/app/Controllers/Vprasanja/VprasanjaController.php index c34b1c3..baeb207 100644 --- a/main/survey/app/Controllers/Vprasanja/VprasanjaController.php +++ b/main/survey/app/Controllers/Vprasanja/VprasanjaController.php @@ -227,21 +227,17 @@ class VprasanjaController extends Controller $zaporedna++;
}
-
+
// JS za mobilno razpiranje tabel
- SurveySetting::getInstance()->Init(get('anketa'));
- $mobile_tables = SurveySetting::getInstance()->getSurveyMiscSetting('mobile_tables');
- if($mobile_tables == 2){
-
- echo '<script>
- $(document).ready(
- function(){
- mobileMultigridExpandable();
- }
- );
- </script>';
- }
+ echo '<script>
+ $(document).ready(
+ function(){
+ mobileMultigridExpandable();
+ }
+ );
+ </script>';
+
// JS za razpiranje tabel znotraj bloka s to nastavitvijo
echo '<script>
$(document).ready(
@@ -251,12 +247,12 @@ class VprasanjaController extends Controller );
</script>';
-
+
echo '<script>
var comments = init_comments_save();
// GDPR popup
- $(".gdpr_popup_trigger").click(function(){ show_gdpr_about(\''.get('lang_id').'\'); });
+ $(".gdpr_popup_trigger").click(function(){ show_gdpr_about(\''. self::$lang['id'] .'\'); });
</script>';
}
@@ -323,12 +319,22 @@ class VprasanjaController extends Controller $sql = sisplet_query("SELECT text FROM srv_data_text" . get('db_table') . " WHERE spr_id='0' AND vre_id='$spremenljivka' AND usr_id='" . get('usr_id') . "' AND loop_id $loop_id");
$row = mysqli_fetch_array($sql);
- echo '<div class="comment red" onclick="$(\'#question_resp_comment_' . $spremenljivka . '\').toggle();" >' . $comment . '</div>
- <div class="variable_holder ' . ($question_resp_comment_show_open == 1 ? 'display_none' : '') . '" id="question_resp_comment_' . $spremenljivka . '">
- <div class="variabla question_comment">
- <textarea name="question_comment_' . $spremenljivka . '" id="question_comment_' . $spremenljivka . '">' . $row['text'] . '</textarea>
- </div>
- </div>';
+
+ echo '<div class="comment_holder">';
+
+ echo ' <div class="comment red" onclick="$(\'#question_resp_comment_' . $spremenljivka . '\').toggle();" >' . $comment . '</div>';
+
+ echo ' <div class="variable_holder ' . ($question_resp_comment_show_open == 1 ? 'display_none' : '') . '" id="question_resp_comment_' . $spremenljivka . '">';
+ echo ' <div class="variabla question_comment">';
+ echo ' <textarea name="question_comment_' . $spremenljivka . '" id="question_comment_' . $spremenljivka . '">' . $row['text'] . '</textarea>';
+ echo ' </div>';
+ echo ' </div>';
+
+ echo ' <div class="comment_autosave">';
+ echo ' <span class="faicon bottom_saving"></span>'.self::$lang['srv_vprasalnik_autosave'];
+ echo ' </div>';
+
+ echo '</div>';
}
/**
@@ -342,9 +348,9 @@ class VprasanjaController extends Controller $row = Model::select_from_srv_spremenljivka($spremenljivka);
$rowl = Language::srv_language_spremenljivka($spremenljivka);
- if (strip_tags($rowl['naslov']) != '') $row['naslov'] = $rowl['naslov'];
- if (strip_tags($rowl['info']) != '') $row['info'] = $rowl['info'];
- if ($rowl['vsota'] != '') $row['vsota'] = $rowl['vsota'];
+ if (isset($rowl['naslov']) && strip_tags($rowl['naslov']) != '') $row['naslov'] = $rowl['naslov'];
+ if (isset($rowl['info']) && strip_tags($rowl['info']) != '') $row['info'] = $rowl['info'];
+ if (isset($rowl['vsota']) && $rowl['vsota'] != '') $row['vsota'] = $rowl['vsota'];
// da dela tudi userjem brez JS, po defaultu vedno prikazemo vsa vprasanja, ki jih potem skrivamo z JS
@@ -534,8 +540,9 @@ class VprasanjaController extends Controller echo '<div class="variable_holder vodoravno_ob_vprasanju '.$oblika['divClear'].'" '.($row['hidden_default'] == 1 ? 'style="display:none"' : '').'>';
}
else{
+ $visual_scale = ($row['tip'] == 1 && $row['orientation'] == 11) ? 'analog_visual_scale' : '';
//echo '<div class="variable_holder '.$oblika['divClear'].'" ' . ($row['hidden_default'] == 1 ? 'style="display:none"' : 'style="display:inline"').'>';
- echo '<div class="variable_holder '.$oblika['divClear'].'" ' . ($row['hidden_default'] == 1 ? 'style="display:none"' : '').'>';
+ echo '<div class="variable_holder '.$oblika['divClear'].' '.$visual_scale.'" ' . ($row['hidden_default'] == 1 ? 'style="display:none"' : '').'>';
}
}
@@ -701,11 +708,11 @@ class VprasanjaController extends Controller // Tabela - radio
case 6:
-
- SurveySetting::getInstance()->Init(get('anketa'));
- $mobile_tables = SurveySetting::getInstance()->getSurveyMiscSetting('mobile_tables');
- // Izris multigrida s postopnim resevanjem
+ // Pridobimo nastavitve za prikaz tabele
+ $tables_setting = MultigridMobile::getInstance()->getTableSettings($spremenljivkaParams);
+
+ // Izris multigrida s postopnim resevanjem - ostanek za stare ankete
if($row['dynamic_mg'] > 0 && !get('printPreview')){
if ($row['dynamic_mg'] == 1 || $row['dynamic_mg'] == 3 || $row['dynamic_mg'] == 5)
@@ -713,16 +720,23 @@ class VprasanjaController extends Controller else
Dynamic::getInstance()->verticalMultigrid($spremenljivka);
}
- // Izris radio multigrida na mobitelu
- elseif (get('mobile') == 1 && $mobile_tables > 0) {
-
- // Dvojni multigrid
- if($row['enota'] == 3)
- MultigridMobile::getInstance()->radioDoubleMultigrid($spremenljivka);
- else
- MultigridMobile::getInstance()->radioMultigrid($spremenljivka);
+ // Izris multigrida na mobitelu
+ elseif (get('mobile') == 1 && $tables_setting > 0) {
+
+ // Prilagojena tabela s horizontalnim pomikanjem
+ if ($tables_setting == 3) {
+ MultigridMobile::getInstance()->radioHorizontalDynamicMultigrid($spremenljivka);
+ }
+ else{
+
+ // Dvojni multigrid
+ if($row['enota'] == 3)
+ MultigridMobile::getInstance()->radioDoubleMultigrid($spremenljivka);
+ else
+ MultigridMobile::getInstance()->radioMultigrid($spremenljivka);
+ }
}
- // Ostali podtipi tabel
+ // Podtipi tabel
else{
// Izris glede na podtip
@@ -735,7 +749,19 @@ class VprasanjaController extends Controller // Dvojni multigrid
case 3:
- Double::getInstance()->grid($spremenljivka);
+
+ // Prilagojena tabela
+ if ($tables_setting == 1 || $tables_setting == 2) {
+ MultigridMobile::getInstance()->radioDoubleMultigrid($spremenljivka);
+ }
+ // Prilagojena tabela s horizontalnim pomikanjem
+ elseif ($tables_setting == 3) {
+ MultigridMobile::getInstance()->radioHorizontalDynamicMultigrid($spremenljivka);
+ }
+ else{
+ Double::getInstance()->grid($spremenljivka);
+ }
+
break;
// OneAgainstAnother
@@ -765,7 +791,19 @@ class VprasanjaController extends Controller // Navaden multigrid
default:
- Multigrid::getInstance()->display($spremenljivka);
+
+ // Prilagojena tabela
+ if (($tables_setting == 1 || $tables_setting == 2) && !get('printPreview')) {
+ MultigridMobile::getInstance()->radioMultigrid($spremenljivka);
+ }
+ // Prilagojena tabela s horizontalnim pomikanjem
+ elseif ($tables_setting == 3 && !get('printPreview')) {
+ MultigridMobile::getInstance()->radioHorizontalDynamicMultigrid($spremenljivka);
+ }
+ else{
+ Multigrid::getInstance()->display($spremenljivka);
+ }
+
break;
}
}
@@ -776,11 +814,11 @@ class VprasanjaController extends Controller // Tabela - checkbox
case 16:
- SurveySetting::getInstance()->Init(get('anketa'));
- $mobile_tables = SurveySetting::getInstance()->getSurveyMiscSetting('mobile_tables');
+ // Pridobimo nastavitve za prikaz tabele
+ $tables_setting = MultigridMobile::getInstance()->getTableSettings($spremenljivkaParams);
// Izris checkbox multigrida na mobitelu
- if (get('mobile') == 1 && $mobile_tables > 0) {
+ if (get('mobile') == 1 && $tables_setting > 0) {
// Dvojni multigrid
if($row['enota'] == 3)
@@ -794,7 +832,15 @@ class VprasanjaController extends Controller // Dvojni multicheckboxa
case 3:
- Double::getInstance()->checkGrid($spremenljivka);
+
+ // Prilagojena tabela
+ if ($tables_setting > 0) {
+ MultigridMobile::getInstance()->checkboxDoubleMultigrid($spremenljivka);
+ }
+ else{
+ Double::getInstance()->checkGrid($spremenljivka);
+ }
+
break;
// SelectBox
@@ -804,7 +850,15 @@ class VprasanjaController extends Controller // Navaden checkbox
case 0:
- Multigrid::getInstance()->checkbox($spremenljivka);
+
+ // Prilagojena tabela
+ if ($tables_setting > 0 && !get('printPreview')) {
+ MultigridMobile::getInstance()->checkboxDoubleMultigrid($spremenljivka);
+ }
+ else{
+ Multigrid::getInstance()->checkbox($spremenljivka);
+ }
+
break;
// Grid drag and drop
@@ -821,14 +875,13 @@ class VprasanjaController extends Controller case 19:
case 20:
- SurveySetting::getInstance()->Init(get('anketa'));
- $mobile_tables = SurveySetting::getInstance()->getSurveyMiscSetting('mobile_tables');
+ // Pridobimo nastavitve za prikaz tabele
+ $tables_setting = MultigridMobile::getInstance()->getTableSettings($spremenljivkaParams);
- // Izris text in number multigrida na mobitelu
- if (get('mobile') == 1 && $mobile_tables > 0) {
+ // Prilagojena tabela
+ if ($tables_setting > 0) {
MultigridMobile::getInstance()->textMultigrid($spremenljivka);
}
- // Izris navadnega text in number multigrida
else{
Text::getInstance()->multitext($spremenljivka);
}
diff --git a/main/survey/app/Controllers/Vprasanja/VsotaController.php b/main/survey/app/Controllers/Vprasanja/VsotaController.php index ad79de7..b69d190 100644 --- a/main/survey/app/Controllers/Vprasanja/VsotaController.php +++ b/main/survey/app/Controllers/Vprasanja/VsotaController.php @@ -71,20 +71,21 @@ class VsotaController extends Controller $row2 = mysqli_fetch_array($sql2);
//preverjanje skritega vprasanja(-2)
- $row2['text'] != -2 ? $text = $row2['text'] : $text = '';
+ $text = isset($row2['text']) && $row2['text'] != -2 ? $row2['text'] : '';
echo '<div class="variabla_sum width_' . $gridWidth . '" id="vrednost_if_' . $row1['id'] . '" ' . ($row1['if_id'] > 0 ? ' style="display:none"' : '') . '>';
//echo ' <label for="spremenljivka_' . $spremenljivka . '_sestevanec_' . $counter . '">' . $row1['naslov'] . '</label>';
//echo ' <label style="width:200px;display: inline-block;" for="spremenljivka_' . $spremenljivka . '_sestevanec_' . $counter . '">' . $row1['naslov'] . '</label>';
- echo ' <label class="vsota_besedilo" for="spremenljivka_' . $spremenljivka . '_sestevanec_' . $counter . '">' . $row1['naslov'] . '</label>';
- echo ' <input type="text" name="spremenljivka_' . $spremenljivka . '_vrednost_' . $row1['id'] . '" id="spremenljivka_' . $spremenljivka . '_sestevanec_' . $counter . '" value="' . $text . '" onkeypress="checkNumber(this, ' . $row['cela'] . ', ' . $row['decimalna'] . ');" onkeyup="checkNumber(this, ' . $row['cela'] . ', ' . $row['decimalna'] . '); calcSum(' . $spremenljivka . ', ' . $max . ', ' . $row['vsota_limit'] . ');" onBlur="checkBranching();" ' . ($selected ? ' disabled' : '') . '>';
+ echo '<label class="vsota_besedilo" for="spremenljivka_' . $spremenljivka . '_sestevanec_' . $counter . '">' . $row1['naslov'] . '</label>';
+ echo '<input type="text" name="spremenljivka_' . $spremenljivka . '_vrednost_' . $row1['id'] . '" id="spremenljivka_' . $spremenljivka . '_sestevanec_' . $counter . '" value="' . $text . '" onkeypress="checkNumber(this, ' . $row['cela'] . ', ' . $row['decimalna'] . ');" onkeyup="checkNumber(this, ' . $row['cela'] . ', ' . $row['decimalna'] . '); calcSum(' . $spremenljivka . ', ' . $max . ', ' . $row['vsota_limit'] . ');" onBlur="checkBranching();" ' . ($selected ? ' disabled' : '') . '>';
echo '</div>' . "\n";
$counter++;
$sum += (double)$text;
}
+ $limit = '';
if ($row['vsota_limit'] != 0 && $row['vsota_limit'] == $row['vsota_min'])
$limit = '(' . $row['vsota_min'] . ')';
elseif ($row['vsota_limit'] != 0 && $row['vsota_min'] != 0)
@@ -95,14 +96,15 @@ class VsotaController extends Controller $limit = '(min ' . $row['vsota_min'] . ')';
$rowl = Language::srv_language_spremenljivka($spremenljivka);
- if ($rowl['vsota'] != '') $row['vsota'] = $rowl['vsota'];
- if ($row['vsota'] == '') $row['vsota'] = self::$lang['srv_vsota_text'];
+ if (isset($rowl['vsota']) && $rowl['vsota'] != '')
+ $row['vsota'] = $rowl['vsota'];
+
+ if ($row['vsota'] == '')
+ $row['vsota'] = self::$lang['srv_vsota_text'];
echo '<div class="variabla_sum width_' . $gridWidth . ' sum" id="vsota_' . $row['id'] . '">';
- //echo ' <label for="spremenljivka_' . $spremenljivka . '_vsota">' . $row['vsota'] . '</label>';
- //echo ' <label style="width:200px;display: inline-block;" for="spremenljivka_' . $spremenljivka . '_vsota">' . $row['vsota'] . '</label>';
- echo ' <label class="vsota_besedilo" for="spremenljivka_' . $spremenljivka . '_vsota">' . $row['vsota'] . '</label>';
- echo ' <input type="text" name="spremenljivka_' . $spremenljivka . '_vsota_' . $row['id'] . '" id="spremenljivka_' . $spremenljivka . '_vsota" value="' . $sum . '" disabled class="def">';
+ echo ' <label class="vsota_besedilo" for="spremenljivka_' . $spremenljivka . '_vsota">' . $row['vsota'] . '</label>';
+ echo ' <input type="text" name="spremenljivka_' . $spremenljivka . '_vsota_' . $row['id'] . '" id="spremenljivka_' . $spremenljivka . '_vsota" value="' . $sum . '" disabled class="def">';
echo '</div>' . "\n";
if ($row['vsota_show'] == 1)
|