ILIAS  release_9 Revision v9.13-25-g2c18ec4c24f
ilSurveyCronNotification Class Reference

Cron for survey notifications (reminder to paricipate in the survey) More...

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

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, ?CronJobScheduleType $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 (?CronJobScheduleType $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
CronJobScheduleType $schedule_type = null
 
int $schedule_value = null
 
Closure $date_time_provider = null
 

Detailed Description

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

Constructor & Destructor Documentation

◆ __construct()

ilSurveyCronNotification::__construct ( )

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

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

33  {
34  global $DIC;
35 
36  $this->lng = $DIC->language();
37  if (isset($DIC["tree"])) {
38  $this->tree = $DIC->repositoryTree();
39  }
40  }
global $DIC
Definition: feed.php:28
+ Here is the call graph for this function:

Member Function Documentation

◆ getDefaultScheduleType()

ilSurveyCronNotification::getDefaultScheduleType ( )

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

64  {
65  return CronJobScheduleType::SCHEDULE_TYPE_DAILY;
66  }
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...

◆ getDefaultScheduleValue()

ilSurveyCronNotification::getDefaultScheduleValue ( )

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

68  : ?int
69  {
70  return null;
71  }

◆ getDescription()

ilSurveyCronNotification::getDescription ( )

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

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

55  : string
56  {
57  $lng = $this->lng;
58 
59  $lng->loadLanguageModule("survey");
60  return $lng->txt("survey_reminder_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()

ilSurveyCronNotification::getId ( )

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

42  : string
43  {
44  return "survey_notification";
45  }

◆ getTitle()

ilSurveyCronNotification::getTitle ( )

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

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

47  : string
48  {
49  $lng = $this->lng;
50 
51  $lng->loadLanguageModule("survey");
52  return $lng->txt("survey_reminder_cron");
53  }
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()

ilSurveyCronNotification::hasAutoActivation ( )

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

73  : bool
74  {
75  return true;
76  }

◆ hasFlexibleSchedule()

ilSurveyCronNotification::hasFlexibleSchedule ( )

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

78  : bool
79  {
80  return false;
81  }

◆ run()

ilSurveyCronNotification::run ( )

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

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

84  {
85  global $tree;
86 
88  $log->debug("start");
89 
91  $message = array();
92 
93  $root = $tree->getNodeData(ROOT_FOLDER_ID);
94  foreach ($tree->getSubTree($root, false, ["svy"]) as $svy_ref_id) {
95  $svy = new ilObjSurvey($svy_ref_id);
96  $num = $svy->checkReminder();
97  if (!is_null($num)) {
98  $message[] = $svy_ref_id . "(" . $num . ")";
100  }
101  }
102 
103  $result = new ilCronJobResult();
104  $result->setStatus($status);
105 
106  if (count($message)) {
107  $result->setMessage("Ref-Ids: " . implode(", ", $message) . ' / ' . "#" . count($message));
108  }
109  $log->debug("end");
110  return $result;
111  }
static getLogger(string $a_component_id)
Get component logger.
const ROOT_FOLDER_ID
Definition: constants.php:32
$log
Definition: result.php:33
final const STATUS_NO_ACTION
$message
Definition: xapiexit.php:32
+ Here is the call graph for this function:

Field Documentation

◆ $lng

ilLanguage ilSurveyCronNotification::$lng
protected

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

Referenced by getDescription(), and getTitle().

◆ $tree

ilTree ilSurveyCronNotification::$tree
protected

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

Referenced by run().


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