From b1ff02a5b94a6a2324fd46d4343c579830408090 Mon Sep 17 00:00:00 2001 From: Adam Zammit Date: Wed, 16 Aug 2017 14:53:12 +1000 Subject: [PATCH] Fixed issue: Data output including shift reports failing --- admin/dataoutput.php | 2 +- include/limesurvey/admin/exportresults.php | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/admin/dataoutput.php b/admin/dataoutput.php index 84eeb35c..6959e6a9 100644 --- a/admin/dataoutput.php +++ b/admin/dataoutput.php @@ -106,7 +106,7 @@ if (isset($_GET['key']) || isset($_GET['sample'])) (SELECT cp1.phone FROM `call` as cl4, `contact_phone` as cp1 WHERE cl4.call_id = c.last_call_id AND cp1.contact_phone_id = cl4.contact_phone_id ) as lastnumber, (SELECT cl55.start FROM `call` as cl55 WHERE cl55.call_id = c.last_call_id ) as lastcallstart, (SELECT op1.username FROM `call` as cl5, `operator` as op1 WHERE cl5.call_id = c.last_call_id AND op1.operator_id = cl5.operator_id) as operatoru, - (SELECT GROUP_CONCAT(DISTINCT sr1.report SEPARATOR '|') FROM `call` as cl6, `shift` as sh1, `shift_report` as sr1 WHERE cl6.case_id = c.case_id AND sr1.shift_id = sh1.shift_id AND sh1.questionnaire_id = c.questionnaire_id AND cl6.start >= sh1.start AND cl6.end < sh1.end GROUP BY sr1.shift_id) as shiftr, + (SELECT GROUP_CONCAT(DISTINCT sr1.report SEPARATOR '|') FROM `call` as cl6, `shift` as sh1, `shift_report` as sr1 WHERE cl6.case_id = c.case_id AND sr1.shift_id = sh1.shift_id AND sh1.questionnaire_id = c.questionnaire_id AND cl6.start >= sh1.start AND cl6.end < sh1.end GROUP BY cl6.case_id) as shiftr, o.aapor_id "; $i = 0; diff --git a/include/limesurvey/admin/exportresults.php b/include/limesurvey/admin/exportresults.php index e71d7e1a..a17fdda2 100644 --- a/include/limesurvey/admin/exportresults.php +++ b/include/limesurvey/admin/exportresults.php @@ -518,7 +518,7 @@ if ($tokenTableExists && $thissurvey['anonymized']=='N' && isset($_POST['attribu AND sh1.questionnaire_id = ca8.questionnaire_id AND cl6.start >= sh1.start AND cl6.end < sh1.end - GROUP BY sr1.shift_id) as shiftr "; + GROUP BY cl6.case_id) as shiftr "; } if (in_array('token',$_POST['attribute_select'])) { @@ -1379,4 +1379,4 @@ function strip_tags_full($string) { $string=str_replace('-oth-','',$string); return FlattenText($string,true,'UTF-8',false); } -?> \ No newline at end of file +?>