summaryrefslogtreecommitdiffstats
path: root/admin/survey/classes/class.SurveyDiagnostics.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 /admin/survey/classes/class.SurveyDiagnostics.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 'admin/survey/classes/class.SurveyDiagnostics.php')
-rw-r--r--admin/survey/classes/class.SurveyDiagnostics.php646
1 files changed, 328 insertions, 318 deletions
diff --git a/admin/survey/classes/class.SurveyDiagnostics.php b/admin/survey/classes/class.SurveyDiagnostics.php
index 9a8b01a..49ce651 100644
--- a/admin/survey/classes/class.SurveyDiagnostics.php
+++ b/admin/survey/classes/class.SurveyDiagnostics.php
@@ -143,14 +143,8 @@ class SurveyDiagnostics
$_pripombe = true;
}
-
- echo '<span class="srv_diagnostic_note">';
- echo $this->printNote();
- #
- echo '</span>';
-
- SurveySetting::getInstance()->Init($this->anketa);
+ SurveySetting::getInstance()->Init($this->sid);
$preview_disableif = SurveySetting::getInstance()->getSurveyMiscSetting('preview_disableif');
$preview_disablealert = SurveySetting::getInstance()->getSurveyMiscSetting('preview_disablealert');
$preview_displayifs = SurveySetting::getInstance()->getSurveyMiscSetting('preview_displayifs');
@@ -158,26 +152,35 @@ class SurveyDiagnostics
$preview_hidecomment = SurveySetting::getInstance()->getSurveyMiscSetting('preview_hidecomment');
$preview_options = ''.($preview_disableif==1?'&disableif=1':'').($preview_disablealert==1?'&disablealert=1':'').($preview_displayifs==1?'&displayifs=1':'').($preview_displayvariables==1?'&displayvariables=1':'').($preview_hidecomment==1?'&hidecomment=1':'').'';
+ /* - ZAČASNO ZAKOMENTIRAN TOOLTIP (prekriva vsebino za redizajn) @TG
echo '<br><div style="display:inline-block; margin: 0 0 10px 20px">';
echo '<span class="tooltip">';
- echo '<a href="'.SurveyInfo::getSurveyLink().'&preview=on&testdata=on'.$preview_options.'" target="_blank" style="font-size:15px"><span class="faicon edit_square"></span> '.$lang['srv_survey_testdata'].'</a>';
- echo ' ('.SurveyInfo::getSurveyLink().'&preview=on&testdata=on'.$preview_options.') ';
echo '<span class="expanded-tooltip bottom light" style="left: -40px;">';
echo '<b>' . $lang['srv_survey_testdata2'] . ':</b> '.$lang['srv_testdata_text'].'';
echo '<p>'.$lang['srv_preview_testdata_longtext'].'</p>';
echo '<span class="arrow"></span>';
echo '</span>'; // expanded-tooltip bottom
- echo '</span>'; // tooltip
-
- echo ' - <a href="#" id="popup-open" onclick="javascript:testiranje_preview_settings(); return false;" title="'.$lang['settings'].'"><span class="sprites settings"></span> '.$lang['srv_uredniske_nastavitve'].'</a>';
+ echo '</span>'; // tooltip */
+
+ // TESTIRANJE
+ echo '<h2>'.$lang['srv_diagnostika_testiranje'].'</h2>';
+
+ echo '<p class="bottom16">'.$lang['srv_diagnostika_testiranje_notea'].'<a href="index.php?anketa=' . $this->sid . '&a=testiranje&m=testnipodatki">'.$lang['srv_diagnostika_testiranje_noteb'].'</a>'.$lang['srv_diagnostika_testiranje_notec'].'</p>';
+
+ echo '<div class="button_holder">';
+ echo ' <div class="input_box">';
+ echo ' <span class="faicon link-chain link-right blue"></span>';
+ echo ' <input type="text" onClick="this.select();" value="'.SurveyInfo::getSurveyLink().'&preview=on&testdata=on'.$preview_options.'" readonly/>';
+ echo ' </div>';
+ echo ' <button type="button" class="medium blue" onclick="CopyToClipboard(\''.SurveyInfo::getSurveyLink().'&preview=on&testdata=on'.$preview_options.'\'); actionNotePopup(\'link_copied\', \'success\');">'.$lang['srv_diagnostika_testiranje_copy'].'</button>';
echo '</div>';
+
+ //Nastavitve testnega vnosa - popup
+ echo '<p class="top16"><a href="' .$site_url . '/admin/survey/index.php?anketa=' . $this->sid . '&a=urejanje" title="' . $lang['srv_uredniske_nastavitve'] . '">'. $lang['srv_uredniske_nastavitve'] .'</a></p>';
- if ( isset($_GET['popup']) && $_GET['popup'] == 'open' ) {
- ?><script> $(function() { $('#popup-open').click(); }); </script><?php
- }
-
- echo '<br/>';
+ // DIAGNOSTIKA
+
# predviden čas ankete
list($total,$skupni_cas) = $this->time;
@@ -190,404 +193,384 @@ class SurveyDiagnostics
if ($total < 120) { # 2min
$time = $lang['srv_diagnostic_time_1'];
+ $time_chart = 20;
} else if ($total < 300) { # 5min
$time = $lang['srv_diagnostic_time_2'];
+ $time_chart = 40;
} else if ($total < 900) { # 15 min
$time = $lang['srv_diagnostic_time_3'];
+ $time_chart = 60;
} else if ($total < 1800) { # 30 min
$time = $lang['srv_diagnostic_time_4'];
+ $time_chart = 80;
} else { #> 30 min
$time = $lang['srv_diagnostic_time_5'];
+ $time_chart = 100;
}
-
+ $excess = 100 - $time_chart;
+ $display_length = "'[".$time_chart.",".$excess."]'"; //array za chart
+
# Kompleksnost
if ((int)($this->cnt_blocks + $this->cnt_conditions) == 0) {
$kompleksnost = $lang['srv_diagnostic_complexity_1'];
+ $complex_chart = 20;
} else if ((int)($this->cnt_blocks + $this->cnt_conditions) == 1) {
$kompleksnost = $lang['srv_diagnostic_complexity_2'];
+ $complex_chart = 40;
} else if ((int)($this->cnt_blocks + $this->cnt_conditions) < 10) {
$kompleksnost = $lang['srv_diagnostic_complexity_3'];
+ $complex_chart = 60;
} else if ((int)($this->cnt_blocks + $this->cnt_conditions) < 50) {
$kompleksnost = $lang['srv_diagnostic_complexity_4'];
+ $complex_chart = 80;
} else {
$kompleksnost = $lang['srv_diagnostic_complexity_5'];
+ $complex_chart = 100;
}
-
- #OPOZORILA
- echo '<div class="floatLeft">';
- echo '<div id="srv_diagnostic_results" >';
+ $excess = 100 - $complex_chart;
+ $display_complex = "'[".$complex_chart.",".$excess."]'"; //array za chart
+
+ echo '<h2>'.$lang['srv_testiranje_diagnostika'].'</h2>';
+
echo '<table class="srv_diagnostic_results">';
echo '<tr>';
echo '<th>'.$lang['srv_diagnostika_table_title1'].'</th>';
- echo '<th>'.$lang['srv_diagnostika_table_title'].'</th>';
+ echo '<th class="center">'.$lang['srv_diagnostika_table_title'].'</th>';
+ echo '<th class="center">'.$lang['srv_diagnostika_table_title2'].'</th>';
echo '</tr>';
- #Preveč ali premalo opomnikov (reminder).
-
+
#Napake - v IFih, Zankah
+
+ //Link - kako odkriti logične in tehnične napake
+ if($lang['id'] == '1')
+ $link_status = 'href="https://www.1ka.si/d/sl/pomoc/pogosta-vprasanja/kako-odkriti-logicne-tehnicne-napake-vprasalniku?from1ka=1" target="_blank"';
+ else
+ $link_status = 'href="https://www.1ka.si/d/en/help/faq/how-do-i-detect-logical-and-technical-errors-the-questionnaire?from1ka=1" target="_blank"';
+
echo '<tr>';
echo '<td>'.$lang['srv_diagnostic_5_element_1'].'</td>';
- echo '<td>';
if (in_array(DIAG_INVALID_CONDITIONS,$this->diagnostic_note)) {
- echo '<span class="red">';
- if($lang['id'] == '1')
- echo '<a href="https://www.1ka.si/d/sl/pomoc/pogosta-vprasanja/kako-odkriti-logicne-tehnicne-napake-vprasalniku?from1ka=1" target="_blank">'.$lang['srv_diagnostic_neustreza1'].'</a>';
- else
- echo '<a href="https://www.1ka.si/d/en/help/faq/how-do-i-detect-logical-and-technical-errors-the-questionnaire?from1ka=1" target="_blank">'.$lang['srv_diagnostic_neustreza1'].'</a>';
- echo '</span>';
+ $color_status = 'notok';
+ $msg_status = $lang['srv_diagnostic_neustreza'];
}
else {
- echo '<span class="green">';
- if($lang['id'] == '1')
- echo '<a href="https://www.1ka.si/d/sl/pomoc/pogosta-vprasanja/kako-odkriti-logicne-tehnicne-napake-vprasalniku?from1ka=1" target="_blank">'.$lang['srv_diagnostic_ustreza'].'</a>';
- else
- echo '<a href="https://www.1ka.si/d/en/help/faq/how-do-i-detect-logical-and-technical-errors-the-questionnaire?from1ka=1" target="_blank">'.$lang['srv_diagnostic_ustreza'].'</a>';
- echo '</span>';
+ $color_status = 'ok';
+ $msg_status = $lang['srv_diagnostic_ustreza'];
}
- echo '</td>';
+
+ echo '<td class="center"><div class="status_wrapper"><div class="status '.$color_status.'"><a class="noline" '.$link_status.'>'.$msg_status.'</a></div></div></td>';
+ echo '<td class="center"><a class="noline '.$color_status.' faicon open_icon" '.$link_status.'></a></td>';
echo '</tr>';
#Napake - v validacijah
echo '<tr>';
echo '<td>'.$lang['srv_diagnostic_5_element_3'].'</td>';
- echo '<td>';
if (in_array(DIAG_INVALID_VALIDATIONS, $this->diagnostic_note)) {
- echo '<span class="red">';
- if($lang['id'] == '1')
- echo '<a href="https://www.1ka.si/d/sl/pomoc/pogosta-vprasanja/kako-odkriti-logicne-tehnicne-napake-vprasalniku?from1ka=1" target="_blank">'.$lang['srv_diagnostic_neustreza1'].'</a>';
- else
- echo '<a href="https://www.1ka.si/d/en/help/faq/how-do-i-detect-logical-and-technical-errors-the-questionnaire?from1ka=1" target="_blank">'.$lang['srv_diagnostic_neustreza1'].'</a>';
- echo '</span>';
+ $color_status = 'notok';
+ $msg_status = $lang['srv_diagnostic_neustreza'];
}
else {
- echo '<span class="green">';
- if($lang['id'] == '1')
- echo '<a href="https://www.1ka.si/d/sl/pomoc/pogosta-vprasanja/kako-odkriti-logicne-tehnicne-napake-vprasalniku?from1ka=1" target="_blank">'.$lang['srv_diagnostic_ustreza'].'</a>';
- else
- echo '<a href="https://www.1ka.si/d/en/help/faq/how-do-i-detect-logical-and-technical-errors-the-questionnaire?from1ka=1" target="_blank">'.$lang['srv_diagnostic_ustreza'].'</a>';
- echo '</span>';
+ $color_status = 'ok';
+ $msg_status = $lang['srv_diagnostic_ustreza'];
}
- echo '</td>';
+ echo '<td class="center"><div class="status_wrapper"><div class="status '.$color_status.'">'.$msg_status.'</div></div></td>';
+ echo '<td class="center"><a class="noline '.$color_status.' faicon open_icon" '.$link_status.'></a></td>';
echo '</tr>';
- #napake - Podovojenost imen varianel
+ #napake - Podovojenost imen variabel
echo '<tr>';
echo '<td>'.$lang['srv_diagnostic_5_element_2'].'</td>';
- echo '<td>';
if (in_array(DIAG_INVALID_VARIABLENAMES,$this->diagnostic_note)) {
- echo '<span class="red">';
- if($lang['id'] == '1')
- echo '<a href="https://www.1ka.si/d/sl/pomoc/pogosta-vprasanja/kako-odkriti-logicne-tehnicne-napake-vprasalniku?from1ka=1" target="_blank">'.$lang['srv_diagnostic_neustreza1'].'</a>';
- else
- echo '<a href="https://www.1ka.si/d/en/help/faq/how-do-i-detect-logical-and-technical-errors-the-questionnaire?from1ka=1" target="_blank">'.$lang['srv_diagnostic_neustreza1'].'</a>';
- echo '</span>';
- echo '<span>&nbsp;';
- echo '<a href="'.$site_url . 'admin/survey/index.php?anketa='.$this->sid.'&checkDuplicate=1" title="'.$lang['srv_check_pogoji'].'"><span class="faicon bug"></span></a> '."\n";
- echo '</span>';
- }
+ $color_status = 'notok';
+ $msg_status = '<a href="'.$site_url . 'admin/survey/index.php?anketa='.$this->sid.'&checkDuplicate=1" title="'.$lang['srv_check_pogoji'].'">'.$lang['srv_diagnostic_neustreza'].'</a>';
+ $link_status = 'href="'.$site_url . 'admin/survey/index.php?anketa='.$this->sid.'&checkDuplicate=1"';
+ }
else {
- echo '<span class="green">';
- if($lang['id'] == '1')
- echo '<a href="https://www.1ka.si/d/sl/pomoc/pogosta-vprasanja/kako-odkriti-logicne-tehnicne-napake-vprasalniku?from1ka=1" target="_blank">'.$lang['srv_diagnostic_ustreza'].'</a>';
- else
- echo '<a href="https://www.1ka.si/d/en/help/faq/how-do-i-detect-logical-and-technical-errors-the-questionnaire?from1ka=1" target="_blank">'.$lang['srv_diagnostic_ustreza'].'</a>';
- echo '</span>';
+ $color_status = 'ok';
+ $msg_status = '<a class="noline" '.$link_status.' >'.$lang['srv_diagnostic_ustreza'].'<a/>';
}
- echo '</td>';
- echo '</tr>';
-
- echo '</table>';
- echo '</div>';
- echo '<br/><br/>';
-
- echo '<div id="srv_diagnostic_results" >';
- echo '<table class="srv_diagnostic_results">';
-# echo '<COLGROUP><COL width="50%"><COL><COL><COLGROUP>';
- echo '<tr>';
- echo '<th>'.$lang['srv_diagnostika_table_title2'].'</th>';
- echo '<th>'.$lang['srv_diagnostika_table_title'].'</th>';
+ echo '<td class="center"><div class="status_wrapper"><div class="status '.$color_status.'">'.$msg_status.'</div></div></td>';
+ echo '<td class="center"><a class="noline '.$color_status.' faicon open_icon" '.$link_status.'></a></td>';
echo '</tr>';
-
+
+ #OPOZORILA
# Preveč podvprašanj na eni strani.
echo '<tr>';
echo '<td>'.$lang['srv_diagnostic_1_element_1'].'</td>';
- echo '<td>';
if($lang['id'] == '1')
- $link = '<a href="https://www.1ka.si/d/sl/spletne-ankete/osnovna-priporocila/prevec-podvprasanj-bloku-prevec-vprasanj-na-eni-strani?from1ka=1" target="_blank">%s</a>';
+ $link_status = 'href="https://www.1ka.si/d/sl/spletne-ankete/osnovna-priporocila/prevec-podvprasanj-bloku-prevec-vprasanj-na-eni-strani?from1ka=1" target="_blank"';
else
- $link = '<a href="https://www.1ka.si/d/en/web-surveys/basic-recommendations/too-many-subquestions-block-and-too-many-questions-on-one-page?from1ka=1" target="_blank">%s</a>';
+ $link_status = 'href="https://www.1ka.si/d/en/web-surveys/basic-recommendations/too-many-subquestions-block-and-too-many-questions-on-one-page?from1ka=1" target="_blank"';
if (in_array(DIAG_SPR_ON_PAGE,$this->diagnostic_note)) {
- echo '<span class="red">';
- printf($link,$lang['srv_diagnostic_neustreza2']);
- echo '</span>';
+ $color_status = 'rec';
+ $msg_status = $lang['srv_diagnostic_rec'];
}
else {
- echo '<span class="green">';
- printf($link,$lang['srv_diagnostic_ustreza']);
- echo '</span>';
+ $color_status = 'ok';
+ $msg_status = $lang['srv_diagnostic_ustreza'];
}
- echo '</td>';
+
+ echo '<td class="center"><div class="status_wrapper"><div class="status '.$color_status.'"><a class="noline" '.$link_status.'>'.$msg_status.'</a></div></div></td>';
+ echo '<td class="center"><a class="noline '.$color_status.' faicon open_icon" '.$link_status.'></a></td>';
echo '</tr>';
# Preveč vprašanj v bloku.
echo '<tr>';
echo '<td>'.$lang['srv_diagnostic_1_element_2'].'</td>';
- echo '<td>';
if($lang['id'] == '1')
- $link = '<a href="https://www.1ka.si/d/sl/spletne-ankete/osnovna-priporocila/premajhna-strukturiranost-vprasalnika?from1ka=1" target="_blank">%s</a>';
+ $link_status = 'href="https://www.1ka.si/d/sl/spletne-ankete/osnovna-priporocila/premajhna-strukturiranost-vprasalnika?from1ka=1" target="_blank"';
else
- $link = '<a href="https://www.1ka.si/d/en/web-surveys/basic-recommendations/insufficiently-structured-questionnaire?from1ka=1" target="_blank">%s</a>';
+ $link_status = 'href="https://www.1ka.si/d/en/web-surveys/basic-recommendations/insufficiently-structured-questionnaire?from1ka=1" target="_blank"';
if (in_array(DIAG_SPR_IN_BLOCK,$this->diagnostic_note)) {
- echo '<span class="red">';
- printf($link,$lang['srv_diagnostic_neustreza2']);
- echo '</span>';
- } else {
- echo '<span class="green">';
- printf($link,$lang['srv_diagnostic_ustreza']);
- echo '</span>';
+ $color_status = 'rec';
+ $msg_status = $lang['srv_diagnostic_rec'];
}
- echo '</td>';
+ else {
+ $color_status = 'ok';
+ $msg_status = $lang['srv_diagnostic_ustreza'];
+ }
+ echo '<td class="center"><div class="status_wrapper"><div class="status '.$color_status.'"><a class="noline" '.$link_status.'>'.$msg_status.'</a></div></div></td>';
+ echo '<td class="center"><a class="noline '.$color_status.' faicon open_icon" '.$link_status.'></a></td>';
echo '</tr>';
# Preveč podpvprašanj v multigridu
echo '<tr>';
echo '<td>'.$lang['srv_diagnostic_1_element_3'].'</td>';
- echo '<td>';
if($lang['id'] == '1')
- $link = '<a href="https://www.1ka.si/d/sl/spletne-ankete/osnovna-priporocila/prevec-podvprasanj-bloku-prevec-vprasanj-na-eni-strani?from1ka=1" target="_blank">%s</a>';
+ $link_status = 'href="https://www.1ka.si/d/sl/spletne-ankete/osnovna-priporocila/prevec-podvprasanj-bloku-prevec-vprasanj-na-eni-strani?from1ka=1" target="_blank"';
else
- $link = '<a href="https://www.1ka.si/d/en/web-surveys/basic-recommendations/too-many-subquestions-block-and-too-many-questions-on-one-page?from1ka=1" target="_blank">%s</a>';
+ $link_status = 'href="https://www.1ka.si/d/en/web-surveys/basic-recommendations/too-many-subquestions-block-and-too-many-questions-on-one-page?from1ka=1" target="_blank"';
if (in_array(DIAG_SUB_Q_IN_GRID,$this->diagnostic_note)) {
- echo '<span class="red">';
- printf($link,$lang['srv_diagnostic_neustreza2']);
- echo '</span>';
- } else {
- echo '<span class="green">';
- printf($link,$lang['srv_diagnostic_ustreza']);
- echo '</span>';
+ $color_status = 'rec';
+ $msg_status = $lang['srv_diagnostic_rec'];
+ }
+ else {
+ $color_status = 'ok';
+ $msg_status = $lang['srv_diagnostic_ustreza'];
}
+
+ echo '<td class="center"><div class="status_wrapper"><div class="status '.$color_status.'"><a class="noline" '.$link_status.'>'.$msg_status.'</a></div></div></td>';
+ echo '<td class="center"><a class="noline '.$color_status.' faicon open_icon" '.$link_status.'></a></td>';
echo '</td>';
echo '</tr>';
#Začetek ankete z neprimernimi vprašanji.
echo '<tr>';
echo '<td>'.$lang['srv_diagnostic_2_element_1'].'</td>';
- echo '<td>';
if($lang['id'] == '1')
- $link = '<a href="https://www.1ka.si/d/sl/spletne-ankete/osnovna-priporocila/zacetek-ankete-z-neprimernimi-vprasanji?from1ka=1" target="_blank">%s</a>';
+ $link_status = 'href="https://www.1ka.si/d/sl/spletne-ankete/osnovna-priporocila/zacetek-ankete-z-neprimernimi-vprasanji?from1ka=1" target="_blank"';
else
- $link = '<a href="https://www.1ka.si/d/en/web-surveys/basic-recommendations/beginning-the-survey-with-inappropriate-questions?from1ka=1" target="_blank">%s</a>';
+ $link_status = 'href="https://www.1ka.si/d/en/web-surveys/basic-recommendations/beginning-the-survey-with-inappropriate-questions?from1ka=1" target="_blank"';
if (in_array(DIAG_UNAPROPRIATE_START,$this->diagnostic_note)) {
- echo '<span class="red">';
- printf($link,$lang['srv_diagnostic_neustreza2']);
- echo '</span>';
- } else {
- echo '<span class="green">';
- printf($link,$lang['srv_diagnostic_ustreza']);
- echo '</span>';
+ $color_status = 'rec';
+ $msg_status = $lang['srv_diagnostic_rec'];
}
- echo '</td>';
+ else {
+ $color_status = 'ok';
+ $msg_status = $lang['srv_diagnostic_ustreza'];
+ }
+
+ echo '<td class="center"><div class="status_wrapper"><div class="status '.$color_status.'"><a class="noline" '.$link_status.'>'.$msg_status.'</a></div></div></td>';
+ echo '<td class="center"><a class="noline '.$color_status.' faicon open_icon" '.$link_status.'></a></td>';
echo '</tr>';
+
# predolga anketa - opozorilo
if (in_array(DIAG_TIME_HARD_LIMIT,$this->diagnostic_note)) {
echo '<tr>';
echo '<td>'.$lang['srv_diagnostic_2_element_2'].'</td>';
- echo '<td>';
- echo '<span class="red">';
-
- if($lang['id'] == '1')
- echo '<a href="https://www.1ka.si/d/sl/spletne-ankete/osnovna-priporocila/kako-dolga-naj-bo-moja-anketa?from1ka=1" target="_blank">';
- else
- echo '<a href="https://www.1ka.si/d/en/web-surveys/basic-recommendations/how-long-should-my-survey-be?from1ka=1" target="_blank">';
- echo $lang['srv_diagnostic_neustreza'];
- echo '</a>';
- echo '</span>';
- echo '</td>';
+ if($lang['id'] == '1')
+ $link_status = 'href="https://www.1ka.si/d/sl/spletne-ankete/osnovna-priporocila/kako-dolga-naj-bo-moja-anketa?from1ka=1" target="_blank"';
+ else
+ $link_status = 'href="https://www.1ka.si/d/en/web-surveys/basic-recommendations/how-long-should-my-survey-be?from1ka=1" target="_blank"';
+
+ $color_status = 'rec';
+ $msg_status = $lang['srv_diagnostic_rec'];
+
+ echo '<td class="center"><div class="status_wrapper"><div class="status '.$color_status.'"><a class="noline" '.$link_status.'>'.$msg_status.'</a></div></div></td>';
+ echo '<td class="center"><a class="noline faicon open_icon" '.$link_status.'></a></td>';
echo '</tr>';
}
- echo '</table>';
- echo '</div>';
-
+
# PRIPOROČILA
- echo '<br/><br/>';
- echo '<div id="srv_diagnostic_results" >';
- echo '<table class="srv_diagnostic_results">';
- echo '<tr>';
- echo '<th>'.$lang['srv_diagnostika_table_title3'].'</th>';
- echo '<th>'.$lang['srv_diagnostika_table_title'].'</th>';
- echo '</tr>';
- #Preveč ali premalo opomnikov (reminder).
+ #Preveč ali premalo opomnikov (reminder) - 2 vrstici
echo '<tr>';
echo '<td>'.$lang['srv_diagnostic_3_element_1'].'</td>';
- echo '<td>';
if($lang['id'] == '1')
- $link = '<a href="https://www.1ka.si/d/sl/spletne-ankete/osnovna-priporocila/prevec-ali-premalo-opomnikov?from1ka=1" target="_blank">%s</a>';
+ $link_status = 'href="https://www.1ka.si/d/sl/spletne-ankete/osnovna-priporocila/prevec-ali-premalo-opomnikov?from1ka=1" target="_blank"';
else
- $link = '<a href="https://www.1ka.si/d/en/web-surveys/basic-recommendations/too-many-or-too-few-reminders?from1ka=1" target="_blank">%s</a>';
+ $link_status = 'href="https://www.1ka.si/d/en/web-surveys/basic-recommendations/too-many-or-too-few-reminders?from1ka=1" target="_blank"';
if (in_array(DIAG_REMINDER_ON_IF,$this->diagnostic_note)) {
- echo '<span class="red">';
- printf($link,$lang['srv_diagnostic_neustreza']);
- echo '</span>';
- } else {
- echo '<span class="green">';
- printf($link,$lang['srv_diagnostic_ustreza']);
- echo '</span>';
- }
- echo '</td>';
+ $color_status = 'rec';
+ $msg_status = $lang['srv_diagnostic_rec'];
+ }
+ else {
+ $color_status = 'ok';
+ $msg_status = $lang['srv_diagnostic_ustreza'];
+ }
+
+ echo '<td class="center"><div class="status_wrapper"><div class="status '.$color_status.'"><a class="noline" '.$link_status.'>'.$msg_status.'</a></div></div></td>';
+ echo '<td class="center"><a class="noline '.$color_status.' faicon open_icon" '.$link_status.'></a></td>';
echo '</tr>';
echo '<tr>';
echo '<td>'.$lang['srv_diagnostic_3_element_2'].'</td>';
- echo '<td>';
-
- if($lang['id'] == '1')
- $link = '<a href="https://www.1ka.si/d/sl/spletne-ankete/osnovna-priporocila/prevec-ali-premalo-opomnikov?from1ka=1" target="_blank">%s</a>';
- else
- $link = '<a href="https://www.1ka.si/d/en/web-surveys/basic-recommendations/too-many-or-too-few-reminders?from1ka=1" target="_blank">%s</a>';
if (in_array(DIAG_REMINDER_ON_MGRID,$this->diagnostic_note)) {
- echo '<span class="red">';
- printf($link,$lang['srv_diagnostic_neustreza']);
- echo '</span>';
- } else {
- echo '<span class="green">';
- printf($link,$lang['srv_diagnostic_ustreza']);
- echo '</span>';
- }
- echo '</td>';
+ $color_status = 'rec';
+ $msg_status = $lang['srv_diagnostic_rec'];
+ }
+ else {
+ $color_status = 'ok';
+ $msg_status = $lang['srv_diagnostic_ustreza'];
+ }
+
+ echo '<td class="center"><div class="status_wrapper"><div class="status '.$color_status.'"><a class="noline" '.$link_status.'>'.$msg_status.'</a></div></div></td>';
+ echo '<td class="center"><a class="noline '.$color_status.' faicon open_icon" '.$link_status.'></a></td>';
echo '</tr>';
+
# predolga naketa - priporočilo
if (in_array(DIAG_TIME_SOFT_LIMIT,$this->diagnostic_note)) {
echo '<tr>';
echo '<td>'.$lang['srv_diagnostic_2_element_2'].'</td>';
- echo '<td>';
- echo '<span class="red">';
- if($lang['id'] == '1')
- echo '<a href="https://www.1ka.si/d/sl/spletne-ankete/osnovna-priporocila/kako-dolga-naj-bo-moja-anketa?from1ka=1" target="_blank">';
- else
- echo '<a href="https://www.1ka.si/d/en/web-surveys/basic-recommendations/how-long-should-my-survey-be?from1ka=1" target="_blank">';
+ if($lang['id'] == '1')
+ $link_status = 'href="https://www.1ka.si/d/sl/spletne-ankete/osnovna-priporocila/kako-dolga-naj-bo-moja-anketa?from1ka=1" target="_blank"';
+ else
+ $link_status = 'href="https://www.1ka.si/d/en/web-surveys/basic-recommendations/how-long-should-my-survey-be?from1ka=1" target="_blank"';
- echo $lang['srv_diagnostic_neustreza'];
- echo '</a>';
- echo '</span>';
- echo '</td>';
+ $color_status = 'rec';
+ $msg_status = $lang['srv_diagnostic_rec'];
+
+ echo '<td class="center"><div class="status_wrapper"><div class="status '.$color_status.'"><a class="noline" '.$link_status.'>'.$msg_status.'</a></div></div></td>';
+ echo '<td class="center"><a class="noline faicon open_icon" '.$link_status.'></a></td>';
echo '</tr>';
}
- echo '</table>';
- echo '</div>';
- echo '</div>';
-
- # Trajanje - linki
- echo '<div id="srv_diagnostic_results_right">';
- echo '<table class="srv_diagnostic_results">';
- echo '<tr>';
- echo '<th>'.$lang['srv_info_duration'].'</th>';
- echo '<th></th>';
- echo '<th></th>';
- echo '</tr>';
- echo '<tr>';
- echo '<td>'.$lang['srv_testiranje_predvidenicas'].'</td>';
- echo '<td>'.$skupni_cas.'</td>';
- echo '<td><a href="index.php?anketa=' . $this->sid . '&amp;a='.A_TESTIRANJE.'&amp;m=predvidenicas" title="'.$lang['srv_testiranje_predvidenicas'].'">'.$lang['details'].'</a></td>';
- echo '</tr>';
+ echo '</table>';
+
+ // LASTNOSTI ANKETE
+ echo '<h2>'.$lang['srv_testiranje_diagnostika_lastnosti'].'</h2>';
+
+ echo '<div class="lastnosti_wrapper">';
+
+ echo '<div class="lastnosti_left">';
+
+ echo '<div class="box">';
+ echo '<div class="title">'.$lang['srv_neto_v_cas'].'</div>';
+
+ // Dejansko trajanje
$sas = new SurveyAdminSettings();
$dejanski_cas = ($sas->testiranje_cas(1) == null) ? '-' : $sas->testiranje_cas(1);
- echo '<tr>';
- echo '<td>'.$lang['srv_testiranje_cas'].'</td>';
- echo '<td>'.$dejanski_cas.'</td>';
- echo '<td><a href="index.php?anketa=' . $this->sid . '&amp;a='.A_TESTIRANJE.'&amp;m='.M_TESTIRANJE_CAS.'" title="'.$lang['srv_testiranje_cas'].'">'.$lang['details'].'</a></td>';
- echo '</tr>';
- echo '</table>';
- echo '</div>';
- echo '<br /><br />';
-
-
- echo '<div id="srv_diagnostic_results_right">';
- echo '<table class="srv_diagnostic_results">';
- echo '<tr>';
- echo '<th>'.$lang['srv_diagnostika_table_title4'].'</th>';
- echo '<th colspan="2">'.$lang['srv_diagnostika_table_title'].'</th>';
- echo '</tr>';
- /*echo '<tr>';
- echo '<td>'.$lang['srv_diagnostic_1_element_0'].'</td>';
- echo '<td colspan="2">'.$skupni_cas.'</td>';
- echo '</tr>';*/
- echo '<tr>';
- echo '<td>'.$lang['srv_diagnostic_1_element_5'].'</td>';
+ echo '<p class="time">'.$dejanski_cas.'</p>';
+ if ($sas->testiranje_cas(1) == null)
+ echo $lang['srv_data_no_data'];
+ else
+ echo '<a href="index.php?anketa=' . $this->sid . '&amp;a='.A_TESTIRANJE.'&amp;m='.M_TESTIRANJE_CAS.'">'.$lang['srv_testiranje_cas_info'].'</a>';
+ echo '</div>'; #box
- echo '<td colspan="2">';
+ //Ocena trajanja
+ echo '<div class="box">';
+ echo '<div class="title">'.$lang['srv_testiranje_predvidenicas'].'</div>';
+ echo '<p class="time">'.$skupni_cas.'</p>';
+ echo '<a href="index.php?anketa=' . $this->sid . '&amp;a='.A_TESTIRANJE.'&amp;m=predvidenicas">'.$lang['srv_testiranje_predvidenicas_info'].'</a>';
+ echo '</div>'; #box
- if($lang['id'] == '1')
- echo '<a href="https://www.1ka.si/d/sl/spletne-ankete/osnovna-priporocila/kako-dolga-naj-bo-moja-anketa?from1ka=1" target="_blank">';
+ echo '</div>'; #lastnosti_left
+
+ echo '<div class="lastnosti_middle">';
+ // Dolžina ankete
+ if($lang['id'] == '1')
+ $link_time = 'href="https://www.1ka.si/d/sl/spletne-ankete/osnovna-priporocila/kako-dolga-naj-bo-moja-anketa?from1ka=1" target="_blank"';
else
- echo '<a href="https://www.1ka.si/d/en/web-surveys/basic-recommendations/how-long-should-my-survey-be?from1ka=1" target="_blank">';
+ $link_time = 'href="https://www.1ka.si/d/en/web-surveys/basic-recommendations/how-long-should-my-survey-be?from1ka=1" target="_blank"';
+
+ echo '<div class="box">';
+ echo '<div class="title">'.$lang['srv_diagnostic_1_element_5'].'</div>';
+
+ echo '<div class="diagnostic_graph">';
+
+ echo '<div class="circle">';
+ echo '<canvas id="survey_length"></canvas>';
+ echo '</div>';
+ echo '<script type="text/javascript"> diagnosticsChart(\'survey_length\','.$display_length.'); </script>';
+
+ echo '<div class="other_text">';
+ echo '<p class="desc">'.$time.'</p>';
+ echo '<a '.$link_time.'>'.$lang['srv_diagnostic_time_extra'].'</a>';
+ echo '</div>';
+
+ echo '</div>';
+ echo '</div>'; #box
- echo $time;
- echo '</a>';
-# echo Help::display('srv_diag_time').'</td>';
- echo '</tr>';
- echo '<tr>';
- echo '<td>'.$lang['srv_diagnostic_4_element_9'].'</td>';
- echo '<td colspan="2">'.(int)SurveyInfo::getSurveyGroupCount().'</td>';
- echo '</tr>';
- echo '<tr>';
- echo '<td>'.$lang['srv_diagnostic_4_element_5'].'</td>';
- echo '<td colspan="2">'.(int)$this->cnt_spremenljivka.'</td>';
- echo '</tr>';
- echo '<tr>';
- echo '<td>'.$lang['srv_diagnostic_4_element_5a'].'</td>';
- echo '<td colspan="2">'.(int)$this->cnt_hidden.'</td>';
- echo '</tr>';
- echo '<tr>';
- echo '<td>'.$lang['srv_diagnostic_4_element_8'].'</td>';
- echo '<td colspan="2">'.(int)SurveyInfo::getSurveyVariableCount().'</td>';
- echo '</tr>';
- echo '<tr>';
- echo '<td>'.$lang['srv_diagnostic_4_element_2'].'</td>';
- echo '<td colspan="2">'.(int)$this->cnt_conditions.'</td>';
- echo '</tr>';
- echo '<tr>';
- echo '<td>'.$lang['srv_diagnostic_4_element_3'].'</td>';
- echo '<td colspan="2">'.(int)$this->cnt_blocks.'</td>';
- echo '</tr>';
- echo '<tr>';
- echo '<td>'.$lang['srv_diagnostic_4_element_4'].'</td>';
- echo '<td colspan="2">'.(int)$this->globina.'</td>';
- echo '</tr>';
- echo '<tr>';
- echo '<td>'.$lang['srv_diagnostic_1_element_4'].'</td>';
- echo '<td colspan="2">';
-
- if($lang['id'] == '1')
- echo '<a href="https://www.1ka.si/d/sl/spletne-ankete/osnovna-priporocila/kaj-pomeni-kompleksnost-ankete?from1ka=1" target="_blank">';
+ // Kompleksnost ankete
+ if($lang['id'] == '1')
+ $link_complex = 'href="https://www.1ka.si/d/sl/spletne-ankete/osnovna-priporocila/kaj-pomeni-kompleksnost-ankete?from1ka=1" target="_blank"';
else
- echo '<a href="https://www.1ka.si/d/en/web-surveys/basic-recommendations/what-does-survey-complexity-mean?from1ka=1" target="_blank">';
-
- echo $kompleksnost;
- echo '</a>';
- #echo Help::display('srv_diag_complexity').'</td>';
- echo '</tr>';
+ $link_complex = 'href="https://www.1ka.si/d/en/web-surveys/basic-recommendations/what-does-survey-complexity-mean?from1ka=1" target="_blank"';
- echo '</table>';
+ echo '<div class="box">';
+ echo '<div class="title">'.$lang['srv_diagnostic_1_element_4'].'</div>';
+ echo '<div class="diagnostic_graph">';
+
+ echo '<div class="circle">';
+ echo '<canvas id="survey_complex"></canvas>';
echo '</div>';
- echo '<br /><br />';
+ echo '<script type="text/javascript"> diagnosticsChart(\'survey_complex\','.$display_complex.'); </script>';
+ echo '<div class="other_text">';
+ echo '<p class="desc">'.$kompleksnost.'</p>';
+ echo '<a '.$link_complex.'>'.$lang['srv_diagnostic_complexity_extra'].'</a>';
+ echo '</div>';
+
+ echo '</div>';
+ echo '</div>'; #box
+ echo '</div>'; #lastnosti_middle
+
+ //Ostale lastnosti ankete
+ echo '<div class="lastnosti_right">';
+
+ echo '<div class="box">';
+ echo '<div class="vertical_section">';
+ echo '<div class="item">'.$lang['srv_diagnostic_4_element_9'].':</div>';
+ echo '<div class="item">'.$lang['srv_diagnostic_4_element_5'].':</div>';
+ echo '<div class="item">'.$lang['srv_diagnostic_4_element_5a'].':</div>';
+ echo '<div class="item">'.$lang['srv_diagnostic_4_element_8'].':</div>';
+ echo '<div class="item">'.$lang['srv_diagnostic_4_element_2'].':</div>';
+ echo '<div class="item">'.$lang['srv_diagnostic_4_element_3'].':</div>';
+ echo '<div class="item">'.$lang['srv_diagnostic_4_element_4'].':</div>';
+ echo '</div>';
+ echo '<div class="vertical_section second">';
+ echo '<div class="item">'.(int)SurveyInfo::getSurveyGroupCount() . ' ' . ((int)SurveyInfo::getSurveyGroupCount() == 1 ? $lang['page']: $lang['srv_diagnostics_strani']).'</div>';
+ echo '<div class="item">'.(int)$this->cnt_spremenljivka . ' ' . ((int)$this->cnt_spremenljivka == 1 ? $lang['srv_casi_po_vprasanjih_vprasanje'] : ((int)$this->cnt_spremenljivka == 2 ? $lang['srv_info_questions2'] : ((int)$this->cnt_spremenljivka > 4 || (int)$this->cnt_spremenljivka == 0 ? $lang['srv_info_questions1'] : $lang['srv_info_questions3']) )).'</div>';
+ echo '<div class="item">'.(int)$this->cnt_hidden . ' '. ((int)$this->cnt_hidden == 1 ? $lang['srv_hidden_text'] : ((int)$this->cnt_hidden == 2 ? $lang['srv_hidden_text2'] : ((int)$this->cnt_hidden > 4 || (int)$this->cnt_hidden == 0 ? $lang['srv_hidden_text4'] : $lang['srv_hidden_text3']) )). ' ' . ((int)$this->cnt_hidden == 1 ? $lang['srv_casi_po_vprasanjih_vprasanje'] : ((int)$this->cnt_hidden == 2 ? $lang['srv_info_questions2'] : ((int)$this->cnt_hidden > 4 || (int)$this->cnt_hidden == 0 ? $lang['srv_info_questions1'] : $lang['srv_info_questions3']) )).'</div>';
+ echo '<div class="item">'.(int)SurveyInfo::getSurveyVariableCount() . ' ' . ((int)SurveyInfo::getSurveyVariableCount() == 1 ? $lang['srv_spremenljivka'] : ((int)SurveyInfo::getSurveyVariableCount() == 2 ? $lang['srv_spremenljivka2'] : ((int)SurveyInfo::getSurveyVariableCount() > 4 || (int)SurveyInfo::getSurveyVariableCount() == 0 ? $lang['srv_spremenljivka4'] : $lang['srv_spremenljivka3']) )).'</div>';
+ echo '<div class="item">'.(int)$this->cnt_conditions . ' ' . ((int)$this->cnt_conditions == 1 ? $lang['srv_pogoj'] : ((int)$this->cnt_conditions == 2 ? $lang['srv_pogoj2'] : ((int)$this->cnt_conditions > 4 || (int)$this->cnt_conditions == 0 ? $lang['srv_pogoj4'] : $lang['srv_pogoj3']) )).'</div>';
+ echo '<div class="item">'.(int)$this->cnt_blocks . ' ' . ((int)$this->cnt_blocks == 1 ? $lang['srv_blok'] : ((int)$this->cnt_blocks == 2 ? $lang['srv_blok2'] : ((int)$this->cnt_blocks > 4 || (int)$this->cnt_blocks == 0 ? $lang['srv_blok4'] : $lang['srv_blok3']) )).'</div>';
+ echo '<div class="item">'.(int)$this->globina.'</div>';
+ echo '</div>';
+ echo '</div>'; #box
+
+ echo '</div>'; #lastnosti_right
+
+ echo '</div>'; #lastnosti_wrapper
+
+
+ // KOMENATRJI
# nerazrešeni komentarji uporabnikov $commentsUser,$commentsUserFinished
$commentsUserUnresolved = $commentsUser - $commentsUserFinished;
if (( (int)$commentsAll
@@ -597,39 +580,53 @@ class SurveyDiagnostics
+(int)$commentsUser
+(int)$commentsUserFinished
) > 0 ) {
- echo '<div id="srv_diagnostic_results_right">';
- echo '<table class="srv_diagnostic_results">';
- echo '<tr>';
- echo '<th>'.$lang['srv_diagnostic_4_element_0'].'</th>';
- echo '<th>'.$lang['srv_diagnostic_unresolved'].'</th>';
- echo '<th>'.$lang['srv_diagnostic_all'].'</th>';
- echo '</tr>';
- echo '<tr>';
- echo '<td>'.$lang['srv_diagnostic_4_element_1'].'</td>';
- echo '<td>'.(int)$commentsUnresolved.'</td>';
- echo '<td>'.(int)$commentsAll.'</td>';
- echo '</tr>';
- echo '<tr>';
- echo '<td>'.$lang['srv_diagnostic_4_element_1a'].'</td>';
- echo '<td>'.(int)$commentsUserSurveyUnresolved.'</td>';
- echo '<td>'.(int)$commentsUserSurveyAll.'</td>';
- echo '</tr>';
- echo '<tr>';
- echo '<td>'.$lang['srv_diagnostic_4_element_6'].'</td>';
- echo '<td>'.(int)$commentsQuestionUnresolved.'</td>';
- echo '<td>'.(int)$commentsQuestionAll.'</td>';
- echo '</tr>';
- echo '<tr>';
- echo '<td>'.$lang['srv_diagnostic_4_element_7'].'</td>';
- echo '<td>'.(int)$commentsUserUnresolved.'</td>';
- echo '<td>'.(int)$commentsUser.'</td>';
- echo '</tr>';
- echo '</table>';
- echo '</div>';
- }
-
+
+ echo '<h2>'.$lang['srv_diagnostic_4_element_0'].'</h2>';
+
+ echo '<div class="komentarji_wrapper">';
+
+ echo '<div class="komentarji_left">';
+ echo '<div class="title">'.$lang['srv_testiranje_komentarji_anketa'].'</div>';
+
+ echo '<div class="comment_count">';
+ echo '<div>'.$lang['srv_admin_comment2'].'</div>';
+ echo '<div><span class="semi-bold">'.(int)$commentsUnresolved.'/'.(int)$commentsAll.'</span> '.$lang['srv_inv_archive_comment2'].'</div>';
+ echo '</div>';
+
+ echo '<div class="comment_count">';
+ echo '<div>'.$lang['srv_repondent_comment2'].'</div>';
+ echo '<div><span class="semi-bold">'.(int)$commentsUserSurveyUnresolved.'/'.(int)$commentsUserSurveyAll.'</span> '.$lang['srv_inv_archive_comment2'].'</div>';
+ echo '</div>';
+
+ $b = new Branching($this->anketa['id']);
+
+ $id = $b->anketa;
+
+ echo '<a href="'.$site_url.'/admin/survey/index.php?anketa='.$id.'&a=komentarji_anketa">'.$lang['srv_testiranje_komentarji_anketa_link'].'</a>';
+
+ echo '</div>'; #komentarji_left
+
+
+ echo '<div class="komentarji_right">';
+ echo '<div class="title">'.$lang['srv_testiranje_komentarji_title'].'</div>';
+
+ echo '<div class="comment_count">';
+ echo '<div>'.$lang['srv_admin_comment2'].'</div>';
+ echo '<div><span class="semi-bold">'.(int)$commentsQuestionUnresolved.'/'.(int)$commentsQuestionAll.'</span> '.$lang['srv_inv_archive_comment2'].'</div>';
+ echo '</div>';
+
+ echo '<div class="comment_count">';
+ echo '<div>'.$lang['srv_repondent_comment2'].'</div>';
+ echo '<div><span class="semi-bold">'.(int)$commentsUserUnresolved.'/'.(int)$commentsUser.'</span> '.$lang['srv_inv_archive_comment2'].'</div>';
+ echo '</div>';
+
+ echo '<a href="'.$site_url.'/admin/survey/index.php?anketa='.$id.'&a=komentarji">'.$lang['srv_testiranje_komentarji_title_link'].'</a>';
+
+ echo '</div>'; #komentarji_right
+
+ echo '</div>'; #komentarji_wrapper
+ }
- echo '<br /><br />';
echo '</div>'; # id="srv_diagnostic"
}
@@ -700,7 +697,8 @@ class SurveyDiagnostics
# vsako spremenljivko preverimo samo 1x :)
if ( !in_array(DIAG_REMINDER_ON_IF,$this->diagnostic_note)
&& !isset($_spr_reminders[$row_condition_spr['spr_id']])) {
- if ((int)$this->spremenljivke[$row_condition_spr['spr_id']]['reminder'] == 0) {
+
+ if (!isset($this->spremenljivke[$row_condition_spr['spr_id']]['reminder']) || (int)$this->spremenljivke[$row_condition_spr['spr_id']]['reminder'] == 0) {
$this->diagnostic_note[] = DIAG_REMINDER_ON_IF;
}
@@ -769,7 +767,7 @@ class SurveyDiagnostics
$sas = new SurveyAdminSettings();
$total = $sas->testiranje_predvidenicas(2);
$this->time = array( $total,
- (bcdiv($total, 60, 0)>0?bcdiv($total, 60, 0).'min ':'').''.round(bcmod($total, 60), 0).'s'
+ (bcdiv($total, 60, 0)>0?bcdiv($total, 60, 0).'<span class="time_text">min</span> ':'').''.round(bcmod($total, 60), 0).'<span class="time_text">s</span>'
);
if ($total >= TIME_SOFT_LIMIT) {
@@ -782,8 +780,10 @@ class SurveyDiagnostics
}
function testComments() {
+
$spr_id=array();
$threads=array();
+
if ( is_array($this->spremenljivke) && count($this->spremenljivke) > 0 ) {
foreach ($this->spremenljivke as $id=>$value) {
$spr_id[] = $id;
@@ -792,9 +792,20 @@ class SurveyDiagnostics
}
}
}
+
+ $rowqr = 0;
+ $rowqrf = 0;
+ $rowta = 0;
+ $rowtu = 0;
+ $rowtar = 0;
+ $rowtur = 0;
+
+ $rowtqa = 0;
+ $rowtqu = 0;
+
if (count($spr_id) > 0) {
- $db_table = ($this->surveyInfo['db_table'] == 1) ? '_active' : '';
+ $db_table = SurveyInfo::getInstance()->getSurveyArchiveDBString();
#preštejemo komentarje uporabnikov na vprašanja
# srv_data_text where spr_id = 0 AND vre_id IN (id-ji spremenljivk)
@@ -804,7 +815,7 @@ class SurveyDiagnostics
#končani komentarji respondentov
#text2 = 2 => končan
- #text2 = 3 => nerelevantno
+ #text2 = 3 => nerelevantno
$strqrf = "SELECT count(*) FROM srv_data_text".$db_table." WHERE spr_id=0 AND vre_id IN (".implode(',',$spr_id).") AND text2 IN (2,3)";
$sqlqrf = sisplet_query($strqrf);
list($rowqrf) = mysqli_fetch_row($sqlqrf);
@@ -814,23 +825,21 @@ class SurveyDiagnostics
$sqlta = sisplet_query($strta);
list($rowta) = mysqli_fetch_row($sqlta);
- # nerešeni komentarji: only_unresolved => ocena <= 1
+ # nerešeni komentarji: only_unresolved => ocena <= 1
$strtu = "SELECT count(*) FROM post WHERE tid='".$this->surveyInfo['thread']."' AND parent > 0 AND ocena <= 1 ";
$sqltu = sisplet_query($strtu);
list($rowtu) = mysqli_fetch_row($sqltu);
- # vsi komentarji na anketo respondentov
+ # vsi komentarji na anketo respondentov
$strtar = "SELECT count(*) FROM srv_comment_resp WHERE ank_id='".$this->sid."'";
$sqltar = sisplet_query($strtar);
list($rowtar) = mysqli_fetch_row($sqltar);
- # nerešeni komentarji respondentov na anketo: only_unresolved => ocena <= 1
+ # nerešeni komentarji respondentov na anketo: only_unresolved => ocena <= 1
$strtur = "SELECT count(*) FROM srv_comment_resp WHERE ank_id='".$this->sid."' AND ocena <= 1 ";
$sqltur = sisplet_query($strtur);
list($rowtur) = mysqli_fetch_row($sqltur);
- $rowtqa = 0;
- $rowtqu = 0;
# preštejemo
if (count($threads) > 0) {
# vsi komentarji na anketo
@@ -842,10 +851,11 @@ class SurveyDiagnostics
$strtu = "SELECT count(*) FROM post WHERE tid IN (".implode(',',$threads).") AND parent > 0 AND ocena <= 1 ";
$sqltu = sisplet_query($strtu);
list($rowtqu) = mysqli_fetch_row($sqltu);
-
}
}
+
$this->comments = array($rowta,$rowtu,$rowtqa,$rowtqu,$rowqr,$rowqrf,$rowtar,$rowtur);
+
return $this->comments;
}
@@ -890,7 +900,7 @@ class SurveyDiagnostics
}
function countHidden() {
- if (count($this->spremenljivke) > 0) {
+ if (is_countable($this->spremenljivke) && count($this->spremenljivke) > 0) {
foreach ($this->spremenljivke as $spremenljivka) {
if ((int)$spremenljivka['visible'] == 0) {
$this->cnt_hidden++;