From ee3c57a18c86c265379dc395e2b0d071cef50e2c Mon Sep 17 00:00:00 2001 From: azammitdcarf Date: Thu, 19 Feb 2009 03:02:29 +0000 Subject: [PATCH] Added transactions --- appointment.php | 8 +++++++- calllist.php | 3 +++ casenote.php | 6 +++++- index.php | 7 ++----- respondent.php | 4 +++- 5 files changed, 20 insertions(+), 8 deletions(-) diff --git a/appointment.php b/appointment.php index 3c265c9d..71bd8b7c 100644 --- a/appointment.php +++ b/appointment.php @@ -59,6 +59,8 @@ include("functions/functions.operator.php"); */ include("functions/functions.input.php"); +$db->StartTrans(); + $operator_id = get_operator_id(); $questionnaire_id = get_questionnaire_id($operator_id); $case_id = get_case_id($operator_id); @@ -67,6 +69,7 @@ if (!$case_id){ xhtml_head(T_("Appointment error")); print("
" . T_("You have not been assigned a case therefore cannot create an appointment") . "
"); xhtml_foot(); + $db->CompleteTrans(); exit(); } @@ -99,8 +102,11 @@ if(isset($_POST['start']) && isset($_POST['end']) && isset($_POST['day']) && iss make_appointment($respondent_id,$case_id,$contact_phone_id,$call_attempt_id,$day,$month,$year,$start,$end); + $db->CompleteTrans(); + xhtml_head(T_("Appointment made"),true,false,false,"onload='top.close()'"); xhtml_foot(); + exit(); } @@ -218,6 +224,6 @@ else if(isset($_GET['respondent_id'])) xhtml_foot(); - +$db->CompleteTrans(); ?> diff --git a/calllist.php b/calllist.php index e90a5344..9815cba3 100644 --- a/calllist.php +++ b/calllist.php @@ -55,6 +55,8 @@ xhtml_head(T_("Call List"),true,array("css/table.css"),false,false,15); // display in respondent time so that the operator will be able to // quote verbatim to the respondent if necessary +$db->StartTrans(); + $case_id = get_case_id(get_operator_id()); if ($case_id) @@ -80,5 +82,6 @@ else xhtml_foot(); +$db->CompleteTrans(); ?> diff --git a/casenote.php b/casenote.php index 8f39d048..d4b15974 100644 --- a/casenote.php +++ b/casenote.php @@ -70,7 +70,9 @@ if (isset($_GET['add'])) else { global $db; - + + $db->StartTrans(); + $operator_id = get_operator_id(); $case_id = get_case_id($operator_id); @@ -106,6 +108,8 @@ else } else print "

" . T_("No case") . "

"; + + $db->CompleteTrans(); } xhtml_foot(); diff --git a/index.php b/index.php index b0d8ebd9..8a0fa5d0 100644 --- a/index.php +++ b/index.php @@ -45,11 +45,12 @@ include ("functions/functions.xhtml.php"); */ include("functions/functions.operator.php"); +$db->StartTrans(); + $operator_id = get_operator_id(); if (isset($_GET['endwork'])) { - $db->StartTrans(); if (isset($_GET['note'])) { @@ -72,7 +73,6 @@ if (isset($_GET['endwork'])) if (isset($_GET['endcase'])) { - $db->StartTrans(); if (isset($_GET['note'])) { @@ -86,11 +86,8 @@ if (isset($_GET['endcase'])) end_case($operator_id); //if ($db->HasFailedTrans()) {print "

FAILED AT ENDCASE

"; exit();} - $db->CompleteTrans(); } -$db->StartTrans(); - xhtml_head(T_("queXS"), true, array("css/index.css","css/tabber.css") , array("js/popup.js","js/tabber.js")); ?> diff --git a/respondent.php b/respondent.php index b76f591c..aa0e7c81 100644 --- a/respondent.php +++ b/respondent.php @@ -68,6 +68,8 @@ xhtml_head(T_("Respondent Selector"),true,array("css/table.css","css/respondent. global $db; +$db->StartTrans(); + $operator_id = get_operator_id(); $call_attempt_id = get_call_attempt($operator_id); $case_id = get_case_id($operator_id); @@ -153,5 +155,5 @@ else xhtml_foot(); - +$db->CompleteTrans(); ?>