From d52f9fd6615db275a4e23bc9c00ade6301c092c4 Mon Sep 17 00:00:00 2001 From: Dan Marsden Date: Wed, 16 Sep 2020 14:25:26 +1200 Subject: [PATCH] Fix #493 allow session description to be included in export. --- classes/form/export.php | 1 + export.php | 3 +++ lang/en/attendance.php | 1 + 3 files changed, 5 insertions(+) diff --git a/classes/form/export.php b/classes/form/export.php index d707699..f8c2d37 100644 --- a/classes/form/export.php +++ b/classes/form/export.php @@ -140,6 +140,7 @@ class export extends \moodleform { $mform->setDefault('includeallsessions', true); $mform->addElement('checkbox', 'includenottaken', get_string('includenottaken', 'attendance'), get_string('yes')); $mform->addElement('checkbox', 'includeremarks', get_string('includeremarks', 'attendance'), get_string('yes')); + $mform->addElement('checkbox', 'includedescription', get_string('includedescription', 'attendance'), get_string('yes')); $mform->addElement('date_selector', 'sessionstartdate', get_string('startofperiod', 'attendance')); $mform->setDefault('sessionstartdate', $course->startdate); $mform->disabledIf('sessionstartdate', 'includeallsessions', 'checked'); diff --git a/export.php b/export.php index 1495ce8..653c53d 100644 --- a/export.php +++ b/export.php @@ -123,6 +123,9 @@ if ($formdata = $mform->get_data()) { } else { $text .= $sess->groupid ? $reportdata->groups[$sess->groupid]->name : get_string('commonsession', 'attendance'); } + if (isset($formdata->includedescription) && !empty($sess->description)) { + $text .= " ". strip_tags($sess->description); + } $data->tabhead[] = $text; if (isset($formdata->includeremarks)) { $data->tabhead[] = ''; // Space for the remarks. diff --git a/lang/en/attendance.php b/lang/en/attendance.php index 8c163b6..e7eea16 100644 --- a/lang/en/attendance.php +++ b/lang/en/attendance.php @@ -267,6 +267,7 @@ $string['importstatus_help'] = 'This allows a status value to be included in the $string['includeabsentee'] = 'Include session when calculating absentee report'; $string['includeabsentee_help'] = 'If checked this session will be included in the absentee report calculations.'; $string['includeall'] = 'Select all sessions'; +$string['includedescription'] = 'Include session description'; $string['includenottaken'] = 'Include not taken sessions'; $string['includeqrcode'] = 'Include QR code'; $string['includeremarks'] = 'Include remarks';