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/Branching.php | 4691 ++++++++++++++++++++++++++++---------------- 1 file changed, 2968 insertions(+), 1723 deletions(-) (limited to 'admin/survey/Branching.php') diff --git a/admin/survey/Branching.php b/admin/survey/Branching.php index 08ff025..6c48009 100644 --- a/admin/survey/Branching.php +++ b/admin/survey/Branching.php @@ -5,22 +5,8 @@ class Branching { var $anketa; // trenutna anketa var $grupa; // trenutna grupa var $spremenljivka; // trenutna spremenljivka - //var $SurveyAdmin = null; // globalna spremenljivka za SurveyAdmin // SurveyAdmin se nikjer vec ne klice iz Branchinga - - //var $sidebar; // ali prikazemo sidebar: 0-ne, 1-vprasanja, 2-library // sidebara nimamo vec - //var $collapsed_content; // ali prikazujemo vseibno IFa (ce ne se poklice z ajaxom) // to se bo pa mogoce se uporabil, pri skrivanju ifov, zaenkrat se pa ne var $skin = 0; - - // teh nastavitev se ne uporablja vec - // tele nastavitve so tudi v BranchingAjax in jih je treba tudi tam popravit! - - //var $maxIfCount = 0; // koliko ifov je meja za prikaz. Če je 0 prikeže vse - //var $autoRecount = 0; // ce je vec kot 50 spremenljivk nimamo avtomatskega prestevilcevanja - - //var $new = true; // spremenljivka za nov nacin prikaza ifov (s checkboxi), ker bo zihr treba se nazaj dajat... (v Branching.php in branching.js) - //var $full_screen_edit = false; // Ali editiramo v full screen nacinu - var $expanded = false; // ali prikazujemo anketo razsirjeno (prikazan predogled vprasanja) ali skrceno (samo 1 vrstica za vprasanje) var $db_table = ''; @@ -34,7 +20,7 @@ class Branching { var $prevajanje = false; var $imageadded = array(); - //$imageadded[$spremenljivka] = false; + /** * @desc konstruktor @@ -84,8 +70,7 @@ class Branching { SurveyInfo::getInstance()->SurveyInit($this->anketa); - if (SurveyInfo::getInstance()->getSurveyColumn('db_table') == 1) - $this->db_table = '_active'; + $this->db_table = SurveyInfo::getInstance()->getSurveyArchiveDBString(); UserSetting :: getInstance()->Init($global_user_id); @@ -102,7 +87,7 @@ class Branching { } /** - * @desc inicializacija branchinga (samo prvi�, na za�etku), prepi�e vrstni red iz normalenga urejanja + * @desc inicializacija branchinga (samo prvic, na zacetku), prepise vrstni red iz normalenga urejanja */ function init_branching () { @@ -147,44 +132,39 @@ class Branching { $gl = new Glasovanje($this->anketa); - //div z nastavitvami za glasovanje - echo '
'; - //$this->display_glasovanje_settings(); + // div z nastavitvami za glasovanje + echo '
'; + echo '
'; $gl->display_glasovanje_settings(); - echo '
'; + echo '
'; + echo '
'; echo '
'; - echo '
'; - - //$this->branching_struktura(); + echo '
'; $gl = new Glasovanje($this->anketa); $gl->vprasanja(); + echo '
'; // #branching - echo '
'; // #branching - - //$this->vprasanje_float_editing(); - echo '
'; + echo '
'; echo '
'; // #placeholder - - $this->toolbox(); } // Navadna anketa ali forma else{ + + Common::Init($this->anketa); + echo '
'; - echo '
'; - - Common::Init($this->anketa); + echo '
'; echo Common::checkStruktura(); $this->branching_struktura(); + echo '
'; - echo '
'; // #branching - - $this->vprasanje_float_editing(); + echo '
'; echo '
'; // #placeholder @@ -192,11 +172,11 @@ class Branching { } // forma in glasovanje - hitre nastavitve na desni - ce imamo odprto knjiznico ne prikazemo zaradi prekrivanja - if ( ($this->survey_type == 1 || $this->survey_type == 0) && ($row['toolbox'] < 3) ) { + if ( $this->survey_type == 1 || $this->survey_type == 0 ) { echo '
survey_type==0 ? ' class="glas_quick_settings"':'').'>'; - echo '
survey_type==0 ? ' class="glas_quick_settings"':'').'>'; + echo '
survey_type==0 ? ' class="glas_quick_settings"':'').'>'; $this->toolbox_settings(); - echo '
'; + echo '
'; echo '
'; } @@ -208,32 +188,8 @@ class Branching { } ?>'; - echo 'alert(document.getElementsByTagName("*").length);'; - echo '';*/ - - } - - - function vprasanje_float_editing () { - - echo '
'; - } - /** - * prikaze zgornji toolbox z nastavitvami - * - */ - /*function toolbox_nastavitve () { - - $row = SurveyInfo::getInstance()->getSurveyRow(); - - echo '
=3?' class="library"':'').'>'; - $this->display_toolbox_nastavitve(); - echo '
'; - }*/ /** * prikaze zgornji toolbox z nastavitvami @@ -259,49 +215,6 @@ class Branching { $full_view = (int)$row_query_fv['full_view'] == 1 ? true : false; $full_view = true; - echo '
'; - # skrčen / razširjen - if ($this->expanded) { - echo ''.$lang['srv_expanded_0_short'].' '; - $sqle = sisplet_query("SELECT count(*) AS c FROM srv_branching WHERE ank_id='$this->anketa'"); - $rowe = mysqli_fetch_array($sqle); - if ($rowe['c'] > 15 && !isset($_COOKIE['expanded'])) - echo ''.$lang['srv_expaned_text'].' '.$lang['srv_zapri'].''; - } else { - echo ''.$lang['srv_expanded_0_short'].' '; - } - echo Help::display('srv_branching_expanded'); - - echo '
'; - - - echo '
'; - - # find & replace - if ($row['locked'] == 0) { - echo ''; - } - - if ($row['locked'] == 0 && $full_view == true) { - echo ' '."\n"; - } - - # Hrošč je viden samo če imamo ife in razširjen pogled - if ($row['locked'] == 0 && $full_view == true) { // if ($row['flat'] == 0) - echo ' '."\n"; - } - - if ($row['locked'] == 0 && $full_view == true) { - echo '' . Help :: display('srv_grupe_recount_branching') ."\n"; - } - - if ($has_if == true && $full_view == true || ($has_if == true && $this->expanded == false)) { - echo ''."\n"; - echo ''."\n"; - } - - echo '
'; - // prikaz blokov kot zavihke echo '
'; $sql = sisplet_query("SELECT i.* FROM srv_if i, srv_branching b WHERE i.tab='1' AND i.tip='1' AND i.id=b.element_if AND b.ank_id='$this->anketa' ORDER BY b.parent, b.vrstni_red"); @@ -336,20 +249,20 @@ class Branching { * */ function toolbox () { - + $row = SurveyInfo::getInstance()->getSurveyRow(); - if($this->survey_type != 0) - $this->toolbox_basic2(); + echo '
'; + + $this->toolbox_basic2(); + + echo ''; - if ($row['toolbox'] >= 3) - $this->toolbox_library(); + // Predpregled tipa vprašanj + $this->getTipPreviewHtml(); + + echo '
'; - ?>anketa); @@ -367,96 +280,134 @@ class Branching { $this->survey_type = SurveyInfo::getInstance()->getSurveyColumn("survey_type"); $hierarhija = SurveyInfo::getInstance()->checkSurveyModule('hierarhija'); - // Toolbox napredne nastavitve (prestevilci, dodaj prelome, debug...) - if($this->survey_type > 1 && !SurveyInfo::getInstance()->checkSurveyModule('hierarhija') ){ - - echo '
'; - - echo ''; - - $this->toolbox_add_advanced_settings(); - - echo '
'; - } - - echo '
survey_type==1?' class="forma"':'').($hierarhija ? ' class="toolbox-hierarhija"' : '').'>'; + echo '
'; if ($row['locked'] == 1) { - // Ce ima uporabnik prepreceno moznost odklepanja ankete $d = new Dostop(); - if(($hierarhija && SurveyInfo::getSurveyModules('hierarhija') == 2) || $d->checkDostopSub('lock') && ($admin_type != 0 && $admin_type != 1)){ + + // Ce ima uporabnik prepreceno moznost odklepanja ankete + $prevent_unlock = 0; + if(SurveyInfo::getSurveyModules('hierarhija') == 2 || (!$d->checkDostopSub('lock') && $row['locked'] == 1 && $admin_type != 0 && $admin_type != 1)) + $prevent_unlock = 1; + + if($prevent_unlock == 1){ echo '
'; - echo ''; + echo ' '; echo '
'; } else{ - //echo '

'; echo '
'; - echo ''; + echo ' '; echo '
'; } if(!$hierarhija) { - echo '

'; - echo '

'; + echo '
'.$lang['srv_vprasanje_radio'].'
'; + echo '
'; + + echo '
'.$lang['srv_vprasanje_checkbox'].'
'; + echo '
'; } - echo '

'; - echo '

'; + echo '
'.$lang['srv_vprasanje_multigrid'].'
'; + echo '
'; - if(!$hierarhija) - echo '

'; + echo '
'.$lang['srv_vprasanje_text'].'
'; + echo '
'; - echo '

'; + if(!$hierarhija){ + echo '
'.$lang['srv_vprasanje_number'].'
'; + echo '
'; + } + + echo '
'.$lang['srv_vprasanje_label'].'
'; + echo '
'; if(!$hierarhija) { - echo '
'; + echo '
'.$lang['srv_mobile_add_question'].''; $this->toolbox_add_advanced(); echo '
'; + + echo '
'; } + // Knjiznica + echo '
'.$lang['srv_library'].'
'; + echo '
'; + // normalna anketa if ($this->survey_type != 1){ // Preverimo, ce je funkcionalnost v paketu, ki ga ima uporabnik $userAccess = UserAccess::getInstance($global_user_id); - echo '

'; - echo '

'; - } + echo '
'.$lang['srv_condition'].'
'; + echo '
'; + + echo '
'.$lang['srv_block_random_blocks'].'
'; + } + + // Pobrisana vprasanja + $vd = new VprasanjeDeleted($this->anketa); + $deleted_vrasanja_count = $vd->countDeletedVprasanja(); + echo '
'; + echo '
'.$lang['srv_deleted_vprasanja'].' ('.$deleted_vrasanja_count.')
'; } else { if(!$hierarhija) { - echo '

'; - echo '

'; + echo '
'.$lang['srv_vprasanje_radio'].'
'; + echo '
'; + + echo '
'.$lang['srv_vprasanje_checkbox'].'
'; + echo '
'; } - echo '

'; - echo '

'; + echo '
'.$lang['srv_vprasanje_multigrid'].'
'; + echo '
'; + + echo '
'.$lang['srv_vprasanje_text'].'
'; + echo '
'; - if(!$hierarhija) - echo '

'; + if(!$hierarhija){ + echo '
'.$lang['srv_vprasanje_number'].'
'; + echo '
'; + } - echo '

'; + echo '
'.$lang['srv_vprasanje_label'].'
'; + echo '
'; if(!$hierarhija) { - echo '
'; + echo '
'.$lang['srv_mobile_add_question'].''; $this->toolbox_add_advanced(); echo '
'; + + echo '
'; } + // Knjiznica + echo '
'.$lang['srv_library'].'
'; + echo '
'; + // normalna anketa if ($this->survey_type != 1){ // Preverimo, ce je funkcionalnost v paketu, ki ga ima uporabnik $userAccess = UserAccess::getInstance($global_user_id); - echo '

'; - echo '

'; + echo '
'.$lang['srv_condition'].'
'; + echo '
'; + + echo '
'.$lang['srv_block_random_blocks'].'
'; } + + // Pobrisana vprasanja + $vd = new VprasanjeDeleted($this->anketa); + $deleted_vrasanja_count = $vd->countDeletedVprasanja(); + echo '
'; + echo '
'.$lang['srv_deleted_vprasanja'].' ('.$deleted_vrasanja_count.')
'; } echo '
'; @@ -466,324 +417,1058 @@ class Branching { * prikaze popup z vsemi tipi vprasanj * */ - function toolbox_add_advanced() { + function toolbox_add_advanced($popup=false) { global $lang; global $site_url; global $admin_type; global $global_user_id; - $spr = $_POST['spr']; - $if = $_POST['if']; - $endif = $_POST['endif']; - + // Preverimo, ce je funkcionalnost v paketu, ki ga ima uporabnik $userAccess = UserAccess::getInstance($global_user_id); - echo '
'; - echo '

'.$lang['srv_add_question_type'].' '.Help::display('srv_toolbox_add_advanced').'

'; - echo '

'.$lang['srv_new_question_text'].'

'; + echo '
'; - echo ''; - echo ''; - echo ''; + // Naslov v oknu + echo '
'; + echo $lang['srv_add_question_type'].' '.Help::display('srv_toolbox_add_advanced'); + echo ''.$lang['srv_new_question_text'].''; + echo '
'; - echo '
'; - echo '

'.$lang['srv_sklop_osnovna2'].'

'; - echo '
'; + // Vsebina okna + echo '
'; - echo '

'.$lang['srv_vprasanje_tip_1'].'

'; - echo '

'.$lang['srv_vprasanje_tip_1'].' - '.$lang['srv_dropdown'].'

'; - echo '

'.$lang['srv_vprasanje_tip_2'].'

'; - echo '
'; - echo '

'.$lang['srv_vprasanje_tables'].'

'; - echo '
'; + // Segment kategorije + echo '
'; + echo '

'.$lang['srv_sklop_osnovna2'].'

'; - echo '

'.$lang['srv_classic'].'

'; - echo '

'.$lang['srv_diferencial2'].'

'; - echo '

'.$lang['srv_table_dropdown'].'

'; - echo '

'.$lang['srv_double_grid'].'

'; + echo '

'.$lang['srv_vprasanje_tip_1'].'

'; + echo '

'.$lang['srv_vprasanje_tip_1'].' - '.$lang['srv_dropdown'].'

'; + echo '

'.$lang['srv_vprasanje_tip_2'].'

'; - echo '
'; - echo '

'.$lang['srv_sklop_posebna'].'

'; - echo '
'; + echo '
'; - echo '

'.$lang['srv_vprasanje_tip_5'].'

'; - echo '

'.$lang['srv_vprasanje_tip_26'].'

'; - - echo '

'.$lang['srv_vprasanje_heatmap'].'

'; - - echo '

'.$lang['srv_vprasanje_tip_8'].'

'; - echo '

'.$lang['srv_vprasanje_tip_17'].'

'; - echo '

'.$lang['srv_vprasanje_tip_18'].'

'; + // Segment vnos + echo '
'; + echo '

'.$lang['srv_sklop_osnovna_vnos2'].'

'; - echo '
'; - echo '
'; + echo '

'.$lang['srv_vprasanje_tip_7'].'

'; + echo '

'.$lang['srv_vprasanje_tip_21'].'

'; + echo '

'.$lang['srv_number_insert_1'].'

'; - echo '

'.$lang['srv_sklop_osnovna_vnos2'].'

'; - echo '
'; + echo '
'; - echo '

'.$lang['srv_vprasanje_tip_7'].'

'; - echo '

'.$lang['srv_vprasanje_tip_21'].'

'; - echo '

'.$lang['srv_number_insert_1'].'

'; - echo '
'; - echo '

'.$lang['srv_sklop_tabele_ostale'].'

'; - echo '
'; + // Segment tabele + echo '
'; + echo '

'.$lang['srv_vprasanje_tables'].'

'; - echo '

'.$lang['srv_vprasanje_tip_16'].'

'; - echo '

'.$lang['srv_vprasanje_tip_20'].'

'; - echo '

'.$lang['srv_vprasanje_tip_19'].'

'; - echo '

'.$lang['srv_survey_table_multiple'].'

'; + echo '

'.$lang['srv_classic'].'

'; + echo '

'.$lang['srv_diferencial2'].'

'; + echo '

'.$lang['srv_table_dropdown'].'

'; + echo '

'.$lang['srv_double_grid'].'

'; - echo '
'; - echo '

'.$lang['srv_standardni_vnosi'].'

'; - echo '
'; + echo '
'; - echo '

'.$lang['email'].'

'; - echo '

'.$lang['url'].'

'; - echo '

'.$lang['srv_tip_standard_993'].'

'; - echo '

'.$lang['srv_vprasanje_tip_long_21_7'].'

'; - echo '

'.$lang['srv_captcha_edit'].'

'; - echo '

'.$lang['srv_gdpr'].'

'; - echo '
'; + // Segment ostale tabele + echo '
'; + echo '

'.$lang['srv_sklop_tabele_ostale'].'

'; + + echo '

'.$lang['srv_vprasanje_tip_16'].'

'; + echo '

'.$lang['srv_vprasanje_tip_20'].'

'; + echo '

'.$lang['srv_vprasanje_tip_19'].'

'; + + if(!$userAccess->checkUserAccess($what='question_type_multitable')){ + echo '
'; + } + echo '

'.$lang['srv_survey_table_multiple'].'

'; + if(!$userAccess->checkUserAccess($what='question_type_multitable')){ + echo '
'; + } - echo '
'; + echo '
'; - if (($lang['id'] == '1' || $lang['id'] == '2') && ($site_url == 'https://www.1ka.si/' || strpos($site_url, 'localhost') !== false ) ) { - echo '

'.$lang['srv_demografija'].'

'; - echo '
'; + // Segment posebna vprasanja + echo '
'; + echo '

'.$lang['srv_sklop_posebna'].'

'; - if ($lang['id'] == '1') { - echo '

'.$lang['srv_demografija_spol'].'

'; - echo '

'.$lang['srv_demografija_starost'].'

'; - echo '

'.$lang['srv_demografija_zakonski_stan'].'

'; - echo '

'.$lang['srv_demografija_status'].'

'; - echo '

'.$lang['srv_demografija_izobrazba'].'

'; - echo '

'.$lang['srv_demografija_lokacija'].'

'; - } + echo '

'.$lang['srv_vprasanje_tip_5'].'

'; + if(!$userAccess->checkUserAccess($what='question_type_location')){ + echo '
'; + } + echo '

'.$lang['srv_vprasanje_tip_26'].'

'; + echo '

'.$lang['srv_vprasanje_heatmap'].'

'; + if(!$userAccess->checkUserAccess($what='question_type_multitable')){ + echo '
'; + } + echo '

'.$lang['srv_vprasanje_tip_8'].'

'; - if ($lang['id'] == '2') { - echo '

'.$lang['srv_demografija_spol'].'

'; - echo '

'.$lang['srv_demografija_starost'].'

'; - echo '

'.$lang['srv_demografija_zakonski_stan'].'

'; - echo '

'.$lang['srv_demografija_status'].'

'; - echo '

'.$lang['srv_demografija_izobrazba'].'

'; - echo '

'.$lang['srv_demografija_lokacija'].'

'; - } + if(!$userAccess->checkUserAccess($what='question_type_ranking')){ + echo '
'; + } + echo '

'.$lang['srv_vprasanje_tip_17'].'

'; + echo '

'.$lang['srv_vprasanje_tip_18'].'

'; + if(!$userAccess->checkUserAccess($what='question_type_multitable')){ + echo '
'; } - echo '

'; - echo '

'; + echo '
'; - echo '
'; - echo '

'.$lang['srv_advanced_features'].'

'; - echo '
'; + + echo '
'; + echo '

'.$lang['srv_standardni_vnosi'].'

'; + + echo '

'.$lang['email'].'

'; + echo '

'.$lang['url'].'

'; + echo '

'.$lang['srv_tip_standard_993'].'

'; + echo '

'.$lang['srv_vprasanje_tip_long_21_7'].'

'; + echo '

'.$lang['srv_captcha_edit'].'

'; + echo '

'.$lang['srv_gdpr'].'

'; + + echo '
'; + + + echo '
'; + echo '

'.$lang['srv_advanced_features'].'

'; + + if(!$userAccess->checkUserAccess($what='question_type_calculation')){ + echo '
'; + } // Kalkulacija - echo '

'.$lang['srv_vprasanje_tip_22'].'

'; + echo '

'.$lang['srv_vprasanje_tip_22'].'

'; // Kvota - echo '

'.$lang['srv_vprasanje_tip_25'].'

'; + echo '

'.$lang['srv_vprasanje_tip_25'].'

'; // Loop - echo '

'.$lang['srv_zanka'].'

'; + echo '

'.$lang['srv_zanka'].'

'; // Signature - echo '

'.$lang['srv_signature_edit'].'

'; + echo '

'.$lang['srv_signature_edit'].'

'; + + // Chat (nagovor z gumbom za vklop chata) - ce je vklopljen modul chat if (SurveyInfo::getInstance()->checkSurveyModule('chat')){ - echo '

'.$lang['srv_vprasanje_tip_5_2'].'

'; + echo '

'.$lang['srv_vprasanje_tip_5_2'].'

'; } // Socialna omrezja if (SurveyInfo::getInstance()->checkSurveyModule('social_network')){ - echo '

'.$lang['srv_vprasanje_tip_9'].'

'; + echo '

'.$lang['srv_vprasanje_tip_9'].'

'; } elseif(!$userAccess->checkUserAccess($what='question_type_signature')){ - echo '

'.$lang['srv_vprasanje_tip_9'].'

'; + echo '

'.$lang['srv_vprasanje_tip_9'].'

'; } else{ - echo '

checkUserAccess($what='question_type_signature') ? 'class="user_access_locked"' : '').'"> '.$lang['srv_vprasanje_tip_9'].'

'; + echo '

checkUserAccess($what='question_type_signature') ? 'class="user_access_locked"' : '').'">'.$lang['srv_vprasanje_tip_9'].'

'; } - echo '
'; + if(!$userAccess->checkUserAccess($what='question_type_calculation')){ + echo '
'; + } - //echo ''.$lang['srv_zapri'].''; + echo '
'; echo '
'; - } - /** - * prikaze popup z vsemi tipi vprasanj - * - */ - function toolbox_add_advanced_settings() { - global $lang; - global $admin_type; - global $site_url; - global $global_user_id; - echo '
'; + if($popup){ + echo '
'; + echo ' '; + echo '
'; - echo ''.$lang['srv_advanced_settings_title'].''; + // Klik izven okna - zapremo okno + echo ''; + } - # preverimo ali imamo ife. Če so, izpisujemo vse ikonce - $sql_select = "SELECT count(*) AS if_count FROM srv_branching WHERE element_if > 0 AND ank_id = '".$this->anketa."'"; - $sql_query = sisplet_query($sql_select); - $row_query = mysqli_fetch_array($sql_query); - $has_if = (int)$row_query['if_count'] > 0 ? true : false; - # ali prikazujemo vse ikonice ali samo "simpl" ikonice - $sql_select_fv = "SELECT count(*) AS full_view FROM srv_user_setting_for_survey WHERE sid='".$this->anketa."' AND uid='".$global_user_id."' AND what='display_full_toolbox' AND value='1'"; - $sql_query_fv = sisplet_query($sql_select_fv); - $row_query_fv = mysqli_fetch_array($sql_query_fv); - $full_view = (int)$row_query_fv['full_view'] == 1 ? true : false; - $full_view = true; + echo '
'; + } - // Razsiri / skrci - if($this->survey_type > 1){ - if($this->expanded) { - echo '

'; - echo ''; - echo ''; - echo $lang['srv_expand_0']; - echo ''; - echo '

'; - } - else { - echo '

'; - echo ''; - echo ''; - echo $lang['srv_expand_1']; - echo ''; - echo '

'; - } - } + /** + * preview + * + */ + private function getTipPreviewHtml(){ + global $lang; + global $global_user_id; - if ($has_if == true/* && $full_view == true || ($has_if == true && $this->expanded == false)*/) { - echo '

'; - echo ''.$lang['srv_expand'].''."\n"; - echo ''.$lang['srv_collapse'].''."\n"; - echo '

'; - } - # find & replace - if ($row['locked'] == 0) { - echo '

'; - echo ''.$lang['srv_find_replace_words'].''; - echo '

'; - } + // Predpregled tipa vprašanj - prikazujemo samo kadar smo v urejanju ankete + if (!$this->anketa > 0) + return; - if ($row['locked'] == 0 && $full_view == true) { - echo '

'; - echo ''.$lang['srv_pagebreak_all'].' '."\n"; - echo '

'; - } + if ( ($_GET['a'] != '' || !isset($_GET['anketa'])) && $_GET['a'] != 'branching' ) + return; - # Hrošč je viden samo če imamo ife in razširjen pogled - if ($row['locked'] == 0 && $full_view == true) { // if ($row['flat'] == 0) - echo '

'; - echo ''.$lang['srv_check_pogoji'].' '."\n"; - echo '

'; - } - if ($row['locked'] == 0 && $full_view == true) { - echo '

'; - echo ''.$lang['srv_grupe_recount_branching'].'' . Help :: display('srv_grupe_recount_branching') ."\n"; - echo '

'; - } + echo '
'; - // Knjiznica na desni - if ($row['locked'] == 0) { - if($row['toolbox'] >= 3){ - echo '

'; - echo ''.$lang['srv_library_hide'].''; - echo '

'; - } - else{ - echo '

'; - echo ''.$lang['srv_library_show'].''; - echo '

'; - } - } - - echo '
'; - // prikaz blokov kot zavihke - /*echo '
'; - $sql = sisplet_query("SELECT i.* FROM srv_if i, srv_branching b WHERE i.tab='1' AND i.tip='1' AND i.id=b.element_if AND b.ank_id='$this->anketa' ORDER BY b.parent, b.vrstni_red"); - if (!$sql) echo mysqli_error($GLOBALS['connect_db']); - $i = 0; - while ($row = mysqli_fetch_array($sql)) { - if ($i++ != 0) echo ' | '; - $label = ($row['label'] == ''?$lang['srv_blok'].' ('.$row['number'].')':$row['label']); - echo '

'; - echo ''.$label.' '; - echo '

'; - } - echo '
';*/ - } + // Preverimo, ce je funkcionalnost v paketu, ki ga ima uporabnik + $userAccess = UserAccess::getInstance($global_user_id); - /** - * prikaz knjiznice v toolboxu na levi strani - * - */ - function toolbox_library () { - global $lang; + // tip 9999 - IF + echo '
'; + echo '' . $lang['srv_new_question_icon'] . ''; + echo '
'; + echo $lang['srv_toolbox_if']; + echo '
'; + if(!$userAccess->checkUserAccess($what='if')){ + $userAccess->displayNoAccessText($what='if'); + } + echo '
'; - $row = SurveyInfo::getInstance()->getSurveyRow(); + // tip 9998 - Block + echo '
'; + echo '' . $lang['srv_new_question_icon'] . ''; + echo '
'; + echo $lang['srv_toolbox_block']; + echo '
'; + if(!$userAccess->checkUserAccess($what='block')){ + $userAccess->displayNoAccessText($what='block'); + } + echo '
'; - //glede na to kje smo se nahajali se vrnemo (na osnovne oz napredne moznosti) - //$row['toolbox'] == 3 ? $preklop = 1 : $preklop = 2; + // tip 9997 - Loop + echo '
'; + echo '' . $lang['srv_new_question_icon'] . ''; + echo '
'; + echo $lang['srv_toolbox_loop']; + echo '
'; + if(!$userAccess->checkUserAccess($what='loop')){ + $userAccess->displayNoAccessText($what='loop'); + } + echo '
'; - echo '
'; - //echo '

'.$lang['srv_nazajnavprasanja'].'

'; + // tip 1_1 - radio + echo '
'; + echo '' . $lang['srv_new_question_icon'] . ''; + echo '
'; + echo '
' . $lang['srv_tip_sample_t1'] . '
'; + echo '
' . $lang['srv_tip_sample_t1_o1'] . '
'; + echo '
' . $lang['srv_tip_sample_t1_o2'] . '
'; + echo '
' . $lang['srv_tip_sample_t1_o3'] . '
'; + echo '
'; + echo '
'; + + // tip 1_10 - gdpr + echo '
'; + echo '' . $lang['srv_new_question_icon'] . ''; + echo '
'; + echo '
' . $lang['srv_gdpr_intro_title'] . '

'; + echo '
' . $lang['srv_gdpr_intro'] . '.
'.$lang['srv_gdpr_intro4'].'
'; + echo '
' . $lang['srv_gdpr_intro_no'] . '
'; + echo '
' . $lang['srv_gdpr_intro_yes'] . '
'; + echo '
'; + echo '
'; + // tip 1 - radio (horizontalno) + echo '
'; + echo '' . $lang['srv_new_question'] . ''; + echo '
'; + echo '
' . $lang['srv_tip_sample_t1'] . ' ' . $lang['srv_tip_sample_t1_o1'] . ' ' . $lang['srv_tip_sample_t1_o2'] . '
'; + echo '
'; + echo '
'; - //zgornja navigacija toolboxa - /*echo ''; - echo ''; - //echo ''; - echo ''; - echo '
'.$lang['srv_novaspremenljivka'].''.$lang['srv_advanced'].''.$lang['srv_library'].'
';*/ + // tip 1_2 - radio (horizontalno - nova vrstica) + echo '
'; + echo '' . $lang['srv_new_question'] . ''; + echo '
'; + echo '
' . $lang['srv_tip_sample_t1'] . '
'; + echo '
' . $lang['srv_tip_sample_t1_o1'] . ' ' . $lang['srv_tip_sample_t1_o2'] . ' ' . $lang['srv_tip_sample_t1_o3'] . '
'; + echo '
'; + echo '
'; - if ($row['locked'] == 1) { + // tip 1_5 - radio potrditev + echo '
'; + echo '' . $lang['srv_new_question'] . ''; + echo '
'; + echo '
' . $lang['srv_tip_sample_t1_5'] . '
'; + echo '
'; + echo '
'; + echo '
'; - //echo '

'.$lang['srv_anketa_locked_1'].'

'; - echo '

'; - echo ' '.$lang['srv_anketa_locked_1']; - echo '

'; + // tip 1_6 - select box + echo '
'; + echo '
'; + echo '
' . $lang['srv_tip_sample_t3'] . '
'; + echo '
'; + echo '
'; + echo '
'; - } else { + // tip 1_8 - Drag-drop + echo '
'; + echo '
'; + echo '
' . $lang['srv_tip_sample_t1'] . '
'; - echo '
'; - $l = new Library(); - $l->display(); - echo '
'; - } + echo '
'; + echo '
' . $lang['srv_tip_sample_t1_o1'] . '
'; + echo '
' . $lang['srv_tip_sample_t1_o2'] . '
'; + echo '
' . $lang['srv_tip_sample_t1_o3'] . '
'; + echo '
'; - echo '
'; - } + echo '
'; + echo '
'; + echo '
'; + echo '
'; + + echo '
'; + echo '
'; + + // tip 1_9 - custom radio picture + echo '
'; + echo '
'; + + echo '
' . $lang['srv_tip_sample_t1'] . '
'; + // star + echo '
'; + for ($i = 1; $i < 4; $i++) { + echo '
'; + } + echo '
'; + + // thumb + echo '
'; + for ($i = 1; $i < 4; $i++) { + echo '
'; + } + echo '
'; + + //smiley + echo '
'; + for ($i = 1; $i < 4; $i++) { + echo '
'; + } + echo '
'; + + // heart + echo '
'; + for ($i = 1; $i < 4; $i++) { + echo '
'; + } + echo '
'; + + // flag + echo '
'; + for ($i = 1; $i < 4; $i++) { + echo '
'; + } + echo '
'; + + // user + echo '
'; + for ($i = 1; $i < 4; $i++) { + echo '
'; + } + echo '
'; + + echo '
'; + echo '
'; + + // tip 1_10 - Image HotSpot + echo '
'; + echo '
'; + echo '
' . $lang['srv_hotspot_preview_text_radio'] . '
'; + echo '
'; + echo '
'; + echo '
'; + + // tip 1_11 - Vizualna anlaogna skala + echo '
'; + echo '
'; + echo '
' . $lang['srv_tip_sample_t1'] . '
'; + + echo '
'; + for ($i = 1; $i < 7; $i++) { + echo '
+ +
'; + } + echo '
'; + + echo '
'; + echo '
'; + + + // tip 2 - checkbox + echo '
'; + echo '' . $lang['srv_new_question_icon'] . ''; + echo '
'; + echo '
' . $lang['srv_tip_sample_t2'] . '
'; + echo '
' . $lang['srv_tip_sample_t2_o1'] . '
'; + echo '
' . $lang['srv_tip_sample_t2_o2'] . '
'; + echo '
' . $lang['srv_tip_sample_t2_o3'] . '
'; + echo '
'; + echo '
'; + + // tip 2_1 - check(horizontalno) + echo '
'; + echo '' . $lang['srv_new_question'] . ''; + echo '
'; + echo '
' . $lang['srv_tip_sample_t2'] . ' ' . $lang['srv_tip_sample_t2_o2'] . ' ' . $lang['srv_tip_sample_t2_o3'] . '
'; + echo '
'; + echo '
'; + + // tip 2_2 - check (horizontalno - nova vrstica) + echo '
'; + echo '' . $lang['srv_new_question'] . ''; + echo '
'; + echo '
' . $lang['srv_tip_sample_t2'] . '
'; + echo '
' . $lang['srv_tip_sample_t2_o1'] . ' ' . $lang['srv_tip_sample_t2_o2'] . ' ' . $lang['srv_tip_sample_t2_o3'] . '
'; + echo '
'; + echo '
'; + + // tip 2_8 - Drag-drop + echo '
'; + echo '' . $lang['srv_new_question'] . ''; + echo '
'; + echo '
' . $lang['srv_tip_sample_t1'] . '
'; + + echo '
'; + echo '
' . $lang['srv_tip_sample_t1_o1'] . '
'; + echo '
' . $lang['srv_tip_sample_t1_o2'] . '
'; + echo '
' . $lang['srv_tip_sample_t1_o3'] . '
'; + echo '
'; + + echo '
'; + echo '
'; + echo '
'; + echo '
'; + + echo '
'; + echo '
'; + + // tip 2_10 - Image HotSpot + echo '
'; + // echo '
Primer tipa vprašanj: label.
'; + //echo '' . $lang['srv_new_question'] . ''; + echo '
'; + echo '
' . $lang['srv_hotspot_preview_text_checkbox'] . '
'; + echo '
'; + echo '
'; + echo '
'; + + // tip 3 - select + echo '
'; + // echo '
Primer tipa vprašanj: select.
'; + echo '' . $lang['srv_new_question'] . ''; + echo '
'; + echo '
' . $lang['srv_tip_sample_t3'] . '
'; + echo '
'; + echo '
'; + echo '
'; + + // tip 21 - besedilo* + echo '
'; + echo '' . $lang['srv_new_question_icon'] . ''; + echo '
'; + echo '
' . $lang['srv_tip_sample_t21'] . '
'; + echo '
'; + echo '
'; + echo '
'; + + // tip 21_1 - cpatcha + echo '
'; + echo '' . $lang['srv_new_question'] . ''; + echo '
'; + echo '
' . $lang['srv_tip_sample_t21_1_o1'] . '
'; + echo '
'; + echo '
'; + echo '
'; + echo '
'; + + // tip 21_2 - email + echo '
'; + echo '' . $lang['srv_new_question'] . ''; + echo '
'; + echo '
'.$lang['srv_tip_sample_t21_2_o1'].' ('.$lang['srv_email_example'].')
'; + echo '
'; + echo '
' . $lang['srv_email_example_txt'] . '
'; + echo '
'; + echo '
'; + + // tip 21_3 - url + echo '
'; + echo '' . $lang['srv_new_question'] . ''; + echo '
'; + echo '
' . $lang['srv_tip_sample_t21_3_o1'] . '
'; + echo '
(' . $lang['srv_url_example'] . ')
'; + echo '
'; + echo '
'; + echo '
'; + + // tip 21_4 - upload + echo '
'; + echo '' . $lang['srv_new_question'] . ''; + echo '
'; + echo '
' . $lang['srv_tip_sample_t21_4_o1'] . '
'; + echo '
'; + echo '
'; + echo '
'; + + // tip 21_5 - textbox box + echo '
'; + echo '' . $lang['srv_new_question'] . ''; + echo '
'; + echo '
' . $lang['srv_tip_sample_t21'] . '
'; + echo '
'; + echo '
'; + echo '
'; + + // tip 21_6 - elektronski podpis + echo '
'; + echo '' . $lang['srv_new_question'] . ''; + echo '
'; + echo '
' . $lang['srv_tip_sample_t21_6'] . '
'; + echo '
'; + echo '
'; + echo '
'.$lang['srv_signature_clear'].'
'; + echo '
'; + echo ' '.$lang['srv_signature_name'].''; + echo ' '; + echo '
'; + if(!$userAccess->checkUserAccess($what='question_type_signature')){ + $userAccess->displayNoAccessText($what='question_type_signature'); + } + echo '
'; + + // tip 21_7 - fotografija + echo '
'; + echo '' . $lang['srv_new_question'] . ''; + echo '
'; + echo '
' . $lang['srv_tip_sample_t21_7'] . '
'; + echo '
'; + echo '
'; + echo '
'; + + // tip 5 - label + echo '
'; + echo '' . $lang['srv_new_question_icon'] . ''; + echo '
'; + echo '
' . $lang['srv_tip_sample_t5'] . '
'; + echo '
'; + echo '
'; + + // tip 5_2 - nagovor za aktivacijo chata + echo '
'; + echo '' . $lang['srv_new_question'] . ''; + echo '
'; + echo '
' . $lang['srv_chat_question_text'] . '
'; + echo '
'.$lang['srv_chat_turn_on'].'
'; + echo '
'; + echo '
'; + + // tip 26 - lokacija + echo '
'; + echo '' . $lang['srv_new_question_icon'] . ''; + echo '
'; + echo '
' . $lang['srv_tip_sample_t26_1'] . '
'; + echo '
'; + echo '
'; + if(!$userAccess->checkUserAccess($what='question_type_location')){ + $userAccess->displayNoAccessText($what='question_type_location'); + } + echo '
'; + + // tip 26_2 - multi lokacija + echo '
'; + echo '' . $lang['srv_new_question_icon'] . ''; + echo '
'; + echo '
' . $lang['srv_tip_sample_t26_2'] . '
'; + echo '
'; + echo '
'; + if(!$userAccess->checkUserAccess($what='question_type_location')){ + $userAccess->displayNoAccessText($what='question_type_location'); + } + echo '
'; + + // tip 26_1 - moja lokacija + echo '
'; + echo '' . $lang['srv_new_question_icon'] . ''; + echo '
'; + echo '
' . $lang['srv_tip_sample_t26_1'] . '
'; + echo '
'; + echo '
'; + if(!$userAccess->checkUserAccess($what='question_type_location')){ + $userAccess->displayNoAccessText($what='question_type_location'); + } + echo '
'; + + // tip 6 - multigrid + echo '
'; + echo '' . $lang['srv_new_question_icon'] . ''; + echo '
'; + + echo '
' . $lang['srv_tip_sample_t6'] . '
'; + echo '
 
' . $lang['srv_tip_sample_t6_o1'] . '' . $lang['srv_tip_sample_t6_o2'] . ' ' . $lang['srv_tip_sample_t6_o3'] . '
'; + echo '
'; + echo '
' . $lang['srv_tip_sample_t6_v1'] . '
'; + echo '
'; + echo '
' . $lang['srv_tip_sample_t6_v2'] . '
'; + echo '
'; + echo '
' . $lang['srv_tip_sample_t6_v3'] . '
'; + echo '
'; + + echo '
'; + echo '
'; + + // tip 6_1 - multigrid (semanticni diferencial) + echo '
'; + echo '' . $lang['srv_new_question'] . ''; + echo '
'; + + echo '
' . $lang['srv_tip_sample_t61'] . ':
'; + echo '
 
123
'; + echo '
'; + echo '
' . $lang['srv_tip_sample_t61_v1x'] . '
' . $lang['srv_tip_sample_t61_v1y'] . '
'; + echo '
'; + echo '
' . $lang['srv_tip_sample_t61_v2x'] . '
' . $lang['srv_tip_sample_t61_v2y'] . '
'; + echo '
'; + echo '
' . $lang['srv_tip_sample_t61_v3x'] . '
' . $lang['srv_tip_sample_t61_v3y'] . '
'; + echo '
'; + + echo '
'; + echo '
'; + + // tip 6_2 - multigrid (dropdown) + echo '
'; + echo '' . $lang['srv_new_question'] . ''; + echo '
'; + + echo '
' . $lang['srv_tip_sample_t6'] . '
'; + echo '
' . $lang['srv_tip_sample_t6_v1'] . '
'; + echo '
'; + echo '
' . $lang['srv_tip_sample_t6_v2'] . '
'; + echo '
'; + echo '
' . $lang['srv_tip_sample_t6_v3'] . '
'; + echo '
'; + + echo '
'; + echo '
'; + + // tip 6_3 - multigrid (double grid) + echo '
'; + echo '' . $lang['srv_new_question'] . ''; + echo '
'; + + echo '
' . $lang['srv_tip_sample_t6'] . '
'; + echo '
 
' . $lang['srv_tip_sample_t6_v1'] . '' . $lang['srv_tip_sample_t6_v3'] . '
'; + echo '
'; + + echo '
 
' . $lang['srv_tip_sample_t6_o1'] . '' . $lang['srv_tip_sample_t6_o2'] . '' . $lang['srv_tip_sample_t6_o3'] . ' ' . $lang['srv_tip_sample_t6_o1'] . '' . $lang['srv_tip_sample_t6_o2'] . '' . $lang['srv_tip_sample_t6_o3'] . '
'; + echo '
'; + echo '
www.xxx.si
'; + echo '
'; + echo '
www.yyy.si
'; + echo '
'; + echo '
www.zzz.si
'; + echo '
'; + + echo '
'; + echo '
'; + + + // tip 6_4 - multigrid (one against another) + echo '
'; + echo '' . $lang['srv_new_question'] . ''; + echo '
'; + + echo '
' . $lang['srv_tip_sample_t6_4'] . '
'; + echo '
'; + echo '
' . $lang['srv_tip_sample_t6_4_v1'] . '
' . $lang['srv_tip_sample_t6_4_vmes'] . '' . $lang['srv_tip_sample_t6_4_v2'] . '
'; + echo '
'; + echo '
' . $lang['srv_tip_sample_t6_4_v1'] . '
' . $lang['srv_tip_sample_t6_4_vmes'] . '' . $lang['srv_tip_sample_t6_4_v3'] . '
'; + echo '
'; + echo '
' . $lang['srv_tip_sample_t6_4_v3'] . '
' . $lang['srv_tip_sample_t6_4_vmes'] . '' . $lang['srv_tip_sample_t6_4_v2'] . '
'; + echo '
'; + + echo '
'; + echo '
'; + + // tip 6_5 - multigrid (max diff) + echo '
'; + echo '' . $lang['srv_new_question'] . ''; + echo '
'; + + echo '
' . $lang['srv_tip_sample_t6_5'] . '
'; + echo '
 
' . $lang['srv_tip_sample_t6_5_c1'] . '
 
' . $lang['srv_tip_sample_t6_5_c2'] . '
'; + echo '
'; + echo '
 
' . $lang['srv_tip_sample_t6_5_v1'] . '
'; + echo '
'; + echo '
 
' . $lang['srv_tip_sample_t6_5_v2'] . '
'; + echo '
'; + echo '
 
' . $lang['srv_tip_sample_t6_5_v3'] . '
'; + echo '
'; + echo '
 
' . $lang['srv_tip_sample_t6_5_v4'] . '
'; + echo '
'; + + echo '
'; + echo '
'; + + // tip 6_6 - multigrid (select box) + echo '
'; + echo '' . $lang['srv_new_question'] . ''; + echo '
'; + + echo '
' . $lang['srv_tip_sample_t6_6'] . '
'; + echo '
' . $lang['srv_tip_sample_t6_6_v1'] . '
'; + echo '
'; + echo '
' . $lang['srv_tip_sample_t6_6_v2'] . '
'; + echo '
'; + echo '
' . $lang['srv_tip_sample_t6_6_v3'] . '
'; + echo '
'; + echo '
' . $lang['srv_tip_sample_t6_6_v4'] . '
'; + echo '
'; + + echo '
'; + echo '
'; + + // tip 6_8 - multigrid (Tabela Da/Ne) + echo '
'; + echo '' . $lang['srv_new_question_icon'] . ''; + echo '
'; + + echo '
' . $lang['srv_tip_sample_t6'] . '
'; + echo '
 
' . $lang['srv_tip_sample_t6_8_o1'] . '' . $lang['srv_tip_sample_t6_8_o2'] . '
'; + echo '
'; + echo '
' . $lang['srv_tip_sample_t6_v1'] . '
'; + echo '
'; + echo '
' . $lang['srv_tip_sample_t6_v2'] . '
'; + echo '
'; + echo '
' . $lang['srv_tip_sample_t6_v3'] . '
'; + echo '
'; + + echo '
'; + echo '
'; + + // tip 6_9 - Drag-drop + echo '
'; + echo '' . $lang['srv_new_question'] . ''; + + echo '
'; + + echo '
' . $lang['srv_tip_sample_t6'] . '
'; + + echo '
'; + echo '


'; + echo '
' . $lang['srv_tip_sample_t6_v1'] . '
'; + echo '
' . $lang['srv_tip_sample_t6_v2'] . '
'; + echo '
' . $lang['srv_tip_sample_t6_v3'] . '
'; + echo '
'; + + echo '
'; + echo '
'; + echo '
    '; + + echo '
  • +
    ' . $lang['srv_tip_sample_t6_o1'] . '
    +
  • '; //izpis "naslova" okvirja + echo '
  • +
    +
  • ' . "\n"; //izpis okvirja + echo '
  • +
    ' . $lang['srv_tip_sample_t6_o2'] . '
    +
  • '; //izpis "naslova" okvirja + echo '
  • +
    +
  • ' . "\n"; //izpis okvirja + echo '
  • +
    ' . $lang['srv_tip_sample_t6_o3'] . '
    +
  • '; //izpis "naslova" okvirja + echo '
  • +
    +
  • ' . "\n"; //izpis okvirja + echo '
'; + echo '
'; + echo '
'; + + echo '
'; + + echo '
'; + echo '
'; + + // tip 6_10 - Image HotSpot + echo '
'; + echo '
'; + echo '
' . $lang['srv_hotspot_preview_text_radio_grid'] . '
'; + echo '
'; + echo '
'; + echo '
'; + + // tip 16 - multicheckbox + echo '
'; + echo '' . $lang['srv_new_question'] . ''; + echo '
'; + echo '
' . $lang['srv_tip_sample_t16'] . '
'; + echo '
 
' . $lang['srv_tip_sample_t16_o1'] . '' . $lang['srv_tip_sample_t16_o2'] . ' ' . $lang['srv_tip_sample_t16_o3'] . '
'; + echo '
'; + echo '
' . $lang['srv_tip_sample_t16_v1'] . '
'; + echo '
'; + echo '
' . $lang['srv_tip_sample_t16_v2'] . '
'; + echo '
'; + echo '
' . $lang['srv_tip_sample_t16_v3'] . '
'; + echo '
'; + echo '
'; + echo '
'; + + // tip 19 - multitext + echo '
'; + echo '' . $lang['srv_new_question'] . ''; + echo '
'; + echo '
' . $lang['srv_tip_sample_t19'] . '
'; + echo '
 
' . $lang['srv_tip_sample_t19_o1'] . '' . $lang['srv_tip_sample_t19_o2'] . '' . $lang['srv_tip_sample_t19_o3'] . '
'; + echo '
'; + echo '
' . $lang['srv_tip_sample_t19_v1'] . '
'; + echo '
'; + echo '
' . $lang['srv_tip_sample_t19_v2'] . '
'; + echo '
'; + echo '
'; + echo '
'; + + // tip 20 - multinumber + echo '
'; + echo '' . $lang['srv_new_question'] . ''; + echo '
'; + echo '
' . $lang['srv_tip_sample_t20'] . '
'; + echo '
 
' . $lang['srv_tip_sample_t20_o1'] . '' . $lang['srv_tip_sample_t20_o2'] . '' . $lang['srv_tip_sample_t20_o3'] . '
'; + echo '
'; + echo '
' . $lang['srv_tip_sample_t20_v1'] . '
'; + echo '
'; + echo '
' . $lang['srv_tip_sample_t20_v2'] . '
'; + echo '
'; + echo '
' . $lang['srv_tip_sample_t20_v3'] . '
'; + echo '
'; + echo '
'; + echo '
'; + + // tip 7 - number + echo '
'; + echo '' . $lang['srv_new_question_icon'] . ''; + echo '
'; + echo '
' . $lang['srv_tip_sample_t7'] . '
'; + echo '
' . $lang['srv_tip_sample_t7_o1'] . '
'; + echo '
'; + echo '
'; + + // tip 7_2 - slider + echo '
'; + echo '' . $lang['srv_new_question_icon'] . ''; + echo '
'; + echo '
' . $lang['srv_tip_sample_t7_2'] . '
'; + echo '
'; + echo '
'; + echo '
'; + + // tip 8 - datum + echo '
'; + echo '' . $lang['srv_new_question'] . ''; + echo '
'; + echo '
' . $lang['srv_tip_sample_t8'] . '
'; + echo '
'; + echo '
'; + echo '
'; + + // tip 17 - Razvrščanje prestavljanje (default) + echo '
'; + echo '' . $lang['srv_new_question'] . ''; + echo '
'; + echo '
' . $lang['srv_tip_sample_t17'] . '
'; + + echo '
'; + echo '
'; + echo '
' . $lang['srv_tip_sample_t17_o1'] . '
'; + echo '
' . $lang['srv_tip_sample_t17_o2'] . '
'; + echo '
' . $lang['srv_tip_sample_t17_o3'] . '
'; + echo '
'; + + echo '
'; + echo '
1.
'; + echo '
2.
'; + echo '
3.
'; + echo '
'; + echo '
'; + + echo '
'; + if(!$userAccess->checkUserAccess($what='question_type_ranking')){ + $userAccess->displayNoAccessText($what='question_type_ranking'); + } + echo '
'; + + // tip 171 - Razvrščanje ostevilcevanje (design = 1) + echo '
'; + echo '' . $lang['srv_new_question'] . ''; + echo '
'; + echo '
' . $lang['srv_tip_sample_t171'] . '
'; + + echo '
' . $lang['srv_tip_sample_t171_o1'] . '
'; + echo '
'; + echo '
' . $lang['srv_tip_sample_t171_o2'] . '
'; + echo '
'; + echo '
' . $lang['srv_tip_sample_t171_o3'] . '
'; + echo '
'; + + echo '
'; + if(!$userAccess->checkUserAccess($what='question_type_ranking')){ + $userAccess->displayNoAccessText($what='question_type_ranking'); + } + echo '
'; + + // tip 172 - Razvrščanje premikanje (design = 2) + echo '
'; + echo '' . $lang['srv_new_question'] . ''; + echo '
'; + echo '
' . $lang['srv_tip_sample_t172'] . '
'; + echo '
 
' . $lang['srv_tip_sample_t172_o1'] . '
 
'; + echo '
'; + echo '
 
' . $lang['srv_tip_sample_t172_o2'] . '
 
'; + echo '
'; + echo '
 
' . $lang['srv_tip_sample_t172_o3'] . '
 
'; + echo '
'; + echo '
'; + if(!$userAccess->checkUserAccess($what='question_type_ranking')){ + $userAccess->displayNoAccessText($what='question_type_ranking'); + } + echo '
'; + + // tip 18 - vsota + echo '
'; + echo '' . $lang['srv_new_question'] . ''; + echo '
'; + echo '
' . $lang['srv_tip_sample_t18'] . '
'; + echo '
' . $lang['srv_tip_sample_t18_o1'] . '
'; + echo '
' . $lang['srv_tip_sample_t18_o2'] . '
'; + echo '
' . $lang['srv_tip_sample_t18_o3'] . '
'; + echo '
' . $lang['srv_tip_sample_t18_o4'] . '
'; + echo '
'; + if(!$userAccess->checkUserAccess($what='question_type_sum')){ + $userAccess->displayNoAccessText($what='question_type_sum'); + } + echo '
'; + + // tip 24 - Kombinirana tabela + echo '
'; + echo '' . $lang['srv_new_question_icon'] . ''; + echo '
'; + echo $lang['srv_survey_table_multiple']; + echo '
'; + if(!$userAccess->checkUserAccess($what='question_type_multitable')){ + $userAccess->displayNoAccessText($what='question_type_multitable'); + } + echo '
'; + + // tip 27 - Heatmap + echo '
'; + echo '' . $lang['srv_new_question_icon'] . ''; + echo '
'; + echo $lang['srv_vprasanje_heatmap']; + echo '
'; + if(!$userAccess->checkUserAccess($what='question_type_heatmap')){ + $userAccess->displayNoAccessText($what='question_type_heatmap'); + } + echo '
'; + + // tip 22 - Kalkulacija + echo '
'; + echo '' . $lang['srv_new_question_icon'] . ''; + echo '
'; + echo $lang['srv_vprasanje_tip_long_22']; + echo '
'; + if(!$userAccess->checkUserAccess($what='question_type_calculation')){ + $userAccess->displayNoAccessText($what='question_type_calculation'); + } + echo '
'; + + // tip 25 - Kvota + echo '
'; + echo '' . $lang['srv_new_question_icon'] . ''; + echo '
'; + echo $lang['srv_vprasanje_tip_long_25']; + echo '
'; + if(!$userAccess->checkUserAccess($what='question_type_quota')){ + $userAccess->displayNoAccessText($what='question_type_quota'); + } + echo '
'; + + // tip 9 - SN-imena + echo '
'; + echo '' . $lang['srv_new_question'] . ''; + echo '
'; + echo '
' . $lang['srv_tip_sample_t9'] . ':
'; + echo '
'; + echo '
' . $lang['srv_add_field'] . '
'; + echo '
'; + if(!$userAccess->checkUserAccess($what='social_network')){ + $userAccess->displayNoAccessText($what='social_network'); + } + echo '
'; + + // tip 9_1 - SN-imena - fiksno st. polj + echo '
'; + echo '' . $lang['srv_new_question'] . ''; + echo '
'; + echo '
' . $lang['srv_tip_sample_t9'] . ':
'; + echo '
'; + echo '
'; + echo '
'; + echo '
'; + echo '
'; + echo '
'; + echo '
'; + + // tip 9_2 - SN-imena - 1 textbox + echo '
'; + echo '' . $lang['srv_new_question'] . ''; + echo '
'; + echo '
' . $lang['srv_tip_sample_t9'] . ':
'; + echo '
'; + echo '
'; + echo '
'; + + // tip 9_3 - SN-imena - vnos stevila polj + echo '
'; + echo '' . $lang['srv_new_question'] . ''; + echo '
'; + echo '
' . $lang['srv_tip_sample_t9'] . ':
'; + echo '
' . $lang['srv_design_count'] . ':
'; + echo '
'; + echo '
'; + echo '
'; + echo '
'; + echo '
'; + + echo '
'; // tip_preview + } /** * hitre nastavitve - na dnu pri formi * */ - function toolbox_settings ($status1='none', $status2='none') { + function toolbox_settings ($status1='none') { global $lang; global $admin_type; - $row = Cache::srv_spremenljivka($row2['spr_id']); $rowA = SurveyInfo::getInstance()->getSurveyRow(); SurveySetting::getInstance()->Init($this->anketa); @@ -791,7 +1476,7 @@ class Branching { $emailDiv = SurveySetting::getInstance()->getSurveyMiscSetting('srvtoolbox_form_email'); - //OBVESCANJE + // OBVESCANJE $sqlAlert = sisplet_query("SELECT * FROM srv_alert WHERE ank_id = '$this->anketa'"); if (!$sqlAlert) echo mysqli_error($GLOBALS['connect_db']); @@ -799,52 +1484,50 @@ class Branching { $rowAlert['finish_other'] == 1 || ($rowAlert['finish_other_emails'] && $rowAlert['finish_other'] != 0) ? $checked = true : $checked = false; - echo '

'; - $alertDiv == 1 ? $obvescanje = 0 : $obvescanje = 1; - echo ''; + $alertDiv == 1 ? $obvescanje = 0 : $obvescanje = 1; + - $img = ($status1 == 'none') ? ' class="faicon icon-blue plus"' : ' class="faicon icon-blue minus"'; - echo ' '; + echo '

'; - echo '' . $lang['srv_alert_link_form'] . ''; - echo '

'; - //echo '
'; $sas = new SurveyAdminSettings(); echo '
'; // avtor ankete oz osebe z dostopom - echo '

'; - echo ''; + echo '

'; + echo ''; + echo ' '; $sas->display_alert_label('finish_author',($rowAlert['finish_author'] == 1), true); - echo '

'; + echo ' '; + echo '
'; // posebej navedeni maili - echo '

'; - - echo '

'; - echo ''; - echo ''; - echo '

'; - - //respondent iz cms - /*echo '

'; - echo ''; - $sas->display_alert_label('finish_respondent_cms',($rowAlert['finish_respondent_cms'] == 1), true); - echo '

';*/ - - //respondent - echo '

'; - echo ''; - echo ''; + echo '

'; + echo ' '; + + echo '
'; + echo ' '; + echo ' '; + echo '
'; + + echo '
'; + + // respondent + echo '
'; + echo ' '; + echo ' '; $sas->display_alert_label('finish_respondent',($rowAlert['finish_respondent'] == 1), true); - echo '

'; + echo ' '; + echo '
'; - echo ''.$lang['srv_detail_settings'].''; + echo ''; - echo '
'; + echo '
'; } /** @@ -862,28 +1545,28 @@ class Branching { echo '
'; if ($lang['id'] == '1') { - echo '

check_demografija_exists('XSPOL')?'checked':'').' value="XSPOL" id="XSPOL">

'; - echo '

check_demografija_exists('XSTAR2a4')?'checked':'').' value="XSTAR2a4" id="XSTAR2a4">

'; - echo '

check_demografija_exists('XZST1surs4')?'checked':'').' value="XZST1surs4" id="XZST1surs4">

'; + echo '

check_demografija_exists('XSPOL')?'checked':'').' value="XSPOL" id="XSPOL">

'; + echo '

check_demografija_exists('XSTAR2a4')?'checked':'').' value="XSTAR2a4" id="XSTAR2a4">

'; + echo '

check_demografija_exists('XZST1surs4')?'checked':'').' value="XZST1surs4" id="XZST1surs4">

'; echo '
'; - echo '

check_demografija_exists('XDS2a4')?'checked':'').' value="XDS2a4" id="XDS2a4">

'; - echo '

check_demografija_exists('XIZ1a2')?'checked':'').' value="XIZ1a2" id="XIZ1a2">

'; - echo '

check_demografija_exists('XLOKACREGk')?'checked':'').' value="XLOKACREGk" id="XLOKACREGk">

'; + echo '

check_demografija_exists('XDS2a4')?'checked':'').' value="XDS2a4" id="XDS2a4">

'; + echo '

check_demografija_exists('XIZ1a2')?'checked':'').' value="XIZ1a2" id="XIZ1a2">

'; + echo '

check_demografija_exists('XLOKACREGk')?'checked':'').' value="XLOKACREGk" id="XLOKACREGk">

'; //echo '

'; } if ($lang['id'] == '2') { - echo '

check_demografija_exists('XSEX')?'checked':'').' value="XSEX" id="XSEX">

'; - echo '

check_demografija_exists('XAGE')?'checked':'').' value="XAGE" id="XAGE">

'; - echo '

check_demografija_exists('XMRSTS')?'checked':'').' value="XMRSTS" id="XMRSTS">

'; + echo '

check_demografija_exists('XSEX')?'checked':'').' value="XSEX" id="XSEX">

'; + echo '

check_demografija_exists('XAGE')?'checked':'').' value="XAGE" id="XAGE">

'; + echo '

check_demografija_exists('XMRSTS')?'checked':'').' value="XMRSTS" id="XMRSTS">

'; echo '
'; - echo '

check_demografija_exists('XSTS')?'checked':'').' value="XSTS" id="XSTS">

'; - echo '

check_demografija_exists('XEDU')?'checked':'').' value="XEDU" id="XEDU">

'; - echo '

check_demografija_exists('XLOC')?'checked':'').' value="XLOC" id="XLOC">

'; //echo '

'; + echo '

check_demografija_exists('XSTS')?'checked':'').' value="XSTS" id="XSTS">

'; + echo '

check_demografija_exists('XEDU')?'checked':'').' value="XEDU" id="XEDU">

'; + echo '

check_demografija_exists('XLOC')?'checked':'').' value="XLOC" id="XLOC">

'; //echo '

'; } echo '
'; @@ -964,6 +1647,7 @@ class Branching { */ function branching_struktura () { global $lang; + global $global_user_id; // naenkrat preberemo vse spremenljivke, da ne delamo queryja vsakic posebej Cache::cache_all_srv_spremenljivka($this->anketa, true); @@ -974,36 +1658,157 @@ class Branching { // cache vseh spremenljivk //$this->find_all_spremenljivka(); - #$this->survey_type = SurveyAdmin::getSurvey_type($this->anketa); - $this->survey_type = SurveyInfo::getInstance()->getSurveyColumn("survey_type"); + #$this->survey_type = SurveyAdmin::getSurvey_type($this->anketa); + $this->survey_type = SurveyInfo::getInstance()->getSurveyColumn("survey_type"); + + //$this->toolbox_nastavitve(); + + + // prikaz blokov kot zavihke + $sqlB = sisplet_query("SELECT i.* FROM srv_if i, srv_branching b WHERE i.tab='1' AND i.tip='1' AND i.id=b.element_if AND b.ank_id='$this->anketa' ORDER BY b.parent, b.vrstni_red"); + if (!$sqlB) echo mysqli_error($GLOBALS['connect_db']); + + if(mysqli_num_rows($sqlB) > 0){ + + echo '
'; + + // Zavihek VSI + echo '

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

'; + + // Ostali zavihki + while ($rowB = mysqli_fetch_array($sqlB)) { + echo ' | '; + $label = ($rowB['label'] == '' ? $lang['srv_blok'].' ('.$rowB['number'].')' : $rowB['label']); + echo '

'; + echo ''.$label.' '; + echo '

'; + } + + echo '
'; + } + + // Napredne nastavitve v sredini zgoraj + echo '
'; + + echo '
'; + + $url0 = "'" . "index.php?anketa=".$this->anketa."&a=branching&change_mode=1&what=expanded&value=0" . "'"; + $url1 = "'" . "index.php?anketa=".$this->anketa."&a=branching&change_mode=1&what=expanded&value=1" . "'"; + + echo '
'; + // Razširi + echo '
'; + //echo ''; + echo ''; + echo ''.$lang['srv_expand'].''; + echo '
'; + + //echo '
'; + + //Skrči + echo '
'; + echo ''.$lang['srv_collapse'].''; + echo '
'; + + echo '
';// settings group + + // Napredne nastavitve dropdown + $row = SurveyInfo::getInstance()->getSurveyRow(); + # preverimo ali imamo ife. Če so, izpisujemo vse ikonce + $sql_select = "SELECT count(*) AS if_count FROM srv_branching WHERE element_if > 0 AND ank_id = '".$this->anketa."'"; + $sql_query = sisplet_query($sql_select); + $row_query = mysqli_fetch_array($sql_query); + $has_if = (int)$row_query['if_count'] > 0 ? true : false; + + # ali prikazujemo vse ikonice ali samo "simpl" ikonice + $sql_select_fv = "SELECT count(*) AS full_view FROM srv_user_setting_for_survey WHERE sid='".$this->anketa."' AND uid='".$global_user_id."' AND what='display_full_toolbox' AND value='1'"; + $sql_query_fv = sisplet_query($sql_select_fv); + $row_query_fv = mysqli_fetch_array($sql_query_fv); + $full_view = (int)$row_query_fv['full_view'] == 1 ? true : false; + $full_view = true; + + #odpri vse - zapri vse bloki + if ($has_if == true && $full_view == true || ($has_if == true && $this->expanded == false)) { + echo '
'; + //echo ''.$lang['srv_expand_colapse'].': '; + + echo '
'; + echo ''; + echo ''.$lang['srv_expand_open'].''; + echo '
'; + + echo '
'; + echo ''; + echo ''.$lang['srv_collapse_close'].''; + echo '
'; + echo '
';// settings group + } + echo '
'; + + echo '
'; - //$this->toolbox_nastavitve(); - - - // prikaz blokov kot zavihke - $sqlB = sisplet_query("SELECT i.* FROM srv_if i, srv_branching b WHERE i.tab='1' AND i.tip='1' AND i.id=b.element_if AND b.ank_id='$this->anketa' ORDER BY b.parent, b.vrstni_red"); - if (!$sqlB) echo mysqli_error($GLOBALS['connect_db']); - - if(mysqli_num_rows($sqlB) > 0){ - - echo '
'; + echo '
'; + // Arhiviraj - ENKLIK ARHIV + echo '
'; + echo ''; + echo ''.$lang['srv_analiza_arhiviraj'].''; + echo '
'; + + if ($row['locked'] == 0) { + echo '
'; - // Zavihek VSI - echo '

'; - echo ''.$lang['srv_vsi'].' '; - echo '

'; + echo '
'; + echo ''; + echo '
'; - // Ostali zavihki - while ($rowB = mysqli_fetch_array($sqlB)) { - echo ' | '; - $label = ($rowB['label'] == '' ? $lang['srv_blok'].' ('.$rowB['number'].')' : $rowB['label']); - echo '

'; - echo ''.$label.' '; + echo '

'; + + # find & replace + echo '

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

'; + + if ($full_view == true) { + #prelom strani + echo '

'; + echo ''.$lang['srv_pagebreak_all'].' '."\n"; + echo '

'; + + # Hrošč je viden samo če imamo ife in razširjen pogled + //if ($row['flat'] == 0) + echo '

'; + echo ''.$lang['srv_check_pogoji'].' '."\n"; + echo '

'; + + #prestevilci + echo '

'; + echo ''.$lang['srv_grupe_recount_branching'].'' . Help :: display('srv_grupe_recount_branching') ."\n"; echo '

'; } - + echo '
'; - } + echo '
'; + } + + + //Klik izven razprith nastavitev - zapremo okno + echo ''; + + echo '
'; // settings group + echo '
'; // left settings + echo '
'; //top_center_settings echo '
    '; @@ -1019,11 +1824,14 @@ class Branching { // napis uvod na začetku echo '
  • '; - echo ''.$lang['srv_intro_page'].''; + echo '
    '; + echo '
    '.$lang['srv_intro_page'].'
    '; + echo '
    '; + echo '
    '; echo '
  • '; echo '
  • '; - echo ''; + echo '
    '; echo '
  • '; // Ce imamo slucajno GDPR preduvod @@ -1040,7 +1848,7 @@ class Branching { echo ''; echo '
  • '; - echo ''; + echo '
    '; echo '
  • '; } } @@ -1063,13 +1871,14 @@ class Branching { echo '
  • '; - echo '
    '.$lang['srv_new_survey_success2'].'
    '; + echo '
    '.$lang['srv_new_survey_success'].'
    '; - echo '
    '; - printf ($lang['srv_new_survey_success3'], 'index.php?anketa='.$this->anketa.'&a=branching&change_mode=1&what=toolbox&value=3'); - echo '
    '; + echo '
    '; + echo ' '; + echo ' '; + echo '
    '; - MobileSurveyAdmin::displayNoQuestions($this->anketa); + MobileSurveyAdmin::displayNoQuestions($this->anketa); echo '
  • '; } @@ -1077,9 +1886,10 @@ class Branching { if ($first > 0) { + // Uvodni element (pri formi ga ni) if ($this->survey_type != 1) { echo '
  • '; - echo ''; + echo '
    '; echo '
  • '; $first = $this->find_first_spr(); @@ -1087,37 +1897,53 @@ class Branching { // Zaenkrat imamo vedno isti text za strani if ($first > 0){ - /*$gr = $this->getGrupa4Spremenljivka($first);*/ $gr = $this->getGrupa4Spremenljivka($first); $naslov = $lang['srv_stran'].' '.$gr['vrstni_red']; } else $naslov = $lang['srv_stran'].' 1'; - echo ''.$naslov.''; + echo '
    '; + echo '
    '.$naslov.'
    '; + echo '
    '; + echo '
    '; + echo ''; } echo '
  • '; - echo ''; + echo '
    '; echo '
  • '; } + // Dodani elementi v anketi (vprasanja, pogoji...) foreach (Cache::srv_branching_parent($this->anketa, $parent) AS $k => $rowQ) { $this->display_element($rowQ['element_spr'], $rowQ['element_if']); } - // zakljucek - pri formi ga ni + // Gumb za dodajanje vprasanja + if ($first > 0 && !$this->locked) { + echo '
  • '; + echo '
    '; + echo ' '; + echo '
    '; + echo '
  • '; + } + + // Zakljucek - pri formi ga ni if ($this->survey_type != 1) { // napis zakljucek prikazemo tukaj in ne za zadnjo spremenljivko da je lepse echo '
  • '; - echo ''.$lang['srv_end_page'].''; + echo '
    '; + echo '
    '.$lang['srv_end_page'].'
    '; + echo '
    '; + echo '
    '; echo '
  • '; echo '
  • '; - echo ''; + echo '
    '; echo '
  • '; echo '
  • '; @@ -1180,18 +2006,17 @@ class Branching { global $lang; $row = SurveyInfo::getInstance()->getSurveyRow(); - #$this->survey_type = SurveyAdmin::getSurvey_type($this->anketa); $this->survey_type = SurveyInfo::getInstance()->getSurveyColumn("survey_type"); if ($row['flat'] == 0) - $zamik = ( $this->level($spremenljivka,0) > 0 ? ' style="padding-left:'.(10+$this->level($spremenljivka,0)*20).'px"' : '' ); + $zamik = ( $this->level($spremenljivka,0) > 0 ? ' style="padding-left:'.($this->level($spremenljivka,0)*32).'px"' : '' ); else $zamik = ''; $row = Cache::srv_spremenljivka($spremenljivka); $row1 = Cache::srv_branching($spremenljivka, 0); - echo '
  • '; + echo '
  • '; if ($this->expanded) { $this->vprasanje($spremenljivka); } else { @@ -1199,76 +2024,75 @@ class Branching { } echo '
  • '; - //echo '
  • '; if ($this->pagebreak($spremenljivka)) { + $gr = $this->getGrupa4Spremenljivka($this->find_next_spr($spremenljivka)); + if ($gr['id'] > 0) { echo '
  • '; - echo ''; + echo '
    '; echo '
  • '; // ++ zadnji pagebreak prikazan izven ifa // // ce je spremenljivka zadnja v IFu, ne prikazemo PB, ker ga bomo za ENDIFom $rows = Cache::srv_branching($spremenljivka, 0); if ( $this->find_last_in_if($rows['parent']) != $spremenljivka ) { - echo '
  • '; - //echo ''.$gr['naslov'].''; - echo ''.$lang['srv_stran'].' '.$gr['vrstni_red'].''; + + echo '
  • '; + echo '
    '; + echo '
    '.$lang['srv_stran'].' '.$gr['vrstni_red'].'
    '; + echo '
    '.$lang['srv_rem_pagebreak'].'
    '; + echo '
    '; + echo '
    '; echo '
  • '; + echo '
  • '; - echo ''; + echo '
    '; echo '
  • '; } - // -- zadnji pagebreak prikazan izven ifa // - } elseif($this->survey_type != 1) { + + } + // -- zadnji pagebreak prikazan izven ifa // + elseif($this->survey_type != 1) { echo '
  • '; - echo ''; + echo '
    '; echo '
  • '; - - /*echo '
  • '; - echo ''.$lang['srv_end_label'].''; - echo '
  • '; - - echo '
  • '; - echo ''; - echo '
  • ';*/ } - } elseif ($spremenljivka == $this->find_last_spr() && $this->survey_type != 1) { // zadnja spremenljivka - zakljucek + } + elseif ($spremenljivka == $this->find_last_spr() && $this->survey_type != 1) { // zadnja spremenljivka - zakljucek echo '
  • '; - echo ''; + echo '
    '; echo '
  • '; - /*echo '
  • '; - echo ''.$lang['srv_end_label'].''; - echo '
  • '; - - echo '
  • '; - echo ''; - echo '
  • ';*/ - - } elseif ($this->survey_type != 1) { //pri formi ne dovolimo dodajanja page-breakov + } + // pri formi ne dovolimo dodajanja page-breakov + elseif ($this->survey_type != 1) { // tuki pustimo, da se PB lahko dodaja za spremenljivko in za ifom (pol se prikaze za ifom) // -- v zadnji spremenljivki za ifom ne prikazemo dodajanja $rows = Cache::srv_branching($spremenljivka, 0); if ( $this->find_last_in_if($rows['parent']) != $spremenljivka ) { echo '
  • '; - echo ''; + echo '
    '; + echo '
    '.$lang['srv_add_pagebreak'].'
    '; + echo '
    '; + echo '
    '; echo '
  • '; - } else { // zadnji spremenljivki v ifu izpisemo PB izven ifa (da je bolj pregledno in lepse) + } + // zadnji spremenljivki v ifu izpisemo PB izven ifa (da je bolj pregledno in lepse) + else { echo '
  • '; - echo ''; + echo '
    '; echo '
  • '; } - } elseif ($this->survey_type == 1) { // forma + } + // forma + elseif ($this->survey_type == 1) { echo '
  • '; echo '
  • '; } - - //echo ''; - } function display_if_label($if) { @@ -1282,7 +2106,7 @@ class Branching { if ($rowb['tip'] == 0) { $this->conditions_display($if); } elseif ($rowb['tip'] == 1) { - echo 'BLOCK ('.$rowb['number'].')'.($rowb['enabled']==2?' FALSE ':'').($rowb['label']!=''?' ( '.$rowb['label'].' )':'').''; + echo 'BLOCK ('.$rowb['number'].')'.($rowb['enabled']==2?' FALSE ':'').($rowb['label']!=''?' ( '.$rowb['label'].' )':'').''; } elseif ($rowb['tip'] == 2) { $this->loop_display($if); } @@ -1299,7 +2123,7 @@ class Branching { $rowb = Cache::srv_if($if); if ($row['flat'] == 0) - $zamik = ( $this->level(0,$if) > 0 ? ' style="padding-left:'.(10+$this->level(0,$if)*20).'px"' : '' ); + $zamik = ( $this->level(0,$if) > 0 ? ' style="padding-left:'.($this->level(0,$if)*32).'px"' : '' ); else $zamik = ''; @@ -1308,7 +2132,7 @@ class Branching { // plusminus if ($row['flat'] == 0) - echo ''; + echo ''; $this->display_if_label($if); @@ -1333,28 +2157,41 @@ class Branching { $sqle = sisplet_query("SELECT ank_id, parent, element_spr, element_if FROM srv_branching WHERE parent='{$rowi['parent']}' AND vrstni_red>'{$rowi['vrstni_red']}' AND ank_id='$this->anketa'"); - if ($rows['pagebreak'] == 1 AND (mysqli_num_rows($sqle)>0 || $rowi['parent']==0) ) { + if (isset($rows['pagebreak']) && $rows['pagebreak'] == 1 AND (mysqli_num_rows($sqle)>0 || $rowi['parent']==0) ) { $gr = $this->getGrupa4Spremenljivka($this->find_next_spr($spr)); if ($gr['id'] > 0) { - echo '
  • '; - echo ''; + echo '
  • '; + echo '
    '; echo '
  • '; - echo '
  • '; - echo ''.$lang['srv_stran'].' '.$gr['vrstni_red'].''; + + echo '
  • '; + echo '
    '; + echo '
    '.$lang['srv_stran'].' '.$gr['vrstni_red'].'
    '; + echo '
    '.$lang['srv_rem_pagebreak'].'
    '; + echo '
    '; + echo '
    '; echo '
  • '; } - } // zadnji spremenljivki v ifu, tudi dodamo PB izven pagebreaka (da se doda, tam kjer se potem prikaže) - if ($rows['pagebreak'] == 0 AND (mysqli_num_rows($sqle)>0 || $rowi['parent']==0) ) { + // ce gre za zadnji if v anketi ne pustimo dodajanja page breaka + if (isset($rows['pagebreak']) && $rows['pagebreak'] == 0 + && (mysqli_num_rows($sqle) > 0 || $rowi['parent'] == 0) + && ($if != $this->find_last_if_branching()) + ){ + echo '
  • '; - echo ''; + echo '
    '; + echo '
    '.$lang['srv_add_pagebreak'].'
    '; + echo '
    '; + echo '
    '; echo '
  • '; - } else { + } + else { echo '
  • '; echo '
  • '; } @@ -1370,8 +2207,8 @@ class Branching { $rowb = Cache::srv_if($if); if ($row['flat'] == 0) { - $zamik = ($this->level(0, $if) > 0 ? ' style="padding-left:' . (10 + $this->level(0, $if) * 20) . 'px"' : ''); - $zaklepaj = ($this->level(0, $if) > 0 ? 'margin-left:-' . (10 + $this->level(0, $if) * 20) . 'px;width:' . (15 + $this->level(0, $if) * 20) . 'px;' : ''); + $zamik = ($this->level(0, $if) > 0 ? ' style="padding-left:' . ($this->level(0, $if) * 32) . 'px"' : ''); + $zaklepaj = ($this->level(0, $if) > 0 ? 'margin-left:-' . ($this->level(0, $if) * 32) . 'px;width:' . ($this->level(0, $if) * 32) . 'px;' : ''); } else { $zamik = ''; @@ -1386,11 +2223,12 @@ class Branching { } echo '
  • '; - echo ''.($rowb['tip']==0?'ENDIF':($rowb['tip']==1?'ENDBLOCK':'ENDLOOP')).' ('.$rowb['number'].')'."\n\r"; + echo ''.($rowb['tip']==0?'ENDIF':($rowb['tip']==1?'ENDBLOCK':'ENDLOOP')).' ('.$rowb['number'].')'."\n\r"; // Dodajanje komentarjev na if/blok if ($this->displayKomentarji !== false) { - $this->if_komentarji($if, $rowb['tip']); + $sc = new SurveyComments($this->anketa); + $sc->display_if_komentarji($if, $rowb['tip']); } echo '
  • '; @@ -1423,15 +2261,15 @@ class Branching { // Kvota if($tip == 25){ $SQ = new SurveyQuotas($this->anketa); - echo '('.$variable.') '.$SQ->quota_display(-$spremenljivka).' ( '.$lang['srv_vprasanje_tip_long_'.$row['tip']].' )'; + echo '('.$variable.') '.$SQ->quota_display(-$spremenljivka).' ('.$lang['srv_vprasanje_tip_long_'.$row['tip']].')'; } // Kalkulacija else if($tip == 22){ - echo '('.$variable.') '.$this->calculations_display(-$spremenljivka).' ( '.$lang['srv_vprasanje_tip_long_'.$row['tip']].' )'; + echo '('.$variable.') '.$this->calculations_display(-$spremenljivka).' ('.$lang['srv_vprasanje_tip_long_'.$row['tip']].')'; } // Navadne spremenljivke else{ - echo '('.$variable.') '.$spanred.skrajsaj(strip_tags($naslov), 80).($spanred!=''?'':'').' ( '.$lang['srv_vprasanje_tip_long_'.$row['tip']].' )'; + echo '('.$variable.') '.$spanred.skrajsaj(strip_tags($naslov), 80).($spanred!=''?'':'').' ('.$lang['srv_vprasanje_tip_long_'.$row['tip']].')'; } } @@ -1450,6 +2288,13 @@ class Branching { global $site_url; $row = Cache::srv_spremenljivka($spremenljivka); + + // novi missingi - vse tabele razen kombinirane + //dodatne missing vrednosti (ne vem, zavrnil...) + # preberemo iz class.SurveyMissingValues + $smv = new SurveyMissingValues($this->anketa); + # katere missinge imamo na voljo + $missing_values = $smv->GetUnsetValuesForSurvey(); $this->prevajanje = $prevajanje; @@ -1461,9 +2306,10 @@ class Branching { save('lang_id', $this->lang_id); $rowl = \App\Controllers\LanguageController::srv_language_spremenljivka($spremenljivka); - if (strip_tags($rowl['naslov']) != '') $row['naslov'] = $rowl['naslov']; - if (strip_tags($rowl['info']) != '') $row['info'] = $rowl['info']; - if ($rowl['vsota'] != '') $row['vsota'] = $rowl['vsota']; + + if (isset($rowl['naslov']) && strip_tags($rowl['naslov']) != '') $row['naslov'] = $rowl['naslov']; + if (isset($rowl['info']) && strip_tags($rowl['info']) != '') $row['info'] = $rowl['info']; + if (isset($rowl['vsota']) && $rowl['vsota'] != '') $row['vsota'] = $rowl['vsota']; } $this->survey_type = SurveyInfo::getInstance()->getSurveyColumn("survey_type"); @@ -1497,13 +2343,15 @@ class Branching { $string = ''; // statusi: reminder, timer, in še kaj if ($row['sistem'] == 1) - $string = $string . $lang['srv_system_text'] . ' | '; + $string .= ''.$lang['srv_system_text'].''; if ($row['visible'] == 0) - $string .= $lang['srv_hidden_text'] . ' | '; + $string .= ''.$lang['srv_hidden_text'].''; if ($row['dostop'] != 4) { - $string = $string . $lang['srv_visible_dostop'].' '; + + $string .= ''.$lang['srv_visible_dostop'].' '; + switch ($row['dostop']) { case 3: $string .= strtolower($lang['see_registered']); break; @@ -1514,65 +2362,62 @@ class Branching { case 0; $string .= strtolower($lang['see_admin']); break; } - $string .= ' | '; + $string .= ''; } if ($row['reminder'] > 0) { if ($row['reminder'] == 1) { - // echo ''.$lang['srv_reminder_soft'].''; - $string = $string . $lang['srv_reminder_soft']; - } else { - // echo ''.$lang['srv_reminder_hard'].''; - $string = $string . $lang['srv_reminder_hard']; + $string .= ''.$lang['srv_reminder_soft'].''; + } + else { + $string .= ''.$lang['srv_reminder_hard'].''; } - $string = $string . ' | '; } $sqlv = sisplet_query("SELECT spr_id, if_id FROM srv_validation WHERE spr_id = '$spremenljivka'"); if (mysqli_num_rows($sqlv) > 0) { - $string = $string . $lang['srv_validation']; - $string = $string . ' | '; + $string .= ''.$lang['srv_validation'].''; } if ($row['timer'] > 0) { - $string = $string . $lang['srv_timer_on_time']; - $string = $string . (substr(bcdiv($row['timer'], 60), 0, 4)) . '' . $lang['srv_minutes'] . ' '; - $string = $string . (bcmod($row['timer'], 60)) . '' . $lang['srv_seconds'] . ''; - $string = $string . ' | '; + $string .= ''.$lang['srv_timer_on_time']; + $string .= (substr(bcdiv($row['timer'], 60), 0, 4)) . '' . $lang['srv_minutes'] . ' '; + $string .= (bcmod($row['timer'], 60)) . '' . $lang['srv_seconds'] . ''; + $string .= ''; } //izrišemo še ostale statuse: statistika, orientacija, sortiranje if ($row['tip'] <= 3 && $row['stat'] && $this->survey_type != 0) { - $string = $string . $lang['srv_stat_on'] . ' | '; + $string .= ''.$lang['srv_stat_on'].''; } // Status orentacije - navadna vprasanja if((in_array($row['tip'], array('1', '2', '21', '7', '8')) && $row['orientation'] != '1') || ($row['tip'] == '3' && $row['orientation'] == '1')){ - $string .= $this->getVprasanjeOrientationString($row['tip'], $row['orientation']) . ' | '; + $string .= ''.$this->getVprasanjeOrientationString($row['tip'], $row['orientation']) . ''; } // Status orentacije - tabele elseif(in_array($row['tip'], array('6', '16')) && $row['enota'] != '0'){ - $string .= $this->getVprasanjeOrientationString($row['tip'], $row['enota']) . ' | '; + $string .= ''.$this->getVprasanjeOrientationString($row['tip'], $row['enota']) . ''; } if ($row['tip'] == 1 && $row['hidden_default'] == 1) { - $string = $string . $lang['srv_potrditev'] . ' | '; + $string .= ''.$lang['srv_potrditev'].''; } if ($row['random']) { $arrayRandomText = array ( - 0 => $lang['srv_random_off'], - 1 => $lang['srv_random_on'], - 2 => $lang['srv_sort_asc'], - 3 => $lang['srv_sort_desc'] + 0 => $lang['srv_random_off'], + 1 => $lang['srv_random_on'], + 2 => $lang['srv_sort_asc'], + 3 => $lang['srv_sort_desc'] ); - $string = $string . $arrayRandomText[$row['random']] . ' | '; + $string .= ''.$arrayRandomText[$row['random']].''; } //skriti checkboxi if ($row['checkboxhide'] != 0) - $string = $string . $lang['srv_checkboxhide_disabled'] . ' | '; + $string .= ''.$lang['srv_checkboxhide_disabled'].''; // Kljucavnica ce je vprasanje zaklenjeno if($question_locked){ @@ -1580,22 +2425,20 @@ class Branching { } // Ce je zaklenjeno ampak ga lahko ureja ker je admin ali avtor elseif($row['locked']){ - $string = $string . $lang['srv_locked_text'] . ' | '; + $string .= ''.$lang['srv_locked_text'].''; } // Ce je onemogoceno vprasanje $disabled_vprasanje = $spremenljivkaParams->get('disabled_vprasanje') ? $spremenljivkaParams->get('disabled_vprasanje') : 0; if($disabled_vprasanje){ - $string = $string . $lang['srv_disabled_text'] . ' | '; + $string .= ''.$lang['srv_disabled_text'].''; } - //zbrisemo zadnji "|" iz niza - $string = substr($string, 0, -7); - $string = '' . $string . ''; echo $string; echo '
'; + echo '
'; // - spremenljivka_settings // --- Zgornja vrstica pri editiranju vprasanj --> @@ -1614,12 +2457,12 @@ class Branching { // kalkulacija if ($row['tip'] == 22) { - $row['naslov'] = ''.$this->calculations_display(-$spremenljivka).' ( '.$lang['srv_vprasanje_tip_long_'.$row['tip']].' )'; + $row['naslov'] = ''.$this->calculations_display(-$spremenljivka).' ('.$lang['srv_vprasanje_tip_long_'.$row['tip']].')'; } // Kvota else if($row['tip'] == 25){ $SQ = new SurveyQuotas($this->anketa); - $row['naslov'] = ''.$SQ->quota_display(-$spremenljivka).' ( '.$lang['srv_vprasanje_tip_long_'.$row['tip']].' )'; + $row['naslov'] = ''.$SQ->quota_display(-$spremenljivka).' ('.$lang['srv_vprasanje_tip_long_'.$row['tip']].')'; } // Inline ifi so disablani ce nimamo ustreznega paketa @@ -1627,14 +2470,6 @@ class Branching { echo '
'; - if ( in_array($row['tip'], array(1,2,6,16,19,20)) ) { - if ($row['enota'] != 10 && $row['orientation'] != 10){ - echo ''; - - MobileSurveyAdmin::displayAddQuestionCategory($this->anketa, $spremenljivka, $row['tip']); - } - } - // kalkulacija if ($row['tip'] == 22) { echo '
'; @@ -1666,13 +2501,13 @@ class Branching { @include($file); } else{ - echo '
lang_id!=null ? ' default="1"':'').'>'; + echo '
lang_id!=null ? ' default="1"':'').'>'; echo $row['naslov']; echo '
'; } if ($row['info'] != '') - echo '
lang_id!=null ? ' default="1"':'').'>' . $row['info'] . '
'; + echo '
lang_id!=null ? ' default="1"':'').'>' . $row['info'] . '
'; echo ''; @@ -1696,7 +2531,7 @@ class Branching { else{ echo' '; } @@ -1716,7 +2551,7 @@ class Branching { else{ echo' '; } @@ -1737,7 +2572,7 @@ class Branching { else{ echo' '; } @@ -1757,7 +2592,7 @@ class Branching { else{ echo' '; } @@ -1766,11 +2601,14 @@ class Branching { } - echo '
'; + $leftmargin = (($row['tip'] <= 2 && $row['orientation'] == 10) || ($row['tip'] == 1 && ($row['orientation'] == 9 || $row['orientation'] == 11))) + ? ' left11' : ''; + + echo '
'; // radio, checkbox, select if ($row['tip'] <= 3) { - + if ($row['tip'] == 3 || $row['orientation'] == 6) echo '
'; @@ -1829,6 +2667,8 @@ class Branching { $num = mysqli_num_rows($sql1); $size = $num * 50; + echo '
'; + //zaslon razdelimo na dva dela - izris leve strani echo '
'; @@ -1865,47 +2705,57 @@ class Branching { //echo '
'; echo '
'; // Ikona za upload slike - echo ' '; + echo ' '; echo ''; - echo ' '; - echo ' '; - echo ' '; - echo ' '; + echo '
lang_id!=null ?' default="1"':'').'>'.$row1['naslov'].'
'; //koda za notranji IF if ($row1['if_id'] > 0) { echo ' *'; - echo ' '; + echo ' '; $this->conditions_display($row1['if_id']); echo ''; if ($this->condition_check($row1['if_id']) != 0) echo ' '; } + + echo '
'; + echo ' '; + echo ' '; + echo ' '; + echo ' '; + echo '
'; + } else{ if ($length > 30) $class = 'ranking_long'; $class = 'ranking'; - //echo '
'; + echo '
'; echo ''; - echo ' '; - echo ' '; - echo ' '; - echo ' '; + echo '
lang_id!=null ?' default="1"':'').'>'.$row1['naslov'].'
'; - //koda za notranji IF + + // koda za notranji IF if ($row1['if_id'] > 0) { echo ' *'; - echo ' '; + echo ' '; $this->conditions_display($row1['if_id']); echo ''; if ($this->condition_check($row1['if_id']) != 0) echo ' '; - } + } + + echo '
'; + echo ' '; + echo ' '; + echo ' '; + echo ' '; + echo '
'; } @@ -1924,8 +2774,7 @@ class Branching { echo '
'; - echo '
'; - + echo '
'; } //Image hot spot @ radio ******************************************************************************************************** @@ -1968,20 +2817,24 @@ class Branching { // Ce je variabla ne vem in imamo vklopljen prikaz ob opozorilu -> rdec $missing_warning = ''; - if(($row1['other'] == '-97' && $row['alert_show_97'] > 0) + if(($row1['other'] == '-96' && $row['alert_show_96'] > 0) + || ($row1['other'] == '-97' && $row['alert_show_97'] > 0) || ($row1['other'] == '-98' && $row['alert_show_98'] > 0) || ($row1['other'] == '-99' && $row['alert_show_99'] > 0)){ $missing_warning = ' red'; } if ($row['tip'] == 1 && $row['orientation'] != 8 && $row['orientation'] != 10) { - //echo '
'; + if($row['orientation'] == 6){ - echo '
'.$row1['variable'].'
lang_id!=null ? ' default="1"':'').'>' . $row1['naslov'] . '
'; + echo '
+ +
'.$row1['variable'].'
+
lang_id!=null ? ' default="1"':'').'>' . $row1['naslov'] . '
'; } elseif($row['orientation'] == 7){ - //echo '
'.$row1['variable'].'
' . $row1['naslov'] . '
'; - echo '
'.$row1['variable'].'
lang_id!=null ? ' default="1"':'').'>' . $row1['naslov'] . '
'; + + echo '
'.$row1['variable'].'
lang_id!=null ? ' default="1"':'').'>' . $row1['naslov'] . '
'; if ($row1['other'] == 1){ $otherWidth = ($spremenljivkaParams->get('otherWidth') ? $spremenljivkaParams->get('otherWidth') : -1); @@ -1997,44 +2850,62 @@ class Branching { echo ' *'; - echo ' '; + echo ' '; $this->conditions_display($row1['if_id']); echo ''; if ($this->condition_check($row1['if_id']) != 0) echo ' '; } + + if($row1['other'] != 0 && $row1['other'] != 1){ + echo '
+
+ '.$lang['srv_other_system'].$missing_values[$row1['other']].' +
+
0)?'':' style="display:none;"').'> +
+ + + +
+
+
'; + } - echo ' '; - echo ' '; + echo '
'; + echo ' '; + echo ' '; if($row['tip'] == 1) - echo ' '; - echo ' '; - echo ' '; - + echo ' '; + echo ' '; + echo ' '; + echo '
'; echo ''; echo ''; - echo'
'; + echo '
'; } elseif($row['orientation'] == 9){ echo '
-
'; } elseif( $row['orientation'] == 11){ - + //ali so smeskoti pobarvani ali samo sivi + $colored = ($spremenljivkaParams->get('visual_type') == 1 ? 'colored' : ''); $stVsehEnot = mysqli_num_rows($sql1); // echo '
'; @@ -2048,27 +2919,27 @@ class Branching { echo '
'.$row1['variable'].'
'; // Ikona za upload slike - echo ' '; + echo ' '; // Slika oz. text (brez moznosti editiranja) - samo če je vnesen kaksen text ali slika - echo '
lang_id!=null ? ' default="1"':'').'>' . $row1['naslov'] . '
'; + echo '
lang_id!=null ? ' default="1"':'').'>' . $row1['naslov'] . '
'; } else{ echo '
'; echo ' '; echo '
'.$row1['variable'].'
'; - echo '
lang_id!=null ? ' default="1"':'').'>' . $row1['naslov'] . '
'; + echo '
lang_id!=null ? ' default="1"':'').'>' . $row1['naslov'] . '
'; } } } elseif ($row['tip'] == 2 && $row['orientation'] != 10) { if($row['orientation'] == 6){ - echo '
'.$row1['variable'].'
lang_id!=null ? ' default="1"':'').'>' . $row1['naslov'] . '
'; + echo '
'.$row1['variable'].'
lang_id!=null ? ' default="1"':'').'>' . $row1['naslov'] . '
'; } elseif($row['orientation'] == 7){ //echo '
'.$row1['variable'].'
' . $row1['naslov'] . '
'; - echo '
'.$row1['variable'].'
lang_id!=null ? ' default="1"':'').'>' . $row1['naslov'] . '
'; + echo '
'.$row1['variable'].'
lang_id!=null ? ' default="1"':'').'>' . $row1['naslov'] . '
'; if ($row1['other'] == 1){ $otherWidth = ($spremenljivkaParams->get('otherWidth') ? $spremenljivkaParams->get('otherWidth') : -1); @@ -2084,7 +2955,7 @@ class Branching { echo ' *'; - echo ' '; + echo ' '; $this->conditions_display($row1['if_id']); echo ''; @@ -2092,13 +2963,32 @@ class Branching { echo ' '; } + if($row1['other'] != 0 && $row1['other'] != 1){ + echo '
+
+ '.$lang['srv_other_system'].$missing_values[$row1['other']].' +
+
0)?'':' style="display:none;"').'> +
+ + + +
+
+
'; + } + + echo '
'; + echo ' '; echo ' '; if($row['tip'] == 1) - echo ' '; + echo ' '; echo ' '; echo ' '; - + echo '
'; echo''; echo ''; @@ -2113,19 +3003,19 @@ class Branching { echo '
'.$row1['variable'].'
'; // Ikona za upload slike - echo ' '; + echo ' '; // Slika oz. text (brez moznosti editiranja) - samo če je vnesen kaksen text ali slika - echo '
lang_id!=null ? ' default="1"':'').'>' . $row1['naslov'] . '
'; + echo '
lang_id!=null ? ' default="1"':'').'>' . $row1['naslov'] . '
'; } else{ - echo '
'.$row1['variable'].'
lang_id!=null ? ' default="1"':'').'>' . $row1['naslov'] . '
'; + echo '
'.$row1['variable'].'
lang_id!=null ? ' default="1"':'').'>' . $row1['naslov'] . '
'; } } } elseif ($row['tip'] == 3) { //echo ' '; - echo '
'.$row1['variable'].'
lang_id!=null ? ' default="1"':'').'>' . $row1['naslov'] . '
'; + echo '
'.$row1['variable'].'
lang_id!=null ? ' default="1"':'').'>' . $row1['naslov'] . '
'; } @@ -2144,28 +3034,53 @@ class Branching { echo ' *'; - echo ' '; + echo ' '; $this->conditions_display($row1['if_id']); echo ''; if ($this->condition_check($row1['if_id']) != 0) echo ' '; } + + if($row1['other'] != 0 && $row1['other'] != 1){ + echo '
+
+ '.$lang['srv_other_system'].$missing_values[$row1['other']].' +
'; + + //if($row['tip'] != 3) { + echo '
0)?'':' style="display:none;"').'> +
+ + + +
+
'; + //} + + echo '
'; + } + + + echo '
'; echo ' '; // Kljukica za kviz if(SurveyInfo::getInstance()->checkSurveyModule('quiz')){ - $sqlQ = sisplet_query("SELECT * FROM srv_quiz_vrednost WHERE spr_id='".$row['id']."' AND vre_id='".$row1['id']."'"); + $sqlQ = sisplet_query("SELECT * FROM srv_quiz_vrednost WHERE spr_id='".$row['id']."' AND vre_id='".$row1['id']."'"); echo ' '; } echo ' '; - - if($row['tip'] == 1 || $row['tip'] == 2 || $row['tip'] == 3) - echo ' '; + + if($row['tip'] == 1 || $row['tip'] == 2 || $row['tip'] == 3) + echo ' '; echo ' '; echo ' '; + echo '
'; echo '
'; @@ -2214,7 +3129,8 @@ class Branching { echo '
'; } } - // multigrid, multicheckbox, multitext, multinumber prikaz + + // multigrid, multicheckbox, multitext, multinumber prikaz elseif ($row['tip'] == 6 || $row['tip'] == 16 || $row['tip'] == 19 || $row['tip'] == 20 || $row['tip'] == 24) { $spremenljivkaParams = new enkaParameters($row['params']); @@ -2259,7 +3175,44 @@ class Branching { $sizebox = '$("#grids_count option:selected").val()'; $display = ($row['tip'] == 6 && $row['enota'] == 8) ? ' style="display:none;"' : ''; - $grid_plus_minus = '
'; + + #kateri missingi so nastavljeni + //ignoriraj pri testiranje->komentarji + if($_GET['a'] !== 'komentarji' && $_GET['a'] !== 'komentarji_anketa'){ + $already_set_mv = array(); + $sql_grid_mv = sisplet_query("SELECT naslov, other FROM srv_grid WHERE spr_id='".$spremenljivka."' AND other != 0"); + + while ($row_grid_mv = mysqli_fetch_array($sql_grid_mv)) { + $already_set_mv[$row_grid_mv['other']] = $row_grid_mv['naslov']; + } + + $missing_menu_items = ''; + + if (count($missing_values) > 0) { + foreach ($missing_values AS $mv_key => $mv_text) { + $missing_menu_items = + '
  • +
  • ' + .$missing_menu_items; + } + } + + $grid_plus_minus = '
    + + + +
    +
    +
    +
      +
    • '.$lang['srv_manjkajoce_vrednosti'].' '.Help::display('srv_missing_values').'
    • + '.$missing_menu_items.' +
    + '; + } + //konec missingov //izrisemo multigride z dropdowni in select box if($row['tip'] == 6 && ($row['enota'] == 2 || $row['enota'] == 6)) { @@ -2310,7 +3263,7 @@ class Branching { if ($naslov != '') $row2['naslov'] = $naslov; } - echo '
    lang_id!=null ? ' default="1"':'').'>' . $row2['naslov'] . '
    '; + echo '
    lang_id!=null ? ' default="1"':'').'>' . $row2['naslov'] . '
    '; $row2 = mysqli_fetch_array($sql2); } @@ -2354,12 +3307,15 @@ class Branching { echo ''; echo ''; echo ''; - echo ' '; + + echo '
    '; + echo ' '; echo ' '; echo ' '; echo ' '; + echo '
    '; - echo '
    lang_id!=null ? ' default="1"':'').'>' . $row1['naslov'].'
    '; + echo '
    lang_id!=null ? ' default="1"':'').'>' . $row1['naslov'].'
    '; if ($row1['if_id'] > 0) { echo ' *'; @@ -2382,7 +3338,7 @@ class Branching { $sql2 = sisplet_query("SELECT id, naslov, vrstni_red FROM srv_grid WHERE spr_id='$row[id]' AND other=0 ORDER BY vrstni_red"); $row2 = mysqli_fetch_array($sql2); - echo ''; + echo ''; if ($row['enota'] == 6){ echo ''; + echo ''; else - echo ''; + echo ''; } echo ''; @@ -3129,6 +4096,9 @@ class Branching { // desni del radio button echo ' '; + //zadnji stolpec za ikone + echo ''; + //urejanje navpicnega dela grupiranja radio button - vodoravni je urejen po defaultu s pomočjo atributa name echo' '; - //echo ' '; - //Zadnja bela celica kjer se nahajajo ikone za mouseover, ko je slider - konec - - }else{ + + echo ''; + } + else{ echo ' '; } @@ -3796,12 +4768,21 @@ class Branching { // diferencial if ($row['enota'] == 1 && $row['tip'] == 6) { echo ' '; - echo '
    lang_id!=null ?' default="1"':'').'>' . $row1['naslov2'] . '
    '; + echo '
    lang_id!=null ?' default="1"':'').'>' . $row1['naslov2'] . '
    '; } if ($row['ranking_k'] != 1) { //ce ni slider // Zadnja bela celica kjer se nahajajo ikone za mouseover - echo ''; + echo ''; + + echo '
    '; + echo ' '; + echo ' '; + echo ' '; + echo ' '; + echo '
    '; + + echo ' '; echo ' '; } @@ -3896,8 +4877,11 @@ class Branching { //ce je drsnik in moramo urediti opisne labele - konec ################################################## } - // textbox -- not any more - } elseif ($row['tip'] == 4) { + + // textbox -- not any more + } + + elseif ($row['tip'] == 4) { $taSize = ($spremenljivkaParams->get('taSize') ? $spremenljivkaParams->get('taSize') : 1); $taWidth = ($spremenljivkaParams->get('taWidth') ? $spremenljivkaParams->get('taWidth') : -1); @@ -3924,7 +4908,7 @@ class Branching { // textbox* elseif ($row['tip'] == 21) { - if($row['num_useMin'] == 1 && $row['num_useMax'] == 1 && $row['vsota_min'] == $row['vsota_limit']) + if($row['num_useMin'] == 1 && $row['num_useMax'] == 1 && $row['vsota_min'] == $row['vsota_limit']) $limit = '('.$lang['srv_text_length_char_num'].$row['vsota_min'].')'; elseif($row['num_useMin'] == 1 && $row['num_useMax'] == 1) $limit = '('.$lang['srv_text_length_char_num'].'min '.$row['vsota_min'].', max '.$row['vsota_limit'].')'; @@ -3941,9 +4925,7 @@ class Branching { if($taWidth == -1) $taWidth = 30; - echo ''; - if($row['orientation'] != 3) - echo ''; + echo '
    '; $_others = array(); $sql1 = sisplet_query("SELECT id, naslov, variable, size, other, hidden, naslov2 FROM srv_vrednost WHERE spr_id='$row[id]' AND vrstni_red > 0 ORDER BY vrstni_red"); @@ -3951,77 +4933,102 @@ class Branching { if ((int)$row1['other'] == 0) { - // sirina celice td - $cell = $row['text_kosov'] == 1 ? 100 : $row1['size'] ; + // sirina celice + $cell_width = $row['text_kosov'] > 0 ? 100 / $row['text_kosov'] : 100; + + echo '
    '; + // sirina vnosnega polja $input = $taWidth; - if($row['orientation'] == 3) - echo '
    '; - echo ''; - if($row['orientation'] == 3) - echo ''; + echo ''; + + echo ''; } else { # imamo opcijo drugo prikažemo kot checkbox $_others[] = $row1; } } - if($row['orientation'] != 3) - echo ''; - echo '
    '; + if ($this->lang_id != null) { + save('lang_id', $this->lang_id); + $naslov = \App\Controllers\LanguageController::getInstance()->srv_language_vrednost($row1['id']); + if ($naslov != '') $row1['naslov'] = $naslov; + } + + // Polje za enoto + echo '
    lang_id!=null ?' default="1"':'').'>'.$row1['naslov'].'
    '; - if($row['text_orientation'] == 1 || $row['text_orientation'] == 3){ - echo '
    lang_id!=null ?' default="1"':'').'>'.$row1['naslov'].'
    '; - if ($row['text_orientation'] == 3) - echo '
    '; - } if ($taSize > 1) - echo ''; + echo ''; else - echo ''; - - if($row['text_orientation'] == 2){ - echo '
    lang_id!=null ?' default="1"':'').'>'.$row1['naslov'].'
    '; - } - echo '
    '; + + echo '
    '; + - if ($row['vsota_show'] == 1 && $limit != '') - echo ''.$limit.''; + if ($row['vsota_show'] == 1 && $limit != '') + echo '
    '.$limit.'
    '; if (count($_others)> 0 ) { + + echo '
    '; + foreach ($_others AS $oKey => $_other) { - if ($this->lang_id != null) { - save('lang_id', $this->lang_id); - $naslov = \App\Controllers\LanguageController::getInstance()->srv_language_vrednost($_other['id']); - if ($naslov != '') $_other['naslov'] = $naslov; - } - - // Ce je variabla ne vem in imamo vklopljen prikaz ob opozorilu -> rdec - $missing_warning = ''; - if(($_other['variable'] == '-97' && $row['alert_show_97'] > 0) - || ($_other['variable'] == '-98' && $row['alert_show_98'] > 0) - || ($_other['variable'] == '-99' && $row['alert_show_99'] > 0)){ - $missing_warning = ' red'; - } + if ($this->lang_id != null) { + save('lang_id', $this->lang_id); + $naslov = \App\Controllers\LanguageController::getInstance()->srv_language_vrednost($_other['id']); + if ($naslov != '') $_other['naslov'] = $naslov; + } + + // Ce je variabla ne vem in imamo vklopljen prikaz ob opozorilu -> rdec + $missing_warning = ''; + if(($_other['variable'] == '-97' && $row['alert_show_97'] > 0) + || ($_other['variable'] == '-98' && $row['alert_show_98'] > 0) + || ($_other['variable'] == '-99' && $row['alert_show_99'] > 0)){ + $missing_warning = ' red'; + } - echo '
    '; - echo ' '; - echo '
    ' . $_other['naslov'] . '
    '; - echo ' '; - echo ' '; - echo ' '; - echo ' '; + echo '
    '; + echo ' '; + echo ''; + echo '
    ' . $_other['naslov'] . '
    '; + + if($_other['other'] != 0 && $_other['other'] != 1){ + echo '
    +
    + '.$lang['srv_other_system'].$missing_values[$_other['other']].' +
    +
    0)?'':' style="display:none;"').'> +
    + + + +
    +
    +
    '; + } - echo '
    '; + echo '
    '; + echo ' '; + echo ' '; + echo ' '; + echo ' '; + echo '
    '; + echo '
    '; } + + echo '
    '; } + + $this->missings_menu($spremenljivka); } // number - elseif ($row['tip'] == 7) { + elseif ($row['tip'] == 7) { if($row['num_useMin'] == 1 && $row['num_useMax'] == 1 && $row['vsota_min'] == $row['vsota_limit']) $limit = '('.$row['vsota_min'].')'; @@ -4052,20 +5059,19 @@ class Branching { if($taWidth == -1) $taWidth = 10; - $cssFloat = ' floatLeft'; - $sql1 = sisplet_query("SELECT id, naslov FROM srv_vrednost WHERE spr_id='$row[id]' AND other = 0 "); $row1 = mysqli_fetch_array($sql1); $sqlOther = sisplet_query("SELECT id, naslov, other FROM srv_vrednost WHERE spr_id='$row[id]' AND vrstni_red>0 AND other != 0"); $num_other = mysqli_num_rows($sqlOther); - $num_all = $num_other+$row['size']; - $cell_width = 'width:'.(80/$num_all).'% '; if ( $row['ranking_k'] == '0' ) { - echo '
    '; + echo '
    '; + + + echo '
    '; if ($this->lang_id != null) { save('lang_id', $this->lang_id); @@ -4074,28 +5080,24 @@ class Branching { } if($row['enota'] == 1) - echo '
    lang_id!=null ?' default="1"':'').'>' . $row1['naslov'] . '
    - '; + echo '
    lang_id!=null ?' default="1"':'').'>' . $row1['naslov'] . '
    + '; elseif($row['enota'] == 2) - echo '
    lang_id!=null?' default="1"':'').'>' . $row1['naslov'].'
    '; + echo '
    lang_id!=null?' default="1"':'').'>' . $row1['naslov'].'
    '; else - echo ' '; - echo '
    '; + echo ' '; + + echo '
    '; + // Omejitev vnosa - if ($row['orientacija'] == 1) { - echo '
    ccc
    '; - $cssFloat = ''; - }else { - $cssFloat = ' floatLeft'; - } if ($row['vsota_show'] == 1 && $limit != '') { - echo ''.$limit.''; - } elseif($row['size'] != 2 && $limit == '') { - echo ''.$lang['srv_number_text'].''; + echo '
    '.$limit.'
    '; + } + elseif($row['size'] != 2 && $limit == '') { + echo '
    '.$lang['srv_number_text'].'
    '; } - $cssFloat = ' floatLeft'; if ($row['size'] == 2) { @@ -4107,35 +5109,32 @@ class Branching { if ($naslov != '') $row1['naslov'] = $naslov; } - echo '
    '; + echo '
    '; if($row['enota'] == 1){ if($taWidth > 40) echo '
    '; - echo '
    lang_id!=null ?' default="1"':'').'>' . $row1['naslov'] . '
    - '; + echo '
    lang_id!=null ?' default="1"':'').'>' . $row1['naslov'] . '
    + '; } elseif($row['enota'] == 2) - echo '
    lang_id!=null ?' default="1"':'').'>' . $row1['naslov'].'
    '; + echo '
    lang_id!=null ?' default="1"':'').'>' . $row1['naslov'].'
    '; else - echo ' '; + echo ' '; echo '
    '; - //Omejitev vnosa - if ($row['orientacija'] == 1) { - echo '
    ccc
    '; - $cssFloat = ''; - }else { - $cssFloat = ' floatLeft'; - } + // Omejitev vnosa if ($row['vsota_show'] == 1 && $limit2 != '') { - echo ''.$limit2.''; - } elseif($limit == '' && $limit2 == '') { - echo ''.$lang['srv_number_text'].''; + echo '
    '.$limit2.'
    '; + } + elseif($limit == '' && $limit2 == '') { + echo '
    '.$lang['srv_number_text'].'
    '; } } - }//ranking_k == 0 - + echo '
    '; + } + + //ranking_k == 0 if ( $row['ranking_k'] == '1' ) { echo '
    '; @@ -4222,18 +5221,21 @@ class Branching { //za custom opisne labele //moznosti urejanja opisnih label drsnika + $slider_CustomDescriptiveLabels = ''; if($slider_VmesneDescrLabel){ for($i=1; $i<=$slider_NumofDescrLabels; $i++){ if($prevajanje == false){ $slider_CustomDescriptiveLabelsTmp = ($spremenljivkaParams->get('slider_Labela_opisna_'.$i) ? $spremenljivkaParams->get('slider_Labela_opisna_'.$i) : ''); - }else if ($prevajanje == true){ + } + else if ($prevajanje == true){ $slider_CustomDescriptiveLabelsTmp = $custom_ar[$i-1]; } $slider_CustomDescriptiveLabelsTmp = preg_replace("/\s| /",' ',$slider_CustomDescriptiveLabelsTmp); //za odstranitev morebitnih presledkov, ki lahko delajo tezave pri polju za drsnik if($i == 1){ $slider_CustomDescriptiveLabels = $slider_CustomDescriptiveLabelsTmp; - }else{ + } + else{ $slider_CustomDescriptiveLabels .= "; ".$slider_CustomDescriptiveLabelsTmp; } } @@ -4259,10 +5261,8 @@ class Branching { '; - echo '
    '; - echo '
    '; - + + //tabela za labele podrocij in podrocja echo ''; @@ -4380,14 +5380,37 @@ class Branching { $missing_warning = ' red'; } - echo '
    '; - echo ''; - echo '
    ' . $row1['naslov'] . '
    '; + echo '
    '; + echo ''; + echo ''; + echo '
    ' . $row1['naslov'] . '
    '; + + if($row1['other'] != 0 && $row1['other'] != 1){ + echo '
    +
    + '.$lang['srv_other_system'].$missing_values[$row1['other']].' +
    +
    0)?'':' style="display:none;"').'> +
    + + + + +
    +
    '; + } + echo '
    '; echo ' '; echo ' '; + echo '
    '; + echo '
    '; } + + $this->missings_menu($spremenljivka); } // label @@ -4423,15 +5446,38 @@ class Branching { } echo '
    '; - echo ''; - echo '
    ' . $row1['naslov'] . '
    '; - echo ' '; + echo ''; + echo ''; + echo '
    ' . $row1['naslov'] . '
    '; + + if($row1['other'] != 0 && $row1['other'] != 1){ + echo '
    +
    + '.$lang['srv_other_system'].$missing_values[$row1['other']].' +
    +
    0)?'':' style="display:none;"').'> +
    + + + + +
    +
    '; + } + + echo '
    '; + echo ' '; echo ' '; echo ' '; echo ' '; + echo '
    '; + echo '
    '; } + $this->missings_menu($spremenljivka); } // ranking @@ -4443,9 +5489,12 @@ class Branching { $num = mysqli_num_rows($sql1); $size = $num * 50; + echo '
    '; + // n=k if ($row['design'] == 2) { - echo '
    '; + + echo '
    '; while ($row1 = mysqli_fetch_array($sql1)) { @@ -4469,10 +5518,6 @@ class Branching { echo '
    '; echo ''; - echo ' '; - echo ' '; - echo ' '; - echo ' '; echo '
    lang_id!=null ?' default="1"':'').'>'.$row1['naslov'].'
    '; @@ -4482,7 +5527,7 @@ class Branching { echo '
    '; echo ' *'; - echo ' '; + echo ' '; $this->conditions_display($row1['if_id']); echo ''; @@ -4492,8 +5537,16 @@ class Branching { echo '
    '; } + echo '
    '; + echo ' '; + echo ' '; + echo ' '; + echo ' '; + echo '
    '; + echo '
    '; } + echo '
    '; } @@ -4501,7 +5554,7 @@ class Branching { elseif ($row['design'] == 0) { //zaslon razdelimo na dva dela - izris leve strani - echo '
    '; + echo '
    '; while ($row1 = mysqli_fetch_array($sql1)) { @@ -4525,10 +5578,6 @@ class Branching { echo '
    '; echo ''; - echo ' '; - echo ' '; - echo ' '; - echo ' '; echo '
    lang_id!=null ?' default="1"':'').'>'.$row1['naslov'].'
    '; @@ -4537,7 +5586,7 @@ class Branching { echo '
    '; echo ' *'; - echo ' '; + echo ' '; $this->conditions_display($row1['if_id']); echo ''; @@ -4548,12 +5597,21 @@ class Branching { echo '
    '; } + echo '
    '; + echo ' '; + echo ' '; + echo ' '; + echo ' '; + echo '
    '; + echo '
    '; } + echo '
    '; + // izris desne strani - echo '
    '; + echo '
    '; if($row['ranking_k'] == 0) $max = mysqli_num_rows($sql1); @@ -4565,8 +5623,6 @@ class Branching { } echo '
    '; - - echo '
    '; } // cifre - dropdown @@ -4584,10 +5640,6 @@ class Branching { echo '
    '; echo ''; - echo ' '; - echo ' '; - echo ' '; - echo ' '; //echo ' '; echo ''; - - echo '
    lang_id!=null ?' default="1"':'').'>'.$row1['naslov'].'
    '; + + echo '
    lang_id!=null ?' default="1"':'').'>'.$row1['naslov'].'
    '; //koda za notranji IF if ($row1['if_id'] > 0) { echo ' *'; - echo ' '; + echo ' '; $this->conditions_display($row1['if_id']); echo ''; @@ -4612,6 +5664,13 @@ class Branching { echo ' '; } + echo '
    '; + echo ' '; + echo ' '; + echo ' '; + echo ' '; + echo '
    '; + echo '
    '; } } @@ -4622,6 +5681,8 @@ class Branching { //izris hotspot nastavitev za dodajanje slike $this->vprasanje_hotspot($row['id'], $row['tip'], $row['design']); } + + echo '
    '; } // vsota @@ -4641,14 +5702,17 @@ class Branching { if ($naslov != '') $row1['naslov'] = $naslov; } - echo '
    '; + echo '
    '; echo ''; + + echo '
    '; echo ' '; echo ' '; echo ' '; echo ' '; + echo '
    '; - echo '
    lang_id!=null ?' default="1"':'').'>'.$row1['naslov'].'
    '; + echo '
    lang_id!=null ?' default="1"':'').'>'.$row1['naslov'].'
    '; echo ' '; if ($row1['if_id'] > 0) { @@ -4664,6 +5728,7 @@ class Branching { $row1 = Cache::srv_spremenljivka($row['id']); + $limit = ''; if($row['vsota_limit'] != 0 && $row['vsota_limit'] == $row['vsota_min']) $limit = '('.$row['vsota_min'].')'; elseif($row['vsota_limit'] != 0 && $row['vsota_min'] != 0) @@ -4676,21 +5741,17 @@ class Branching { $vsota = ($row1['vsota'] != '') ? $row1['vsota'] : $lang['srv_vsota_text']; - echo '
    '; + echo '
    '; - echo '
    '; + echo '
    '; + + echo '
    lang_id!=null ?' default="1"':'').'>' . $vsota . '
    '; - echo ' '; + echo ' '; - echo '
    '; - echo '
    '; - echo '
    lang_id!=null ?' default="1"':'').'>' . $vsota . '
    '; - echo '
    '; - echo '
    '; - echo ' '; + echo ' '; if ($row['vsota_show'] == 1) - echo ' '; - echo '
    '; + echo '
    '; } // SN - imena @@ -4738,11 +5799,11 @@ class Branching { $sql1 = sisplet_query("SELECT id, naslov FROM srv_vrednost WHERE spr_id='$row[id]' ORDER BY $orderby"); while ($row1 = mysqli_fetch_array($sql1)) { - echo '

    '; + echo '

    '; } if ($row['textfield'] == 1) { - echo '

    '; + echo '

    '; } } @@ -4788,7 +5849,9 @@ class Branching { else $map_data[] = $sql1; - echo ''.$lang['srv_branching_no_value_map'].''; + echo ''. + $lang['srv_branching_no_value_map'].''; //get info shapes $sql2 = sisplet_query("SELECT lat, lng, address, overlay_id FROM srv_vrednost_map @@ -4821,7 +5884,7 @@ class Branching { ?> '; + if($_GET['a'] !== 'komentarji' && $_GET['a'] !== 'komentarji_anketa'){ $row = Cache::srv_spremenljivka($spremenljivka); - if ($row['thread'] == 0) { - $row['count'] = 0; - } else { - if ($admin_type <= $question_comment_viewadminonly) { - $sql = sisplet_query("SELECT COUNT(*) AS count FROM post WHERE tid='$row[thread]'"); - } elseif ($question_comment_viewauthor==1) { - $sql = sisplet_query("SELECT COUNT(*) AS count FROM post WHERE tid='$row[thread]' AND uid='$global_user_id'"); - } else { - $sql = sisplet_query("SELECT * FROM post WHERE 1 = 0"); - } - $row = mysqli_fetch_array($sql); - $row['count']--;//1. je default comment - } - - // Poglej komentarje - if ($admin_type <= $question_comment_viewadminonly || $question_comment_viewauthor==1) { - echo '   '; - echo ' '; + $spremenljivkaParams = new enkaParameters($row['params']); + + # preberemo missing vrednosti iz class.SurveyMissingValues - kateri so na voljo v anketi + $smv = new SurveyMissingValues($this->anketa); + $missing_values = $smv->GetUnsetValuesForSurvey(); + + # kateri missingi so nastavljeni + $already_set_mv = array(); + $sql_grid_mv = sisplet_query("SELECT naslov, other FROM srv_vrednost WHERE spr_id='".$spremenljivka."' AND other != 0"); + while ($row_grid_mv = mysqli_fetch_array($sql_grid_mv)) { + $already_set_mv[$row_grid_mv['other']] = $row_grid_mv['naslov']; } - } - // komentarji respondentov - if (($question_resp_comment==1) AND ($admin_type <= $question_resp_comment_viewadminonly)) { + $missing_menu_items = ''; - echo ' '; - $sql = sisplet_query("SELECT COUNT(*) AS count FROM srv_data_text".$this->db_table." WHERE spr_id='0' AND vre_id='$spremenljivka'"); - $row = mysqli_fetch_array($sql); + if (count($missing_values) > 0) { + foreach ($missing_values AS $mv_key => $mv_text) { + $missing_menu_items = ' +
  • + +
  • ' + .$missing_menu_items; + } - if ($row['count'] > 0) { - echo ''; - echo ' '; - echo $lang['srv_repondent_comment'].' ('.$row['count'].')'; - echo ''; - echo ' '; } - echo '
    '; - } - - echo '
    '; - } - - /** - * komentarji na if oz. blok - vrstica se izpise na dnu prikaza ifa oz. bloka - * - * @param mixed $if_id (id ifa ali bloka) - * @param mixed $block (ali gre za if ali blok) - */ - function if_komentarji ($if_id, $block=0) { - global $lang; - global $admin_type; - global $global_user_id; - - SurveySetting::getInstance()->Init($this->anketa); - $question_comment = SurveySetting::getInstance()->getSurveyMiscSetting('question_comment'); - - $question_comment_viewadminonly = SurveySetting::getInstance()->getSurveyMiscSetting('question_comment_viewadminonly'); - $question_comment_viewauthor = SurveySetting::getInstance()->getSurveyMiscSetting('question_comment_viewauthor'); - if (!($admin_type <= $question_comment && $question_comment!='')) return; - if ($_GET['a'] == 'komentarji') return; // v komentarjih tut ne izpisujemo te vrstice - - // komentarji na if ali blok - if ($admin_type <= $question_comment && $question_comment != '') { - - // Dodaj komentar - echo ' '; - //echo ''.$lang['srv_question_comment'].' '; - echo ' '; - echo $lang['srv_add_comment']; - echo ''; - echo ' '; - - $row = Cache::srv_if($if_id); - if ($row['thread'] == 0) { - $row['count'] = 0; - } else { - if ($admin_type <= $question_comment_viewadminonly) { - $sql = sisplet_query("SELECT COUNT(*) AS count FROM post WHERE tid='$row[thread]'"); - } elseif ($question_comment_viewauthor==1) { - $sql = sisplet_query("SELECT COUNT(*) AS count FROM post WHERE tid='$row[thread]' AND uid='$global_user_id'"); - } else { - $sql = sisplet_query("SELECT * FROM post WHERE 1 = 0"); - } - $row = mysqli_fetch_array($sql); - $row['count']--;//1. je default comment - } + if (count($missing_values) > 0) { - // Poglej komentarje - if ($admin_type <= $question_comment_viewadminonly || $question_comment_viewauthor==1) { - echo '   '; - echo ' '; + echo ' +
    +
    +
      +
    • '.$lang['srv_manjkajoce_vrednosti'].' '.Help::display('srv_missing_values').'
    • + '.$missing_menu_items.' +
    + '; } } } @@ -5432,11 +6413,15 @@ class Branching { $this->Survey = new \App\Controllers\SurveyController(true); $lang = $l; + save('lang_id', $this->lang_id); + $rowl = \App\Controllers\LanguageController::srv_language_spremenljivka($id); - if ($id == -1) { + + if ($id == -1 && isset($rowl['naslov'])) { if (strip_tags($rowl['naslov']) != '') $row['introduction'] = $rowl['naslov']; - } else { + } + elseif(isset($rowl['naslov'])) { if (strip_tags($rowl['naslov']) != '') $row['conclusion'] = $rowl['naslov']; } } @@ -5524,7 +6509,7 @@ class Branching { // prikažemo nastavitve vprasanja $fullscreen = ( isset($_POST['fullscreen']) && $_POST['fullscreen'] != 'undefined') ? (int)$_POST['fullscreen'] : false; - echo '
    '."\n\r"; + echo '
    '."\n\r"; if ($id == -1) { $show = $row['show_intro']; @@ -5545,25 +6530,21 @@ class Branching { // <-- Editor teksta vprasanja --- echo '
    '; echo '
    '.$text.'
    '; - echo '
    '; echo ''; // opomba if ($opomba != '' && $this->lang_id == null) { - echo ''; - echo ''; - echo ''; - echo '
    '.$lang['note'].' ('.$lang['srv_internal'].'):'; - echo ''.$opomba.''; - echo '
    '; + + echo '
    '; + echo '*'.$lang['note'].' ('.$lang['srv_internal'].'): '.$opomba; + echo '
    '; } + echo '
    '; // --- Editor teksta vprasanja --> - - echo '
    '; - - } else { // urejanje uvoda,zakljucka + } + else { // urejanje uvoda,zakljucka // <-- Zgornja vrstica pri editiranju vprasanj --- echo '
    '; @@ -5576,9 +6557,8 @@ class Branching { // prikažemo nastavitve vprasanja $fullscreen = ( isset($_POST['fullscreen']) && $_POST['fullscreen'] != 'undefined') ? (int)$_POST['fullscreen'] : false; - echo '
    '."\n\r"; + echo '
    '."\n\r"; echo ' '; - //$this->introconcl_visible($id); echo ' '."\n\r"; echo '
    '; @@ -5601,7 +6581,6 @@ class Branching { echo '
    '; echo ''; echo '
    '; @@ -5713,16 +6692,14 @@ class Branching { // <-- Editor teksta vprasanja --- echo '
    '; echo '
    '.$text.'
    '; - echo '
    '; - echo '
    '; // --- Editor teksta vprasanja --> - echo '
    '; // Da/ne variable + echo '
    '; echo '
    '; echo '
    '; @@ -5739,6 +6716,7 @@ class Branching { echo '
    '.$lang['srv_gdpr_intro_yes'].'
    '; echo '
    '; + echo '
    '; echo '
    '; echo '
    '; @@ -5793,7 +6771,7 @@ class Branching { /** * @desc prikaze pogoje v IFu */ - function conditions_display($if, $long_alert=0, $notranji_pogoj=0) { + function conditions_display($if, $long_alert=0, $notranji_pogoj=0, $vrednost=0) { global $lang; $row_if = Cache::srv_if($if); @@ -5890,6 +6868,7 @@ class Branching { else echo $row2['variable']; } + // multigrid } elseif ($row['vre_id'] > 0) { @@ -5897,7 +6876,7 @@ class Branching { // Preverimo pogoj -1 $sqlX = sisplet_query("SELECT * FROM srv_condition_grid WHERE cond_id='$row[id]' AND grd_id='-1'"); - if (!$sql2) echo mysqli_error($GLOBALS['connect_db']); + if (!$sqlX) echo mysqli_error($GLOBALS['connect_db']); if(mysqli_num_rows($sqlX) > 0){ echo '-1'; $j++; @@ -6031,48 +7010,55 @@ class Branching { echo ' ) '; } - //echo ''; if ($row_if['label'] != '') { echo ' ('; echo ' '.$row_if['label'].' '; echo ') '; - } $condition_check = $this->condition_check($if); if ($long_alert) { - if ($c == 1 && $spr_id == 0) - if ($this->count_spr_in_if($if) > 1) { + + if ($c == 1 && $spr_id == 0){ + + if ($this->count_spr_in_if($if) > 1) { echo ''.$lang['srv_edit_condition_question'].''; - } else { + } + else { $spr = $this->find_first_in_if($if); $r = Cache::srv_spremenljivka($spr); - if (!$spr > 0) $r['variable'] = ''; - echo ''.sprintf($lang['srv_edit_condition_question1'], ''.$r['variable'].'').''; + + if (!$spr > 0) + $r['variable'] = ''; + + if(($vrednost == -4)) + echo ''.sprintf($lang['srv_edit_validation_question1'], ''.$r['variable'].'').''; + else + echo ''.sprintf($lang['srv_edit_condition_question1'], ''.$r['variable'].'').''; } - //if ($condition_check >= 1 && $condition_check <= 5 ) { - echo ''; - if ($condition_check == 1) - echo ' '.$lang['srv_error_oklepaji'].''; - if ($condition_check == 2) { - if (mysqli_num_rows($sql) > 1) // ko nardimo nov if, ne prikazemo takoj errorja - echo ' '.$lang['srv_error_spremenljivka'].''; - } elseif ($condition_check == 3) - echo ' '.$lang['srv_error_vrednost'].''; - if ($condition_check == 4) - echo ' '.$lang['srv_error_numericno'].''; - if ($condition_check == 5) - echo ' '.$lang['srv_error_calculation'].''; - if ($condition_check == 6) - echo ' '.$lang['srv_error_date'].''; - echo ''; - //} - } else { + echo ''; + if ($condition_check == 1) + echo ' '.$lang['srv_error_oklepaji'].''; + if ($condition_check == 2) { + if (mysqli_num_rows($sql) > 1) // ko nardimo nov if, ne prikazemo takoj errorja + echo ' '.$lang['srv_error_spremenljivka'].''; + } elseif ($condition_check == 3) + echo ' '.$lang['srv_error_vrednost'].''; + if ($condition_check == 4) + echo ' '.$lang['srv_error_numericno'].''; + if ($condition_check == 5) + echo ' '.$lang['srv_error_calculation'].''; + if ($condition_check == 6) + echo ' '.$lang['srv_error_date'].''; + echo ''; + } + } + else { if ($condition_check != 0) - echo ' '.$lang['srv_if_error'].''; + echo ' '.$lang['srv_if_error'].''; } @@ -6094,7 +7080,7 @@ class Branching { $rowb = Cache::srv_if($if); //začetek oklepaja za ZANKO - echo 'LOOP ('.$rowb['number'].')'; + echo 'LOOP ('.$rowb['number'].')'; $sql = sisplet_query("SELECT l.spr_id, s.variable FROM srv_loop l, srv_spremenljivka s WHERE l.if_id='$if' AND l.spr_id=s.id"); $row = mysqli_fetch_array($sql); @@ -6179,8 +7165,87 @@ class Branching { // in pa mogoce se cez spremenljivke tipa kalkulacija ? // TODO maybe - return true; - } + return true; + } + + function check_pogoji_output () { + global $lang; + + $output = ''; + + $code = $this->check_pogoji(); + + // ce je vse ok, preverimo se loope + if ($code === true) + $code = $this->check_loops(); + + // ce je vse ok, preverimo se validacije + if ($code === true) + $code = $this->check_validation(); + + // ce je vse ok, preverimo se imena variabel (vprasanj in variabel znotraj vprasanj) + if ($code === true) + $code = $this->check_variable(); + + // ce je vse ok, preverimo se vrednosti stolpcev v gridu (ce je slucajno kaksna prazna) + if ($code === true) + $code = $this->check_grid_value(); + + if ($code === true) return '1'; + + $output .= '
    '; + if ($code['type'] == 'if' || $code['type'] == 'podif') + $output .= $lang['srv_check_pogoji_not_ok']; + elseif ($code['type'] == 'loop') + $output .= $lang['srv_loop_no_nesting']; + elseif ($code['type'] == 'question_variable') + $output .= $lang['srv_duplicate_question_variable']; + elseif ($code['type'] == 'variable') + $output .= $lang['srv_duplicate_variables']; + elseif ($code['type'] == 'grid_value') + $output .= $lang['srv_empty_grid_values']; + + $output .= '
    '; + + // napaka v ifih + if ($code['type'] == 'if') { + $sql = sisplet_query("SELECT id, number FROM srv_if WHERE id = '$code[id]'"); + $row = mysqli_fetch_array($sql); + $output .= '

    '.$lang['srv_check_pogoji_if'].' '.$row['number'].'.

    '; + } + // napaka v podifih, ki so nastavljeni na vrednosti spremenljivk + elseif ($code['type'] == 'podif') { + $sql = sisplet_query("SELECT id, naslov, variable FROM srv_spremenljivka WHERE id = '$code[id]'"); + $row = mysqli_fetch_array($sql); + $output .= '

    '.$lang['srv_check_pogoji_spremenljivka'].': '.$row['variable'].' - '.strip_tags($row['naslov']).'

    '; + } + // napaka z gnezdenjem loopov + elseif ($code['type'] == 'loop') { + $sql = sisplet_query("SELECT id, number FROM srv_if WHERE id = '$code[id]'"); + $row = mysqli_fetch_array($sql); + $output .= '

    '.$lang['srv_check_pogoji_loop'].' '.$row['number'].'

    '; + } + elseif ($code['type'] == 'validation') { + $sql = sisplet_query("SELECT id, naslov, variable FROM srv_spremenljivka WHERE id = '$code[id]'"); + $row = mysqli_fetch_array($sql); + $output .= '

    '.$lang['srv_check_validacija'].': '.$row['variable'].' - '.strip_tags($row['naslov']).'

    '; + } + // napaka z imeni variabel + elseif ($code['type'] == 'variable') { + foreach ($code['vars'] AS $var) { + $output .= ''.$var.'
    '; + }; + } + // napaka z vrednostmi v gridu + elseif ($code['type'] == 'grid_value') { + foreach ($code['vars'] AS $var) { + $output .= ''.$var.'
    '; + }; + } + + + return $output; + } /** * preveri celo anketo, ce so loopi pravilno postavljeni @@ -6284,15 +7349,44 @@ class Branching { } } } - - /*if(count($spr_errors)) - return $spr_errors;*/ if(count($var_errors)) return $var_errors; return true; } + + /** + * preveri, da vrednosti gridov (multigrid vprasanja) v anketi niso prazne + * + */ + public function check_grid_value () { + + $spr_errors = array(); + $vars = array(); + + // Poiscemo gride, ki imajo prazno vrednost + $sql = sisplet_query("SELECT grid.vrstni_red, s.id AS spr_id, s.variable AS spr_variable + FROM srv_grid grid, srv_spremenljivka s, srv_grupa g + WHERE grid.spr_id=s.id AND s.gru_id=g.id AND g.ank_id='".$this->anketa."' + AND (grid.variable='' OR grid.variable='
    ') + "); + if (!$sql) echo mysqli_error($GLOBALS['connect_db']); + + while ($row = mysqli_fetch_array($sql)) { + $vars[] = $row['spr_variable'] . ' - ' . $row['vrstni_red']; + } + + if(count($vars)){ + $spr_errors['type'] = 'grid_value'; + $spr_errors['code'] = '7'; + $spr_errors['vars'] = $vars; + + return $spr_errors; + } + + return true; + } /** @@ -6563,9 +7657,7 @@ class Branching { echo '

    '.$lang['urejanje_pogoj_popup_vrednost'].'

    '; echo ''; - echo ''.$lang['urejanje_podif_alert'].''; - - echo '

    '; + echo ''.$lang['urejanje_podif_alert'].''; $sql = sisplet_query("SELECT naslov FROM srv_vrednost WHERE id='$vrednost'"); $row = mysqli_fetch_assoc($sql); @@ -6573,7 +7665,7 @@ class Branching { } // Pogoj pri npr. obvescanju elseif($vrednost == -3){ - echo '

    '.$lang['urejanje_pogoj_popup'].'

    '; + echo '

    IF - '.$lang['urejanje_pogoj_popup'].'

    '; echo ''; } // Validacija @@ -6601,26 +7693,56 @@ class Branching { // gumbi na desni v novem oknu if ($vrednost==0) { - // floating box + // floating box echo '
    '; + + echo '
    '; + + echo ''; + if ($row['tip'] == 0) - echo '

    '.$lang['oblikovanje_if'].'

    '; + echo $lang['oblikovanje_if']; elseif ($row['tip'] == 1) - echo '

    '.$lang['oblikovanje_blok'].'

    '; + echo $lang['oblikovanje_blok']; elseif ($row['tip'] == 2) - echo '

    '.$lang['srv_loop_urejanje'].'

    '; + echo $lang['srv_loop_urejanje']; - if ($row['tip'] == 0) - echo '

    '.$lang['srv_edit_condition_question'].'

    '; - elseif ($row['tip'] == 1) - echo '

    '.$lang['srv_block_desc'].'

    '; + echo '
    '; + + + echo '
    '; + + + echo '
    '.$lang['srv_common_settings'].''; + if ($row['tip'] == 0){ + echo '
    '; + echo '
    '; + echo '

    '.$lang['srv_edit_condition_question'].'

    '; + echo '
    '; + echo '
    '; + } + elseif ($row['tip'] == 1){ + echo '
    '; + echo '
    '; + echo '

    '.$lang['srv_block_desc'].'

    '; + echo '
    '; + echo '
    '; + } + if ($vrednost != -1 && $vrednost != -2) { - echo '

    '; - echo ($row['tip']==0?$lang['srv_if_label']:($row['tip']==1?$lang['srv_block_label']:$lang['srv_loop_label'])).':'; - echo ''; - echo '

    '; + + echo '
    '; + + echo '
    '; + echo ' '; + echo ' '; + echo ' '; + echo ' '; + echo '
    '; + + echo '
    '; echo ''; - } + // Dodaj blok/if v knjiznico + echo '
    '; + + echo '
    '; + echo ' '.$lang['srv_library_add_to_lib'].''; + echo '
    '; + + echo '
    '; + + echo '
    '; + + if ($row['tip'] == 0 || $row['tip'] == 1) { - echo '
    '; + echo '
    '.($row['tip'] == 1 ? $lang['srv_block_enabled'] : $lang['srv_if_enabled']).''; - echo '

    '.($row['tip'] == 1 ? $lang['srv_block_enabled'] : $lang['srv_if_enabled']).':'; + echo '

    '; - echo''; - echo ''; - if ($row['tip'] == 0) - echo ''; - echo ''; - echo ''; + echo '
    '; + echo ' '; + echo '
    '; + + if ($row['tip'] == 0){ + echo '
    '; + echo '
    '; + } - echo '

    '; + echo '
    '; + echo ' '; + echo '
    '; + + echo '
    '; echo '
    '; } @@ -6653,15 +7793,18 @@ class Branching { // Posebna nastavitev vrednosti statusa panelista ce je vklopljen modul "panel" if ($row['tip'] == 0 && SurveyInfo::getInstance()->checkSurveyModule('panel')) { - echo '
    '; - echo '

    '.$lang['srv_panel_if'].':'; + echo '

    '.$lang['srv_panel_if'].''; - $sp = new SurveyPanel($this->anketa); + $sp = new SurveyPanel($this->anketa); $panel_if = $sp->getPanelIf($if); - - echo''; - echo ''; - echo ''; + + echo '
    '; + + echo '
    '; + echo ' '; + echo '
    '; + + echo '
    '; echo ''; - echo '

    '; echo '
    '; } if ($row['tip'] == 1) { - echo '
    '; + echo '
    '.$lang['srv_block_random'].' '.Help::display('srv_block_random').''; // Blok ki prikaze nakljucno razvrscena vprasanja (in samo doloceno stevilo) - echo '

    '; - echo ' '.$lang['srv_block_random'].': '.Help::display('srv_block_random'); - echo ' '; - echo ' '; - echo ' '; - echo ' '; - echo ' '; - echo '

    '; + echo '
    '; + + echo '
    '; + echo ' '; + echo '
    '; + + echo '
    '; + echo ' '; + echo '
    '; + + echo '
    '; + echo ' =0?' checked="checked"':'').' onClick="if_blok_random(\''.$row['id'].'\', $(this).val())" />'; + echo '
    '; + + echo '
    '; + // Stevilo vprasanj ki jih nakljucno izberemo (ce je zgornja "da") - echo '

    = 0) ? '' : ' style="display:none;"').'>'.$lang['srv_block_random_cnt'].':'; - echo ''; + echo ' '; $sqlB = sisplet_query("SELECT count(*) AS cnt_spr FROM srv_branching WHERE ank_id='".$this->anketa."' AND parent='".$row['id']."' AND element_spr>'0' ORDER BY vrstni_red"); @@ -6702,102 +7857,119 @@ class Branching { echo ' '; } } - echo ''; - + echo ' '; + echo ' '; + + echo '

    '; + + echo '
    '; + + // Blok ki vsebuje horizontalno urejena vprasanja - echo '

    '.$lang['srv_orientacija_vprasanja'].':'; - echo ''; - echo '

    '; + echo '
    '; + + echo '
    '; + echo ' '; + echo ' '; + echo ' '; + echo ' '; + echo '
    '; + + echo '
    '; + + // Blok kot zavihek - echo '

    '.$lang['srv_block_tab'].':'; - echo ''; - echo '

    '; - + echo '
    '; + + echo '
    '; + echo ' '; + echo' '; + echo ' '; + echo ' '; + echo '
    '; + + echo '
    '; + + // Opozorilo, da mora biti blok na svoji strani (ce je vklopljena katera od zgornjih nastavitev) - echo '

    =0 ? '' : ' style="display:none;"').'>'.$lang['srv_block_pbWarning'].'

    '; - + echo '
    =0 ? '' : ' style="display:none;"').'>'; + echo '
    '; + echo ' '.$lang['srv_block_pbWarning'].''; + echo '
    '; + echo '
    '; + echo ''; } + + echo '
    '; - echo ''; - - echo ''; - echo ''.($row['tip'] == 0 ? $lang['srv_if_rem_all'] : ($row['tip']==1?$lang['srv_block_rem_all']:$lang['srv_loop_rem_all']) ).''."\n\r"; - echo ''; + echo '
    '; - echo '
    '; + echo '
    '; + echo ($row['tip'] == 0 ? $lang['srv_if_rem_all'] : ($row['tip']==1?$lang['srv_block_rem_all']:$lang['srv_loop_rem_all']) ); + echo '
    '; - echo ''; - echo ''.$lang['srv_zapri'].''; - echo ''; + echo '
    '; + echo ' '; + echo ($row['tip'] == 0 ? $lang['srv_if_rem_only'] : ($row['tip']==1?$lang['srv_block_rem_only']:$lang['srv_loop_rem_only']) ); + echo '
    '; - echo ''; - echo ''.($row['tip'] == 0 ? $lang['srv_if_rem'] : ($row['tip']==1?$lang['srv_block_rem']:$lang['srv_loop_rem']) ).''."\n\r"; - echo ''; + echo '
    '; - echo '
    '; // -- div_condition_editing_float + + echo '
    '; + + echo ' '; + + echo '
    '; - } - // filter v DisplayData - elseif ($vrednost == -1) { - // tega niti ni vec... - } - // profili filtrov - elseif ($vrednost == -2) { + echo '
    '; // -- div_condition_editing_float } // klasicen popup v #div_condition_editing, uporablja se npr pri ifih za obvescanje - elseif ($vrednost == -3) { - echo ''; - echo ''.$lang['srv_potrdi'].''; - echo ''; - echo ''; - echo ''.$lang['srv_zapri'].''; - echo ''; - echo ''; - echo ''.$lang['srv_if_rem'].''."\n\r"; - echo ''; - + elseif ($vrednost == -3) { + + echo '
    '; + echo ''; + echo ''; + echo '
    '; } // validacija - elseif ($vrednost == -4) { - echo ''; - echo ''.$lang['srv_potrdi'].''; - echo ''; - echo ''; - echo ''.$lang['srv_zapri'].''; - echo ''; - echo ''; - echo ''.$lang['srv_if_rem'].''."\n\r"; - echo ''; - + elseif ($vrednost == -4) { + + echo '
    '; + echo ''; + echo ''; + echo '
    '; + } + // analize, podatki, vabila ipd + elseif ($vrednost == -2) { } // filter na vrednosti - else { - echo ''; - echo ''.$lang['srv_potrdi'].''; - echo ''; - echo ''; - echo ''.$lang['srv_zapri'].''; - echo ''; - echo ''; - echo ''.$lang['srv_if_rem'].''."\n\r"; - echo ''; + else { + + echo '
    '; + echo ''; + echo ''; + echo ''; + echo '
    '; } - echo '
    '; + echo '
    '; ?>'; - echo '

    '.$lang['srv_calc'].'

    '; + echo '

    '.$lang['srv_calc'].'

    '; echo '
    '; echo $this->calculations_display($condition, 1); echo '
    '; echo '
    '; - echo '
    '; - echo '

    '.$lang['srv_editcalculation'].'

    '; - echo '
    '; + echo '
    '; $sql = sisplet_query("SELECT * FROM srv_calculation WHERE cnd_id = '$condition' ORDER BY vrstni_red"); if (mysqli_num_rows($sql) == 0) { sisplet_query("INSERT INTO srv_calculation (id, cnd_id, vrstni_red) VALUES ('', '$condition', '1')"); $sql = sisplet_query("SELECT * FROM srv_calculation WHERE cnd_id = '$condition' ORDER BY vrstni_red"); } - while ($row = mysqli_fetch_array($sql)) { + while ($row = mysqli_fetch_array($sql)) { $this->calculation_edit($row['id'], $vrednost); } - echo '

    '.$lang['srv_add_cond'].': -  + , -  - , -  * , -  /  -



    '; + echo '

    '.$lang['srv_add_cond'].': +  + , +  - , +  * , +  /  +

    '; + echo '
    '; } /** @@ -7988,53 +9183,16 @@ class Branching { $sql_count = sisplet_query("SELECT COUNT(*) AS count FROM srv_calculation WHERE cnd_id='$row[cnd_id]'"); if (!$sql_count) die(); - $row_count = mysqli_fetch_array($sql_count); - - if ($row['vrstni_red'] == 1 && $row_count['count'] > 1) { - echo ''; - echo ''; - echo ''; // gumbi oklepaji - echo ''; // logicni operatorji - echo ''; // oklepaji - echo ''; - echo ''; // gumbi zaklepaji - echo ''; // move - echo ''; - echo '
    '.$lang['srv_oklepaji'].'   '.$lang['srv_zaklepaji'].''.$lang['edit2'].'
    '; - - } elseif ($row['vrstni_red'] == 1) { - echo '
     
    '; - } - - // form - echo '
    '."\n\r"; + $row_count = mysqli_fetch_array($sql_count); - echo ''; - echo ''; + // form + echo ''."\n\r"; - // left_bracket - if ($row_count['count'] != 1 || $row['left_bracket']>0 || $row['right_bracket']>0) { - - echo ''; // operator - echo ''; + echo '
    '; + + // move + echo '
    '; + if ($row_count['count'] != 1 ) + echo ''; + echo '
    '; + + + // Srednji bel del + echo '
    '; + + // left_bracket + echo '
    '; + + if ($row_count['count'] != 1 || $row['left_bracket']>0 || $row['right_bracket']>0) { + + echo '
    '; + + echo ''; + + if ($row['left_bracket'] > 0) + echo ''; + else + echo ''; + + echo '
    '; + + echo '
    '.$lang['srv_oklepaji'].'
    '; + } + + echo '
    '; // left_bracket - echo '
    '; + echo ' ( '; + } + + echo ''; // spremenljivka - echo ''; - + echo ''; // right_bracket - echo ''; + echo ''; // right_bracket buttons + echo '
    '; + if ($row_count['count'] != 1 || $row['right_bracket']>0 || $row['left_bracket']>0) { - echo '
    '; + echo ''; - // move - echo ''; + echo ''; + + echo '
    '.$lang['srv_zaklepaji'].'
    '; + } + + echo ''; + + echo ''; + // remove - echo ''; - + echo ' '."\n\r"; + + echo ''; - echo ''; - echo '
    '; - echo ''; - - if ($row['left_bracket'] > 0) - echo ''; - else - echo ''; - } - else { - echo ''; - } - echo ''; - - if ($row['vrstni_red'] == 1) { - // nimamo nic.. - } else { + if ($row['vrstni_red'] > 1) { + echo '
    '; if ($row['operator']==0) echo ' + '; @@ -8044,22 +9202,60 @@ class Branching { echo ' * '; if ($row['operator']==3) echo ' / '; + + echo '
    '; } - echo '
    '; + echo '
    '; + for ($i=$row['left_bracket']; $i>0; $i--) { - echo ' ( '; } - echo '
    '; - if ($row['spr_id']==0) echo ''.$lang['srv_select_spr'].'!'; - echo '
    '; - echo ''."\n\r"; echo ''; echo ''; @@ -8173,8 +9369,7 @@ class Branching { // number vnos if ($row['spr_id'] == -1) { - //if ($row['number'] == 0) $row['number'] = ''; - echo ' '; + echo ' '; echo ''; - } - echo '
     '."\n\r"; - echo '
    '; + echo '
    '; + for ($i=$row['right_bracket']; $i>0; $i--) { echo ' ) '; } - echo '
    '; + + echo '
    '; + if ($row['right_bracket'] > 0) echo ''; else echo ''; - echo ''; - } else { - echo '
    '; -// echo ''; -// echo ''; - } - echo ''; - if ($row_count['count'] != 1 ) - echo ''; - echo ''; + echo '
    '; + $sql3 = sisplet_query("SELECT * FROM srv_calculation WHERE cnd_id='$row[cnd_id]'"); if (mysqli_num_rows($sql3) != 1 ) - echo ' '."\n\r"; - echo '
    '; - echo '
    '."\n\r"; + echo '
    '; + echo ''; } /** @@ -8268,7 +9463,7 @@ class Branching { $variable_ok = true; foreach ($variable_array AS $spr => $var) { - if ($spr != $row['id'] && $var == $variable) { + if ($var == $variable) { $variable_ok = false; } } @@ -8313,7 +9508,7 @@ class Branching { function nova_spremenljivka($grupa, $grupa_vrstni_red, $vrstni_red, $kuki = 0) { global $lang; - if ($kuki == 0) + if ($kuki == 0 && isset($_COOKIE['srv_clipboard_' . $this->anketa])) $kuki = $_COOKIE['srv_clipboard_' . $this->anketa]; $variable = $this->generate_variable(); @@ -8380,6 +9575,7 @@ class Branching { 'naslov' => "'".mysqli_real_escape_string($GLOBALS['connect_db'], $row['naslov'])."'", 'variable' => "'".mysqli_real_escape_string($GLOBALS['connect_db'], $variable)."'", 'variable_custom' => "'$variable_custom'", + 'vrstni_red' => "'$vrstni_red'", 'thread' => "'0'", 'edit_graf' => "'0'", // naknadno popravimo editiranje grafov - po kopiranju je onemogoceno ); @@ -8460,7 +9656,7 @@ class Branching { $condition = SurveyCopy::preformCopyTable('srv_condition', 'id', SurveyCopy::sql2array($qry_src_condition), $pre_set); // condtition grid, tabela srv_condition_grid - if (count($condition) > 0) { + if (is_countable($condition) && count($condition) > 0) { foreach ($condition AS $orig => $bckp) { // condtition grid, tabela srv_condition_grid $qry_src_condition_grid = sisplet_query("SELECT * FROM srv_condition_grid WHERE cond_id = '".$orig."'"); @@ -8472,7 +9668,7 @@ class Branching { } // condtition vrednost, tabela srv_condition_vre - if (count($condition) > 0) { + if (is_countable($condition) && count($condition) > 0) { foreach ($condition AS $orig => $bckp) { $qry_src_condition_vre = sisplet_query("SELECT * FROM srv_condition_vre WHERE cond_id = '$orig'"); //$src_srv_condition_vre = SurveyCopy::arrayfilter($arr_src['srv_condition_vre'], 'cond_id', $orig); @@ -8510,28 +9706,17 @@ class Branching { } + + } // nova (prazna) spremenljivka - } else { - + else { // pri glasovanju ustvarimo samo prvic novo spr. z default 2 variablami if(isset($_POST['survey_type']) && $_POST['survey_type'] == 0) $size = 2; else $size = 3; - if($type < 990) - $sql = sisplet_query("INSERT INTO srv_spremenljivka (id, gru_id, naslov, variable, size, tip, vrstni_red) VALUES ('', '$grupa', '

    $lang[srv_new_vprasanje]

    ', '$variable', '$size', '$type', '$vrstni_red')"); - //standardna vprasanja -> email, url, file upload, ime priimek - else{ - if($type == 991) //email - $sql = sisplet_query("INSERT INTO srv_spremenljivka (id, gru_id, naslov, variable, size, tip, vrstni_red) VALUES ('', '$grupa', '

    Vnesite vaš email naslov

    ', 'email', '1', '4', '$vrstni_red')"); - elseif($type == 992) //url - $sql = sisplet_query("INSERT INTO srv_spremenljivka (id, gru_id, naslov, variable, size, tip, vrstni_red) VALUES ('', '$grupa', '

    Vnesite URL

    ', 'url', '1', '4', '$vrstni_red')"); - elseif($type == 993) //file upload - $sql = sisplet_query("INSERT INTO srv_spremenljivka (id, gru_id, naslov, variable, size, tip, vrstni_red) VALUES ('', '$grupa', '

    Naložite datoteko

    ', 'upload', '1', '4', '$vrstni_red')"); - elseif($type == 994) //ime priimek - $sql = sisplet_query("INSERT INTO srv_spremenljivka (id, gru_id, naslov, variable, size, tip, vrstni_red, text_kosov, text_orientation) VALUES ('', '$grupa', '

    Vnesite ime in priimek

    ', 'name', '1', '21', '$vrstni_red', '2', '2')"); - } + $sql = sisplet_query("INSERT INTO srv_spremenljivka (id, gru_id, naslov, variable, size, vrstni_red) VALUES ('', '$grupa', '

    $lang[srv_new_vprasanje]

    ', '$variable', '$size', '$vrstni_red')"); if (!$sql) echo mysqli_error($GLOBALS['connect_db']); @@ -8539,6 +9724,7 @@ class Branching { $spremenljivka = mysqli_insert_id($GLOBALS['connect_db']); } + // vnesemo -4 tag v podatke, ki oznacuje novo spremenljivko $sql = sisplet_query("SELECT id FROM srv_user WHERE ank_id = '$this->anketa'"); $query_values = ""; @@ -8549,6 +9735,12 @@ class Branching { if (mysqli_num_rows($sql) > 0) sisplet_query("INSERT INTO srv_data_vrednost".$this->db_table." (spr_id, vre_id, usr_id) VALUES $query_values"); + + // Preverimo ce smo presegli limit za stevilo vprasanj + $check = new SurveyCheck($this->anketa); + $check->checkLimitSpremenljivke(); + + return $spremenljivka; } @@ -8559,10 +9751,12 @@ class Branching { */ function if_new ($endif, $parent, $if_id, $vrstni_red, $spremenljivka, $if, $copy=0, $no_content=0, $include_element=true) { - if ($copy > 0) - $cookie = $copy; - else - $cookie = substr($_COOKIE['srv_clipboard_'.$this->anketa], 3); + $cookie = 0; + + if ($copy > 0) + $cookie = $copy; + elseif(isset($_COOKIE['srv_clipboard_'.$this->anketa])) + $cookie = substr($_COOKIE['srv_clipboard_'.$this->anketa], 3); // Dodaten pogoj da nikoli ne vstavimo v srv_branching elementa ki ima element_spr=0 in element_if=0 (potem lahko pride do neskoncnega loopa kjer se dodajajo grupe v anketo) if ($if_id == 0) die('copy error2'); @@ -8578,9 +9772,9 @@ class Branching { // ob pastanju zbrisemo clipboard setcookie('srv_clipboard_'.$this->anketa, '', time()-3600); - - // navaden nov if (pri ENDIFu je nov if prazen, zato ne dodamo nicesar) - } else { + } + // navaden nov if (pri ENDIFu je nov if prazen, zato ne dodamo nicesar) + else { $s = sisplet_query("INSERT INTO srv_condition (id, if_id, vrstni_red) VALUES ('', '$if_id', '1')"); if (!$s) echo mysqli_error($GLOBALS['connect_db']); @@ -8706,6 +9900,9 @@ class Branching { SurveyCopy::preformCopyTable('srv_calculation', null, SurveyCopy::sql2array($sql2), $pre_set); } + + $vre_id = array(); + // zanka // srv_loop $qry_src_loop = sisplet_query("SELECT * FROM srv_loop WHERE if_id = '$if_copied'"); @@ -8806,7 +10003,7 @@ class Branching { if ($spr < 0) return $spr; - if ($this->if_copy_spremenljivke[$spr] > 0) + if (isset($this->if_copy_spremenljivke[$spr]) && $this->if_copy_spremenljivke[$spr] > 0) return $this->if_copy_spremenljivke[$spr]; $sql = sisplet_query("SELECT g.ank_id FROM srv_spremenljivka s, srv_grupa g WHERE s.id = '$spr' AND s.gru_id=g.id"); @@ -8827,7 +10024,7 @@ class Branching { if (!$sql) echo mysqli_error($GLOBALS['connect_db']); $row = mysqli_fetch_array($sql); - $spr_copy = $this->if_copy_spremenljivke[$row['spr_id']]; + $spr_copy = (isset($this->if_copy_spremenljivke[$row['spr_id']])) ? $this->if_copy_spremenljivke[$row['spr_id']] : 0; if ($spr_copy > 0) { $vrstni_red = $row['vrstni_red']; @@ -8838,7 +10035,8 @@ class Branching { return $row['id']; - } else { + } + else { $sql = sisplet_query("SELECT g.ank_id FROM srv_vrednost v, srv_spremenljivka s, srv_grupa g WHERE v.id='$vre' AND v.spr_id=s.id AND s.gru_id=g.id"); $row = mysqli_fetch_array($sql); @@ -8847,7 +10045,6 @@ class Branching { return $vre; else return 0; - } } @@ -9070,7 +10267,7 @@ class Branching { $gru_id = $this->find_grupa($gru_vr); - if ($this->spremenljivka_grupa[$row['element_spr']]['vrstni_red'] != $spr_vr OR $this->spremenljivka_grupa[$row['element_spr']]['gru_id'] != $gru_id) { + if (!isset($this->spremenljivka_grupa[$row['element_spr']]) || $this->spremenljivka_grupa[$row['element_spr']]['vrstni_red'] != $spr_vr || $this->spremenljivka_grupa[$row['element_spr']]['gru_id'] != $gru_id) { if ( $gru_id > 0 ) { sisplet_query("UPDATE srv_spremenljivka SET vrstni_red = '$spr_vr', gru_id='$gru_id' WHERE id = '$row[element_spr]'"); @@ -9189,7 +10386,8 @@ class Branching { // naslednij je na isti strani $next = $vrstni_red + 1; $sql = sisplet_query("SELECT id FROM srv_spremenljivka WHERE vrstni_red='$next' AND gru_id='$row[gru_id]'"); - if (mysqli_num_rows($sql) > 0) { + + if (mysqli_num_rows($sql) > 0) { $row = mysqli_fetch_array($sql); return $row['id']; } @@ -9197,12 +10395,17 @@ class Branching { // naslednik je na naslednji strani $sql = sisplet_query("SELECT g.vrstni_red FROM srv_spremenljivka s, srv_grupa g WHERE s.gru_id=g.id AND s.id='$spremenljivka'"); $row = mysqli_fetch_array($sql); + $grupa_red = $row['vrstni_red']; $next = $grupa_red + 1; - $sql = sisplet_query("SELECT s.id FROM srv_spremenljivka s, srv_grupa g WHERE s.gru_id=g.id AND g.ank_id='$this->anketa' AND g.vrstni_red = '$next' ORDER BY s.vrstni_red ASC LIMIT 1"); - $row = mysqli_fetch_array($sql); - return $row['id']; + $sql2 = sisplet_query("SELECT s.id FROM srv_spremenljivka s, srv_grupa g WHERE s.gru_id=g.id AND g.ank_id='$this->anketa' AND g.vrstni_red = '$next' ORDER BY s.vrstni_red ASC LIMIT 1"); + $row2 = mysqli_fetch_array($sql2); + + if(isset($row2['id'])) + return $row2['id']; + + return 0; } /** @@ -9234,12 +10437,16 @@ class Branching { $row = mysqli_fetch_array($sql); $grupa_red = $row['vrstni_red']; $prev = $grupa_red - 1; - $sql = sisplet_query("SELECT s.id FROM srv_spremenljivka s, srv_grupa g WHERE s.gru_id=g.id AND g.ank_id='$this->anketa' AND g.vrstni_red = '$prev' ORDER BY s.vrstni_red DESC LIMIT 1"); - $row = mysqli_fetch_array($sql); - - $this->find_prev_spr[$spremenljivka] = $row['id']; - return $row['id']; - + + $sql = sisplet_query("SELECT s.id FROM srv_spremenljivka s, srv_grupa g WHERE s.gru_id=g.id AND g.ank_id='$this->anketa' AND g.vrstni_red = '$prev' ORDER BY s.vrstni_red DESC LIMIT 1"); + if(mysqli_num_rows($sql) > 0){ + $row = mysqli_fetch_array($sql); + $this->find_prev_spr[$spremenljivka] = $row['id']; + + return $row['id']; + } + + return 0; } var $prev_srv_branching = 0; // zacasna spremenljivka @@ -9276,11 +10483,15 @@ class Branching { return $this->find_last_spr; $sql = sisplet_query("SELECT s.id FROM srv_spremenljivka s, srv_grupa g WHERE s.gru_id=g.id AND g.ank_id='$this->anketa' ORDER BY g.vrstni_red DESC, s.vrstni_red DESC LIMIT 1"); - $row = mysqli_fetch_array($sql); + + if ( mysqli_num_rows($sql) > 0 ){ + $row = mysqli_fetch_array($sql); + $this->find_last_spr = $row['id']; - $this->find_last_spr = $row['id']; - return $row['id']; + return $row['id']; + } + return 0; } /** @@ -9290,14 +10501,34 @@ class Branching { function find_last_spr_branching ($parent = 0) { $sql = sisplet_query("SELECT element_spr, element_if FROM srv_branching WHERE ank_id='$this->anketa' AND parent='$parent' ORDER BY vrstni_red DESC LIMIT 1"); - $row = mysqli_fetch_array($sql); + + if ( mysqli_num_rows($sql) > 0 ){ + $row = mysqli_fetch_array($sql); + + if ($row['element_spr'] > 0) + return $row['element_spr']; + else + return $this->find_last_spr_branching($row['element_if']); + } - if ($row['element_spr'] > 0) return $row['element_spr']; + return 0; + } - if ( mysqli_num_rows($sql) > 0 ) - return $this->find_last_spr_branching($row['element_if']); + /** + * poisce zadnji if v tabeli srv_branching + * + */ + private function find_last_if_branching ($parent = 0) { - return 0; + $sql = sisplet_query("SELECT element_if FROM srv_branching WHERE ank_id='$this->anketa' AND parent='$parent' ORDER BY vrstni_red DESC LIMIT 1"); + + if ( mysqli_num_rows($sql) > 0 ){ + $row = mysqli_fetch_array($sql); + + return $row['element_if']; + } + + return 0; } /** @@ -9309,9 +10540,14 @@ class Branching { function getGrupa4Spremenljivka($spremenljivka) { $sql = sisplet_query("SELECT g.* FROM srv_grupa AS g WHERE g.id = (SELECT s.gru_id FROM srv_spremenljivka as s WHERE s.id = '$spremenljivka')"); - $row = mysqli_fetch_assoc($sql); - return $row; + if ( mysqli_num_rows($sql) > 0 ){ + $row = mysqli_fetch_assoc($sql); + + return $row; + } + + return 0; } /** @@ -9322,28 +10558,47 @@ class Branching { */ function getGrupa4If($if_id) { - $sqlBr = sisplet_query("SELECT vrstni_red FROM srv_branching WHERE ank_id='$this->anketa' AND element_if='$if_id'"); - $rowBr = mysqli_fetch_assoc($sqlBr); - $vrstni_red_if = $rowBr['vrstni_red']; + $row = array(); - if($vrstni_red_if == 1){ - $sql = sisplet_query("SELECT * FROM srv_grupa WHERE ank_id='$this->anketa' AND vrstni_red='1'"); - $row = mysqli_fetch_assoc($sql); + // Najprej preverimo, ce imamo v ifu kaksno vprasanje - potem je 1. vprasanje na isti strani + $spr_in_if = $this->get_subspr($if_id); + if(count($spr_in_if) > 0){ + $row = $this->getGrupa4Spremenljivka($spr_in_if[0]); + return $row; } - else{ - $sqlB = sisplet_query("SELECT element_spr, pagebreak FROM srv_branching WHERE ank_id='$this->anketa' AND vrstni_red<'$vrstni_red_if' AND element_spr>'0' ORDER BY vrstni_red DESC"); - $rowB = mysqli_fetch_assoc($sqlB); - if($rowB['pagebreak'] == 0){ - $row = $this->getGrupa4Spremenljivka($rowB['element_spr']); + // If nima znotraj se nobenega vprasanja - moramo poiskati prejsnje vprasanje in ugotoviti stran - NI SE CISTO OK - JE TREBA DODELATI + $sqlBr2 = sisplet_query("SELECT vrstni_red, parent FROM srv_branching WHERE ank_id='$this->anketa' AND element_if='$if_id'"); + if(mysqli_num_rows($sqlBr2) > 0){ + + $rowBr2 = mysqli_fetch_assoc($sqlBr2); + + $vrstni_red_if = isset($rowBr2['vrstni_red']) ? $rowBr2['vrstni_red'] : null; + $parent_if = isset($rowBr2['parent']) ? $rowBr2['parent'] : null; + + if($vrstni_red_if == 1){ + $sql = sisplet_query("SELECT * FROM srv_grupa WHERE ank_id='$this->anketa' AND vrstni_red='1'"); + $row = mysqli_fetch_assoc($sql); } else{ - $prev_grupa = $this->getGrupa4Spremenljivka($rowB['element_spr']); - $row['id'] = $this->find_grupa($prev_grupa['vrstni_red']+1); - $row['vrstni_red'] = $prev_grupa['vrstni_red']+1; + $sqlB = sisplet_query("SELECT element_spr, pagebreak + FROM srv_branching + WHERE ank_id='".$this->anketa."' AND vrstni_red<'".$vrstni_red_if."' AND parent='".$parent_if."' AND element_spr>'0' + ORDER BY vrstni_red DESC + "); + $rowB = mysqli_fetch_assoc($sqlB); + + if(isset($rowB['pagebreak']) && $rowB['pagebreak'] == 0 && $rowB['element_spr']){ + $row = $this->getGrupa4Spremenljivka($rowB['element_spr']); + } + else{ + $prev_grupa = $this->getGrupa4Spremenljivka($rowB['element_spr']); + $row['id'] = $this->find_grupa($prev_grupa['vrstni_red']+1); + $row['vrstni_red'] = $prev_grupa['vrstni_red']+1; + } } } - + return $row; } @@ -9357,11 +10612,12 @@ class Branching { return $this->find_first_spr; $sql = sisplet_query("SELECT s.id FROM srv_spremenljivka s, srv_grupa g WHERE s.gru_id=g.id AND g.ank_id='$this->anketa' ORDER BY g.vrstni_red ASC, s.vrstni_red ASC LIMIT 1"); - $row = mysqli_fetch_array($sql); - - $this->find_first_spr = $row['id']; - return $row['id']; + if(mysqli_num_rows($sql) > 0){ + $row = mysqli_fetch_array($sql); + $this->find_first_spr = $row['id']; + } + return $this->find_first_spr; } /** @@ -9415,24 +10671,17 @@ class Branching { * poisce naslednji element (spremenljivko, if, blok) in vrne njegov row (parent, vrstni_red, element_spr, element_if) * v primeru ENDIFA, vrne prazno * - * @param mixed $spr - * @param mixed $if */ - var $find_next_element = array(); function find_next_element($parent, $vrstni_red) { - if (isset($this->find_next_element[$spr][$if])) - return $this->find_next_element[$spr][$if]; - $sql = sisplet_query("SELECT parent, vrstni_red, element_spr, element_if FROM srv_branching WHERE parent='$parent' AND vrstni_red>'$vrstni_red' AND ank_id='$this->anketa' ORDER BY vrstni_red ASC LIMIT 1"); if (mysqli_num_rows($sql) > 0) { $row = mysqli_fetch_array($sql); - $this->find_next_element[$spr][$if] = $row; - } else { - $this->find_next_element[$spr][$if] = null; - } - return $this->find_next_element[$spr][$if]; + return $row; + } + + return null; } /** @@ -9604,8 +10853,11 @@ class Branching { $vrstni_red = 1; $this->vrstni_red_branching_fun(0, $vrstni_red); } - - return $this->vrstni_red_branching[$if][$spremenljivka]; + + if(isset($this->vrstni_red_branching[$if][$spremenljivka])) + return $this->vrstni_red_branching[$if][$spremenljivka]; + else + return null; } /** @@ -9652,7 +10904,7 @@ class Branching { $vrstni_red = 1; - $sql = sisplet_query("SELECT element_spr, element_if FROM srv_branching WHERE parent='$parent' AND ank_id='$this->anketa' ORDER BY vrstni_red ASC"); + $sql = sisplet_query("SELECT element_spr, element_if, vrstni_red FROM srv_branching WHERE parent='$parent' AND ank_id='$this->anketa' ORDER BY vrstni_red ASC"); if (!$sql) echo mysqli_error($GLOBALS['connect_db']); while ($row = mysqli_fetch_array($sql)) { @@ -9798,33 +11050,36 @@ class Branching { // Vprasalnik se shranjuje avt. echo '
    '; - echo ''; - echo '
    '.$lang['srv_vprasalnik_autosave'].'
    '; + echo ' '; + echo ' '.$lang['srv_vprasalnik_autosave'].''; echo '
    '; echo '