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

Opt out of web when opting out of CATI

This commit is contained in:
Adam Zammit
2017-05-11 12:20:48 +10:00
parent 4b5044d59a
commit bfc6af3d7c
2 changed files with 47 additions and 1 deletions

View File

@@ -2287,7 +2287,22 @@ function end_case($operator_id)
SET current_operator_id = NULL, current_call_id = NULL, sortorder = NULL, current_outcome_id = '$outcome', last_call_id = '$lastcall'
WHERE case_id = '$case_id'";
$o = $db->Execute($sql);
$o = $db->Execute($sql);
//if this is a refusal outcome - set the Limesurvey token table to opt-out
//this will avoid sending email invitations once refused on the phone
$sql = "SELECT count(*)
FROM outcome
WHERE outcome_type_id = 3
AND outcome_id = $outcome";
$isrefusal = $db->GetOne($sql);
if ($isrefusal > 0) {
include_once(dirname(__FILE__).'/functions.limesurvey.php');
lime_set_token_properties($case_id,array('emailstatus' => 'OptOut'));
}
$return = true;
}