mirror of
https://github.com/ACSPRI/queXS
synced 2024-04-02 12:12:16 +00:00
Fixed bug: OPERATOR and RESPONDENT replacements not working in respondent selection module
This commit is contained in:
@@ -3416,10 +3416,25 @@
|
|||||||
//Add all sample variables for this case
|
//Add all sample variables for this case
|
||||||
global $connect;
|
global $connect;
|
||||||
|
|
||||||
$sql = "SELECT sv.var,sv.val
|
$use_call = true;
|
||||||
FROM sample_var as sv, `case` as c
|
if (strlen($_SESSION['token']) == 15)
|
||||||
WHERE c.sample_id = sv.sample_id
|
$use_call = false;
|
||||||
AND c.token = '{$_SESSION['token']}'";
|
|
||||||
|
if ($use_call)
|
||||||
|
{
|
||||||
|
$sql = "SELECT sv.var,sv.val
|
||||||
|
FROM sample_var as sv, `case` as c, `call` as cl
|
||||||
|
WHERE c.sample_id = sv.sample_id
|
||||||
|
AND c.case_id = cl.case_id
|
||||||
|
AND cl.call_id = '{$_SESSION['token']}'";
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
$sql = "SELECT sv.var,sv.val
|
||||||
|
FROM sample_var as sv, `case` as c
|
||||||
|
WHERE c.sample_id = sv.sample_id
|
||||||
|
AND c.token = '{$_SESSION['token']}'";
|
||||||
|
}
|
||||||
|
|
||||||
$queXSrs = $connect->GetAssoc($sql);
|
$queXSrs = $connect->GetAssoc($sql);
|
||||||
|
|
||||||
@@ -3434,46 +3449,57 @@
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if ($use_call)
|
||||||
|
{
|
||||||
|
$osql = "FROM operator as o, `call` as cl
|
||||||
|
WHERE o.operator_id = cl.operator_id
|
||||||
|
AND cl.case_id = '{$_SESSION['token']}'";
|
||||||
|
|
||||||
|
$rsql = "FROM respondent as r, `call` as cl
|
||||||
|
WHERE cl.case_id = '{$_SESSION['token']}'
|
||||||
|
AND r.respondent_id = cl.respondent_id";
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
$osql = "FROM operator as o, `case` as c
|
||||||
|
WHERE c.token = '{$_SESSION['token']}'
|
||||||
|
AND o.operator_id = c.current_operator_id";
|
||||||
|
|
||||||
|
$rsql = "FROM respondent as r, `case` as c, call_attempt as ca
|
||||||
|
WHERE c.token = '{$_SESSION['token']}'
|
||||||
|
AND ca.case_id = c.case_id
|
||||||
|
AND ca.end IS NULL
|
||||||
|
AND r.respondent_id = ca.respondent_id";
|
||||||
|
}
|
||||||
|
|
||||||
//add operator and respondent details
|
//add operator and respondent details
|
||||||
$this->knownVars["OPERATOR:FIRSTNAME"] =
|
$this->knownVars["OPERATOR:FIRSTNAME"] =
|
||||||
array('code' => $connect->GetOne(" SELECT o.firstName
|
array('code' => $connect->GetOne(" SELECT o.firstName " . $osql
|
||||||
FROM operator as o, `case` as c
|
),
|
||||||
WHERE c.token = '{$_SESSION['token']}'
|
|
||||||
AND o.operator_id = c.current_operator_id"),
|
|
||||||
'jsName_on'=>'',
|
'jsName_on'=>'',
|
||||||
'jsName'=>'',
|
'jsName'=>'',
|
||||||
'readWrite'=>'N',
|
'readWrite'=>'N',
|
||||||
);
|
);
|
||||||
|
|
||||||
$this->knownVars["OPERATOR:LASTNAME"] =
|
$this->knownVars["OPERATOR:LASTNAME"] =
|
||||||
array('code' => $connect->GetOne(" SELECT o.lastName
|
array('code' => $connect->GetOne(" SELECT o.lastName " . $osql
|
||||||
FROM operator as o, `case` as c
|
),
|
||||||
WHERE c.token = '{$_SESSION['token']}'
|
|
||||||
AND o.operator_id = c.current_operator_id"),
|
|
||||||
'jsName_on'=>'',
|
'jsName_on'=>'',
|
||||||
'jsName'=>'',
|
'jsName'=>'',
|
||||||
'readWrite'=>'N',
|
'readWrite'=>'N',
|
||||||
);
|
);
|
||||||
|
|
||||||
$this->knownVars["RESPONDENT:FIRSTNAME"] =
|
$this->knownVars["RESPONDENT:FIRSTNAME"] =
|
||||||
array('code' => $connect->GetOne(" SELECT r.firstName
|
array('code' => $connect->GetOne(" SELECT r.firstName " . $rsql
|
||||||
FROM respondent as r, `case` as c, call_attempt as ca
|
),
|
||||||
WHERE c.token = '{$_SESSION['token']}'
|
|
||||||
AND ca.case_id = c.case_id
|
|
||||||
AND ca.end IS NULL
|
|
||||||
AND r.respondent_id = ca.respondent_id"),
|
|
||||||
'jsName_on'=>'',
|
'jsName_on'=>'',
|
||||||
'jsName'=>'',
|
'jsName'=>'',
|
||||||
'readWrite'=>'N',
|
'readWrite'=>'N',
|
||||||
);
|
);
|
||||||
|
|
||||||
$this->knownVars["RESPONDENT:LASTNAME"] =
|
$this->knownVars["RESPONDENT:LASTNAME"] =
|
||||||
array('code' => $connect->GetOne(" SELECT r.lastName
|
array('code' => $connect->GetOne(" SELECT r.lastName " . $rsql
|
||||||
FROM respondent as r, `case` as c, call_attempt as ca
|
),
|
||||||
WHERE c.token = '{$_SESSION['token']}'
|
|
||||||
AND ca.case_id = c.case_id
|
|
||||||
AND ca.end IS NULL
|
|
||||||
AND r.respondent_id = ca.respondent_id"),
|
|
||||||
'jsName_on'=>'',
|
'jsName_on'=>'',
|
||||||
'jsName'=>'',
|
'jsName'=>'',
|
||||||
'readWrite'=>'N',
|
'readWrite'=>'N',
|
||||||
|
|||||||
Reference in New Issue
Block a user