Browse Source

found log function in attforblock

MOODLE_26_STABLE
Joseph Baxter 11 years ago
parent
commit
e5a4dbb12c
  1. 46
      locallib.php

46
locallib.php

@ -810,8 +810,8 @@ class attendance {
}
$i++;
}
add_to_log($this->course->id, 'attendance', 'sessions added', $this->url_manage(),
implode(',', $info_array), $this->cm->id);
$this->log('sessions added', $this->url_manage(), implode(', ', $info_array));
}
public function update_session_from_form_data($formdata, $sessionid) {
@ -833,7 +833,7 @@ class attendance {
$url = $this->url_sessions(array('sessionid' => $sessionid, 'action' => att_sessions_page_params::ACTION_UPDATE));
$info = construct_session_full_date_time($sess->sessdate, $sess->duration);
add_to_log($this->course->id, 'attendance', 'session updated', $url, $info, $this->cm->id);
$this->log('session updated', $url, $info);
}
/**
@ -884,18 +884,12 @@ class attendance {
$params = array(
'sessionid' => $this->pageparams->sessionid,
'grouptype' => 0,
'id' => $this->cm->id);
$url = 'take.php?';
foreach ($params as $param => $value) {
$url = $url . $param . '=' . $value . '&';
}
$url = rtrim($url,'&');
'grouptype' => 0);
$url = $this->url_take($params);
// Log the change.
add_to_log($this->course->id, 'attendance', 'taken', $url, '', $USER->id);
$this->log('attendance taken', $url, $USER->firstname.' '.$USER->lastname);
return true;
}
@ -950,17 +944,12 @@ class attendance {
// create url for link in log screen
$params = array(
'sessionid' => $this->pageparams->sessionid,
'grouptype' => $this->pageparams->grouptype,
'id' => $this->cm->id);
$url = 'take.php?';
foreach ($params as $param => $value) {
$url = $url . $param . '=' . $value . '&';
}
$url = rtrim($url,'&');
'grouptype' => $this->pageparams->grouptype);
$url = $this->url_take($params);
add_to_log($this->course->id, 'attendance', 'taken', $url, '', $this->cm->id);
// Log the change.
$this->log('attendance taken', $url, $USER->firstname.' '.$USER->lastname);
$group = 0;
if ($this->pageparams->grouptype != attendance::SESSION_COMMON) {
@ -1392,8 +1381,7 @@ class attendance {
list($sql, $params) = $DB->get_in_or_equal($sessionsids);
$DB->delete_records_select('attendance_log', "sessionid $sql", $params);
$DB->delete_records_list('attendance_sessions', 'id', $sessionsids);
add_to_log($this->course->id, 'attendance', 'sessions deleted', $this->url_manage(),
get_string('sessionsids', 'attendance').implode(', ', $sessionsids), $this->cm->id);
$this->log('sessions deleted', null, get_string('sessionsids', 'attforblock').implode(', ', $sessionsids));
}
public function update_sessions_duration($sessionsids, $duration) {
@ -1409,6 +1397,8 @@ class attendance {
$sessions->close();
add_to_log($this->course->id, 'attendance', 'sessions duration updated', $this->url_manage(),
get_string('sessionsids', 'attendance').implode(', ', $sessionsids), $this->cm->id);
$this->log('sessions duration updated', $this->url_manage(), get_string('sessionsids', 'attforblock').implode(', ', $sessionsids));
}
public function remove_status($statusid) {
@ -1429,8 +1419,7 @@ class attendance {
$rec->grade = $grade;
$DB->insert_record('attendance_statuses', $rec);
add_to_log($this->course->id, 'attendance', 'status added', $this->url_preferences(),
$acronym.': '.$description.' ('.$grade.')', $this->cm->id);
$this->log('status added', $this->url_preferences(), $acronym.': '.$description.' ('.$grade.')');
} else {
print_error('cantaddstatus', 'attendance', $this->url_preferences());
}
@ -1461,8 +1450,7 @@ class attendance {
}
$DB->update_record('attendance_statuses', $status);
add_to_log($this->course->id, 'attendance', 'status updated', $this->url_preferences(),
implode(' ', $updated), $this->cm->id);
$this->log('status updated', $this->url_preferences(), implode(' ', $updated));
}
}

Loading…
Cancel
Save