19 declare(strict_types=1);
53 $this->
lng = $DIC->language();
64 $status =
'pc_prgstatus_status_no_qualification';
65 $status_txt =
'pc_prgstatus_text_no_qualification';
67 $icon =
'standard/icon_not_ok.svg';
70 $ass = $this->repo_assignment->getLongestValidAssignment($prg_obj_id, $this->usr_id)
71 ?? $this->repo_assignment->getLatestAssignment($prg_obj_id, $this->usr_id);
74 $pgs = $ass->getProgressTree();
76 if ($pgs->hasValidQualification($now)) {
77 $status =
'pc_prgstatus_status_valid_qualification';
78 $status_txt =
'pc_prgstatus_unlimited_validation';
79 $icon =
'standard/icon_ok.svg';
82 if ($validity = $pgs->getValidityOfQualification()) {
83 $status_txt =
'pc_prgstatus_expiration_date';
84 $validity_txt =
' ' . $validity->format(
'd.m.Y');
87 if (!is_null($restart)) {
88 $restart_date = $validity->sub($restart)->format(
'd.m.Y');
93 $icon = $this->ui_renderer->render(
94 $this->ui_factory->symbol()->icon()->custom(
96 $this->
lng->txt($status_txt)
100 $this->tpl->setVariable(
"ICON", $icon);
101 $this->tpl->setVariable(
"HEADLINE", $this->
lng->txt(
"pc_prgstatus_qualification_headline"));
102 $this->tpl->setVariable(
"STATUS", $this->
lng->txt($status));
103 $this->tpl->setVariable(
"STATUS_TEXT", $this->
lng->txt($status_txt) . $validity_txt);
105 $this->tpl->setVariable(
"CERTIFICATE", $certificate_link);
108 $this->tpl->setVariable(
"EDIT_QUALIFICATION", $this->
lng->txt(
"pc_prgstatus_edit_qualification") .
" " . $restart_date);
110 return $this->tpl->get();
115 $settings = $this->repo_settings->get($prg_obj_id);
116 $offset_days = $settings->getValidityOfQualificationSettings()->getRestartPeriod();
125 if ($this->cert_validator->isCertificateDownloadable($this->usr_id, $prg_obj_id)) {
126 $target = $this->
ctrl->getLinkTargetByClass(
"ilObjStudyProgrammeGUI",
"deliverCertificate");
127 return $this->ui_renderer->render($this->ui_factory->link()->standard($this->
lng->txt(
'download_certificate'), $target));
maybeGetCertificateLink(int $prg_obj_id)
getRestartPeriodOfProgrammeNode(int $prg_obj_id)
__construct(UIFactory $ui_factory, Renderer $ui_renderer, ilLanguage $lng, ilCtrl $ctrl, ilTemplate $tpl, PRGAssignmentRepository $repo_assignment, ilStudyProgrammeSettingsRepository $repo_settings, ilCertificateDownloadValidator $cert_validator, int $usr_id)
ilStudyProgrammeSettingsRepository $repo_settings
Builds PageContent "Status Information".
while($session_entry=$r->fetchRow(ilDBConstants::FETCHMODE_ASSOC)) return null
Covers the persistence of settings belonging to a study programme (SP).
Validates if an active certificate is stored in the database and can be downloaded by the user...
static getImagePath(string $image_name, string $module_path="", string $mode="output", bool $offline=false)
get image path (for images located in a template directory)
ilCertificateDownloadValidator $cert_validator
getStatusInfoFor(int $prg_obj_id)
PRGAssignmentRepository $repo_assignment