Ce nimamo parapodatka cas responsa, shranimo anonimno cas zadnjega responsa v srv_anketa
This commit is contained in:
parent
24cb3fc692
commit
df16d7d3ea
@ -57,16 +57,9 @@ class SurveyDataFile {
|
||||
$this->data_file_name = $folder . 'export_data_'.$this->anketa.'.dat';
|
||||
|
||||
// Vedno ob inicializaciji preverimo status datoteke
|
||||
if($this->checked == false) {
|
||||
|
||||
// Ce ne belezimo parapodatka o datumu responsa, vedno pobrisemo datoteko
|
||||
if(SurveySetting::getInstance()->getSurveyMiscSetting('survey_date') == 1) {
|
||||
$this->clearFiles();
|
||||
}
|
||||
|
||||
if($this->checked == false)
|
||||
$this->checkFile();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**** GETTERJI ****/
|
||||
@ -219,6 +212,19 @@ class SurveyDataFile {
|
||||
WHERE u.ank_id = '".$this->anketa."' AND preview='0' AND (u.testdata = '1' OR u.testdata = '2') AND u.deleted = '0'");
|
||||
list($this->has_test_data) = mysqli_fetch_row($_qry_cnt_testdata);
|
||||
|
||||
|
||||
// Ce ne belezimo parapodatka o datumu responsa, preverimo zadnji timestamp resevanja ankete
|
||||
if(SurveySetting::getInstance()->getSurveyMiscSetting('survey_date') == 1) {
|
||||
|
||||
$sql_last_response_time = sisplet_query("SELECT UNIX_TIMESTAMP(last_response_time) AS last_response_time FROM srv_anketa WHERE id='".$this->anketa."'");
|
||||
list($last_response_time) = mysqli_fetch_row($sql_last_response_time);
|
||||
|
||||
if($this->data_file_time < $last_response_time){
|
||||
$this->clearFiles();
|
||||
$this->file_status = FILE_STATUS_NO_FILE;
|
||||
}
|
||||
}
|
||||
|
||||
// Preverimo ce imamo usability stolpec v header datoteki ali ce imamo na novo testne podatke - potem pobrisemo vse datoteke, ker moramo vse generirati na novo
|
||||
if($this->checkUsability() || $this->checkTestData()){
|
||||
$this->clearFiles();
|
||||
|
@ -3984,6 +3984,9 @@ class SurveyInvitationsNew {
|
||||
VALUES
|
||||
('".$this->sid."', '".$_user_data['cookie']."', '".$_user_data['password']."', '".$_user_data['status']."', '-1') ON DUPLICATE KEY UPDATE cookie = '".$_user_data['cookie']."', pass='".$_user_data['password']."'
|
||||
");
|
||||
|
||||
// Ce ne belezimo parapodatka za cas responsa, anonimno zabelezimo cas zadnjega responsa
|
||||
sisplet_query("UPDATE srv_anketa SET last_response_time=NOW() WHERE id='".$this->sid."'");
|
||||
}
|
||||
else{
|
||||
$_r = sisplet_query("INSERT INTO srv_user
|
||||
@ -5931,6 +5934,9 @@ class SurveyInvitationsNew {
|
||||
VALUES
|
||||
('".$this->sid."', '".$user_data['cookie']."', '".$user_data['password']."', '".$user_data['status']."', '-1') ON DUPLICATE KEY UPDATE last_status=VALUES(last_status)
|
||||
");
|
||||
|
||||
// Ce ne belezimo parapodatka za cas responsa, anonimno zabelezimo cas zadnjega responsa
|
||||
sisplet_query("UPDATE srv_anketa SET last_response_time=NOW() WHERE id='".$this->sid."'");
|
||||
}
|
||||
else{
|
||||
sisplet_query("INSERT INTO srv_user
|
||||
|
@ -1143,9 +1143,11 @@ class InitClass extends Controller
|
||||
$sql_userbase = sisplet_query("SELECT MAX(tip) AS tip FROM srv_userbase WHERE usr_id = '" . get('usr_id') . "'");
|
||||
if (!$sql_userbase) echo mysqli_error($GLOBALS['connect_db']);
|
||||
$row_userbase = mysqli_fetch_array($sql_userbase);
|
||||
|
||||
if ($row_userbase['tip'] > 0) {
|
||||
$tip = $row_userbase['tip'];
|
||||
} else {
|
||||
}
|
||||
else {
|
||||
$tip = 0;
|
||||
}
|
||||
|
||||
@ -1200,6 +1202,12 @@ class InitClass extends Controller
|
||||
sisplet_query("UPDATE srv_user SET time_edit = " . $_time_insert . ", language='" . get('language') . "' WHERE id='" . get('usr_id') . "'");
|
||||
|
||||
}
|
||||
|
||||
// Ce ne belezimo parapodatka za cas responsa, anonimno zabelezimo cas zadnjega responsa
|
||||
if(SurveySetting::getInstance()->getSurveyMiscSetting('survey_date') == 1) {
|
||||
sisplet_query("UPDATE srv_anketa SET last_response_time=NOW() WHERE id='".get('anketa')."'");
|
||||
}
|
||||
|
||||
# dodamo še tracking arhivov vabil
|
||||
if (get('user_inv_archive') > 0 && $inv_res_id > 0) {
|
||||
|
||||
|
@ -9483,3 +9483,7 @@ CREATE TABLE srv_squalo_anketa(
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
|
||||
|
||||
UPDATE misc SET value='21.03.17' WHERE what="version";
|
||||
|
||||
ALTER TABLE srv_anketa ADD last_response_time DATETIME NOT NULL AFTER edit_time;
|
||||
|
||||
UPDATE misc SET value='21.03.30' WHERE what="version";
|
||||
|
Loading…
x
Reference in New Issue
Block a user