function release_cert(&$url) { checkPerm('view'); $id_certificate = importVar('id_certificate', true, 0); $id_course = importVar('id_course', true, 0); $id_meta = Get::req('idmeta', DOTY_INT, 0); $cert = new Certificate(); $subs = $cert->getSubstitutionArray(Docebo::user()->getIdST(), $id_course, $id_meta); $cert->send_certificate($id_certificate, Docebo::user()->getIdST(), $id_course, $subs); }
function print_certificate() { require_once _lms_ . '/lib/lib.certificate.php'; require_once _base_ . '/lib/lib.download.php'; $id_certificate = importVar('certificate_id', true, 0); $id_course = importVar('course_id', true, 0); $id_user = importVar('user_id', true, 0); $cert = new Certificate(); $subs = $cert->getSubstitutionArray($id_user, $id_course); $cert->send_certificate($id_certificate, $id_user, $id_course, $subs, true); }
function release_cert() { checkPerm('view'); require_once $GLOBALS['where_lms'] . '/lib/lib.certificate.php'; $id_certificate = importVar('id_certificate', true, 0); $id_course = importVar('id_course', true, 0); $id_user = Get::req('iduser', DOTY_INT, 0); $id_meta = Get::req('idmeta', DOTY_INT, 0); $cert = new Certificate(); $subs = $cert->getSubstitutionArray($id_user, $id_course, $id_meta); $cert->send_certificate($id_certificate, $id_user, $id_course, $subs); }
$head = Lang::t('_GENERATE_CERTIFICATES', 'certificate'); $body = '<div><p>' . Lang::t('_PROGRESS', 'certificate') . '</p><div class="box_progress_bar" id="load_line">' . '<div id="print_progressbar" class="bar_complete" style="width:0%"></div>' . '<div class="no_float"></div></div>' . '<p>' . Lang::t('_GENERATE', 'certificate') . ' <span id="actual_num">' . '</span> ' . Lang::t('_OF', 'certificate') . ' <span id="total_num">' . '</span>' . '</p></div><div id="print_result" class="error_frame"></div>'; $output['head'] = $head; $output['body'] = $body; aout($json->encode($output)); break; case "print": $output = array('success' => false); $id_certificate = Get::req('id_certificate', DOTY_INT, -1); $id_course = Get::req('id_course', DOTY_INT, -1); $id_user = Get::req('id_user', DOTY_INT, -1); ob_start(); if ($id_user > 0 && $id_course > 0 && $id_certificate > 0) { $cert = new Certificate(); $subs = $cert->getSubstitutionArray($id_user, $id_course); $cert->send_certificate($id_certificate, $id_user, $id_course, $subs, false, true); $output['success'] = true; $output['printed'] = $id_user; } else { $acl_man =& $GLOBALS['current_user']->getAclManager(); $user_info = $acl_man->getUser($id_user, false); if ($user_info[ACL_INFO_FIRSTNAME] !== '' && $user_info[ACL_INFO_LASTNAME] !== '') { $username = $user_info[ACL_INFO_FIRSTNAME] . ' ' . $user_info[ACL_INFO_LASTNAME] . ' (' . $acl_man->relativeId($user_info[ACL_INFO_USERID]) . ')'; } elseif ($user_info[ACL_INFO_LASTNAME] !== '') { $username = $user_info[ACL_INFO_LASTNAME] . ' (' . $acl_man->relativeId($user_info[ACL_INFO_USERID]) . ')'; } elseif ($user_info[ACL_INFO_FIRSTNAME] !== '') { $username = $user_info[ACL_INFO_FIRSTNAME] . ' (' . $acl_man->relativeId($user_info[ACL_INFO_USERID]) . ')'; } else { $username = $acl_man->relativeId($user_info[ACL_INFO_USERID]); } $output['message'] = $username . ' - ' . Lang::t('_CERTIFICATE_PRINT_ERROR', 'certificate');