ILIAS  trunk Revision v11.0_alpha-1761-g6dbbfa7b760
All Data Structures Namespaces Files Functions Variables Enumerations Enumerator Modules Pages
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 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
 
ilTree $tree
 
- Protected Attributes inherited from ILIAS\Cron\CronJob
JobScheduleType $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 29 of file class.ilSurveyCronNotification.php.

Constructor & Destructor Documentation

◆ __construct()

ilSurveyCronNotification::__construct ( )

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

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

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

Member Function Documentation

◆ getDefaultScheduleType()

ilSurveyCronNotification::getDefaultScheduleType ( )

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

66  {
67  return JobScheduleType::DAILY;
68  }

◆ getDefaultScheduleValue()

ilSurveyCronNotification::getDefaultScheduleValue ( )

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

References null.

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

◆ getDescription()

ilSurveyCronNotification::getDescription ( )

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

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

57  : string
58  {
59  $lng = $this->lng;
60 
61  $lng->loadLanguageModule("survey");
62  return $lng->txt("survey_reminder_cron_info");
63  }
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 44 of file class.ilSurveyCronNotification.php.

44  : string
45  {
46  return "survey_notification";
47  }

◆ getTitle()

ilSurveyCronNotification::getTitle ( )

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

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

49  : string
50  {
51  $lng = $this->lng;
52 
53  $lng->loadLanguageModule("survey");
54  return $lng->txt("survey_reminder_cron");
55  }
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 75 of file class.ilSurveyCronNotification.php.

75  : bool
76  {
77  return true;
78  }

◆ hasFlexibleSchedule()

ilSurveyCronNotification::hasFlexibleSchedule ( )

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

80  : bool
81  {
82  return false;
83  }

◆ run()

ilSurveyCronNotification::run ( )

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

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

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

Field Documentation

◆ $lng

ilLanguage ilSurveyCronNotification::$lng
protected

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

Referenced by getDescription(), and getTitle().

◆ $tree

ilTree ilSurveyCronNotification::$tree
protected

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

Referenced by run().


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