From 75160b12821f7f4299cce7f0b69c83c1502ae071 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Anton=20Luka=20=C5=A0ijanec?= Date: Mon, 27 May 2024 13:08:29 +0200 Subject: 2024-02-19 upstream --- admin/survey/classes/class.RecodeValues.php | 96 +++++++++++++++-------------- 1 file changed, 51 insertions(+), 45 deletions(-) (limited to 'admin/survey/classes/class.RecodeValues.php') diff --git a/admin/survey/classes/class.RecodeValues.php b/admin/survey/classes/class.RecodeValues.php index eef65b0..2f4bd91 100644 --- a/admin/survey/classes/class.RecodeValues.php +++ b/admin/survey/classes/class.RecodeValues.php @@ -30,9 +30,8 @@ class RecodeValues { self::$anketa = $anketa; self::$spremenljivka = $spremenljivka; - SurveyInfo::getInstance()->SurveyInit($anketa); - if (SurveyInfo::getInstance()->getSurveyColumn('db_table') == 1) - self::$db_table = '_active'; + SurveyInfo::getInstance()->SurveyInit($anketa); + self::$db_table = SurveyInfo::getInstance()->getSurveyArchiveDBString(); # polovimo manjkajoče privzete vrednosti ankete self::$smv = new SurveyMissingValues(self::$anketa); @@ -445,7 +444,7 @@ class RecodeValues { echo '
  • '; echo ''; printf($lang['srv_recode_number_if'],self::$cacheSpremenljivka['variable']); - echo ' '; foreach (self::$_operators AS $value => $operator) { $selected = ($value == '0') ? ' selected="selected"' : ''; echo ''; @@ -463,7 +462,7 @@ class RecodeValues { echo ' '.$lang['srv_recode_number_to']; - echo ''; foreach (self::$options AS $oKey => $option) { if ($option['variable'] == null && $oKey != '_0_') { echo ''; @@ -495,7 +494,7 @@ class RecodeValues { echo '
  • '; echo ''; printf($lang['srv_recode_number_if'],self::$cacheSpremenljivka['variable']); - echo ' '; foreach (self::$_operators AS $value => $operator) { $selected = ($value == '0') ? ' selected="selected"' : ''; echo ''; @@ -515,7 +514,7 @@ class RecodeValues { # imamo rekodiranje v novo spremenljivko $recode['vred_id'] = '-1'; - echo ''; if (is_array($new_spr_vrednosti) && count($new_spr_vrednosti)>0) { foreach ($new_spr_vrednosti AS $oKey => $option) { if ($option['variable'] == null) { @@ -668,48 +667,57 @@ class RecodeValues { } $sugestedName = strip_tags(self::$cacheSpremenljivka['naslov'].' - recoded'); echo'
    '; - echo ''; + echo ''; } else { - echo ''; - echo ''; + echo ''; + echo ''; } echo '
    '; if ((int)$recode_type == 1) { - echo''; + echo'
    '; if ((int)$to_spr_id == 0) { - echo '
    '; - echo $lang['srv_recode_to_spr_add_spr'].'
    '; + echo '
    '; + //echo $lang['srv_recode_to_spr_add_spr'].'
    '; echo '
    '; - echo '

    '.$lang['srv_recode_to_spr_name'].' '; + echo '

    '.$lang['srv_recode_to_spr_name'].' '; #echo ''.$lang['add'].''; - echo ''; + echo ''; echo '

    '; echo '
    '; echo '
    '; } else { - echo ''.$rowSpremenljivka['variable'].' - '.skrajsaj(strip_tags($rowSpremenljivka['naslov']), 40).'

    '; + echo ''.$rowSpremenljivka['variable'].' - '.skrajsaj(strip_tags($rowSpremenljivka['naslov']), 40).''; $sql1 = sisplet_query("SELECT naslov FROM srv_vrednost WHERE spr_id='$to_spr_id' ORDER BY vrstni_red ASC"); + $count = 0; + echo '

    '.$lang['srv_recode_valueset']; while ($row1 = mysqli_fetch_array($sql1)) { if ($rowSpremenljivka['tip'] == 1) { - echo ''; - echo '
    '; + if ($count == 0) { + $count = 1; + } + else { + echo ', '; + } + echo $row1['naslov']; } } + echo '

    '; + echo '
    '; if (mysqli_num_rows($sql1) == 0) { echo ' '.$lang['srv_novavrednost'].': '; $margin='0'; - } else { $margin = '23px'; + } else { $margin = 'none-left'; } - echo '0?' placeholder="'.$lang['srv_novavrednost'].'" ':'').' style="margin-left:'.$margin.'; width: 80px" /> '; - echo ''; - echo '
    Napredne spremembe:'.Help::display('srv_recode_advanced_edit'); + echo '0?' placeholder="'.$lang['srv_novavrednost'].'" ':'').' /> '; + echo ''; + echo '

    Napredne spremembe:'.Help::display('srv_recode_advanced_edit').'

    '; + echo '
    '; } - echo ''; + echo '
    '; } - echo'
    '; } if ( $displayType == 1 ) { if (count(self::$variables)> 0) { @@ -722,39 +730,37 @@ class RecodeValues { //echo ''; echo '
    '; echo ''; - echo ''; - echo ''; - echo ''; echo ''; echo ''; - echo ''; - echo ''; + echo ''; + echo ''; + echo ''; echo ''; foreach (self::$variables AS $vKey => $variable) { echo ''; - echo ''; - echo ''; - # spacer - echo ''; - # echo '
    '; + echo ''; echo $lang['srv_recode_original']; echo '  '; + echo ''; echo $lang['srv_recode_to']; echo '
    '; - echo $lang['srv_recode_to_label']; - echo ''; - echo $lang['srv_recode_to_value']; - echo ''; + echo $lang['srv_label']; + echo ''; + echo $lang['srv_vrednost']; + echo ''; + echo '
    '; + echo ''; echo $variable['naslov']; echo ''; + echo ''; echo '  ['.$variable['variable'].']'; echo ' '; if ((int)$recode_type == 0) { # imamo klasično rekodiranje - echo ''; foreach (self::$options AS $oKey => $option) { if ($option['variable'] == null) { @@ -775,7 +781,7 @@ class RecodeValues { if (!isset($recodedFrom[$vKey])) { $recodedFrom[$vKey] = '-1'; } - echo ''; if (is_array($new_spr_vrednosti) && count($new_spr_vrednosti)>0) { foreach ($new_spr_vrednosti AS $oKey => $option) { if ($option['variable'] == null) { @@ -817,7 +823,7 @@ class RecodeValues { echo '
  • '; echo ''; printf($lang['srv_recode_number_if'],self::$cacheSpremenljivka['variable']); - echo ' '; foreach (self::$_operators AS $value => $operator) { $selected = ($value == $recode['operator']) ? ' selected="selected"' : ''; echo ''; @@ -835,7 +841,7 @@ class RecodeValues { echo ' '.$lang['srv_recode_number_to']; $is_missing_value = false; - echo ''; foreach (self::$options AS $oKey => $option) { if ($oKey == '_0_' || $oKey == '_1_' || $oKey == '_2_') { # privzeto izberemo prvi odgovor - veljavni, nato spodaj popravimo @@ -876,7 +882,7 @@ class RecodeValues { echo '
  • '; echo ''; printf($lang['srv_recode_number_if'],self::$cacheSpremenljivka['variable']); - echo ' '; foreach (self::$_operators AS $value => $operator) { $selected = ($value == $recode['operator']) ? ' selected="selected"' : ''; echo ''; @@ -897,7 +903,7 @@ class RecodeValues { $recodedFrom[$rKey] = '-1'; } # imamo rekodiranje v novo spremenljivko - echo ''; if (is_array($new_spr_vrednosti) && count($new_spr_vrednosti)>0) { foreach ($new_spr_vrednosti AS $oKey => $option) { if ($option['variable'] == null) { -- cgit v1.2.3