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

Added customised outcomes feature (thanks Alex)

This commit is contained in:
Adam Zammit
2015-11-20 11:53:18 +11:00
8 changed files with 389 additions and 87 deletions

View File

@@ -107,32 +107,32 @@ function display_outcomes($contacted,$ca,$case_id)
AND call_attempt_id = '$ca'";
$rs = $db->GetAll($sql);
$outcomes = $db->GetOne("SELECT q.outcomes FROM `questionnaire` as q JOIN `case` as c ON (c.questionnaire_id =q.questionnaire_id) WHERE c.case_id = $case_id");
if (!empty($rs))
{
//we have an appointment made ... only select appointment ID's
$sql = "SELECT outcome_id,description
FROM outcome
WHERE outcome_type_id = '5'";
WHERE outcome_type_id = '5'
AND outcome_id IN ($outcomes)";
}
else
{
if ($contacted === false)
{
$sql = "SELECT outcome_id,description
FROM outcome
WHERE outcome_id != 10"; //don't show completed if not
}
if ($contacted === false) $ctd = "";
else
{
$contacted = bigintval($contacted);
$sql = "SELECT outcome_id,description
FROM outcome
WHERE contacted = '$contacted'
AND outcome_id != 10"; //don't show completed if not
$ctd = "AND contacted = '$contacted'";
}
$sql = "SELECT outcome_id,description
FROM outcome
WHERE outcome_type_id != '5'
$ctd
AND outcome_id IN ($outcomes)
AND outcome_id NOT IN(10,42,43,44,45)"; //don't show completed if not, hide max calls as the supposed to be automatic or admin
}
}
$rs = $db->GetAll($sql);