3 declare(strict_types=1);
30 private const ID =
'prg_user_not_restarted';
40 $this->
log = $DIC[
'ilLog'];
41 $this->
lng = $DIC[
'lng'];
42 $this->
lng->loadLanguageModule(
'prg');
45 $this->assignment_repo =
$dic[
'repo.assignment'];
46 $this->adapter =
$dic[
'cron.notRestarted'];
51 return $this->
lng->txt(
'prg_user_not_restarted_title');
56 return $this->
lng->txt(
'prg_user_not_restarted_desc');
76 return JobScheduleType::IN_DAYS;
87 $result->setStatus(JobResult::STATUS_NO_ACTION);
89 $programmes_to_send = $this->adapter->getRelevantProgrammeIds();
90 if (count($programmes_to_send) == 0) {
95 $programmes_and_due = [];
96 foreach ($programmes_to_send as $programme_obj_id => $days_offset_mail) {
97 $interval =
new DateInterval(
'P' . $days_offset_mail .
'D');
98 $due = $today->add($interval);
99 $programmes_and_due[$programme_obj_id] = $due;
102 $assignments = $this->assignment_repo->getAboutToExpire($programmes_and_due,
true);
104 if (count($assignments) == 0) {
107 foreach ($assignments as $ass) {
108 $pgs = $ass->getProgressTree();
111 'PRG, UserNotRestarted: user %s\'s qualification is about to expire at assignment %s (prg obj_id %s)',
117 $this->adapter->actOnSingleAssignment($ass);
118 $this->assignment_repo->storeExpiryInfoSentFor($ass);
120 $result->setStatus(JobResult::STATUS_OK);
129 protected function log(
string $msg): void
131 $this->
log->write($msg);
getDefaultScheduleValue()
Component logger with individual log levels by component id.
Inform a user, that her qualification is about to expire.
ilPRGAssignmentDBRepository $assignment_repo
ilPrgCronJobAdapter $adapter
Assignments are relations of users to a PRG; They hold progress-information for (sub-)nodes of the PR...