Browse Source

Fix #493 allow session description to be included in export.

nwp90-nwp90-allsessionsreport
Dan Marsden 4 years ago
parent
commit
d52f9fd661
  1. 1
      classes/form/export.php
  2. 3
      export.php
  3. 1
      lang/en/attendance.php

1
classes/form/export.php

@ -140,6 +140,7 @@ class export extends \moodleform {
$mform->setDefault('includeallsessions', true); $mform->setDefault('includeallsessions', true);
$mform->addElement('checkbox', 'includenottaken', get_string('includenottaken', 'attendance'), get_string('yes')); $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', '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->addElement('date_selector', 'sessionstartdate', get_string('startofperiod', 'attendance'));
$mform->setDefault('sessionstartdate', $course->startdate); $mform->setDefault('sessionstartdate', $course->startdate);
$mform->disabledIf('sessionstartdate', 'includeallsessions', 'checked'); $mform->disabledIf('sessionstartdate', 'includeallsessions', 'checked');

3
export.php

@ -123,6 +123,9 @@ if ($formdata = $mform->get_data()) {
} else { } else {
$text .= $sess->groupid ? $reportdata->groups[$sess->groupid]->name : get_string('commonsession', 'attendance'); $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; $data->tabhead[] = $text;
if (isset($formdata->includeremarks)) { if (isset($formdata->includeremarks)) {
$data->tabhead[] = ''; // Space for the remarks. $data->tabhead[] = ''; // Space for the remarks.

1
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'] = 'Include session when calculating absentee report';
$string['includeabsentee_help'] = 'If checked this session will be included in the absentee report calculations.'; $string['includeabsentee_help'] = 'If checked this session will be included in the absentee report calculations.';
$string['includeall'] = 'Select all sessions'; $string['includeall'] = 'Select all sessions';
$string['includedescription'] = 'Include session description';
$string['includenottaken'] = 'Include not taken sessions'; $string['includenottaken'] = 'Include not taken sessions';
$string['includeqrcode'] = 'Include QR code'; $string['includeqrcode'] = 'Include QR code';
$string['includeremarks'] = 'Include remarks'; $string['includeremarks'] = 'Include remarks';

Loading…
Cancel
Save