From d7c813a7707ef8197b804f893784065105c36125 Mon Sep 17 00:00:00 2001 From: Matheus Garcia Date: Thu, 30 May 2019 11:27:16 -0300 Subject: [PATCH] =?UTF-8?q?Adapta=C3=A7=C3=A3o=20para=20MOODLE=203.7?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- type/ILB_Sem_tutoria_2014/certificate.php | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/type/ILB_Sem_tutoria_2014/certificate.php b/type/ILB_Sem_tutoria_2014/certificate.php index cebf47e..04ee4bc 100644 --- a/type/ILB_Sem_tutoria_2014/certificate.php +++ b/type/ILB_Sem_tutoria_2014/certificate.php @@ -38,9 +38,12 @@ require_once("$CFG->dirroot/enrol/locallib.php"); $cc = new completion_completion(array('userid'=>$USER->id, 'course'=>$course->id)); $enrol_manager = new course_enrolment_manager($PAGE, $course); -$user_enrol = end($enrol_manager->get_user_enrolments($USER->id)); -$start_date = $user_enrol->timestart; +$enrolments = $enrol_manager->get_user_enrolments($USER->id); + +//$user_enrol = isempty($enrolments)? end(); + +$start_date = (empty($enrolments))? $enrolments[0]->timestart : 0; $end_date = $cc->timecompleted; $cert_date = $end_date;