You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
60 lines
1.5 KiB
60 lines
1.5 KiB
![]()
11 years ago
|
<?php
|
||
|
/* For licensing terms, see /license.txt */
|
||
![]()
8 years ago
|
|
||
![]()
11 years ago
|
/**
|
||
![]()
8 years ago
|
* List of achieved certificates by the current user.
|
||
|
*
|
||
![]()
11 years ago
|
* @author Angel Fernando Quiroz Campos <angel.quiroz@beeznest.com>
|
||
![]()
8 years ago
|
*
|
||
![]()
11 years ago
|
* @package chamilo.gradebook
|
||
|
*/
|
||
|
$cidReset = true;
|
||
|
|
||
![]()
9 years ago
|
require_once __DIR__.'/../inc/global.inc.php';
|
||
![]()
11 years ago
|
|
||
![]()
7 years ago
|
$logInfo = [
|
||
|
'tool' => 'MyCertificates',
|
||
|
'tool_id' => 0,
|
||
|
'tool_id_detail' => 0,
|
||
|
'action' => '',
|
||
|
'action_details' => '',
|
||
|
];
|
||
|
Event::registerLog($logInfo);
|
||
|
|
||
![]()
11 years ago
|
if (api_is_anonymous()) {
|
||
|
api_not_allowed(true);
|
||
|
}
|
||
|
|
||
|
$userId = api_get_user_id();
|
||
|
|
||
![]()
11 years ago
|
$courseList = GradebookUtils::getUserCertificatesInCourses($userId);
|
||
|
$sessionList = GradebookUtils::getUserCertificatesInSessions($userId);
|
||
![]()
11 years ago
|
|
||
![]()
10 years ago
|
if (empty($courseList) && empty($sessionList)) {
|
||
|
Display::addFlash(
|
||
![]()
6 years ago
|
Display::return_message(get_lang('You have not achieved any certificate just yet. Continue on your learning path to get one!'), 'warning')
|
||
![]()
10 years ago
|
);
|
||
|
}
|
||
|
|
||
![]()
6 years ago
|
$template = new Template(get_lang('My certificates'));
|
||
![]()
11 years ago
|
|
||
|
$template->assign('course_list', $courseList);
|
||
|
$template->assign('session_list', $sessionList);
|
||
![]()
9 years ago
|
$templateName = $template->get_template('gradebook/my_certificates.tpl');
|
||
|
$content = $template->fetch($templateName);
|
||
![]()
11 years ago
|
|
||
![]()
9 years ago
|
if (api_get_setting('allow_public_certificates') === 'true') {
|
||
![]()
11 years ago
|
$template->assign(
|
||
|
'actions',
|
||
|
Display::toolbarButton(
|
||
![]()
6 years ago
|
get_lang('Search certificates'),
|
||
![]()
7 years ago
|
api_get_path(WEB_CODE_PATH).'gradebook/search.php',
|
||
![]()
11 years ago
|
'search',
|
||
|
'info'
|
||
|
)
|
||
|
);
|
||
|
}
|
||
![]()
11 years ago
|
|
||
![]()
11 years ago
|
$template->assign('content', $content);
|
||
|
$template->display_one_col_template();
|