3 declare(strict_types=1);
28 private const ID =
'prg_user_not_restarted';
38 $this->
log = $DIC[
'ilLog'];
39 $this->
lng = $DIC[
'lng'];
40 $this->
lng->loadLanguageModule(
'prg');
43 $this->assignment_repo =
$dic[
'repo.assignment'];
44 $this->adapter =
$dic[
'cron.notRestarted'];
49 return $this->
lng->txt(
'prg_user_not_restarted_title');
54 return $this->
lng->txt(
'prg_user_not_restarted_desc');
74 return CronJobScheduleType::SCHEDULE_TYPE_IN_DAYS;
87 $programmes_to_send = $this->adapter->getRelevantProgrammeIds();
88 if (count($programmes_to_send) == 0) {
93 $programmes_and_due = [];
94 foreach ($programmes_to_send as $programme_obj_id => $days_offset_mail) {
95 $interval =
new DateInterval(
'P' . $days_offset_mail .
'D');
96 $due = $today->add($interval);
97 $programmes_and_due[$programme_obj_id] = $due;
100 $assignments = $this->assignment_repo->getAboutToExpire($programmes_and_due,
true);
102 if (count($assignments) == 0) {
105 foreach ($assignments as $ass) {
106 $pgs = $ass->getProgressTree();
109 'PRG, UserNotRestarted: user %s\'s qualification is about to expire at assignment %s (prg obj_id %s)',
115 $this->adapter->actOnSingleAssignment($ass);
116 $this->assignment_repo->storeExpiryInfoSentFor($ass);
127 protected function log(
string $msg): void
129 $this->
log->write($msg);
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
getDefaultScheduleValue()
Component logger with individual log levels by component id.
Inform a user, that her qualification is about to expire.
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
ilPRGAssignmentDBRepository $assignment_repo
ilPrgCronJobAdapter $adapter
final const STATUS_NO_ACTION
Assignments are relations of users to a PRG; They hold progress-information for (sub-)nodes of the PR...