mirror of
https://github.com/ACSPRI/queXS
synced 2024-04-02 12:12:16 +00:00
New feature: Allow samples to specify existing token record
Update to 2.3.0 release
This commit is contained in:
10
CHANGELOG
10
CHANGELOG
@@ -1,3 +1,13 @@
|
|||||||
|
queXS 2.3.0 - Changes since 2.2.6
|
||||||
|
|
||||||
|
New feature: Allow operators to search the sample (visible fields only) and assign cases to themselves
|
||||||
|
|
||||||
|
New feature: Allow for samples to reference existing token records
|
||||||
|
|
||||||
|
Requires database update:
|
||||||
|
alter table `case` drop index token;
|
||||||
|
alter table `case` add index (`token`);
|
||||||
|
|
||||||
queXS 2.2.6 - Changes since 2.2.5
|
queXS 2.2.6 - Changes since 2.2.5
|
||||||
|
|
||||||
Fixed bug: LimeSurvey reports session mismatch with token
|
Fixed bug: LimeSurvey reports session mismatch with token
|
||||||
|
|||||||
@@ -226,10 +226,10 @@ CREATE TABLE `case` (
|
|||||||
`token` varchar(36) COLLATE utf8_unicode_ci NOT NULL,
|
`token` varchar(36) COLLATE utf8_unicode_ci NOT NULL,
|
||||||
PRIMARY KEY (`case_id`),
|
PRIMARY KEY (`case_id`),
|
||||||
UNIQUE KEY `onecasepersample` (`sample_id`,`questionnaire_id`),
|
UNIQUE KEY `onecasepersample` (`sample_id`,`questionnaire_id`),
|
||||||
UNIQUE KEY `token` (`token`),
|
|
||||||
UNIQUE KEY `current_operator_id` (`current_operator_id`),
|
UNIQUE KEY `current_operator_id` (`current_operator_id`),
|
||||||
UNIQUE KEY `current_call_id` (`current_call_id`),
|
UNIQUE KEY `current_call_id` (`current_call_id`),
|
||||||
KEY `sample_id` (`sample_id`),
|
KEY `sample_id` (`sample_id`),
|
||||||
|
KEY `token` (`token`),
|
||||||
KEY `questionnaire_id` (`questionnaire_id`),
|
KEY `questionnaire_id` (`questionnaire_id`),
|
||||||
KEY `sortorder` (`sortorder`),
|
KEY `sortorder` (`sortorder`),
|
||||||
KEY `last_call_id` (`last_call_id`)
|
KEY `last_call_id` (`last_call_id`)
|
||||||
|
|||||||
@@ -343,20 +343,20 @@ function add_case($sample_id,$questionnaire_id,$operator_id = "NULL",$testing =
|
|||||||
$dtoken = $db->GetOne($sql);
|
$dtoken = $db->GetOne($sql);
|
||||||
|
|
||||||
$ttries = 0;
|
$ttries = 0;
|
||||||
|
if (empty($dtoken)) {
|
||||||
do {
|
|
||||||
if (empty($dtoken)) {
|
do {
|
||||||
$token = sRandomChars();
|
$token = sRandomChars();
|
||||||
} else {
|
|
||||||
$token = $dtoken;
|
|
||||||
}
|
|
||||||
|
|
||||||
$sql = "SELECT count(*) as c
|
$sql = "SELECT count(*) as c
|
||||||
FROM `case`
|
FROM `case`
|
||||||
WHERE token = '$token'";
|
WHERE token = '$token'";
|
||||||
|
|
||||||
$ttries++;
|
$ttries++;
|
||||||
} while ($db->GetOne($sql) > 0 && $ttries < 10);
|
} while ($db->GetOne($sql) > 0 && $ttries < 10);
|
||||||
|
} else {
|
||||||
|
$token = $dtoken;
|
||||||
|
}
|
||||||
|
|
||||||
if ($ttries >= 10) //failed to get a token
|
if ($ttries >= 10) //failed to get a token
|
||||||
return false;
|
return false;
|
||||||
|
|||||||
Reference in New Issue
Block a user