Minor - fix php warnings

pull/2487/head
jmontoyaa 8 years ago
parent f84c2903d2
commit e79c498017
  1. 16
      main/inc/lib/certificate.lib.php
  2. 2
      main/mySpace/myStudents.php

@ -624,7 +624,11 @@ class Certificate extends Model
$extraFieldValue = new ExtraFieldValue('user');
$value = $extraFieldValue->get_values_by_handler_and_field_variable($this->user_id, 'legal_accept');
list($id, $id2, $termsValidationDate) = explode(':', $value['value']);
$termsValidationDate = '';
if (isset($value) && !empty($value['value'])) {
list($id, $id2, $termsValidationDate) = explode(':', $value['value']);
}
$sessions = SessionManager::get_sessions_by_user($this->user_id);
$sessionsApproved = [];
@ -672,7 +676,8 @@ class Certificate extends Model
$skill = new Skill();
$skills = $skill->getStudentSkills($this->user_id);
$time = api_time_to_hms(Tracking::get_time_spent_on_the_platform($this->user_id));
$timeInSeconds = Tracking::get_time_spent_on_the_platform($this->user_id);
$time = api_time_to_hms($timeInSeconds);
$tplContent = new Template(null, false, false, false, false, false);
@ -680,10 +685,13 @@ class Certificate extends Model
$tplContent->assign('complete_name', $userInfo['complete_name']);
$tplContent->assign('time_in_platform', $time);
$tplContent->assign('certificate_generated_date', api_get_local_time($myCertificate['created_at']));
$tplContent->assign('terms_validation_date', api_get_local_time($termsValidationDate));
if (!empty($termsValidationDate)) {
$termsValidationDate = api_get_local_time($termsValidationDate);
}
$tplContent->assign('terms_validation_date', $termsValidationDate);
// Ofaj
$tplContent->assign('time_in_platform_in_hours', round($time/3600, 1));
$tplContent->assign('time_in_platform_in_hours', round($timeInSeconds/3600, 1));
$tplContent->assign(
'certificate_generated_date_no_time',
api_get_local_time(

@ -698,7 +698,7 @@ $userGroups = $userGroupManager->getNameListByUser(
'legal_accept'
);
$icon = Display::return_icon('accept_na.png');
if (isset($value['value'])) {
if (isset($value['value']) && !empty($value['value'])) {
list($legalId, $legalLanguageId, $legalTime) = explode(':', $value['value']);
$icon = Display::return_icon('accept.png').' '.api_get_local_time($legalTime);
$icon .= ' '.Display::url(

Loading…
Cancel
Save