ILIAS  trunk Revision v11.0_alpha-1871-gde1fee8db3d
All Data Structures Namespaces Files Functions Variables Enumerations Enumerator Modules Pages
ilExcCronReminders Class Reference

Cron for exercise reminders. 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 ILIAS\Cron\CronJob
 setDateTimeProvider (?\Closure $date_time_provider)
 
 isDue (?\DateTimeImmutable $last_run, ?JobScheduleType $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 (?JobScheduleType $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 ()
 
 usesLegacyForms ()
 
 getCustomConfigurationInput (\ILIAS\UI\Factory $ui_factory, \ILIAS\Refinery\Factory $factory, \ilLanguage $lng)
 
 addCustomSettingsToForm (\ilPropertyFormGUI $a_form)
 
 saveCustomConfiguration (mixed $form_data)
 
 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 ILIAS\Cron\CronJob
JobScheduleType $schedule_type = null
 
int $schedule_value = null
 
Closure $date_time_provider = null
 

Detailed Description

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 29 of file class.ilExcCronReminders.php.

Constructor & Destructor Documentation

◆ __construct()

ilExcCronReminders::__construct ( )

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

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

34  {
35  global $DIC;
36 
37  $this->lng = $DIC->language();
38  }
global $DIC
Definition: shib_login.php:22
+ Here is the call graph for this function:

Member Function Documentation

◆ getDefaultScheduleType()

ilExcCronReminders::getDefaultScheduleType ( )

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

64  {
65  return JobScheduleType::DAILY;
66  }

◆ getDefaultScheduleValue()

ilExcCronReminders::getDefaultScheduleValue ( )

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

References null.

68  : ?int
69  {
70  return null;
71  }
while($session_entry=$r->fetchRow(ilDBConstants::FETCHMODE_ASSOC)) return null

◆ getDescription()

ilExcCronReminders::getDescription ( )

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

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

54  : string
55  {
56  $lng = $this->lng;
57 
58  $lng->loadLanguageModule("exc");
59 
60  return $lng->txt("exc_reminders_cron_info");
61  }
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 40 of file class.ilExcCronReminders.php.

40  : string
41  {
42  return "exc_reminders";
43  }

◆ getTitle()

ilExcCronReminders::getTitle ( )

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

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

45  : string
46  {
47  $lng = $this->lng;
48 
49  $lng->loadLanguageModule("exc");
50 
51  return $lng->txt("exc_reminders_cron");
52  }
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 73 of file class.ilExcCronReminders.php.

73  : bool
74  {
75  return true;
76  }

◆ hasFlexibleSchedule()

ilExcCronReminders::hasFlexibleSchedule ( )

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

78  : bool
79  {
80  return true;
81  }

◆ run()

ilExcCronReminders::run ( )
Exceptions
ilExcUnknownAssignmentTypeException

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

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

86  : 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  }
static getLogger(string $a_component_id)
Get component logger.
$log
Definition: result.php:32
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
$message
Definition: xapiexit.php:31
+ Here is the call graph for this function:

Field Documentation

◆ $lng

ilLanguage ilExcCronReminders::$lng
protected

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

Referenced by getDescription(), and getTitle().


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