mirror of
https://github.com/ACSPRI/queXS
synced 2024-04-02 12:12:16 +00:00
added transactions
This commit is contained in:
@@ -221,6 +221,9 @@ function is_respondent_selection($operator_id)
|
|||||||
|
|
||||||
$rs = $db->GetRow($sql);
|
$rs = $db->GetRow($sql);
|
||||||
|
|
||||||
|
|
||||||
|
//if ($db->HasFailedTrans()) { print "FAILED in is_respondent_selection"; exit; }
|
||||||
|
|
||||||
if (!$db->CompleteTrans())
|
if (!$db->CompleteTrans())
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
@@ -462,6 +465,7 @@ function get_case_id($operator_id, $create = true)
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//if ($db->HasFailedTrans()) { print "FAILED in get_case_id"; exit; }
|
||||||
$db->CompleteTrans();
|
$db->CompleteTrans();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -665,6 +669,7 @@ function is_on_shift($operator_id)
|
|||||||
$shift_id = $row['shift_id'];
|
$shift_id = $row['shift_id'];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//if ($db->HasFailedTrans()) { print "FAILED in is_on_shift"; exit; }
|
||||||
if ($db->CompleteTrans())
|
if ($db->CompleteTrans())
|
||||||
return $shift_id;
|
return $shift_id;
|
||||||
|
|
||||||
@@ -708,6 +713,7 @@ function is_on_call($operator_id)
|
|||||||
$call_state_id = $row['state'];
|
$call_state_id = $row['state'];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//if ($db->HasFailedTrans()) { print "FAILED in is_on_call"; exit; }
|
||||||
if ($db->CompleteTrans())
|
if ($db->CompleteTrans())
|
||||||
return $call_state_id;
|
return $call_state_id;
|
||||||
|
|
||||||
@@ -747,6 +753,7 @@ function is_on_call_attempt($operator_id)
|
|||||||
$return = true;
|
$return = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//if ($db->HasFailedTrans()) { print "FAILED in is_on_call_attempt"; exit; }
|
||||||
if ($db->CompleteTrans())
|
if ($db->CompleteTrans())
|
||||||
return $return;
|
return $return;
|
||||||
|
|
||||||
@@ -807,6 +814,7 @@ function get_call($operator_id,$respondent_id = "",$contact_phone_id = "")
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//if ($db->HasFailedTrans()) { print "FAILED in get_call"; exit; }
|
||||||
if ($db->CompleteTrans())
|
if ($db->CompleteTrans())
|
||||||
return $id;
|
return $id;
|
||||||
|
|
||||||
@@ -851,6 +859,7 @@ function get_limesurvey_url($operator_id)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//if ($db->HasFailedTrans()) { print "FAILED in get_limesurvey_url"; exit; }
|
||||||
$db->CompleteTrans();
|
$db->CompleteTrans();
|
||||||
|
|
||||||
return $url;
|
return $url;
|
||||||
@@ -1071,6 +1080,7 @@ function end_case($operator_id)
|
|||||||
else
|
else
|
||||||
$return = false;
|
$return = false;
|
||||||
|
|
||||||
|
//if ($db->HasFailedTrans()) { print "FAILED in end_case"; exit; }
|
||||||
if ($db->CompleteTrans())
|
if ($db->CompleteTrans())
|
||||||
return $return;
|
return $return;
|
||||||
|
|
||||||
@@ -1120,8 +1130,6 @@ function end_call_attempt($operator_id)
|
|||||||
|
|
||||||
if ($ca)
|
if ($ca)
|
||||||
{
|
{
|
||||||
$db->StartTrans();
|
|
||||||
|
|
||||||
$sql = "UPDATE `call_attempt`
|
$sql = "UPDATE `call_attempt`
|
||||||
SET end = CONVERT_TZ(NOW(),'System','UTC')
|
SET end = CONVERT_TZ(NOW(),'System','UTC')
|
||||||
WHERE call_attempt_id = '$ca'";
|
WHERE call_attempt_id = '$ca'";
|
||||||
@@ -1131,6 +1139,7 @@ function end_call_attempt($operator_id)
|
|||||||
$return = true;
|
$return = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//if ($db->HasFailedTrans()) { print "FAILED in end_call_attempt"; exit; }
|
||||||
if ($db->CompleteTrans())
|
if ($db->CompleteTrans())
|
||||||
return $return;
|
return $return;
|
||||||
|
|
||||||
@@ -1216,6 +1225,7 @@ function get_call_attempt($operator_id)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//if ($db->HasFailedTrans()) { print "FAILED in get_call_attempt"; exit; }
|
||||||
if ($db->CompleteTrans())
|
if ($db->CompleteTrans())
|
||||||
return $id;
|
return $id;
|
||||||
|
|
||||||
@@ -1266,6 +1276,7 @@ function end_call($operator_id,$outcome_id,$state = 5)
|
|||||||
$db->Execute($sql);
|
$db->Execute($sql);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//if ($db->HasFailedTrans()) { print "FAILED in end_call"; exit; }
|
||||||
if ($db->CompleteTrans())
|
if ($db->CompleteTrans())
|
||||||
return $o;
|
return $o;
|
||||||
|
|
||||||
|
|||||||
11
index.php
11
index.php
@@ -53,7 +53,7 @@ if (isset($_GET['endwork']))
|
|||||||
|
|
||||||
if (isset($_GET['note']))
|
if (isset($_GET['note']))
|
||||||
{
|
{
|
||||||
$case_id = get_case_id($operator_id);
|
$case_id = get_case_id($operator_id,false);
|
||||||
$note = $db->qstr($_GET['note']);
|
$note = $db->qstr($_GET['note']);
|
||||||
$sql = "INSERT INTO `case_note` (case_note_id,case_id,operator_id,note,datetime)
|
$sql = "INSERT INTO `case_note` (case_note_id,case_id,operator_id,note,datetime)
|
||||||
VALUES (NULL,'$case_id','$operator_id',$note,CONVERT_TZ(NOW(),'System','UTC'))";
|
VALUES (NULL,'$case_id','$operator_id',$note,CONVERT_TZ(NOW(),'System','UTC'))";
|
||||||
@@ -61,7 +61,8 @@ if (isset($_GET['endwork']))
|
|||||||
}
|
}
|
||||||
end_call_attempt($operator_id);
|
end_call_attempt($operator_id);
|
||||||
end_case($operator_id);
|
end_case($operator_id);
|
||||||
|
|
||||||
|
//if ($db->HasFailedTrans()){ print "<p>FAILED AT ENDWORK</p>"; exit();}
|
||||||
$db->CompleteTrans();
|
$db->CompleteTrans();
|
||||||
|
|
||||||
include("endwork.php");
|
include("endwork.php");
|
||||||
@@ -75,7 +76,7 @@ if (isset($_GET['endcase']))
|
|||||||
|
|
||||||
if (isset($_GET['note']))
|
if (isset($_GET['note']))
|
||||||
{
|
{
|
||||||
$case_id = get_case_id($operator_id);
|
$case_id = get_case_id($operator_id,false);
|
||||||
$note = $db->qstr($_GET['note']);
|
$note = $db->qstr($_GET['note']);
|
||||||
$sql = "INSERT INTO `case_note` (case_note_id,case_id,operator_id,note,datetime)
|
$sql = "INSERT INTO `case_note` (case_note_id,case_id,operator_id,note,datetime)
|
||||||
VALUES (NULL,'$case_id','$operator_id',$note,CONVERT_TZ(NOW(),'System','UTC'))";
|
VALUES (NULL,'$case_id','$operator_id',$note,CONVERT_TZ(NOW(),'System','UTC'))";
|
||||||
@@ -84,6 +85,7 @@ if (isset($_GET['endcase']))
|
|||||||
end_call_attempt($operator_id);
|
end_call_attempt($operator_id);
|
||||||
end_case($operator_id);
|
end_case($operator_id);
|
||||||
|
|
||||||
|
//if ($db->HasFailedTrans()) {print "<p>FAILED AT ENDCASE</p>"; exit();}
|
||||||
$db->CompleteTrans();
|
$db->CompleteTrans();
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -167,6 +169,9 @@ xhtml_head(T_("queXS"), true, array("css/index.css","css/tabber.css") , array("j
|
|||||||
<?
|
<?
|
||||||
|
|
||||||
xhtml_foot();
|
xhtml_foot();
|
||||||
|
|
||||||
|
|
||||||
|
//if ($db->HasFailedTrans()){ print "<p>FAILED AT END of index</p>"; exit();}
|
||||||
$db->CompleteTrans();
|
$db->CompleteTrans();
|
||||||
|
|
||||||
?>
|
?>
|
||||||
|
|||||||
Reference in New Issue
Block a user