Browse Source

fix for log page link

MOODLE_26_STABLE
Joseph Baxter 11 years ago
parent
commit
ba31d7ad83
  1. 32
      locallib.php

32
locallib.php

@ -878,10 +878,23 @@ class attendance {
// Update the users grade. // Update the users grade.
$this->update_users_grade(array($USER->id)); $this->update_users_grade(array($USER->id));
// Log the change. /* create url for link in log screen
* need to set grouptype to 0 to allow take attendance page to be called
* from report/log page */
$params = array( $params = array(
'sessionid' => $mformdata->sessid); 'sessionid' => $this->pageparams->sessionid,
$url = $this->url_take($params); 'grouptype' => 0,
'id' => $this->cm->id);
$url = 'take.php?';
foreach ($params as $param => $value) {
$url = $url . $param . '=' . $value . '&';
}
$url = rtrim($url,'&');
// Log the change.
add_to_log($this->course->id, 'attendance', 'taken', $url, '', $USER->id); add_to_log($this->course->id, 'attendance', 'taken', $url, '', $USER->id);
return true; return true;
@ -934,10 +947,19 @@ class attendance {
$this->update_users_grade(array_keys($sesslog)); $this->update_users_grade(array_keys($sesslog));
} }
// create url for link in log screen
$params = array( $params = array(
'sessionid' => $this->pageparams->sessionid, 'sessionid' => $this->pageparams->sessionid,
'grouptype' => $this->pageparams->grouptype); 'grouptype' => $this->pageparams->grouptype,
$url = $this->url_take($params); 'id' => $this->cm->id);
$url = 'take.php?';
foreach ($params as $param => $value) {
$url = $url . $param . '=' . $value . '&';
}
$url = rtrim($url,'&');
add_to_log($this->course->id, 'attendance', 'taken', $url, '', $this->cm->id); add_to_log($this->course->id, 'attendance', 'taken', $url, '', $this->cm->id);
$group = 0; $group = 0;

Loading…
Cancel
Save