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

Save call attempt id in to sent when sent and set default call id

This commit is contained in:
Adam Zammit
2013-02-27 09:28:00 +11:00
parent 11df5b93b5
commit 971eb8d584
2 changed files with 12 additions and 19 deletions

View File

@@ -134,13 +134,17 @@ function display_outcomes($contacted,$ca,$case_id)
print "<div>";
if (!empty($rs))
{
//Get current outcome to set as default
$sql = "SELECT outcome
FROM `call`
WHERE call_attempt_id = $ca
AND `end` IS NULL";
$lime_sid = get_limesurvey_id(get_operator_id());
//Check to see if we have sent an email on this call and set the default outcome
$sql = "SELECT 41
FROM `case` as c, " . LIME_PREFIX . "tokens_$lime_sid as t
WHERE t.sent = '$ca'
AND c.case_id = $case_id
AND t.token = c.token";
$do = $db->GetOne($sql);
if (isset($_GET['defaultoutcome'])) $do = bigintval($_GET['defaultoutcome']);
foreach($rs as $r)
{

View File

@@ -73,6 +73,7 @@ if (isset($_POST['firstname']))
{
$case_id = get_case_id($operator_id);
$lime_sid = get_lime_sid($case_id);
$ca = get_call_attempt($operator_id);
$token = get_token($case_id);
$email = $db->qstr($_POST['email']);
$firstname = $db->qstr($_POST['firstname']);
@@ -168,11 +169,9 @@ if (isset($_POST['firstname']))
if ($mail->Send())
{
// Put date into sent
$today = date("Y-m-d H:i:s");
// Put call attempt id in to sent
$sql = "UPDATE ". LIME_PREFIX . "tokens_{$lime_sid}
SET sent='$today'
SET sent='$ca'
WHERE token='$token'";
$db->Execute($sql);
@@ -204,16 +203,6 @@ if (isset($_POST['firstname']))
}
else if (isset($_POST['submit']))
{
/*
$call_id = get_call($operator_id);
$sql = "UPDATE `call` as c
SET c.outcome_id = 41
WHERE c.call_id = $call_id";
$db->Execute($sql);
*/
xhtml_head(T_("Email"),true,array("css/call.css"),array($js),"onload='parent.closePopup();'");
}
xhtml_foot();