2
0
mirror of https://github.com/ACSPRI/queXS synced 2024-04-02 12:12:16 +00:00

Add operator and respondent details to expression manager

This commit is contained in:
Adam Zammit
2013-03-27 12:13:21 +11:00
parent 7cb7de5d16
commit fc74099de7
4 changed files with 64 additions and 6 deletions

View File

@@ -3433,6 +3433,55 @@
'readWrite'=>'N',
);
}
//add operator and respondent details
$this->knownVars["OPERATOR:FIRSTNAME"] =
array('code' => $connect->GetOne(" SELECT o.firstName
FROM operator as o, `case` as c
WHERE c.token = '{$_SESSION['token']}'
AND o.operator_id = c.current_operator_id"),
'jsName_on'=>'',
'jsName'=>'',
'readWrite'=>'N',
);
$this->knownVars["OPERATOR:LASTNAME"] =
array('code' => $connect->GetOne(" SELECT o.lastName
FROM operator as o, `case` as c
WHERE c.token = '{$_SESSION['token']}'
AND o.operator_id = c.current_operator_id"),
'jsName_on'=>'',
'jsName'=>'',
'readWrite'=>'N',
);
$this->knownVars["RESPONDENT:FIRSTNAME"] =
array('code' => $connect->GetOne(" SELECT r.firstName
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'=>'',
'readWrite'=>'N',
);
$this->knownVars["RESPONDENT:LASTNAME"] =
array('code' => $connect->GetOne(" SELECT r.lastName
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'=>'',
'readWrite'=>'N',
);
}
else
@@ -3480,6 +3529,17 @@
'readWrite'=>'N',
);
}
$oa= array("OPERATOR:FIRSTNAME","OPERATOR:LASTNAME","RESPONDENT:FIRSTNAME","RESPONDENT:LASTNAME");
foreach ($oa as $o)
{
$this->knownVars[$o] = array(
'code'=>"",
'jsName_on'=>'',
'jsName'=>'',
'readWrite'=>'N',
);
}
}