Browse Source

Fix #346 correct redirect after saving attendance.

regression caused by mobile app restructuring.
MOODLE_36_STABLE
Dan Marsden 6 years ago
parent
commit
742b883b14
  1. 3
      renderer.php
  2. 3
      take.php

3
renderer.php

@ -415,7 +415,8 @@ class mod_attendance_renderer extends plugin_renderer_base {
$table .= $this->render_attendance_take_grid($takedata); $table .= $this->render_attendance_take_grid($takedata);
} }
$table .= html_writer::input_hidden_params($takedata->url(array('sesskey' => sesskey(), $table .= html_writer::input_hidden_params($takedata->url(array('sesskey' => sesskey(),
'page' => $takedata->pageparams->page))); 'page' => $takedata->pageparams->page,
'perpage' => $takedata->pageparams->perpage)));
$table .= html_writer::end_div(); $table .= html_writer::end_div();
$params = array( $params = array(
'type' => 'submit', 'type' => 'submit',

3
take.php

@ -77,6 +77,9 @@ if (($formdata = data_submitted()) && confirm_sesskey()) {
if (!empty($att->pageparams->page) && $att->pageparams->page && $totalusers && $usersperpage) { if (!empty($att->pageparams->page) && $att->pageparams->page && $totalusers && $usersperpage) {
$numberofpages = ceil($totalusers / $usersperpage); $numberofpages = ceil($totalusers / $usersperpage);
if ($att->pageparams->page < $numberofpages) { if ($att->pageparams->page < $numberofpages) {
$params = array(
'sessionid' => $att->pageparams->sessionid,
'grouptype' => $att->pageparams->grouptype);
$params['page'] = $att->pageparams->page + 1; $params['page'] = $att->pageparams->page + 1;
redirect($att->url_take($params), get_string('moreattendance', 'attendance')); redirect($att->url_take($params), get_string('moreattendance', 'attendance'));
} }

Loading…
Cancel
Save