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:
@@ -70,7 +70,7 @@ class ExpressionManager {
|
|||||||
$RDP_regex_compare = '<=|<|>=|>|==|!=|\ble\b|\blt\b|\bge\b|\bgt\b|\beq\b|\bne\b';
|
$RDP_regex_compare = '<=|<|>=|>|==|!=|\ble\b|\blt\b|\bge\b|\bgt\b|\beq\b|\bne\b';
|
||||||
$RDP_regex_assign = '='; // '=|\+=|-=|\*=|/=';
|
$RDP_regex_assign = '='; // '=|\+=|-=|\*=|/=';
|
||||||
$RDP_regex_sgqa = '(?:INSERTANS:)?[0-9]+X[0-9]+X[0-9]+[A-Z0-9_]*\#?[01]?(?:\.(?:' . ExpressionManager::$RDP_regex_var_attr . '))?';
|
$RDP_regex_sgqa = '(?:INSERTANS:)?[0-9]+X[0-9]+X[0-9]+[A-Z0-9_]*\#?[01]?(?:\.(?:' . ExpressionManager::$RDP_regex_var_attr . '))?';
|
||||||
$RDP_regex_word = '(?:TOKEN:|SAMPLE:)?(?:[A-Z][A-Z0-9_]*)?(?:\.(?:[A-Z][A-Z0-9_]*))*(?:\.(?:' . ExpressionManager::$RDP_regex_var_attr . '))?';
|
$RDP_regex_word = '(?:TOKEN:|SAMPLE:|OPERATOR:|RESPONDENT:)?(?:[A-Z][A-Z0-9_]*)?(?:\.(?:[A-Z][A-Z0-9_]*))*(?:\.(?:' . ExpressionManager::$RDP_regex_var_attr . '))?';
|
||||||
$RDP_regex_number = '[0-9]+\.?[0-9]*|\.[0-9]+';
|
$RDP_regex_number = '[0-9]+\.?[0-9]*|\.[0-9]+';
|
||||||
$RDP_regex_andor = '\band\b|\bor\b|&&|\|\|';
|
$RDP_regex_andor = '\band\b|\bor\b|&&|\|\|';
|
||||||
$RDP_regex_lcb = '{';
|
$RDP_regex_lcb = '{';
|
||||||
|
|||||||
@@ -3433,6 +3433,55 @@
|
|||||||
'readWrite'=>'N',
|
'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
|
else
|
||||||
@@ -3480,6 +3529,17 @@
|
|||||||
'readWrite'=>'N',
|
'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',
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -632,10 +632,6 @@ function quexs_core_replace()
|
|||||||
$core['PERCCOMPLETE'] = round(get_percent_complete($case_id),0);
|
$core['PERCCOMPLETE'] = round(get_percent_complete($case_id),0);
|
||||||
$core['ENDINTERVIEWURL'] = get_end_interview_url();
|
$core['ENDINTERVIEWURL'] = get_end_interview_url();
|
||||||
$core['STARTINTERVIEWURL'] = get_start_interview_url();
|
$core['STARTINTERVIEWURL'] = get_start_interview_url();
|
||||||
$core['OPERATOR:FIRSTNAME'] = get_operator_variable('firstName',$operator_id);
|
|
||||||
$core['OPERATOR:LASTNAME'] = get_operator_variable('lastName',$operator_id);
|
|
||||||
$core['RESPONDENT:FIRSTNAME'] = get_respondent_variable('firstName',$respondent_id);
|
|
||||||
$core['RESPONDENT:LASTNAME'] = get_respondent_variable('lastName',$respondent_id);
|
|
||||||
|
|
||||||
return $core;
|
return $core;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -171,6 +171,9 @@ if (!is_respondent_selection($operator_id))
|
|||||||
else
|
else
|
||||||
$data = get_respondentselection_url($operator_id);
|
$data = get_respondentselection_url($operator_id);
|
||||||
|
|
||||||
|
|
||||||
|
$db->CompleteTrans();
|
||||||
|
|
||||||
xhtml_object($data,"main-content");
|
xhtml_object($data,"main-content");
|
||||||
|
|
||||||
?>
|
?>
|
||||||
@@ -289,6 +292,5 @@ xhtml_foot();
|
|||||||
|
|
||||||
|
|
||||||
//if ($db->HasFailedTrans()){ print "<p>FAILED AT END of index</p>"; exit();}
|
//if ($db->HasFailedTrans()){ print "<p>FAILED AT END of index</p>"; exit();}
|
||||||
$db->CompleteTrans();
|
|
||||||
|
|
||||||
?>
|
?>
|
||||||
|
|||||||
Reference in New Issue
Block a user