Ce nimamo parapodatka cas responsa, shranimo anonimno cas zadnjega responsa v srv_anketa
This commit is contained in:
parent
24cb3fc692
commit
df16d7d3ea
@ -57,15 +57,8 @@ class SurveyDataFile {
|
|||||||
$this->data_file_name = $folder . 'export_data_'.$this->anketa.'.dat';
|
$this->data_file_name = $folder . 'export_data_'.$this->anketa.'.dat';
|
||||||
|
|
||||||
// Vedno ob inicializaciji preverimo status datoteke
|
// Vedno ob inicializaciji preverimo status datoteke
|
||||||
if($this->checked == false) {
|
if($this->checked == false)
|
||||||
|
|
||||||
// Ce ne belezimo parapodatka o datumu responsa, vedno pobrisemo datoteko
|
|
||||||
if(SurveySetting::getInstance()->getSurveyMiscSetting('survey_date') == 1) {
|
|
||||||
$this->clearFiles();
|
|
||||||
}
|
|
||||||
|
|
||||||
$this->checkFile();
|
$this->checkFile();
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -202,7 +195,7 @@ class SurveyDataFile {
|
|||||||
if(mysqli_num_rows($sql) > 0) {
|
if(mysqli_num_rows($sql) > 0) {
|
||||||
list($this->head_file_time, $this->data_file_time, $this->last_update, $this->collect_all_status) = mysqli_fetch_row($sql);
|
list($this->head_file_time, $this->data_file_time, $this->last_update, $this->collect_all_status) = mysqli_fetch_row($sql);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Ce je collect_all_status = 2 je admin nastavil da se lovijo vsi statusi, popravimo tudi čas, da se datoteka zgenerira na novo
|
// Ce je collect_all_status = 2 je admin nastavil da se lovijo vsi statusi, popravimo tudi čas, da se datoteka zgenerira na novo
|
||||||
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) {
|
||||||
|
|
||||||
@ -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'");
|
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);
|
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
|
// 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()){
|
if($this->checkUsability() || $this->checkTestData()){
|
||||||
$this->clearFiles();
|
$this->clearFiles();
|
||||||
|
@ -3984,6 +3984,9 @@ class SurveyInvitationsNew {
|
|||||||
VALUES
|
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']."'
|
('".$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{
|
else{
|
||||||
$_r = sisplet_query("INSERT INTO srv_user
|
$_r = sisplet_query("INSERT INTO srv_user
|
||||||
@ -5931,6 +5934,9 @@ class SurveyInvitationsNew {
|
|||||||
VALUES
|
VALUES
|
||||||
('".$this->sid."', '".$user_data['cookie']."', '".$user_data['password']."', '".$user_data['status']."', '-1') ON DUPLICATE KEY UPDATE last_status=VALUES(last_status)
|
('".$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{
|
else{
|
||||||
sisplet_query("INSERT INTO srv_user
|
sisplet_query("INSERT INTO srv_user
|
||||||
|
@ -1141,11 +1141,13 @@ class InitClass extends Controller
|
|||||||
private function set_userstatus($status)
|
private function set_userstatus($status)
|
||||||
{
|
{
|
||||||
$sql_userbase = sisplet_query("SELECT MAX(tip) AS tip FROM srv_userbase WHERE usr_id = '" . get('usr_id') . "'");
|
$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']);
|
if (!$sql_userbase) echo mysqli_error($GLOBALS['connect_db']);
|
||||||
$row_userbase = mysqli_fetch_array($sql_userbase);
|
$row_userbase = mysqli_fetch_array($sql_userbase);
|
||||||
|
|
||||||
if ($row_userbase['tip'] > 0) {
|
if ($row_userbase['tip'] > 0) {
|
||||||
$tip = $row_userbase['tip'];
|
$tip = $row_userbase['tip'];
|
||||||
} else {
|
}
|
||||||
|
else {
|
||||||
$tip = 0;
|
$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') . "'");
|
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
|
# dodamo še tracking arhivov vabil
|
||||||
if (get('user_inv_archive') > 0 && $inv_res_id > 0) {
|
if (get('user_inv_archive') > 0 && $inv_res_id > 0) {
|
||||||
|
|
||||||
|
@ -9483,3 +9483,7 @@ CREATE TABLE srv_squalo_anketa(
|
|||||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
|
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
|
||||||
|
|
||||||
UPDATE misc SET value='21.03.17' WHERE what="version";
|
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