[Redizajn 1KA] - Podatki --> Izračuni --> Rekodiranje - v1

This commit is contained in:
tejagerjovic 2022-04-01 04:44:33 +02:00
parent 1c5eea4538
commit 99a48cdc1f
5 changed files with 101 additions and 40 deletions

View File

@ -62,8 +62,8 @@ class SurveyRecoding
function DisplaySettings() {
global $lang;
echo '<fieldset><legend>'.$lang['srv_data_subnavigation_recode'].'</legend>';
echo $lang['srv_recode_note'].'<br/><br/>';
echo $lang['srv_recode_note_text'].'<br/><br/>';
echo '<p class="bottom16">'.$lang['srv_recode_note'].'</p>';
echo '<p class="bottom16">'.$lang['srv_recode_note_text'].'</p>';
#poiščemo spremenljivke ki so morda rekodirane v drugo spremenljivko
/*
$qry_str = "select distinct spr1, spr2 from srv_recode_vrednost WHERE ank_id = '$this->anketa'";
@ -109,11 +109,16 @@ class SurveyRecoding
$qry_str = "SELECT s.id, s.variable, s.naslov FROM srv_spremenljivka s, srv_grupa g WHERE s.gru_id=g.id AND g.ank_id='$this->anketa' AND s.tip IN (1,2,3,6,16,17,7,18,20,22,25)ORDER BY g.vrstni_red ASC, s.vrstni_red ASC";
$sql = sisplet_query($qry_str);
if (mysqli_num_rows($sql)) {
echo '<table id="recode_table">';
echo '<thead><tr>';
echo '<th colspan="4">'.$lang['srv_recode_h_variable'].'</th>';
echo '<th colspan="5">'.$lang['srv_recode_h_actions'].Help::display('srv_recode_h_actions').'</th>';
echo '</tr></thead>';
echo '<tr>';
echo '<th></th>';
echo '<th>'.$lang['srv_recode_h_variable'].'</th>';
echo '<th>'.$lang['srv_recode_h_scale'].'</th>';
echo '<th class="center functions_column" colspan="2">'.$lang['srv_recode_h_actions'].Help::display('srv_recode_h_actions').'</th>';
echo '</tr>';
while (list($spr_id, $variable, $naslov) = mysqli_fetch_row($sql)) {
$vmv = new RecodeValues($this->anketa,$spr_id);
$hasRecoded = $vmv->hasRecodedValues() || in_array($spr_id,$recodedFrom);
@ -149,20 +154,16 @@ class SurveyRecoding
$css_even_odd = ( ($cnt_even_odd & 1) ? ' odd' : ' even' );
echo '<tr id="recoding_variable_div_'.$spr_id.'" class="recoding_variable_div'.$css_even_odd.$css_border.'">';
echo '<td style="width:auto;">';
echo '<td>';
SurveyAnalysis::showIcons($spr_id.'_0',$row,'desc',array('noReport' => true, 'showChart' => false));
echo '</td>';
echo '<td style="width:25px; text-align:center;" class="gray">';
echo $icon1;
echo '</td>';
echo '<td>';
echo '<span class="gray">'.$icon2.'</span>';
echo '<span class="green'.$css_strong.'">';
echo '<td>';
echo '<a onclick="showspremenljivkaSingleVarPopup(\''.$spr_id.'_0\'); return false;" href="#">';
echo $variable;
echo '</a>';
echo '</span> - <span class="spaceRight'.$css_strong.'">'.skrajsaj(strip_tags($naslov),40).'</span>';
echo ' - '.skrajsaj(strip_tags($naslov),40);
if ($key) {
$row1 = Cache::srv_spremenljivka($key);
@ -171,60 +172,57 @@ class SurveyRecoding
echo '</td>';
echo '<td class="gray" style="padding-right:10px; padding-left:10px;">';
echo '<td>';
$legend = Cache::spremenljivkaLegenda($spr_id);
echo '('.$legend['izrazanje'].' - '.$legend['skala'].')';
echo $legend['skala'];
echo '</td>';
echo '<td style="width:50px; text-align:center;" >';
echo '<td class="functions_column">';
echo '<div class="functions">';
#dodaj
if ($is_recoded_new == true) {
echo '<span class="silver">&nbsp;</span>';
echo '<div class="sep silver">&nbsp;</div>';
} else {
if ((int)$hasRecoded > 0) {
echo '<span class="silver">'.$lang['srv_recode_add'].'</span>';
echo '<div class="sep sep silver">'.$lang['srv_recode_add'].'</div>';
} else {
echo '<span class="as_link" onclick="showQuestionRecode(\''.$spr_id.'\');">'.$lang['srv_recode_add'].'</span>';
echo '<div class="sep as_link" onclick="showQuestionRecode(\''.$spr_id.'\');">'.$lang['srv_recode_add'].'</div>';
}
}
echo '</td>';
echo '<td style="padding-right:10px; padding-left:10px;text-align:center;">';
# uredi
if ($is_recoded_new == true) {
echo '<span class="silver">&nbsp;</span>';
echo '<div class="sep silver">&nbsp;</div>';
} else {
if ((int)$hasRecoded > 0) {
echo '<span class="as_link" onclick="showQuestionRecode(\''.$spr_id.'\');">'.$lang['srv_recode_edit'] .'</span>';
echo '<div class="sep as_link" onclick="showQuestionRecode(\''.$spr_id.'\');">'.$lang['srv_recode_edit'] .'</div>';
} else {
echo '<span class="silver">'.$lang['srv_recode_edit'] .'</span>';
echo '<div class="sep silver">'.$lang['srv_recode_edit'] .'</div>';
}
}
echo '</td>';
echo '<td style="padding-right:10px; padding-left:10px; text-align:center;">';
# odstrani
if ($is_recoded_new == true) {
echo '<span class="silver">&nbsp;</span>';
echo '<div class="sep silver">&nbsp;</div>';
} else {
if ((int)$hasRecoded > 0) {
echo '<span class="as_link" onclick="removeQuestionRecode(\''.$spr_id.'\',\''.$lang['srv_recode_confirm_delete'].'\');">'.$lang['srv_recode_remove'].'</span>';
echo '<div class="sep as_link" onclick="removeQuestionRecode(\''.$spr_id.'\',\''.$lang['srv_recode_confirm_delete'].'\');">'.$lang['srv_recode_remove'].'</div>';
} else {
echo '<span class="silver" >'.$lang['srv_recode_remove'].'</span>';
echo '<div class="sep silver" >'.$lang['srv_recode_remove'].'</div>';
}
}
echo '</td>';
echo '<td style="padding-right:10px; padding-left:10px;">';
if ($is_recoded_new == true) {
echo '<span class="silver">&nbsp;</span>';
echo '<div class="sep silver">&nbsp;</div>';
} else {
if ($hasRecoded) {
echo '<label><span class="as_link" onclick="enableRecodeVariable(\''.$spr_id.'\',this);">'.($enabled ? $lang['srv_recode_enabled'] : $lang['srv_recode_disabled']).'</span></label>';
echo '<label><div class="sep as_link" onclick="enableRecodeVariable(\''.$spr_id.'\',this);">'.($enabled ? $lang['srv_recode_enabled'] : $lang['srv_recode_disabled']).'</div></label>';
#echo '<label><input type="checkbox" id="recoding_variable_cb_'.$spr_id.'" onchange="enableRecodeVariable(\''.$spr_id.'\',this);"'.($enabled?' checked="checked"':'').' autocomplete="off">'.$lang['srv_recode_enable'].'</label>';
} else {
echo '<span class="silver">'.$lang['srv_recode_enabled'].'</span>';
echo '<div class="sep silver">'.$lang['srv_recode_enabled'].'</div>';
}
}
echo '</div>';
echo '</td>';
$visible= ((int)$row['visible'] == 1) ? true : false;

View File

@ -5983,7 +5983,8 @@ $lang = array (
"srv_no_reminder_all" => "Odstrani opozorila iz vseh vprašanj",
"srv_reminder_popup_warning" => "Ta funkcionalnost se zelo dolgo izvaja. Želite nadaljevati?",
"srv_jump_to" => "Skoči na",
"srv_recode_h_variable" => "Variable",
"srv_recode_h_variable" => "Spremenljivka",
"srv_recode_h_scale" => "Merska lestvica",
"srv_recode_h_actions" => "Funkcije rekodiranja",
"srv_recode_add" => "Dodaj",
"srv_recode_remove" => "Odstrani",
@ -6190,7 +6191,7 @@ $lang = array (
'srv_recode_to_label' => 'labela',
'srv_recode_to_value' => 'vrednost',
'srv_recode_naknadnoVprasanje' => 'Naknadno vprašanje [-4]',
'srv_recode_note' => 'Rekodiranje je primerno za spremembo ali združevanje vrednosti numeričnih in kategorialnih spremenljvk, kot tudi za uvrstitev določene vrednosti med manjkajoče. Za večje posege priporočamo rekodiranje v novo spremenljivko. <a href="https://www.1ka.si/d/sl/pomoc/prirocniki/rekodiranje?from1ka=1" target="_blank">Več >></a>',
'srv_recode_note' => 'Rekodiranje je primerno za spremembo ali združevanje vrednosti numeričnih in kategorialnih spremenljvk, kot tudi za uvrstitev določene vrednosti med manjkajoče. Za večje posege priporočamo rekodiranje v novo spremenljivko. <a href="https://www.1ka.si/d/sl/pomoc/prirocniki/rekodiranje?from1ka=1" target="_blank">Več informacij.</a>',
'srv_recode_note_text' => 'Za tekstovne spremenljivke izberite kodiranje.',
'srv_recode_confirm_delete' => 'Ali ste prepričani da želite izbrisati rekodirane vrednosti?',
'srv_recode_confirm_delete_sub' => 'Ali želite pobrisati tudi rekodirano spremenljivko:',

View File

@ -5877,7 +5877,8 @@ $lang = array (
"srv_no_reminder_all" => "Remove reminders from all questions",
"srv_reminder_popup_warning" => "This functionality takes a long time to complete. Do you wish to proceed?",
"srv_jump_to" => "Jump to",
"srv_recode_h_variable" => "Variables",
"srv_recode_h_variable" => "Variable",
"srv_recode_h_scale" => "Scale",
"srv_recode_h_actions" => "Recode functions",
"srv_recode_add" => "Add",
"srv_recode_remove" => "Remove",
@ -6083,7 +6084,7 @@ $lang = array (
'srv_recode_to_label' => 'label',
'srv_recode_to_value' => 'value',
'srv_recode_naknadnoVprasanje' => 'Subsequently question [-4]',
'srv_recode_note' => 'Recoding is used to change or merge values of numeric and categorical variables, as well as to assign certain values as missing. For larger interventions we recommended recoding into a new variable. <a href="https://www.1ka.si/d/en/help/manuals/recoding" target="_blank">More >></a>',
'srv_recode_note' => 'Recoding is used to change or merge values of numeric and categorical variables, as well as to assign certain values as missing. For larger interventions we recommended recoding into a new variable. <a href="https://www.1ka.si/d/en/help/manuals/recoding" target="_blank">More information.</a>',
'srv_recode_note_text' => 'For text variables, please select the coding options.',
'srv_recode_confirm_delete' => 'Are you sure you want to delete recoded values?',
'srv_recode_confirm_delete_sub' => 'Do you want to delete a recoded variable:',

View File

@ -18237,6 +18237,35 @@ fieldset#calculations div.button_holder {
margin-bottom: 0;
}
table#recode_table {
width: 100%;
white-space: nowrap;
}
table#recode_table td div.analysis_icons_holder,
table#recode_table td div.functions, table#recode_table th div.analysis_icons_holder,
table#recode_table th div.functions {
display: flex;
flex-direction: row;
flex-wrap: nowrap;
justify-content: flex-start;
}
table#recode_table td div.analysis_icons_holder div.sep,
table#recode_table td div.functions div.sep, table#recode_table th div.analysis_icons_holder div.sep,
table#recode_table th div.functions div.sep {
border-right: 1px solid #E5E5E5;
padding: 0 16px;
vertical-align: middle;
width: fit-content;
}
table#recode_table td div.analysis_icons_holder div.sep.silver,
table#recode_table td div.functions div.sep.silver, table#recode_table th div.analysis_icons_holder div.sep.silver,
table#recode_table th div.functions div.sep.silver {
color: #777777;
}
table#recode_table td.functions_column, table#recode_table th.functions_column {
border-left: 1px solid #E5E5E5;
}
div.appendmerge_indent {
margin: 16px 0 16px 16px;
}

View File

@ -15,4 +15,36 @@ fieldset#calculations {
margin-top: 16px;
margin-bottom: 0;
}
}
//Rekodiranje
table#recode_table {
width: 100%;
white-space: nowrap;
td,th {
div.analysis_icons_holder,
div.functions {
display: flex;
flex-direction: row;
flex-wrap: nowrap;
justify-content: flex-start;
div.sep {
border-right: 1px solid $gray;
padding: 0 16px;
vertical-align: middle;
width: fit-content;
&.silver {
color: $very-dark-gray;
}
}
}
&.functions_column {
border-left: 1px solid $gray;
}
}
}