/** * Return an array of replacement items * * @return array An array with the key being the replacement string and the value being its value * @author Adam Zammit <*****@*****.**> * @since 2012-11-20 */ function quexs_core_replace() { $operator_id = get_operator_id(); $case_id = get_case_id($operator_id); $respondent_id = get_respondent_id($case_id, $operator_id); $core = array(); $core['CALLATTEMPTS'] = get_call_attempts($case_id); $on_appointment = is_on_appointment($case_id, $operator_id); $str = T_("Not on an appointment"); if ($on_appointment) { $str = T_("On an appointment"); } $core['ONAPPOINTMENT'] = $str; $core['PERIODOFDAY'] = get_period_of_day($respondent_id); $core['APPOINTMENTDATE'] = get_appointment_date($respondent_id); $core['APPOINTMENTTIME'] = get_appointment_time($respondent_id); $core['APPOINTMENTNUMBER'] = get_appointment_number($respondent_id); $core['PERCCOMPLETE'] = round(get_percent_complete($case_id), 0); $core['ENDINTERVIEWURL'] = get_end_interview_url(); $core['STARTINTERVIEWURL'] = get_start_interview_url(); return $core; }
//Automatically redirect the page to the "url" setting for the survey $url = templatereplace($thissurvey['surveyls_url']); // TODO - check safety of this - provides access to any replacement value $url = passthruReplace($url, $thissurvey); $url = str_replace("{SAVEDID}", $saved_id, $url); // to activate the SAVEDID in the END URL $url = str_replace("{TOKEN}", $clienttoken, $url); // to activate the TOKEN in the END URL $url = str_replace("{SID}", $surveyid, $url); // to activate the SID in the END URL $url = str_replace("{LANG}", $clang->getlangcode(), $url); // to activate the LANG in the END URL //queXS Addition include_once "quexs.php"; if ($interviewer) { $quexs_url = get_start_interview_url(); $url = str_replace("{STARTINTERVIEWURL}", $quexs_url, $url); $end_url = get_end_interview_url(); $url = str_replace("{ENDINTERVIEWURL}", $end_url, $url); } else { $url = get_end_interview_url($clienttoken); quexs_completed_by_respondent($surveyid, $clienttoken); } killSession(); header("Location: {$url}"); } if ($thissurvey['printanswers'] != 'Y') { killSession(); } doHeader(); echo $content;