diff --git a/.gitignore b/.gitignore index cb9ad28d9..7d1f10a97 100644 --- a/.gitignore +++ b/.gitignore @@ -51,4 +51,5 @@ docker /.favorites.json main/survey/skins/1045_test.css -/d \ No newline at end of file +/d +/nbproject diff --git a/admin/survey/SurveyAdmin.php b/admin/survey/SurveyAdmin.php index 991bd7868..800858d92 100644 --- a/admin/survey/SurveyAdmin.php +++ b/admin/survey/SurveyAdmin.php @@ -67,6 +67,7 @@ define("A_IZVOZI", "izvozi"); define("M_IZVOZI_EXCEL", "excel"); define("M_IZVOZI_SPSS", "spss"); define("M_IZVOZI_txt", "txt"); +define("M_IZVOZI_1ka", "1ka"); define("A_REPORT_VPRASALNIK_PDF", "vprasalnik_pdf"); define("A_REPORT_VPRASALNIK_RTF", "vprasalnik_rtf"); @@ -3119,6 +3120,12 @@ class SurveyAdmin echo '' . $lang['srv_lnk_txt'] . ' '; echo ''; + + # 1KA export + echo '
  • '; + echo '' . $lang['srv_lnk_1ka'] . '
  • '; + + echo ''; } function showcalculationsLinks(){ @@ -3355,7 +3362,7 @@ class SurveyAdmin $user_package = $userAccess->getPackage(); // paket, ki ga ima uporabnik (1, 2 , 3) $dostop_styling = ""; - if ($user_package != "") + if ($user_package != "-1" && $user_package != "") $dostop_styling = "dostop_".$user_package."ka"; echo '' . $lang['srv_moduli'] . ''; @@ -4481,7 +4488,8 @@ class SurveyAdmin echo '' . $lang['srv_export_hover_spss'] . ''; echo '' . $lang['srv_export_hover_xls'] . ''; echo '' . $lang['srv_export_hover_txt'] . ''; - + echo '' . $lang['srv_export_hover_1ka'] . ''; + // poseben excel izvoz za mfdps if(SurveyInfo::getInstance()->checkSurveyModule('mfdps')){ echo 'MFDPŠ - predmeti'; diff --git a/admin/survey/SurveyAdminSettings.php b/admin/survey/SurveyAdminSettings.php index 721314475..a6a9efb60 100644 --- a/admin/survey/SurveyAdminSettings.php +++ b/admin/survey/SurveyAdminSettings.php @@ -4459,6 +4459,8 @@ class SurveyAdminSettings { echo '
    '; } else if($_GET['m'] == 'txt') { echo ''; + } else if($_GET['m'] == '1ka') { + echo ''; } else if($_GET['m'] == 'spss') { echo ''; } else if($_GET['m'] == 'sav') { @@ -4625,6 +4627,17 @@ class SurveyAdminSettings { echo ''; } + elseif ($_GET['m'] == M_EXPORT_1KA) { + + echo '
    '.$lang['srv_lnk_1ka'].''; + echo $lang['srv_izvoz_1ka_note']; + echo '
    '; + echo ''; + echo '
    '; + + echo '
    '; + } + elseif ($_GET['m'] == 'export_PDF') { $pageBreak = isset($_GET['pageBreak']) ? $_GET['pageBreak'] : 0; @@ -10690,4 +10703,4 @@ class SurveyAdminSettings { echo ''; } } -?> \ No newline at end of file +?> diff --git a/admin/survey/ajax.php b/admin/survey/ajax.php index f0ad1cd3a..9904382d0 100644 --- a/admin/survey/ajax.php +++ b/admin/survey/ajax.php @@ -57,9 +57,42 @@ $_SESSION['langX'] = $site_url .'lang/'.$lang_admin.'.php'; $result = sisplet_query ("SELECT value FROM misc WHERE what='SurveyDostop'"); list ($SurveyDostop) = mysqli_fetch_row ($result); +global $data_export_ajax_access; + if ( (( ($admin_type <= $SurveyDostop && $SurveyDostop<3) || ($SurveyDostop==3) ) && ($admin_type>=0)) || $_GET['a']=='comment_manage' ) { // ok, bo slo naprej... } + +/* poseben primer za izvažanje na anketarskih laptopih (klic z wget) + * če imaš v settings.php definirano TO anketo in posebno kodo ter dostopaš iz lokalnega IP + * (server = klient), potem dovoli izvažanje z vnaprej definiranim userjem. + * + * To se izvozi v next/owncloud direktorij, zašifrira, sinhronizira na pravi server - kjer se dešifrira in merga, + * da se na koncu skonvertira v SPSS SAV. + */ +else if (isset ($_REQUEST['t']) && ($_REQUEST['t'] == 'export' || $_REQUEST['a'] == 'data') && // gre za export + isset ($_REQUEST['anketa']) && isset($data_export_ajax_access[$_REQUEST['anketa']]) && // to anketo imamo v special dostopu + isset ($_REQUEST['secret']) && $data_export_ajax_access[$_REQUEST['anketa']][1] == $_REQUEST['secret'] && // koda je enaka, pravilna + ($_SERVER['SERVER_ADDR'] == $_SERVER['REMOTE_ADDR'] || $_SERVER['REMOTE_ADDR']=='127.0.0.1')) +{ + $global_user_id = $data_export_ajax_access[$_REQUEST['anketa']][0]; + $admin_type = 0; + + + Common::deletePreviewData($anketa); + // naj še fizično izbriše z diska!!! + + $SDF = SurveyDataFile::get_instance(); + $SDF->init($anketa); + $SDF->prepareFiles(); + + $SDS = new SurveyDataDisplay($anketa); + + + + +} + else { header ('location: ' .$site_url .'admin/survey/index.php'); die(); diff --git a/admin/survey/api/api_test.php b/admin/survey/api/api_test.php index 33e879860..a63c552b4 100644 --- a/admin/survey/api/api_test.php +++ b/admin/survey/api/api_test.php @@ -94,19 +94,13 @@ function executePOST(){ //$params .= '&ank_id='.$ank_id; // ostali parametri potrebni za klic funkcije (id ankete, vprašanja...) // POST data + // primer, sestavi po svoje. $post_data = array( - "email" => "peter@1ka.si", - "firstname" => "Peter", - "lastname" => "Hrvatin" + "email" => "...", + "firstname" => "...", + "lastname" => "..." ); - /*$post_data = array( - "email" => "BRATISLAVA.LAMAC@PLANEOELEKTRO.SK", - "firstname" => "MONIKA", - "lastname" => "ŽIAKOVÁ", - "expired" => "7", - "param_string" => "rekid=5406729&dnid=10352449&brand=MORA&ser=Žiak Pavel Žiak - GOREMO (Víglaš)&serenota=Pavel Žiak - GOREMO&sercenter=SC Slovakia&drzava=Slovakia" - );*/ $post_data = array( "naslov_vprasalnika" => "naslovovoovvo", @@ -144,4 +138,4 @@ function executePOST(){ return $result; } - \ No newline at end of file + diff --git a/admin/survey/classes/class.GDPR.php b/admin/survey/classes/class.GDPR.php index ddde5a4f5..7c2e2226a 100644 --- a/admin/survey/classes/class.GDPR.php +++ b/admin/survey/classes/class.GDPR.php @@ -1868,12 +1868,13 @@ class GDPR{ $signature = Common::getEmailSignature(); $content .= $signature; } - + // Posljemo mail avtorju ankete in na help@1ka.si za obvestilo adminu try{ $MA = new MailAdapter(); $MA->addRecipients($survey_data['author_email']); + // tole ni ok, a se da v modulu nastaviti kako spremenljivko? if(Common::checkModule('gorenje')){ //$MA->addRecipients('dusan.rutnik@gorenje.com'); $MA->addRecipients('gdpr@gorenje.com'); @@ -1881,10 +1882,12 @@ class GDPR{ elseif(AppSettings::getInstance()->getSetting('gdpr_admin_email') !== false){ $MA->addRecipients($gdpr_admin_email); } - else{ + // šele če pri instalaciji ni nič nastavljeno in ni lastna instalacija, gre na 1ka. + // tale gmail bo treba ukiniti prej ali slej (GDPR se pošilja na gmail, WTF?!) + elseif (!isLastnaInstalacija()) { $MA->addRecipients('help@1ka.si'); $MA->addRecipients('enklikanketa@gmail.com'); - } + } $resultX = $MA->sendMail($content, $subject); } diff --git a/admin/survey/classes/class.SurveyCheck.php b/admin/survey/classes/class.SurveyCheck.php index 2e81972ae..12dd380d8 100644 --- a/admin/survey/classes/class.SurveyCheck.php +++ b/admin/survey/classes/class.SurveyCheck.php @@ -217,10 +217,6 @@ class SurveyCheck { private function sendAlert($alert_type, $count=0){ global $site_url; - // Alerta ne posljemo na lastnih instalacijah - if(isLastnaInstalacija()) - return; - // Dobimo hash ankete $anketa_hash = SurveyInfo::getInstance()->getSurveyColumn('hash'); @@ -260,10 +256,19 @@ class SurveyCheck { // Dodamo se link do predogleda $content .= '

    Predogled ankete: '.$site_url.'a/'.$anketa_hash.'&preview=on'; - try{ + if (!isLastnaInstalacija()) { + $prejemnik_obvestila = 'info@1ka.si'; + } + elseif(AppSettings::getInstance()->getSetting('gdpr_admin_email') !== false){ + $prejemnik_obvestila = AppSettings::getInstance()->getSetting('gdpr_admin_email'); + } + else { + return; + } + + try { $MA = new MailAdapter($anketa=null, $type='admin'); - //$MA->addRecipients('peter.hrvatin@gmail.com'); - $MA->addRecipients('info@1ka.si'); + $MA->addRecipients($prejemnik_obvestila); $resultX = $MA->sendMail($content, $title); } catch (Exception $e){ @@ -343,4 +348,4 @@ class SurveyCheck { } } -?> \ No newline at end of file +?> diff --git a/admin/survey/classes/class.SurveyConditionProfiles.php b/admin/survey/classes/class.SurveyConditionProfiles.php index de6cb2c1c..f92b1cb72 100644 --- a/admin/survey/classes/class.SurveyConditionProfiles.php +++ b/admin/survey/classes/class.SurveyConditionProfiles.php @@ -832,13 +832,6 @@ class SurveyConditionProfiles } -# static function setConditionLabel($pid,$condition_label) { -# if ((int)$pid > 0 ) { -# $updateString = "UPDATE srv_condition_profiles SET condition_label = '" . $condition_label . "' WHERE id = '" . $pid . "'"; -# $sqlInsert = sisplet_query($updateString); -# } -# } - static function setConditionError($pid,$condition_error) { if ((int)$pid > 0 ) { $updateString = "UPDATE srv_condition_profiles SET condition_error = '" . $condition_error . "' WHERE id = '" . $pid . "'"; @@ -846,47 +839,45 @@ class SurveyConditionProfiles } } - static function getConditionString($if_id = null) - { + static function getConditionString($if_id = null){ global $lang; - # $condition_label = self::$profiles[self::$currentProfileId]['condition_label']; ob_start(); $b = new Branching(self::$sid ); - if ($if_id == null || (int)$if_id == 0) - { + if ($if_id == null || (int)$if_id == 0){ $if_id = (int)self::$profiles[self :: $currentProfileId]['if_id']; } + $b->display_if_label($if_id); - #$condition_label = mysqli_escape_string(ob_get_contents()); $condition_label = ob_get_contents(); ob_end_clean(); + if ( $if_id > 0 && $condition_label != '') { - echo '
    '; - #if (self::$profiles[self :: $currentProfileId]['type'] == 'inspect') { - # echo ''.$lang['srv_profile_data_is_filtred_zoom'].''; - #} else { - echo ''.$lang['srv_profile_data_is_filtred'].''; - #} - echo '('.self::$profiles[self :: $currentProfileId]['name'].')'; - echo ''.$condition_label.''; - // ali imamo napake v ifu + echo '
    '; + + echo '
    '; + + echo ' '.self::$profiles[self :: $currentProfileId]['name'].''; + + echo ' '.$condition_label.''; + + // ali imamo napake v ifu if ((int)self::$profiles[$if_id]['condition_error'] != 0) { - echo '
    '; - echo ' '; - echo ''.$lang['srv_profile_condition_has_error'].''; - echo ''; - } - echo ''.$lang['srv_profile_edit'].''; - echo ''.$lang['srv_profile_remove'].''; - #if (self::$profiles[self :: $currentProfileId]['type'] == 'inspect') { - # echo ''.$lang['srv_zoom_link_whoisthis'].''; - #} + echo ' '.$lang['srv_profile_condition_has_error'].''; + } + + echo '
    '; + echo ' '; + echo ' '; + echo '
    '; + + echo '
    '; + echo '
    '; - echo '
    '; + return true; } @@ -1009,4 +1000,4 @@ class SurveyConditionProfiles return false; } } -?> \ No newline at end of file +?> diff --git a/admin/survey/classes/class.SurveyExport.php b/admin/survey/classes/class.SurveyExport.php index 7494191d2..0f3653f2a 100644 --- a/admin/survey/classes/class.SurveyExport.php +++ b/admin/survey/classes/class.SurveyExport.php @@ -132,7 +132,7 @@ class SurveyExport case 'sav': self::exportSav(); break; - case 'spss': + case 'spss': self::exportSpss(); break; case 'excel': @@ -144,6 +144,9 @@ class SurveyExport case 'txt': self::exportText(); break; + case '1ka': + self::export1KA(); + break; } } @@ -154,7 +157,7 @@ class SurveyExport if ($this->_fileStatus >= 0) { - $this->_HEADERS = unserialize(file_get_contents($this->_headFileName)); + $this->_HEADERS = unserialize(file_get_contents($this->_headFileName)); $this->exportSettings = array(); foreach ($_SESSION AS $pkey => $pvalue) @@ -611,7 +614,7 @@ class SurveyExport fwrite($file_handler,$output2."\n"); fclose($file_handler); - + # sfiltriramo podatke exec ('awk -F'.$this->_QUOTE.STR_DLMT.$this->_QUOTE.' '.$this->_QUOTE.$this->_CURRENT_STATUS_FILTER.' {print $0}'.$this->_QUOTE.' '.$this->_dataFileName.' > '.$this->_dataFileName .'_data1'.TMP_EXT); if (IS_WINDOWS) { @@ -711,6 +714,110 @@ class SurveyExport exit; } + + /** naredimo izvoz za txt + * + */ + function export1KA() { + $this->_EXPORT_FULL_META = true; + $this->_EXPORT_HIDDEN_SYSTEM = true; + $this->_SPECIAL_EXPORT = true; + + $this->setUpFilter(); + + global $site_path; + + $folder = $site_path . EXPORT_FOLDER.'/'; + + // če fajl obstaja, ga briši (dodaj) + if ($this->_fileStatus >= 0 && $this->_dataFileName !== null && $this->_dataFileName !== '' && $this->_headFileName !== null && $this->_headFileName !== '') { + + #zapišemo v temp file + + $file_handler = fopen($this->_dataFileName.'.1ka',"w"); + + $output1 = ''; + $output2 = ''; + + // array za labele (ce jih izpisujemo) + $display_labels = true; + $labels = array(); + + # naredimo header row + foreach ($this->_HEADERS AS $spid => $spremenljivka) { + if (isset($this->_SVP_PV[$spid])) { + foreach ($spremenljivka['grids'] AS $gid => $grid) { + foreach ($grid['variables'] AS $vid => $variable ){ + + // izvozimo KOMPLET VSE + $output1 .= strip_tags($variable['variable']).'|'; + $output2 .= strip_tags($variable['naslov']).'|'; + } + } + } + + // Ce izpisujemo tudi labele + if($display_labels && isset($spremenljivka['spr_id'])){ + if(in_array($spremenljivka['tip'], array('1','3','6','16'))){ + + $sequences = array(); + $sequences = explode('_', $spremenljivka['sequences']); + $vars = $this->getVariableLabels($spremenljivka['spr_id']); + + foreach($sequences as $sequence){ + $labels[$sequence] = $vars; + } + } + } + } + fwrite($file_handler,$output1."\n"); + fwrite($file_handler,$output2."\n"); + fclose($file_handler); + + # izvedemo download + $out_file = fopen($this->_dataFileName .'.1ka',"a"); + if ($fd = fopen ($this->_dataFileName, "r")) { + while(($line = fgets($fd)) !== false) { + fwrite($out_file, $line); + } + } + else { + echo "Napaka"; + } + fclose ($fd); + fclose ($out_file); + + if ($fd = fopen ($this->_dataFileName.'.1ka', "r")) { + ob_clean(); + + $fsize = filesize($this->_dataFileName.'.1ka'); + $path_parts = pathinfo($this->_dataFileName.'.1ka'); + $ext = strtolower($path_parts["extension"]); + header('Content-type: text/plain; charset='.$convertTypes[$convertType]['charSet']); + header('Content-Disposition: attachment; filename="anketa'.$this->sid.'-'.date('Y-m-d').'.txt"'); + header('Pragma: public'); + header('Expires: 0'); + header('Cache-Control: must-revalidate, post-check=0, pre-check=0'); + header('Cache-Control: private',false); + header('Content-Transfer-Encoding:­ binary'); + ob_flush(); + + while(($line = fgets($fd)) !== false) { + echo $line; + } + fclose ($fd); + + } + + } + else { + echo ''; + } + unlink ($this->_dataFileName.'.1ka'); + + exit; + } + // shranim SPS in A00, potem pokličem spss in je. private function exportSav () { @@ -1450,4 +1557,4 @@ class SurveyExport return $response; } } -?> \ No newline at end of file +?> diff --git a/admin/survey/classes/class.SurveyInpect.php b/admin/survey/classes/class.SurveyInpect.php index 7416a2117..3cbfd3aca 100644 --- a/admin/survey/classes/class.SurveyInpect.php +++ b/admin/survey/classes/class.SurveyInpect.php @@ -698,8 +698,11 @@ class SurveyInspect { function getConditionString() { global $lang; + global $site_url; + #preverimi ali imamo nastavljen pogoj za inspect $if_id = (int)SurveyUserSetting :: getInstance()->getSettings('inspect_if_id'); + if ($if_id > 0) { ob_start(); $b = new Branching($this->sid); @@ -724,7 +727,8 @@ class SurveyInspect { # } # session_start(); - global $site_url; + + if (isset($_SESSION['inspectFromPodstran'][$this->sid])) { $inspect_comeFrom = '\''.$site_url.'admin/survey/index.php?anketa='.$this->sid.'&a=analysis&m='.$_SESSION['inspectFromPodstran'][$this->sid].'\''; unset($_SESSION['inspectFromPodstran'][$this->sid]); @@ -739,6 +743,7 @@ class SurveyInspect { echo ''.$lang['srv_profile_remove'].''; echo '
    '; echo '
    '; + return true; } } @@ -792,4 +797,4 @@ class SurveyInspect { } return $vars; } -} \ No newline at end of file +} diff --git a/admin/survey/classes/class.SurveyTimeProfiles.php b/admin/survey/classes/class.SurveyTimeProfiles.php index a8936524d..19de17775 100644 --- a/admin/survey/classes/class.SurveyTimeProfiles.php +++ b/admin/survey/classes/class.SurveyTimeProfiles.php @@ -696,7 +696,9 @@ class SurveyTimeProfiles { */ static function printIsDefaultProfile() { global $lang; + if (self::$currentProfileId != 0) { + $cp_data = self::GetCurentProfileData(); echo '
    '; @@ -741,4 +743,4 @@ class SurveyTimeProfiles { return false; } } -?> \ No newline at end of file +?> diff --git a/admin/survey/classes/class.SurveyZoom.php b/admin/survey/classes/class.SurveyZoom.php index 8d3009244..228ea2376 100644 --- a/admin/survey/classes/class.SurveyZoom.php +++ b/admin/survey/classes/class.SurveyZoom.php @@ -520,6 +520,7 @@ class SurveyZoom if (is_countable($vars) && count($vars) > 0) { $conditions = self::$profiles[self::$currentProfileId]['conditions']; + if ($showDiv == true) { echo ''; + } private function displaySettingsGoogle(){ @@ -442,4 +443,4 @@ class DisplaySettings{ $result = curl_exec($ch); } -} \ No newline at end of file +} diff --git a/frontend/payments/api_test.php b/frontend/payments/api_test.php index ba15099a4..1cf828237 100644 --- a/frontend/payments/api_test.php +++ b/frontend/payments/api_test.php @@ -112,7 +112,7 @@ function executePOST(){ "narocilo_id" => '33' );*/ $post_data = array( - "email" => 'peter@1ka.si' + "email" => '...' ); /*$post_data = array( "podjetje_drzava" => 'Germany', @@ -166,4 +166,4 @@ function executePOST(){ return $result; } - \ No newline at end of file + diff --git a/function.php b/function.php index 6263933d2..f353605ef 100644 --- a/function.php +++ b/function.php @@ -59,6 +59,8 @@ if (!$connect_db = mysqli_connect($mysql_server, $mysql_username, $mysql_passwor } // To je ostanek sispleta in verjetno ne sme biti več prisotno? +// NAPAČNO, to je za stare instalacije, ki imajo Mario/SQL nastavljen na latin1. +// če imaš v anketah kvake namesto ČŽŠ, odkomentiraj. //sisplet_query("SET character_set_results=latin1"); @@ -772,4 +774,4 @@ function root_dir($file = null) return __DIR__ .'/'. $file; } -?> \ No newline at end of file +?> diff --git a/lang/1.php b/lang/1.php index f5c33f377..44719d0f1 100644 --- a/lang/1.php +++ b/lang/1.php @@ -1583,6 +1583,7 @@ $lang = array ( "srv_lnk_sav" => "SPSS SAV", "srv_lnk_PDF/RTF" => "Zaporedni izpis vseh respodentov", "srv_lnk_txt" => "Tekstovna datoteka", + "srv_lnk_1ka" => "1KA oblika", "srv_lnk_data_view" => "Pregled", "srv_lnk_data_edit" => "Urejanje", "srv_izvoz_step1" => "1. korak:", @@ -1610,7 +1611,9 @@ $lang = array ( "srv_izvoz_step4_SPSS" => "Datoteko s sintakso nato poženemo z ukazom RUN ALL (najdemo ga v spustnem meniju RUN) in tako kreiramo novo datoteko - bazo podatkov (.sav), ki jo lahko shranimo.", "srv_izvoz_step5_SPSS" => "Po izvozu v SPSS/PASW lahko določimo tudi manjkajoče vrednosti. Postavimo se v zavihek Variable View in v stolpcu Missing označimo 'Range plus one optional discrete missing value; Low: -99; High: -1;' v 1KA so namreč manjkajoče vse negativne vrednosti s sledečimi pomeni:
    (-1) Ni odgovoril
    (-2) Preskok (if)
    (-3) Prekinjeno
    (-4) Naknadno vprašanje
    (-97) Neustrezno
    (-98) Zavrnil
    (-99) Ne vem.", "srv_izvoz_txt_note" => "Podatke lahko izvozite v tekstovno ASCII datoteko s klikom na spodnji ukaz:", + "srv_izvoz_1ka_note" => "Podatke lahko izvozite v specialno 1KA datoteko s klikom na spodnji ukaz:", "srv_izvoz_txt_file" => "Izvoz v tekstovno datoteko", + "srv_izvoz_1ka_file" => "Izvoz v 1KA podatkovno (.1KD) datoteko", "srv_izvoz_SPSS_complex_note" => "Pri izvozu zelo kompleksne ankete z zankami vam v primeru kakršnih koli težav priporočamo najprej izvoz v Excel, in nato uvoz v SPSS.", "srv_izvoz_SPSS_faq" => "V primeru kakršnihkoli zapletov (npr. pri kompleksnih anketah z zankami, stare verzije SPSS) priporočamo izvoz v Excel, in nato uvoz v SPSS. To priporočamo še posebej pri kombiniranih tabelah. Več o izvozih v SPSS si lahko preberete v priročniku Izvoz v SPSS. V primeru težav kontaktirajte Pomoč uporabnikom.", "srv_izvoz_SAV_note1" => "Podatke izvozite v SPSS SAV s klikom na spodnji ukaz:", @@ -2403,6 +2406,7 @@ $lang = array ( "srv_concl_link_go" => "Skoči na povezavo", "srv_concl_link_rec" => "Rekurzivno", "srv_concl_deactivation_text" => "Obvestilo pri deaktivaciji", + "srv_concl_deactivation_text_edit" => "Napredno urejanje obvestila pri deaktivaciji", "srv_concl_link_params" => "URL parametri", "srv_concl_link_usr_id" => "ID respondenta", "srv_concl_link_status" => "Status responedenta", diff --git a/lang/2.php b/lang/2.php index 2f26f76c0..2d278279d 100644 --- a/lang/2.php +++ b/lang/2.php @@ -1571,6 +1571,7 @@ $lang = array ( "srv_lnk_sav" => "SPSS SAV", "srv_lnk_PDF/RTF" => "Respondent results", "srv_lnk_txt" => "Text file", + "srv_lnk_1ka" => "1KA format", "srv_lnk_data_view" => "Preview", "srv_lnk_data_edit" => "Editing", "srv_izvoz_step1" => "Step 1:", @@ -1599,6 +1600,8 @@ $lang = array ( "srv_izvoz_step5_SPSS" => "After export we can define missing values. In SPSS/PASW we open the Variable View, find the column Missing and select 'Range plus one optional discrete missing value; Low: -99; High: -1.' Default missing values in 1KA are:
    (-1) Not answered
    (-2) Skipped (condition)
    (-3) Drop-out
    (-4) Subsequently added question
    (-97) Not applicable
    (-98) Refused
    (-99) Don't know.", "srv_izvoz_txt_note" => "Data can be exported in a text ASCII file by clicking the button below:", "srv_izvoz_txt_file" => "Text file export", + "srv_izvoz_1ka_note" => "Data can be exported into a 1KA data file by clicking the button below:", + "srv_izvoz_1ka_file" => "1KA data (.1KD) file export", "srv_izvoz_SPSS_complex_note" => "If you encounter any problems while exporting complex surveys with loops, we suggest you first export data to Excel and then import it into SPSS.", "srv_izvoz_SPSS_faq" => "In case of complications (e.g. complex surveys with loops, old SPSS versions) we suggest export to Excel and then import into SPSS. We specifically recommended for multiple tables. You can find more information about SPSS exports in the SPSS Export manual. In case of any problems please contact Help center.", "srv_izvoz_SAV_note1" => "Export data in SPSS (SAV) format by clicking the button below:", @@ -2388,6 +2391,7 @@ $lang = array ( "srv_concl_link_go" => "Jump to link", "srv_concl_link_rec" => "Recursive", "srv_concl_deactivation_text" => "Deactivation note", + "srv_concl_deactivation_text_edit" => "Edit deactivation note", "srv_concl_link_params" => "URL parameters", "srv_concl_link_usr_id" => "Respondent ID", "srv_concl_link_status" => "Respondent status", @@ -8654,4 +8658,4 @@ GDPR introduction preview", ); -?> \ No newline at end of file +?> diff --git a/main/survey/app/Controllers/BodyController.php b/main/survey/app/Controllers/BodyController.php index f9bdd71ca..154552214 100644 --- a/main/survey/app/Controllers/BodyController.php +++ b/main/survey/app/Controllers/BodyController.php @@ -1853,6 +1853,7 @@ class BodyController extends Controller * @desc prikaze trenutno grupo */ public function displayGrupa(){ + global $fieldwork_install; global $admin_type; @@ -1975,7 +1976,8 @@ class BodyController extends Controller // Preverimo, ce je uporabnik ze bil na strani if(Check::getInstance()->check_subsequent_visit()){ - echo ''; +// PREVERI ME! +// echo ''; } } @@ -2518,4 +2520,4 @@ class BodyController extends Controller echo '
    '; } -} \ No newline at end of file +} diff --git a/main/survey/app/Controllers/CheckController.php b/main/survey/app/Controllers/CheckController.php index 598e20ab7..1d7538934 100644 --- a/main/survey/app/Controllers/CheckController.php +++ b/main/survey/app/Controllers/CheckController.php @@ -663,10 +663,11 @@ class CheckController extends Controller $row1 = mysqli_fetch_array($sql1); save('grupa', $row1['id']); - - $grupa = Find::getInstance()->findNextGrupa(); - + + $grupa = Find::getInstance()->findSameGrupa(); + if ($grupa > 0) { + $_GET['grupa'] = $grupa; // v primeru dostopa s kodo, po vpisu kode nastavi $_GET['grupa'] na 0. Ker se drugje v kodi preverja GET, ga nastavim tu na pravo vrednost, da deluje "nadaljuj kjer je ostal" tudi v primeru dostopa s kodo. setcookie('ref', get('anketa')); // cookie z referalom (da se ne sprozi redirect zaradi referala pri ?code= ) return header("Location: " . \SurveyInfo::getSurveyLink() . "&grupa=$grupa" . (isset($_GET['language']) ? '&language=' . $_GET['language'] : '') . (isset($_GET['skupina']) ? '&skupina=' . $_GET['skupina'] : '') . get('cookie_url') . "&c"); die(); @@ -770,4 +771,4 @@ class CheckController extends Controller else return false; } -} \ No newline at end of file +} diff --git a/main/survey/app/Controllers/FindController.php b/main/survey/app/Controllers/FindController.php index e0913c99b..4a38d0922 100644 --- a/main/survey/app/Controllers/FindController.php +++ b/main/survey/app/Controllers/FindController.php @@ -286,5 +286,38 @@ class FindController extends Controller return 0; } } + /** + * @desc poisce naslednjo stran - grupo, 0 pomeni konec + */ + public function findSameGrupa($gru_id=0) + { + //vrstni red trenutne grupe + if (get('grupa') > 0) { + $sql = sisplet_query("SELECT vrstni_red FROM srv_grupa WHERE id = '" . get('grupa') . "'"); + $row = mysqli_fetch_array($sql); + $vrstni_red = $row['vrstni_red']; + } + elseif ($gru_id > 0) { + $sql = sisplet_query("SELECT vrstni_red FROM srv_grupa WHERE id = '" . $gru_id . "'"); + $row = mysqli_fetch_array($sql); + $vrstni_red = $row['vrstni_red']; + } + else { + $vrstni_red = 0; + } -} \ No newline at end of file + $sql = sisplet_query("SELECT id FROM srv_grupa WHERE ank_id='" . get('anketa') . "' AND vrstni_red='$vrstni_red' ORDER BY vrstni_red ASC LIMIT 1"); + + // naslednja stran + if (mysqli_num_rows($sql) > 0) { + $row = mysqli_fetch_array($sql); + return $row['id']; + } + // konec + else { + return 0; + } + } + + +} diff --git a/settings.php.example b/settings.php.example index 9db55e7e5..36d27ce00 100644 --- a/settings.php.example +++ b/settings.php.example @@ -23,4 +23,23 @@ $pass_salt = ''; $mysql_server = 'localhost'; $mysql_username = ''; $mysql_password = ''; -$mysql_database_name = ''; \ No newline at end of file +$mysql_database_name = ''; + + +/** + * Nastavitve za F2F laptop delo + */ + +$fieldwork_install = false; + +/* + Nastavitev dostopa za export podatkov v .A00 (kao .1KD - 1ka data), + ki se uporablja za redne izvoze in sinhronizacijo na centralni strežnik. + + Za več preveri F2F.md! + + data_export_ajax_access= [id_survey => [id_user, skrita_koda]] + */ + +$data_export_ajax_access = []; +