ILIAS  trunk Revision v11.0_alpha-1769-g99a433fe2dc
All Data Structures Namespaces Files Functions Variables Enumerations Enumerator Modules Pages
class.ilExcCronReminders.php
Go to the documentation of this file.
1 <?php
2 
22 
30 {
31  protected ilLanguage $lng;
32 
33  public function __construct()
34  {
35  global $DIC;
36 
37  $this->lng = $DIC->language();
38  }
39 
40  public function getId(): string
41  {
42  return "exc_reminders";
43  }
44 
45  public function getTitle(): string
46  {
47  $lng = $this->lng;
48 
49  $lng->loadLanguageModule("exc");
50 
51  return $lng->txt("exc_reminders_cron");
52  }
53 
54  public function getDescription(): string
55  {
56  $lng = $this->lng;
57 
58  $lng->loadLanguageModule("exc");
59 
60  return $lng->txt("exc_reminders_cron_info");
61  }
62 
64  {
65  return JobScheduleType::DAILY;
66  }
67 
68  public function getDefaultScheduleValue(): ?int
69  {
70  return null;
71  }
72 
73  public function hasAutoActivation(): bool
74  {
75  return true;
76  }
77 
78  public function hasFlexibleSchedule(): bool
79  {
80  return true;
81  }
82 
86  public function run(): JobResult
87  {
89  $log->debug("--- Start Exercise Reminders Cron");
90 
91  $cron_status = JobResult::STATUS_NO_ACTION;
92  $message = "";
93  $reminder = new ilExAssignmentReminder();
94  $num_reminders = $reminder->checkReminders();
95 
96  $this->lng->loadLanguageModule("exc");
97 
98  if ($num_reminders !== 0) {
99  $cron_status = JobResult::STATUS_OK;
100  $message = $this->lng->txt('exc_reminder_cron_ok');
101  }
102 
103  $cron_result = new JobResult();
104  $cron_result->setStatus($cron_status);
105 
106  if ($message != "") {
107  $cron_result->setMessage($message . " " . $num_reminders . ' / ' . "#" . $num_reminders);
108  }
109 
110  return $cron_result;
111  }
112 }
static getLogger(string $a_component_id)
Get component logger.
txt(string $a_topic, string $a_default_lang_fallback_mod="")
gets the text for a given topic if the topic is not in the list, the topic itself with "-" will be re...
loadLanguageModule(string $a_module)
Load language module.
while($session_entry=$r->fetchRow(ilDBConstants::FETCHMODE_ASSOC)) return null
$log
Definition: result.php:32
Cron for exercise reminders.
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
global $DIC
Definition: shib_login.php:22
$message
Definition: xapiexit.php:31