ILIAS  release_8 Revision v8.24
ilSurveyCronNotification 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 ilSurveyCronNotification:
+ Collaboration diagram for ilSurveyCronNotification:

Public Member Functions

 __construct ()
 
 getId ()
 
 getTitle ()
 
 getDescription ()
 
 getDefaultScheduleType ()
 
 getDefaultScheduleValue ()
 
 hasAutoActivation ()
 Is to be activated on "installation", does only work for ILIAS core cron jobs. More...
 
 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
 
ilTree $tree
 
- 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
 @depracated This will be replaced with an ENUM in ILIAS 9 More...
 
const SCHEDULE_TYPE_IN_MINUTES = 2
 @depracated This will be replaced with an ENUM in ILIAS 9 More...
 
const SCHEDULE_TYPE_IN_HOURS = 3
 @depracated This will be replaced with an ENUM in ILIAS 9 More...
 
const SCHEDULE_TYPE_IN_DAYS = 4
 @depracated This will be replaced with an ENUM in ILIAS 9 More...
 
const SCHEDULE_TYPE_WEEKLY = 5
 @depracated This will be replaced with an ENUM in ILIAS 9 More...
 
const SCHEDULE_TYPE_MONTHLY = 6
 @depracated This will be replaced with an ENUM in ILIAS 9 More...
 
const SCHEDULE_TYPE_QUARTERLY = 7
 @depracated This will be replaced with an ENUM in ILIAS 9 More...
 
const SCHEDULE_TYPE_YEARLY = 8
 @depracated 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 survey notifications (reminder to paricipate in the survey)

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 25 of file class.ilSurveyCronNotification.php.

Constructor & Destructor Documentation

◆ __construct()

ilSurveyCronNotification::__construct ( )

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

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

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

+ Here is the call graph for this function:

Member Function Documentation

◆ getDefaultScheduleType()

ilSurveyCronNotification::getDefaultScheduleType ( )

Reimplemented from ilCronJob.

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

61 : int
62 {
64 }
const SCHEDULE_TYPE_DAILY
@depracated This will be replaced with an ENUM in ILIAS 9

References ilCronJob\SCHEDULE_TYPE_DAILY.

◆ getDefaultScheduleValue()

ilSurveyCronNotification::getDefaultScheduleValue ( )

Reimplemented from ilCronJob.

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

66 : ?int
67 {
68 return null;
69 }

◆ getDescription()

ilSurveyCronNotification::getDescription ( )

Reimplemented from ilCronJob.

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

53 : string
54 {
56
57 $lng->loadLanguageModule("survey");
58 return $lng->txt("survey_reminder_cron_info");
59 }
loadLanguageModule(string $a_module)
Load language module.
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...

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

+ Here is the call graph for this function:

◆ getId()

ilSurveyCronNotification::getId ( )

Reimplemented from ilCronJob.

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

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

◆ getTitle()

ilSurveyCronNotification::getTitle ( )

Reimplemented from ilCronJob.

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

45 : string
46 {
48
49 $lng->loadLanguageModule("survey");
50 return $lng->txt("survey_reminder_cron");
51 }

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

+ Here is the call graph for this function:

◆ hasAutoActivation()

ilSurveyCronNotification::hasAutoActivation ( )

Is to be activated on "installation", does only work for ILIAS core cron jobs.

Reimplemented from ilCronJob.

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

71 : bool
72 {
73 return true;
74 }

◆ hasFlexibleSchedule()

ilSurveyCronNotification::hasFlexibleSchedule ( )

Reimplemented from ilCronJob.

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

76 : bool
77 {
78 return false;
79 }

◆ run()

ilSurveyCronNotification::run ( )

Reimplemented from ilCronJob.

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

82 {
83 global $tree;
84
86 $log->debug("start");
87
89 $message = array();
90
92 foreach ($tree->getSubTree($root, false, ["svy"]) as $svy_ref_id) {
93 $svy = new ilObjSurvey($svy_ref_id);
94 $num = $svy->checkReminder();
95 if (!is_null($num)) {
96 $message[] = $svy_ref_id . "(" . $num . ")";
98 }
99 }
100
101 $result = new ilCronJobResult();
102 $result->setStatus($status);
103
104 if (count($message)) {
105 $result->setMessage("Ref-Ids: " . implode(", ", $message) . ' / ' . "#" . count($message));
106 }
107 $log->debug("end");
108 return $result;
109 }
static getLogger(string $a_component_id)
Get component logger.
getNodeData(int $a_node_id, ?int $a_tree_pk=null)
get all information of a node.
getSubTree(array $a_node, bool $a_with_data=true, array $a_type=[])
get all nodes in the subtree under specified node
const ROOT_FOLDER_ID
Definition: constants.php:32
$log
Definition: result.php:33
$message
Definition: xapiexit.php:32

References $log, $message, $tree, ilLoggerFactory\getLogger(), ilTree\getNodeData(), ilTree\getSubTree(), ROOT_FOLDER_ID, ilCronJobResult\STATUS_NO_ACTION, and ilCronJobResult\STATUS_OK.

+ Here is the call graph for this function:

Field Documentation

◆ $lng

ilLanguage ilSurveyCronNotification::$lng
protected

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

Referenced by getDescription(), and getTitle().

◆ $tree

ilTree ilSurveyCronNotification::$tree
protected

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

Referenced by run().


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