[Redizajn 1KA v2] Testiranje --> Komentarji - meni sredina

This commit is contained in:
tejagerjovic 2022-08-26 09:41:18 +02:00
parent aafe7551ea
commit 0e1991e418
6 changed files with 115 additions and 87 deletions

View File

@ -2636,10 +2636,12 @@ class SurveyAdmin
private function displayAnketaTabTestiranje(){
if ($_GET['a'] == 'komentarji') {
$sas = new SurveyAdminSettings();
$sas->menu_komentarji();
$sas->testiranje_komentarji();
}
elseif ($_GET['a'] == 'komentarji_anketa') {
$sas = new SurveyAdminSettings();
$sas->menu_komentarji();
$sas->testiranje_komentarji_anketa();
}
elseif (trim($_GET['m']) == '' || $_GET['m'] == 'diagnostika') {

View File

@ -6746,6 +6746,76 @@ class SurveyAdminSettings {
return $txt;
}
function menu_komentarji () {
global $lang;
// Prestejemo komentarje (nereseni/vsi)
$sas = new SurveyAdminSettings();
$comment_count = $sas->testiranje_komentarji_count();
echo '<div id="additional_navigation">';
echo '<div id="menu">';
// Komentarji na vprasanja
echo '<span '.($_GET['a'] == A_KOMENTARJI_ANKETA ? 'class="active"' : '').'>';
echo '<a href="index.php?anketa=' . $this->sid . '&amp;a=' . A_KOMENTARJI_ANKETA . '" title="' . $lang['srv_testiranje_komentarji_anketa_title'] . '">';
echo $lang['srv_testiranje_komentarji_anketa_title'];
echo '</a>';
echo '<span class="bold">(';
if ($comment_count['survey_resp']['unresolved'] + $comment_count['survey_admin']['unresolved'] > 0)
echo '<span class="orange">';
echo($comment_count['survey_resp']['unresolved'] + $comment_count['survey_admin']['unresolved']);
if ($comment_count['survey_resp']['unresolved'] + $comment_count['survey_admin']['unresolved'] > 0)
echo '</span>';
echo '/' . ($comment_count['survey_resp']['all'] + $comment_count['survey_admin']['all']);
echo ')</span>';
echo '</span>';
// Komentarji na anketo
echo '<span '.($_GET['a'] == A_KOMENTARJI ? ' class="active"' : '').'>';
echo '<a href="index.php?anketa=' . $this->sid . '&amp;a=' . A_KOMENTARJI . '" title="' . $lang['srv_testiranje_komentarji_title'] . '">';
echo $lang['srv_testiranje_komentarji_title'];
echo '</a>';
echo '<span class="bold">(';
if ($comment_count['question']['unresolved'] > 0)
echo '<span class="orange">';
echo $comment_count['question']['unresolved'];
if ($comment_count['question']['unresolved'] > 0)
echo '</span>';
echo '/' . $comment_count['question']['all'];
echo ')</span>';
echo '</span>';
echo '</div>'; //#menu
//Link na nastavitev komentarjev
$d = new Dostop();
# nastavitve komentarjev
if ($d->checkDostopSub('edit')) {
echo '<div id="analiza_right_options_holder" class="right_options_holder">';
echo '<div title="' . $lang['settings'] . '" id="analiza_right_options">';
echo '<a href="index.php?anketa=' . $this->sid . '&a=urejanje" title="' . $lang['srv_settings_komentarji1'] . '">';
echo '<span class="faicon wheel_32"></span>';
echo '</a>';
echo '</div>';
echo '</div>';
}
echo '</div>';
}
/**
* izpise komentarje na anketo
*
@ -6824,8 +6894,9 @@ class SurveyAdminSettings {
echo '<div class="comment_type">';
echo $lang['srv_admin_comment'].':';
echo '<span class="faicon pointer blue fa-sort-amount-down"></span>'; //manjka funkcija za sort in toggle za spremembo ikone
echo '<span class="faicon pointer blue fa-sort-amount-up"></span>';
/*Sort
echo '<span class="faicon pointer blue fa-sort-amount-down"></span>';
echo '<span class="faicon pointer blue fa-sort-amount-up"></span>';*/
echo '</div>';
@ -6886,7 +6957,7 @@ class SurveyAdminSettings {
echo '</div>';
echo '<div class="line">';
echo '<span class="faicon trash link-right"></span>'; //manjka funkcija za izbris - js preko ajaxa pošlje id komentarja in zbriše komentar v bazi in comment box div, da ne refesha strani
echo '<span class="faicon trash empty link-right"></span>';
echo $lang['srv_comment_delete'];
echo '</div>';
@ -6942,8 +7013,9 @@ class SurveyAdminSettings {
echo '<div class="comment_type">';
echo $lang['srv_repondent_comment'].':';
echo '<span class="faicon pointer blue fa-sort-amount-down"></span>'; //manjka funkcija za sort in toggle za spremembo ikone
echo '<span class="faicon pointer blue fa-sort-amount-up"></span>';
/*Sort
echo '<span class="faicon pointer blue fa-sort-amount-down"></span>';
echo '<span class="faicon pointer blue fa-sort-amount-up"></span>';*/
echo '</div>';
$sql = sisplet_query("SELECT * FROM srv_comment_resp WHERE ank_id='$this->anketa' ".$only_unresolved." ORDER BY comment_time $orderby, id $orderby");
@ -6990,12 +7062,13 @@ class SurveyAdminSettings {
echo '<div class="options_dropdown displayNone" id="options_'.$row['id'].'">';
/* pri splošnih komentarjih ni odgovorov
echo '<div class="line">';
echo '<span class="faicon fa-reply link-right"></span>'.$lang['srv_comment_comment']; // pri splošnih ni odgovorov?
echo '</div>';
echo '<span class="faicon fa-reply link-right"></span>'.$lang['srv_comment_comment'];
echo '</div>';*/
echo '<div class="line">';
echo '<span class="faicon trash link-right"></span>'; //manjka funkcija za izbris
echo '<span class="faicon trash empty link-right"></span>';
echo $lang['srv_comment_delete'];
echo '</div>';
@ -7455,8 +7528,9 @@ class SurveyAdminSettings {
echo $lang['srv_admin_comment'].':';
echo '<span class="faicon pointer blue fa-sort-amount-down"></span>'; //manjka funkcija za sort in toggle za spremembo ikone
echo '<span class="faicon pointer blue fa-sort-amount-up"></span>';
/*Sort
echo '<span class="faicon pointer blue fa-sort-amount-down"></span>';
echo '<span class="faicon pointer blue fa-sort-amount-up"></span>';*/
echo '</div>';
@ -7646,8 +7720,9 @@ class SurveyAdminSettings {
echo $lang['srv_admin_comment'].':';
echo '<span class="faicon pointer blue fa-sort-amount-down"></span>'; //manjka funkcija za sort in toggle za spremembo ikone
echo '<span class="faicon pointer blue fa-sort-amount-up"></span>';
/*Sort
echo '<span class="faicon pointer blue fa-sort-amount-down"></span>';
echo '<span class="faicon pointer blue fa-sort-amount-up"></span>';*/
echo '</div>';
@ -7689,7 +7764,7 @@ class SurveyAdminSettings {
echo '</div>';
echo '<div class="line" onClick="comment_delete(\''.$rowt['id'].'\');">';
echo '<span class="faicon trash link-right"></span>'; //manjka funkcija za izbris
echo '<span class="faicon trash empty link-right"></span>';
echo $lang['srv_comment_delete'];
echo '</div>';
@ -7741,8 +7816,9 @@ class SurveyAdminSettings {
echo '<div class="comment_type">';
echo $lang['srv_repondent_comment'].':';
echo '<span class="faicon pointer blue fa-sort-amount-down"></span>'; //manjka funkcija za sort in toggle za spremembo ikone
echo '<span class="faicon pointer blue fa-sort-amount-up"></span>';
/*Sort
echo '<span class="faicon pointer blue fa-sort-amount-down"></span>';
echo '<span class="faicon pointer blue fa-sort-amount-up"></span>';*/
echo '</div>';
if ($_GET['only_unresolved'] == 1) $only_unresolved = " AND d.text2 <= 1 "; else $only_unresolved = " ";
@ -7796,7 +7872,7 @@ class SurveyAdminSettings {
echo '<div class="options_dropdown displayNone" id="options_'.$rowt['id'].'">';
echo '<div class="line">';
echo '<span class="faicon trash link-right"></span>'; //manjka funkcija za izbris
echo '<span class="faicon trash empty link-right"></span>'; //manjka funkcija za izbris
echo $lang['srv_comment_delete'];
echo '</div>';

View File

@ -374,57 +374,6 @@ class SurveyStaticHtml
echo '<span class="active"><a href="index.php?anketa=' . $this->sid . '&amp;a=' . A_TESTIRANJE . '&amp;m=' . M_TESTIRANJE_CAS . '" title="' . $lang['srv_testiranje_cas'] . '">'.$lang['srv_testiranje_cas'].'</a></span>';
echo '</div>';
$borderLeft = ' class="borderLeft"';
}
// Link nazaj na komentarje
elseif ($podstran == 'komentarji' || $podstran == 'komentarji_anketa') {
// Prestejemo komentarje (nereseni/vsi)
$sas = new SurveyAdminSettings();
$comment_count = $sas->testiranje_komentarji_count();
echo '<div id="additional_navigation">';
// Komentarji na vprasanja
echo '<span '.($_GET['a'] == A_KOMENTARJI_ANKETA ? 'class="active"' : '').'>';
echo '<a href="index.php?anketa=' . $this->sid . '&amp;a=' . A_KOMENTARJI_ANKETA . '" title="' . $lang['srv_testiranje_komentarji_anketa_title'] . '">';
echo $lang['srv_testiranje_komentarji_anketa_title'];
echo '</a>';
echo '<span class="bold">(';
if ($comment_count['survey_resp']['unresolved'] + $comment_count['survey_admin']['unresolved'] > 0)
echo '<span class="orange">';
echo($comment_count['survey_resp']['unresolved'] + $comment_count['survey_admin']['unresolved']);
if ($comment_count['survey_resp']['unresolved'] + $comment_count['survey_admin']['unresolved'] > 0)
echo '</span>';
echo '/' . ($comment_count['survey_resp']['all'] + $comment_count['survey_admin']['all']);
echo ')</span>';
echo '</span>';
// Komentarji na anketo
echo '<span '.($_GET['a'] == A_KOMENTARJI ? ' class="active"' : '').'>';
echo '<a href="index.php?anketa=' . $this->sid . '&amp;a=' . A_KOMENTARJI . '" title="' . $lang['srv_testiranje_komentarji_title'] . '">';
echo $lang['srv_testiranje_komentarji_title'];
echo '</a>';
echo '<span class="bold">(';
if ($comment_count['question']['unresolved'] > 0)
echo '<span class="orange">';
echo $comment_count['question']['unresolved'];
if ($comment_count['question']['unresolved'] > 0)
echo '</span>';
echo '/' . $comment_count['question']['all'];
echo ')</span>';
echo '</span>';
echo '</div>';
$borderLeft = ' class="borderLeft"';
@ -569,24 +518,6 @@ class SurveyStaticHtml
echo '</div>';
}
// Link na nastavitve komentarjev
elseif ($podstran == 'komentarji' || $podstran == 'komentarji_anketa') {
$d = new Dostop();
# nastavitve komentarjev
if ($d->checkDostopSub('edit')) {
echo '<div id="analiza_right_options_holder" class="right_options_holder">';
echo '<div title="' . $lang['settings'] . '" id="analiza_right_options">';
echo '<a href="index.php?anketa=' . $this->sid . '&a=urejanje" title="' . $lang['srv_settings_komentarji1'] . '">';
echo '<span class="faicon wheel_32"></span>';
echo '</a>';
echo '</div>';
echo '</div>';
}
}
echo '</div>';
}

View File

@ -763,7 +763,7 @@ function comment_on_comment (id, user, date, spr_id) {
}
function comment_delete (id) {
$.post("ajax.php?a=comment_delete\', {id: \''+id+'\', anketa: srv_meta_anketa_id}, function() {window.location.reload();}); return false");
$.post("ajax.php?a=comment_delete\', {id: \''+id+'\', anketa: srv_meta_anketa_id}");
}

View File

@ -24985,6 +24985,15 @@ div#srv_diagnostic .button_holder button {
margin: 0 0 0 8px;
}
div.page_komentarji #additional_navigation,
div.page_komentarji_anketa #additional_navigation {
display: flex;
justify-content: center;
}
div.page_komentarji #additional_navigation #menu,
div.page_komentarji_anketa #additional_navigation #menu {
width: fit-content;
}
div.page_komentarji div#comment_question_note,
div.page_komentarji_anketa div#comment_question_note {
margin-bottom: 16px;

View File

@ -1,6 +1,16 @@
div.page_komentarji,
div.page_komentarji_anketa {
//Meni zgoraj
#additional_navigation {
display: flex;
justify-content: center;
#menu {
width: fit-content;
}
}
//Splošni komentarji
div#comment_question_note {