ILIAS  release_5-3 Revision v5.3.23-19-g915713cf615
ilSurveyCronNotification Class Reference

Cron for survey notifications. More...

+ Inheritance diagram for ilSurveyCronNotification:
+ Collaboration diagram for ilSurveyCronNotification:

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...
 
 getValidScheduleTypes ()
 Get all available schedule types. 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
 
 $tree
 

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 survey notifications.

Author
Jörg Lützenkirchen luetz.nosp@m.enki.nosp@m.rchen.nosp@m.@lei.nosp@m.fos.c.nosp@m.om

Definition at line 13 of file class.ilSurveyCronNotification.php.

Constructor & Destructor Documentation

◆ __construct()

ilSurveyCronNotification::__construct ( )

Constructor.

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

30 {
31 global $DIC;
32
33 $this->lng = $DIC->language();
34 if (isset($DIC["tree"])) {
35 $this->tree = $DIC->repositoryTree();
36 }
37 }
global $DIC
Definition: saml.php:7

References $DIC.

Member Function Documentation

◆ getDefaultScheduleType()

ilSurveyCronNotification::getDefaultScheduleType ( )

Get schedule type.

Returns
int

Reimplemented from ilCronJob.

Definition at line 60 of file class.ilSurveyCronNotification.php.

61 {
63 }
const SCHEDULE_TYPE_DAILY

References ilCronJob\SCHEDULE_TYPE_DAILY.

◆ getDefaultScheduleValue()

ilSurveyCronNotification::getDefaultScheduleValue ( )

Get schedule value.

Returns
int|array

Reimplemented from ilCronJob.

Definition at line 65 of file class.ilSurveyCronNotification.php.

66 {
67 return;
68 }

◆ getDescription()

ilSurveyCronNotification::getDescription ( )

Get description.

Returns
string

Reimplemented from ilCronJob.

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

53 {
55
56 $lng->loadLanguageModule("survey");
57 return $lng->txt("survey_reminder_cron_info");
58 }

References $lng.

◆ getId()

ilSurveyCronNotification::getId ( )

Get id.

Returns
string

Reimplemented from ilCronJob.

Definition at line 39 of file class.ilSurveyCronNotification.php.

40 {
41 return "survey_notification";
42 }

◆ getTitle()

ilSurveyCronNotification::getTitle ( )

Get title.

Returns
string

Reimplemented from ilCronJob.

Definition at line 44 of file class.ilSurveyCronNotification.php.

45 {
47
48 $lng->loadLanguageModule("survey");
49 return $lng->txt("survey_reminder_setting");
50 }

References $lng.

◆ hasAutoActivation()

ilSurveyCronNotification::hasAutoActivation ( )

Is to be activated on "installation".

Returns
boolean

Reimplemented from ilCronJob.

Definition at line 70 of file class.ilSurveyCronNotification.php.

71 {
72 return true;
73 }

◆ hasFlexibleSchedule()

ilSurveyCronNotification::hasFlexibleSchedule ( )

Can the schedule be configured?

Returns
boolean

Reimplemented from ilCronJob.

Definition at line 75 of file class.ilSurveyCronNotification.php.

76 {
77 return false;
78 }

◆ run()

ilSurveyCronNotification::run ( )

Run job.

Returns
ilCronJobResult

Reimplemented from ilCronJob.

Definition at line 80 of file class.ilSurveyCronNotification.php.

81 {
83
84 include_once "Modules/Survey/classes/class.ilObjSurvey.php";
85
87 $message = array();
88
89 $root = $tree->getNodeData(ROOT_FOLDER_ID);
90 foreach ($tree->getSubTree($root, false, "svy") as $svy_ref_id) {
91 $svy = new ilObjSurvey($svy_ref_id);
92 $num = $svy->checkReminder();
93 if ($num !== false) {
94 $message[] = $svy_ref_id . "(" . $num . ")";
96 }
97 }
98
100 $result->setStatus($status);
101
102 if (sizeof($message)) {
103 $result->setMessage("Ref-Ids: " . implode(", ", $message));
104 $result->setCode("#" . sizeof($message));
105 }
106
107 return $result;
108 }
$result
Cron job result data container.
catch(Exception $e) $message

References $message, $result, $tree, ilCronJobResult\STATUS_NO_ACTION, and ilCronJobResult\STATUS_OK.

Field Documentation

◆ $lng

ilSurveyCronNotification::$lng
protected

Definition at line 18 of file class.ilSurveyCronNotification.php.

Referenced by getDescription(), and getTitle().

◆ $tree

ilSurveyCronNotification::$tree
protected

Definition at line 23 of file class.ilSurveyCronNotification.php.

Referenced by run().


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