From 6074274f7f72b830f7a8d7805467a129ca8f9c8d Mon Sep 17 00:00:00 2001 From: azammitdcarf Date: Fri, 29 May 2009 01:24:37 +0000 Subject: [PATCH] Make sure to fail if cannot update --- functions/functions.operator.php | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/functions/functions.operator.php b/functions/functions.operator.php index 6a5d6005..a5457f55 100644 --- a/functions/functions.operator.php +++ b/functions/functions.operator.php @@ -213,7 +213,8 @@ function is_respondent_selection($operator_id) $questionnaire_id = get_questionnaire_id($operator_id); - if (!$questionnaire_id) return false; + if (!$questionnaire_id) + return false; $sql = "SELECT respondent_selection FROM questionnaire @@ -454,9 +455,13 @@ function get_case_id($operator_id, $create = false) WHERE current_operator_id IS NULL AND case_id = '$case_id'"; - //should fail transaction if already assigned to another case $db->Execute($sql); + //should fail transaction if already assigned to another case + if ($db->Affected_Rows() != 1) + { + $db->FailTrans(); + } } }