ILIAS  release_8 Revision v8.19-1-g4e8f2f9140c
All Data Structures Namespaces Files Functions Variables Modules Pages
ilExcCronReminders Class Reference

This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Learning e.V. More...

+ Inheritance diagram for ilExcCronReminders:
+ Collaboration diagram for ilExcCronReminders:

Public Member Functions

 __construct ()
 
 getId ()
 
 getTitle ()
 
 getDescription ()
 
 getDefaultScheduleType ()
 
 getDefaultScheduleValue ()
 
 hasAutoActivation ()
 
 hasFlexibleSchedule ()
 
 run ()
 
- Public Member Functions inherited from ilCronJob
 setDateTimeProvider (?Closure $date_time_provider)
 
 isDue (?DateTimeImmutable $last_run, ?int $schedule_type, ?int $schedule_value, bool $is_manually_executed=false)
 
 getScheduleType ()
 Get current schedule type (if flexible) More...
 
 getScheduleValue ()
 Get current schedule value (if flexible) More...
 
 setSchedule (?int $a_type, ?int $a_value)
 Update current schedule (if flexible) More...
 
 getAllScheduleTypes ()
 Get all available schedule types. More...
 
 getScheduleTypesWithValues ()
 
 getValidScheduleTypes ()
 Returns a collection of all valid schedule types for a specific job. More...
 
 isManuallyExecutable ()
 
 hasCustomSettings ()
 
 addCustomSettingsToForm (ilPropertyFormGUI $a_form)
 
 saveCustomSettings (ilPropertyFormGUI $a_form)
 
 addToExternalSettingsForm (int $a_form_id, array &$a_fields, bool $a_is_active)
 
 activationWasToggled (ilDBInterface $db, ilSetting $setting, bool $a_currently_active)
 Important: This method is (also) called from the setup process, where the constructor of an ilCronJob ist NOT executed. More...
 
 getId ()
 
 getTitle ()
 
 getDescription ()
 
 hasAutoActivation ()
 Is to be activated on "installation", does only work for ILIAS core cron jobs. More...
 
 hasFlexibleSchedule ()
 
 getDefaultScheduleType ()
 
 getDefaultScheduleValue ()
 
 run ()
 

Protected Attributes

ilLanguage $lng
 
- Protected Attributes inherited from ilCronJob
int $schedule_type = null
 
int $schedule_value = null
 
Closure $date_time_provider = null
 

Additional Inherited Members

- Data Fields inherited from ilCronJob
const SCHEDULE_TYPE_DAILY = 1
 This will be replaced with an ENUM in ILIAS 9 More...
 
const SCHEDULE_TYPE_IN_MINUTES = 2
 This will be replaced with an ENUM in ILIAS 9 More...
 
const SCHEDULE_TYPE_IN_HOURS = 3
 This will be replaced with an ENUM in ILIAS 9 More...
 
const SCHEDULE_TYPE_IN_DAYS = 4
 This will be replaced with an ENUM in ILIAS 9 More...
 
const SCHEDULE_TYPE_WEEKLY = 5
 This will be replaced with an ENUM in ILIAS 9 More...
 
const SCHEDULE_TYPE_MONTHLY = 6
 This will be replaced with an ENUM in ILIAS 9 More...
 
const SCHEDULE_TYPE_QUARTERLY = 7
 This will be replaced with an ENUM in ILIAS 9 More...
 
const SCHEDULE_TYPE_YEARLY = 8
 This will be replaced with an ENUM in ILIAS 9 More...
 

Detailed Description

This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Learning e.V.

ILIAS is licensed with the GPL-3.0, see https://www.gnu.org/licenses/gpl-3.0.en.html You should have received a copy of said license along with the source code, too.

If this is not the case or you just want to try ILIAS, you'll find us at: https://www.ilias.de https://github.com/ILIAS-eLearning Cron for exercise reminders

Author
Jesús López lopez.nosp@m.@lei.nosp@m.fos.c.nosp@m.om
Alexander Killing killi.nosp@m.ng@l.nosp@m.eifos.nosp@m..de

Definition at line 25 of file class.ilExcCronReminders.php.

Constructor & Destructor Documentation

◆ __construct()

ilExcCronReminders::__construct ( )

Definition at line 29 of file class.ilExcCronReminders.php.

References $DIC, and ILIAS\Repository\lng().

30  {
31  global $DIC;
32 
33  $this->lng = $DIC->language();
34  }
global $DIC
Definition: feed.php:28
+ Here is the call graph for this function:

Member Function Documentation

◆ getDefaultScheduleType()

ilExcCronReminders::getDefaultScheduleType ( )

Definition at line 59 of file class.ilExcCronReminders.php.

59  : int
60  {
61  return self::SCHEDULE_TYPE_DAILY;
62  }

◆ getDefaultScheduleValue()

ilExcCronReminders::getDefaultScheduleValue ( )

Definition at line 64 of file class.ilExcCronReminders.php.

64  : ?int
65  {
66  return null;
67  }

◆ getDescription()

ilExcCronReminders::getDescription ( )

Definition at line 50 of file class.ilExcCronReminders.php.

References $lng, ilLanguage\loadLanguageModule(), and ilLanguage\txt().

50  : string
51  {
52  $lng = $this->lng;
53 
54  $lng->loadLanguageModule("exc");
55 
56  return $lng->txt("exc_reminders_cron_info");
57  }
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.
+ Here is the call graph for this function:

◆ getId()

ilExcCronReminders::getId ( )

Definition at line 36 of file class.ilExcCronReminders.php.

36  : string
37  {
38  return "exc_reminders";
39  }

◆ getTitle()

ilExcCronReminders::getTitle ( )

Definition at line 41 of file class.ilExcCronReminders.php.

References $lng, ilLanguage\loadLanguageModule(), and ilLanguage\txt().

41  : string
42  {
43  $lng = $this->lng;
44 
45  $lng->loadLanguageModule("exc");
46 
47  return $lng->txt("exc_reminders_cron");
48  }
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.
+ Here is the call graph for this function:

◆ hasAutoActivation()

ilExcCronReminders::hasAutoActivation ( )

Definition at line 69 of file class.ilExcCronReminders.php.

69  : bool
70  {
71  return true;
72  }

◆ hasFlexibleSchedule()

ilExcCronReminders::hasFlexibleSchedule ( )

Definition at line 74 of file class.ilExcCronReminders.php.

74  : bool
75  {
76  return true;
77  }

◆ run()

ilExcCronReminders::run ( )
Exceptions
ilExcUnknownAssignmentTypeException

Definition at line 82 of file class.ilExcCronReminders.php.

References $log, $message, ilLoggerFactory\getLogger(), ILIAS\Repository\lng(), ilCronJobResult\STATUS_NO_ACTION, and ilCronJobResult\STATUS_OK.

83  {
85  $log->debug("--- Start Exercise Reminders Cron");
86 
87  $cron_status = ilCronJobResult::STATUS_NO_ACTION;
88  $message = "";
89  $reminder = new ilExAssignmentReminder();
90  $num_reminders = $reminder->checkReminders();
91 
92  $this->lng->loadLanguageModule("exc");
93 
94  if ($num_reminders !== 0) {
95  $cron_status = ilCronJobResult::STATUS_OK;
96  $message = $this->lng->txt('exc_reminder_cron_ok');
97  }
98 
99  $cron_result = new ilCronJobResult();
100  $cron_result->setStatus($cron_status);
101 
102  if ($message != "") {
103  $cron_result->setMessage($message . " " . $num_reminders . ' / ' . "#" . $num_reminders);
104  }
105 
106  return $cron_result;
107  }
static getLogger(string $a_component_id)
Get component logger.
$log
Definition: result.php:33
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
$message
Definition: xapiexit.php:32
+ Here is the call graph for this function:

Field Documentation

◆ $lng

ilLanguage ilExcCronReminders::$lng
protected

Definition at line 27 of file class.ilExcCronReminders.php.

Referenced by getDescription(), and getTitle().


The documentation for this class was generated from the following file: