From 9473ab9c2d4500bf466d18f42538691508c91136 Mon Sep 17 00:00:00 2001 From: Artem Andreev Date: Thu, 1 Dec 2011 17:44:27 +0400 Subject: [PATCH] Fixed bug when you have one session for current day and try take attendance from block. --- manage.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/manage.php b/manage.php index 1e5bfc1..2000471 100644 --- a/manage.php +++ b/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) {