diff --git a/include/limesurvey/classes/expressions/ExpressionManager.php b/include/limesurvey/classes/expressions/ExpressionManager.php index 210f8867..a4f0988d 100644 --- a/include/limesurvey/classes/expressions/ExpressionManager.php +++ b/include/limesurvey/classes/expressions/ExpressionManager.php @@ -70,7 +70,7 @@ class ExpressionManager { $RDP_regex_compare = '<=|<|>=|>|==|!=|\ble\b|\blt\b|\bge\b|\bgt\b|\beq\b|\bne\b'; $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_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_andor = '\band\b|\bor\b|&&|\|\|'; $RDP_regex_lcb = '{'; diff --git a/include/limesurvey/classes/expressions/LimeExpressionManager.php b/include/limesurvey/classes/expressions/LimeExpressionManager.php index 175265e4..f0fd1d81 100644 --- a/include/limesurvey/classes/expressions/LimeExpressionManager.php +++ b/include/limesurvey/classes/expressions/LimeExpressionManager.php @@ -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', + ); + } } diff --git a/include/limesurvey/quexs.php b/include/limesurvey/quexs.php index d6650a55..66dc4b3d 100644 --- a/include/limesurvey/quexs.php +++ b/include/limesurvey/quexs.php @@ -632,10 +632,6 @@ function quexs_core_replace() $core['PERCCOMPLETE'] = round(get_percent_complete($case_id),0); $core['ENDINTERVIEWURL'] = get_end_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; } diff --git a/index.php b/index.php index 00d17bda..07417afd 100644 --- a/index.php +++ b/index.php @@ -171,6 +171,9 @@ if (!is_respondent_selection($operator_id)) else $data = get_respondentselection_url($operator_id); + +$db->CompleteTrans(); + xhtml_object($data,"main-content"); ?> @@ -289,6 +292,5 @@ xhtml_foot(); //if ($db->HasFailedTrans()){ print "
FAILED AT END of index
"; exit();} -$db->CompleteTrans(); ?>