diff --git a/admin/displayappointments.php b/admin/displayappointments.php
index 00e49079..4e19f33f 100644
--- a/admin/displayappointments.php
+++ b/admin/displayappointments.php
@@ -88,7 +88,7 @@ if (isset($_GET['start']) && isset($_GET['end']) && isset($_GET['update']))
// create a call attempt
$sql = "INSERT INTO call_attempt (call_attempt_id,case_id,operator_id,respondent_id,start,end)
- VALUES (NULL,$case_id,$operator_id,$respondent_id,CONVERT_TZ(NOW(),@@session.time_zone,'UTC'),CONVERT_TZ(NOW(),@@session.time_zone,'UTC'))";
+ VALUES (NULL,$case_id,$operator_id,$respondent_id,CONVERT_TZ(NOW(),'System','UTC'),CONVERT_TZ(NOW(),'System','UTC'))";
$db->Execute($sql);
$call_attempt_id = $db->Insert_ID();
@@ -292,19 +292,20 @@ else {
xhtml_head(T_("Display Appointments"),true,$css,$js_head,false,30);
print "
" . T_("Sample details")."
";
$sql = "SELECT sv.sample_id, MIN(c.case_id) as case_id , MIN(s.Time_zone_name) as Time_zone_name,
- MIN(TIME_FORMAT(CONVERT_TZ(NOW(),@@session.time_zone,s.Time_zone_name),'". TIME_FORMAT ."')) as time
+ MIN(TIME_FORMAT(CONVERT_TZ(NOW(),'System',s.Time_zone_name),'". TIME_FORMAT ."')) as time
FROM sample_var AS sv
LEFT JOIN (`case` AS c , sample as s) ON ( c.sample_id = sv.sample_id AND s.sample_id = c.sample_id ) WHERE c.case_id = '$case_id'
GROUP BY sv.sample_id";
@@ -363,8 +363,8 @@ if ($case_id != false)
print "
" . T_("Appointments")."
";
$sql = "SELECT
- MIN(CONVERT_TZ(a.start,'UTC',@@session.time_zone)) as start,
- MIN(CONVERT_TZ(a.end,'UTC',@@session.time_zone)) as end,
+ MIN(CONVERT_TZ(a.start,'UTC',co.Time_zone_name)) as start,
+ MIN(CONVERT_TZ(a.end,'UTC',co.Time_zone_name)) as end,
MIN(CONCAT(r.firstName,' ', r.lastName)) as resp,
MIN(IFNULL(ou.description,'" . T_("Not yet called") . "')) as outcome,
MIN(CONCAT (oo.firstName,' ', oo.lastName)) as makerName,
@@ -373,9 +373,10 @@ if ($case_id != false)
MIN(CONCAT('
')) as link,
MIN(CONCAT('
')) as edit
FROM appointment as a
- JOIN (`case` as c, respondent as r, questionnaire as q, operator as oo, call_attempt as cc) on (a.case_id = c.case_id and a.respondent_id = r.respondent_id and q.questionnaire_id = c.questionnaire_id and a.call_attempt_id = cc.call_attempt_id and cc.operator_id = oo.operator_id)
+ JOIN (`case` as c, respondent as r, questionnaire as q, operator as oo, call_attempt as cc, operator as co) on (a.case_id = c.case_id and a.respondent_id = r.respondent_id and q.questionnaire_id = c.questionnaire_id and a.call_attempt_id = cc.call_attempt_id and cc.operator_id = oo.operator_id)
LEFT JOIN (`call` as ca, outcome as ou, operator as ooo) ON (ca.call_id = a.completed_call_id and ou.outcome_id = ca.outcome_id and ca.operator_id = ooo.operator_id)
WHERE c.case_id = '$case_id'
+ AND co.operator_id = '$operator_id'
GROUP BY a.appointment_id
ORDER BY a.start ASC";
diff --git a/admin/timezonetemplate.php b/admin/timezonetemplate.php
index 3d6ec555..75265c7c 100644
--- a/admin/timezonetemplate.php
+++ b/admin/timezonetemplate.php
@@ -120,7 +120,7 @@ print "
";
print "
" . T_("Timezone list") . "
";
-$sql = "SELECT Time_zone_name, TIME_FORMAT(CONVERT_TZ(NOW(),@@session.time_zone,Time_zone_name),'". TIME_FORMAT ."') as time, CONCAT('
', TIME_FORMAT(TIMEDIFF( CONVERT_TZ(NOW(),'$dtz','$dtz'),CONVERT_TZ(NOW(), Time_zone_name,'$dtz')),' %H : %i'), '
') AS timediff,
+$sql = "SELECT Time_zone_name, TIME_FORMAT(CONVERT_TZ(NOW(),'System',Time_zone_name),'". TIME_FORMAT ."') as time, CONCAT('
', TIME_FORMAT(TIMEDIFF( CONVERT_TZ(NOW(),'$dtz','$dtz'),CONVERT_TZ(NOW(), Time_zone_name,'$dtz')),' %H : %i'), '
') AS timediff,
CONCAT('
" . T_("Remove") . "') as link
FROM timezone_template ORDER BY time ASC";