Browse Source

add setting to allow sessiont description to show in report.

MOODLE_33_STABLE
Dan Marsden 7 years ago
parent
commit
d7a908707a
  1. 2
      lang/en/attendance.php
  2. 19
      renderer.php
  3. 4
      settings.php

2
lang/en/attendance.php

@ -422,6 +422,8 @@ $string['showdefaults'] = 'Show defaults';
$string['showduration'] = 'Show duration'; $string['showduration'] = 'Show duration';
$string['showextrauserdetails'] = 'Show extra user details'; $string['showextrauserdetails'] = 'Show extra user details';
$string['showsessiondetails'] = 'Show session details'; $string['showsessiondetails'] = 'Show session details';
$string['showsessiondescriptiononreport'] = 'Show session description in report';
$string['showsessiondescriptiononreport_desc'] = 'Show the session description in the attendance report listing.';
$string['somedisabledstatus'] = '(Some options have been removed as the session has started.)'; $string['somedisabledstatus'] = '(Some options have been removed as the session has started.)';
$string['sortedgrid'] = 'Sorted grid'; $string['sortedgrid'] = 'Sorted grid';
$string['sortedlist'] = 'Sorted list'; $string['sortedlist'] = 'Sorted list';

19
renderer.php

@ -1508,18 +1508,27 @@ class mod_attendance_renderer extends plugin_renderer_base {
'mod/attendance:changeattendances' 'mod/attendance:changeattendances'
); );
if (is_null($sess->lasttaken) and has_any_capability($capabilities, $reportdata->att->context)) { if (is_null($sess->lasttaken) and has_any_capability($capabilities, $reportdata->att->context)) {
$sesstext = html_writer::link($reportdata->url_take($sess->id, $sess->groupid), $sesstext); $sesstext = html_writer::link($reportdata->url_take($sess->id, $sess->groupid), $sesstext,
array('class' => 'attendancereporttakelink'));
}
$sesstext .= html_writer::empty_tag('br', array('class' => 'attendancereportseparator'));
if (!empty($sess->description) &&
!empty(get_config('attendance', 'showsessiondescriptiononreport'))) {
$sesstext .= html_writer::tag('small', format_text($sess->description),
array('class' => 'attendancereportcommon'));
} }
$sesstext .= html_writer::empty_tag('br');
if ($sess->groupid) { if ($sess->groupid) {
if (empty($reportdata->groups[$sess->groupid])) { if (empty($reportdata->groups[$sess->groupid])) {
$sesstext .= html_writer::tag('small', get_string('deletedgroup', 'attendance')); $sesstext .= html_writer::tag('small', get_string('deletedgroup', 'attendance'),
array('class' => 'attendancereportgroup'));
} else { } else {
$sesstext .= html_writer::tag('small', $reportdata->groups[$sess->groupid]->name); $sesstext .= html_writer::tag('small', $reportdata->groups[$sess->groupid]->name,
array('class' => 'attendancereportgroup'));
} }
} else { } else {
$sesstext .= html_writer::tag('small', get_string('commonsession', 'attendance')); $sesstext .= html_writer::tag('small', get_string('commonsession', 'attendance'),
array('class' => 'attendancereportcommon'));
} }
$row->cells[] = $this->build_header_cell($sesstext, false, true, null, null, false); $row->cells[] = $this->build_header_cell($sesstext, false, true, null, null, false);

4
settings.php

@ -78,6 +78,10 @@ if ($ADMIN->fulltree) {
get_string('multisessionexpanded', 'attendance'), get_string('multisessionexpanded', 'attendance'),
get_string('multisessionexpanded_desc', 'attendance'), 0)); get_string('multisessionexpanded_desc', 'attendance'), 0));
$settings->add(new admin_setting_configcheckbox('attendance/showsessiondescriptiononreport',
get_string('showsessiondescriptiononreport', 'attendance'),
get_string('showsessiondescriptiononreport_desc', 'attendance'), 0));
$settings->add(new admin_setting_configcheckbox('attendance/studentrecordingexpanded', $settings->add(new admin_setting_configcheckbox('attendance/studentrecordingexpanded',
get_string('studentrecordingexpanded', 'attendance'), get_string('studentrecordingexpanded', 'attendance'),
get_string('studentrecordingexpanded_desc', 'attendance'), 1)); get_string('studentrecordingexpanded_desc', 'attendance'), 1));

Loading…
Cancel
Save