ILIAS  release_7 Revision v7.30-3-g800a261c036
ilExcCronReminders Class Reference

Cron for exercise reminders. More...

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

Public Member Functions

 __construct ()
 Constructor. More...
 
 getId ()
 Get id. More...
 
 getTitle ()
 Get title. More...
 
 getDescription ()
 Get description. More...
 
 getDefaultScheduleType ()
 Get schedule type. More...
 
 getDefaultScheduleValue ()
 Get schedule value. More...
 
 hasAutoActivation ()
 Is to be activated on "installation". More...
 
 hasFlexibleSchedule ()
 Can the schedule be configured? More...
 
 run ()
 Run job. More...
 
- Public Member Functions inherited from ilCronJob
 isActive ($a_ts_last_run, $a_schedule_type, $a_schedule_value, $a_manual=false)
 Is job currently active? More...
 
 getScheduleType ()
 Get current schedule type (if flexible) More...
 
 getScheduleValue ()
 Get current schedule value (if flexible) More...
 
 setSchedule ($a_type, $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...
 
 getTitle ()
 Get title. More...
 
 getDescription ()
 Get description. More...
 
 isManuallyExecutable ()
 Defines whether or not a cron job can be started manually. More...
 
 hasCustomSettings ()
 Has cron job any custom setting which can be edited? More...
 
 addCustomSettingsToForm (ilPropertyFormGUI $a_form)
 Add custom settings to form. More...
 
 saveCustomSettings (ilPropertyFormGUI $a_form)
 Save custom settings. More...
 
 addToExternalSettingsForm ($a_form_id, array &$a_fields, $a_is_active)
 Add external settings to form. More...
 
 activationWasToggled ($a_currently_active)
 Cron job status was changed. More...
 
 getId ()
 Get id. More...
 
 hasAutoActivation ()
 Is to be activated on "installation". More...
 
 hasFlexibleSchedule ()
 Can the schedule be configured? More...
 
 getDefaultScheduleType ()
 Get schedule type. More...
 
 getDefaultScheduleValue ()
 Get schedule value. More...
 
 run ()
 Run job. More...
 

Protected Attributes

 $lng
 

Additional Inherited Members

- Data Fields inherited from ilCronJob
const SCHEDULE_TYPE_DAILY = 1
 
const SCHEDULE_TYPE_IN_MINUTES = 2
 
const SCHEDULE_TYPE_IN_HOURS = 3
 
const SCHEDULE_TYPE_IN_DAYS = 4
 
const SCHEDULE_TYPE_WEEKLY = 5
 
const SCHEDULE_TYPE_MONTHLY = 6
 
const SCHEDULE_TYPE_QUARTERLY = 7
 
const SCHEDULE_TYPE_YEARLY = 8
 
- Protected Member Functions inherited from ilCronJob
 checkSchedule ($a_ts_last_run, $a_schedule_type, $a_schedule_value)
 

Detailed Description

Cron for exercise reminders.

Author
Jesús López lopez.nosp@m.@lei.nosp@m.fos.c.nosp@m.om

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

Constructor & Destructor Documentation

◆ __construct()

ilExcCronReminders::__construct ( )

Constructor.

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

23 {
24 global $DIC;
25
26 $this->lng = $DIC->language();
27 }
global $DIC
Definition: goto.php:24

References $DIC.

Member Function Documentation

◆ getDefaultScheduleType()

ilExcCronReminders::getDefaultScheduleType ( )

Get schedule type.

Returns
int

Reimplemented from ilCronJob.

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

53 {
55 }
const SCHEDULE_TYPE_DAILY

References ilCronJob\SCHEDULE_TYPE_DAILY.

◆ getDefaultScheduleValue()

ilExcCronReminders::getDefaultScheduleValue ( )

Get schedule value.

Returns
int|array

Reimplemented from ilCronJob.

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

58 {
59 return;
60 }

◆ getDescription()

ilExcCronReminders::getDescription ( )

Get description.

Returns
string

Reimplemented from ilCronJob.

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

44 {
46
47 $lng->loadLanguageModule("exc");
48
49 return $lng->txt("exc_reminders_cron_info");
50 }

References $lng.

◆ getId()

ilExcCronReminders::getId ( )

Get id.

Returns
string

Reimplemented from ilCronJob.

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

30 {
31 return "exc_reminders";
32 }

◆ getTitle()

ilExcCronReminders::getTitle ( )

Get title.

Returns
string

Reimplemented from ilCronJob.

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

35 {
37
38 $lng->loadLanguageModule("exc");
39
40 return $lng->txt("exc_reminders_cron");
41 }

References $lng.

◆ hasAutoActivation()

ilExcCronReminders::hasAutoActivation ( )

Is to be activated on "installation".

Returns
boolean

Reimplemented from ilCronJob.

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

63 {
64 return true;
65 }

◆ hasFlexibleSchedule()

ilExcCronReminders::hasFlexibleSchedule ( )

Can the schedule be configured?

Returns
boolean

Reimplemented from ilCronJob.

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

68 {
69 return true;
70 }

◆ run()

ilExcCronReminders::run ( )

Run job.

Returns
ilCronJobResult

Reimplemented from ilCronJob.

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

73 {
75 $log->debug("--- Start Exercise Reminders Cron");
76
78 $message = "";
79 $reminder = new ilExAssignmentReminder();
80 $num_reminders = $reminder->checkReminders();
81
82 $this->lng->loadLanguageModule("exc");
83
84 if ($num_reminders) {
85 $cron_status = ilCronJobResult::STATUS_OK;
86 $message = $this->lng->txt('exc_reminder_cron_ok');
87 }
88
89 $cron_result = new ilCronJobResult();
90 $cron_result->setStatus($cron_status);
91
92 if ($message != "") {
93 $cron_result->setMessage($message . " " . $num_reminders);
94 $cron_result->setCode("#" . $num_reminders);
95 }
96
97 return $cron_result;
98 }
Cron job result data container.
TODO: import/export reminder data with the exercise/assignment.
static getLogger($a_component_id)
Get component logger.
$log
Definition: result.php:15
$message
Definition: xapiexit.php:14

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

+ Here is the call graph for this function:

Field Documentation

◆ $lng

ilExcCronReminders::$lng
protected

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

Referenced by getDescription(), and getTitle().


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