Merge remote-tracking branch 'origin/master' into master

This commit is contained in:
Robert Smalc 2020-08-27 13:49:50 +02:00
commit 6a5fc8d0e7
2 changed files with 4 additions and 55 deletions

View File

@ -128,8 +128,6 @@ class SurveyDataCollect{
if (is_numeric($sid) && (int)$sid > 0) { if (is_numeric($sid) && (int)$sid > 0) {
$this->setLogCheckpoint('START');
// Nastavimo id ankete // Nastavimo id ankete
$this->sid = $sid; $this->sid = $sid;
@ -139,8 +137,6 @@ class SurveyDataCollect{
// Nastavimo spremenljivke, ki so potrebne pri generiranju datoteke (cas zadnjega vnosa, status datoteke...) // Nastavimo spremenljivke, ki so potrebne pri generiranju datoteke (cas zadnjega vnosa, status datoteke...)
$this->prepareVariables(); $this->prepareVariables();
$this->setLogCheckpoint('CONST2');
// Za vsak slucaj resetiramo vse pointerje // Za vsak slucaj resetiramo vse pointerje
$this->cleanup(); $this->cleanup();
@ -214,24 +210,14 @@ class SurveyDataCollect{
public function createFiles() { public function createFiles() {
global $site_url, $lang, $site_path; global $site_url, $lang, $site_path;
$this->setLogCheckpoint('CF1');
// Najprej zakesiramo vse podatke // Najprej zakesiramo vse podatke
$this->cache_data(); $this->cache_data();
$this->setLogCheckpoint('CF2');
// Zgeneriramo datoteko z naslovno vrstico // Zgeneriramo datoteko z naslovno vrstico
$CH = (int)$this->createHeadFile(); $CH = (int)$this->createHeadFile();
$this->setLogCheckpoint('CF3');
// Zgeneriramo datoteko s podatki // Zgeneriramo datoteko s podatki
$CD = (int)$this->createDataFile(); $CD = (int)$this->createDataFile();
$this->setLogCheckpoint('CF4');
$this->saveLogCheckpoints();
} }
// Posodobimo datoteke ker so zastarele // Posodobimo datoteke ker so zastarele
@ -297,8 +283,6 @@ class SurveyDataCollect{
// Kreiramo datoteko z responsi // Kreiramo datoteko z responsi
private function createDataFile() { private function createDataFile() {
$this->setLogCheckpoint('CDF1');
$result = false; $result = false;
// Pobrišemo še morebitne prazne vrstice // Pobrišemo še morebitne prazne vrstice
@ -326,8 +310,6 @@ class SurveyDataCollect{
// Datoteko pripravimo za dodajanje // Datoteko pripravimo za dodajanje
$file_handler = fopen($this->data_file_name, "a"); $file_handler = fopen($this->data_file_name, "a");
$this->setLogCheckpoint('CDF2');
if ($this->noErrors) { if ($this->noErrors) {
$_tmpCnt = 0; $_tmpCnt = 0;
@ -348,8 +330,6 @@ class SurveyDataCollect{
$_tmpCnt++; $_tmpCnt++;
} }
} }
$this->setLogCheckpoint('CDF3');
// Peverimo da res ni prišlo do napak // Peverimo da res ni prišlo do napak
if ($this->noErrors) { if ($this->noErrors) {
@ -371,8 +351,6 @@ class SurveyDataCollect{
} }
} }
$this->setLogCheckpoint('CDF4');
// Zapremo datoteko // Zapremo datoteko
if ($file_handler !== null) { if ($file_handler !== null) {
fclose($file_handler); fclose($file_handler);
@ -419,9 +397,7 @@ class SurveyDataCollect{
// Naredimo še cleanup pointerjev // Naredimo še cleanup pointerjev
$this->cleanup(); $this->cleanup();
$this->setLogCheckpoint('CDF5');
return $result; return $result;
} }
@ -1419,15 +1395,11 @@ class SurveyDataCollect{
// Zbiramo podatke // Zbiramo podatke
public function CollectData($c, $file_handler) { public function CollectData($c, $file_handler) {
global $site_path, $site_url, $lang, $admin_type; global $site_path, $site_url, $lang, $admin_type;
$this->setLogCheckpoint('C1');
# osvežimo podatke # osvežimo podatke
if (mysqli_num_rows($this->_qry_users[$c]) > 0) { if (mysqli_num_rows($this->_qry_users[$c]) > 0) {
mysqli_data_seek($this->_qry_users[$c], 0); mysqli_data_seek($this->_qry_users[$c], 0);
} }
$this->setLogCheckpoint('C2');
$_tmpCnt = $c * MAX_USER_PER_LOOP; $_tmpCnt = $c * MAX_USER_PER_LOOP;
@ -1439,8 +1411,6 @@ class SurveyDataCollect{
// lang od 0 je privzet // lang od 0 je privzet
$jeziki[0] = $lang['language']; $jeziki[0] = $lang['language'];
$jeziki[$lang['id']] = $lang['language']; $jeziki[$lang['id']] = $lang['language'];
$this->setLogCheckpoint('C3');
if ($this->noErrors) { if ($this->noErrors) {
@ -2687,8 +2657,6 @@ class SurveyDataCollect{
} // end while user loop } // end while user loop
} // end if ($this->noErrors) } // end if ($this->noErrors)
$this->setLogCheckpoint('C4');
} }
/***** KONEC - ZBIRANJE PODATKOV ZA DATOTEKO *****/ /***** KONEC - ZBIRANJE PODATKOV ZA DATOTEKO *****/
@ -3343,9 +3311,6 @@ class SurveyDataCollect{
// Zakesiramo odgovore respondenta // Zakesiramo odgovore respondenta
private function cache_data_respondent($string_user){ private function cache_data_respondent($string_user){
$this->setLogCheckpoint('CDR1'.$string_user);
if ($this->_str_questions != '') { if ($this->_str_questions != '') {
// resetiramo POINTER-je - Array-je do podatkov // resetiramo POINTER-je - Array-je do podatkov
@ -3373,15 +3338,10 @@ class SurveyDataCollect{
$_string_user = explode(',', $_string_user); $_string_user = explode(',', $_string_user);
$string_user = ' AND usr_id BETWEEN '.$_string_user[0].' AND '.end($_string_user); $string_user = ' AND usr_id BETWEEN '.$_string_user[0].' AND '.end($_string_user);
$this->setLogCheckpoint('CDR2'.$string_user);
// Zakesiramo vse podatke - ce ni nobenega vprasanja tega tipa v anketi, ne rabimo tega izvajat // Zakesiramo vse podatke - ce ni nobenega vprasanja tega tipa v anketi, ne rabimo tega izvajat
$this->cache_data_respondent_vrednost($string_user); $this->cache_data_respondent_vrednost($string_user);
$this->setLogCheckpoint('CDR2B'.$string_user);
$this->cache_data_respondent_text($string_user); $this->cache_data_respondent_text($string_user);
$this->setLogCheckpoint('CDR3'.$string_user);
// Kesiranje podatkov za srv_data_grid // Kesiranje podatkov za srv_data_grid
if((isset($this->_cnt_questions_types['6']) && $this->_cnt_questions_types['6'] > 0) if((isset($this->_cnt_questions_types['6']) && $this->_cnt_questions_types['6'] > 0)
|| (isset($this->_cnt_questions_types['16']) && $this->_cnt_questions_types['16'] > 0) || (isset($this->_cnt_questions_types['16']) && $this->_cnt_questions_types['16'] > 0)
@ -3391,8 +3351,6 @@ class SurveyDataCollect{
) )
$this->cache_data_respondent_grid($string_user); $this->cache_data_respondent_grid($string_user);
$this->setLogCheckpoint('CDR4'.$string_user);
// Kesiranje podatkov za srv_data_checkgrid // Kesiranje podatkov za srv_data_checkgrid
if((isset($this->_cnt_questions_types['6']) && $this->_cnt_questions_types['6'] > 0) if((isset($this->_cnt_questions_types['6']) && $this->_cnt_questions_types['6'] > 0)
|| (isset($this->_cnt_questions_types['16']) && $this->_cnt_questions_types['16'] > 0) || (isset($this->_cnt_questions_types['16']) && $this->_cnt_questions_types['16'] > 0)
@ -3424,8 +3382,6 @@ class SurveyDataCollect{
$this->cache_data_respondent_heatmap($string_user); $this->cache_data_respondent_heatmap($string_user);
$this->cache_data_respondent_heatmap_regions($string_user); $this->cache_data_respondent_heatmap_regions($string_user);
} }
$this->setLogCheckpoint('CDR5'.$string_user);
// Kesiranje podatkov za srv_data_vrednost_cond // Kesiranje podatkov za srv_data_vrednost_cond
if((isset($this->_cnt_questions_types['2']) && $this->_cnt_questions_types['2'] > 0) if((isset($this->_cnt_questions_types['2']) && $this->_cnt_questions_types['2'] > 0)
@ -3436,8 +3392,6 @@ class SurveyDataCollect{
// Kesiranje podatkov za randomizirane vrednosti oz. randomizirana vprasanja v blokih // Kesiranje podatkov za randomizirane vrednosti oz. randomizirana vprasanja v blokih
$this->cache_data_respondent_random($string_user); $this->cache_data_respondent_random($string_user);
} }
$this->setLogCheckpoint('CDR6'.$string_user);
} }
// Zakesiramo case odgovorov po straneh za respondenta // Zakesiramo case odgovorov po straneh za respondenta
@ -3462,8 +3416,6 @@ class SurveyDataCollect{
// Zakesiramo podatke tabele srv_data_vrednost // Zakesiramo podatke tabele srv_data_vrednost
private function cache_data_respondent_vrednost($string_user){ private function cache_data_respondent_vrednost($string_user){
$this->setLogCheckpoint('SDRV1'.$string_user);
if ($this->_array_data_vrednost === null) { if ($this->_array_data_vrednost === null) {
$_qry_data_vrednost = sisplet_query("SELECT spr_id, vre_id, usr_id, loop_id $_qry_data_vrednost = sisplet_query("SELECT spr_id, vre_id, usr_id, loop_id
@ -3482,8 +3434,6 @@ class SurveyDataCollect{
} }
} }
} }
$this->setLogCheckpoint('SDRV2'.$string_user);
} }
// Vrnemo vrednost za uid in spr_id za tabelo srv_data_vrednost // Vrnemo vrednost za uid in spr_id za tabelo srv_data_vrednost

View File

@ -201,11 +201,10 @@ class SurveyDataFile {
if ((int)$this->all_user_cnt > ONLY_VALID_LIMIT && (int)$this->collect_all_status == 1) { if ((int)$this->all_user_cnt > ONLY_VALID_LIMIT && (int)$this->collect_all_status == 1) {
$this->collect_all_status = 0; $this->collect_all_status = 0;
$this->data_file_time = 0;
$updated = sisplet_query("INSERT INTO srv_data_files (sid, collect_all_status, data_file_time) $updated = sisplet_query("INSERT INTO srv_data_files (sid, collect_all_status, data_file_time)
VALUES ('".$this->anketa."','".(int)$this->collect_all_status."', '0000-00-00') VALUES ('".$this->anketa."','".(int)$this->collect_all_status."', '0000-00-00')
ON DUPLICATE KEY UPDATE collect_all_status = '".(int)$this->collect_all_status."', data_file_time = '0000-00-00'"); ON DUPLICATE KEY UPDATE collect_all_status = '".(int)$this->collect_all_status."'");
} }
// Nastavimo, ce imamo testne vnose // Nastavimo, ce imamo testne vnose
@ -430,7 +429,7 @@ class SurveyDataFile {
$collectData = new SurveyDataCollect($this->anketa); $collectData = new SurveyDataCollect($this->anketa);
// File status old - inkrementalno dodamo nove response // File status old - inkrementalno dodamo nove response
if($this->file_status == FILE_STATUS_OLD){ if($this->file_status == FILE_STATUS_OLD){
$sdc = new SurveyDataCollect($this->anketa); $sdc = new SurveyDataCollect($this->anketa);
$createdNewFile = (int)$sdc->updateFilesIncremental(); $createdNewFile = (int)$sdc->updateFilesIncremental();
} }