5 declare(strict_types=1);
12 const ID =
'prg_user_not_restarted';
42 $this->
log = $DIC[
'ilLog'];
43 $this->lng = $DIC[
'lng'];
44 $this->lng->loadLanguageModule(
'prg');
56 return $this->lng->txt(
'prg_user_not_restarted_title');
66 return $this->lng->txt(
'prg_user_not_restarted_desc');
106 return self::SCHEDULE_TYPE_IN_DAYS;
131 ->getProgrammeIdsWithMailsForExpiringValidity();
133 if (count($programmes_to_send) == 0) {
138 $programmes_and_due = [];
139 foreach ($programmes_to_send as $programme_obj_id => $days_offset_mail) {
140 $interval =
new DateInterval(
'P' . $days_offset_mail .
'D');
141 $due = $today->add($interval);
142 $programmes_and_due[$programme_obj_id] = $due;
146 ->getAboutToExpire($programmes_and_due,
true);
148 if (count($progresses) == 0) {
153 foreach ($progresses as $progress) {
156 'PRG, UserNotRestarted: user %s\'s qualification is about to expire at progress %s (prg obj_id %s)',
157 $progress->getUserId(),
159 $progress->getNodeId()
163 $events->informUserByMailToRestart($progress);
176 return $this->dic[
'model.Settings.ilStudyProgrammeSettingsRepository'];
181 return $this->dic[
'ilStudyProgrammeUserProgressDB'];
186 return $this->dic[
'ilStudyProgrammeUserAssignmentDB'];
191 return $this->dic[
'ilStudyProgrammeEvents'];
194 protected function log(
string $msg) : void
196 $this->
log->write($msg);
getDescription()
Get description.
getDefaultScheduleType()
Get schedule type.
Cron job application base class.
getDefaultScheduleValue()
Get schedule value.
getAssignmentRepository()
Inform a user, that her qualification is about to expire.
hasFlexibleSchedule()
Can the schedule be configured?
hasAutoActivation()
Is to be activated on "installation".
Cron job result data container.