function course_signup_watchdog in Course 7.2
Same name and namespace in other branches
- 6 modules/course_signup/course_signup.module \course_signup_watchdog()
- 7 modules/course_signup/course_signup.module \course_signup_watchdog()
Track attendance.
@todo, find a better way? looking at you,
See also
signup_mark_attended_action
File
- modules/
course_signup/ course_signup.module, line 341
Code
function course_signup_watchdog($watchdog) {
if (preg_match('/Marked signup @signup_id attended./', $watchdog['message'])) {
$sid = reset($watchdog['variables']);
$signup = signup_load_signup($sid);
$account = user_load($signup->uid);
$complete = strpos($watchdog['message'], 'did not') === FALSE;
if ($courseObject = course_get_course_object('course_signup', 'signup_attendance', $signup->nid)) {
$courseObject
->getFulfillment($account)
->setComplete($complete)
->save();
}
}
}