From 0367c6ec9b16c959eb81b1984293c8e3c5a09f23 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ses=C3=B3stris=20Vieira?= Date: Thu, 1 Sep 2016 16:42:15 -0300 Subject: [PATCH] =?UTF-8?q?Usa=20a=20data=20de=20matr=C3=ADcula=20como=20d?= =?UTF-8?q?ata=20de=20in=C3=ADcio=20do=20curso?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- type/ILB_Sem_tutoria_2014/certificate.php | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/type/ILB_Sem_tutoria_2014/certificate.php b/type/ILB_Sem_tutoria_2014/certificate.php index fe0beb8..610739f 100644 --- a/type/ILB_Sem_tutoria_2014/certificate.php +++ b/type/ILB_Sem_tutoria_2014/certificate.php @@ -34,9 +34,13 @@ if (!defined('MOODLE_INTERNAL')) { * Finally format them to print */ require_once("$CFG->dirroot/completion/completion_completion.php"); +require_once("$CFG->dirroot/enrol/locallib.php"); $cc = new completion_completion(array('userid'=>$USER->id, 'course'=>$course->id)); -$start_date = $cc->timeenrolled; +$enrol_manager = new course_enrolment_manager($PAGE, $course); +$user_enrol = end($enrol_manager->get_user_enrolments($USER->id)); + +$start_date = $user_enrol->timestart; $end_date = $cc->timecompleted; $fmt = '%d/%m/%Y'; // Default format