5declare(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');
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);
169 protected function getNow() : \DateTimeImmutable
171 return new DateTimeImmutable();
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);
An exception for terminatinating execution or to throw for unit testing.
Cron job result data container.
Cron job application base class.
const SCHEDULE_TYPE_IN_DAYS
Inform a user, that her qualification is about to expire.
getAssignmentRepository()
getDescription()
Get description.
getDefaultScheduleType()
Get schedule type.
hasAutoActivation()
Is to be activated on "installation".
getDefaultScheduleValue()
Get schedule value.
hasFlexibleSchedule()
Can the schedule be configured?