summaryrefslogtreecommitdiffstats
path: root/main/survey/app/Controllers/Vprasanja/MultigridMobileController.php
diff options
context:
space:
mode:
authorAnton Luka Šijanec <anton@sijanec.eu>2024-05-27 13:08:29 +0200
committerAnton Luka Šijanec <anton@sijanec.eu>2024-05-27 13:08:29 +0200
commit75160b12821f7f4299cce7f0b69c83c1502ae071 (patch)
tree27e25e4ccaef45f0c58b22831164050d1af1d4db /main/survey/app/Controllers/Vprasanja/MultigridMobileController.php
parentprvi-commit (diff)
download1ka-75160b12821f7f4299cce7f0b69c83c1502ae071.tar
1ka-75160b12821f7f4299cce7f0b69c83c1502ae071.tar.gz
1ka-75160b12821f7f4299cce7f0b69c83c1502ae071.tar.bz2
1ka-75160b12821f7f4299cce7f0b69c83c1502ae071.tar.lz
1ka-75160b12821f7f4299cce7f0b69c83c1502ae071.tar.xz
1ka-75160b12821f7f4299cce7f0b69c83c1502ae071.tar.zst
1ka-75160b12821f7f4299cce7f0b69c83c1502ae071.zip
Diffstat (limited to 'main/survey/app/Controllers/Vprasanja/MultigridMobileController.php')
-rw-r--r--main/survey/app/Controllers/Vprasanja/MultigridMobileController.php311
1 files changed, 275 insertions, 36 deletions
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