Browse Source

Fixed bug when you have one session for current day and try take attendance from block.

MOODLE_23_STABLE
Artem Andreev 13 years ago
parent
commit
9473ab9c2d
  1. 4
      manage.php

4
manage.php

@ -36,8 +36,8 @@ if ($from === 'block') {
$size = count($sessions);
if ($size == 1) {
$sess = reset($sessions);
$nottaken = !$att->lasttaken && has_capability('mod/attforblock:takeattendances', $context);
$canchange = $att->lasttaken && has_capability('mod/attforblock:changeattendances', $context);
$nottaken = !$sess->lasttaken && has_capability('mod/attforblock:takeattendances', $PAGE->context);
$canchange = $sess->lasttaken && has_capability('mod/attforblock:changeattendances', $PAGE->context);
if ($nottaken || $canchange)
redirect($att->url_take(array('sessionid' => $sess->id, 'grouptype' => $sess->groupid)));
} elseif ($size > 1) {

Loading…
Cancel
Save