Close courses on end date

Third party plugins, patches, bugfixes
Post Reply
User avatar
alberto
FormaLms Guru
Posts: 1135
Joined: Fri Mar 02, 2012 9:18 am
Contact:

Close courses on end date

Post by alberto »

By default courses on “my courses” page are not automatically closed on end date. To make this work just remove comments to the following fuction in /doceboLms/lib/lib.course.php

Code: Select all


// control if the course is elapsed
		/*if($course['date_begin'] != '0000-00-00') {

			$time_begin = fromDatetimeToTimestamp($course['date_begin']);

			if($now < $time_begin) return array('can' => false, 'reason' => 'course_date', 'expiring_in' => $expiring);
		}
		if($course['date_end'] != '0000-00-00') {

			$time_end = fromDatetimeToTimestamp($course['date_end']);

			if($now > $time_end) return array('can' => false, 'reason' => 'course_date', 'expiring_in' => $expiring);
		}
		if($course['valid_time'] != '0' && $course['valid_time'] != '' && $course['date_first_access'] != '') {

			$time_first_access = fromDatetimeToTimestamp($course['date_first_access']);

			if($now > ( $time_first_access + ($course['valid_time'] * 24 * 3600 ) )) return array('can' => true, 'reason' => 'course_valid_time', 'expiring_in' => $expiring);
		}*/

Post Reply