ILIAS  release_8 Revision v8.24
class.ilSurveyCronNotification.php
Go to the documentation of this file.
1<?php
2
26{
27 protected ilLanguage $lng;
28 protected ilTree $tree;
29
30 public function __construct()
31 {
32 global $DIC;
33
34 $this->lng = $DIC->language();
35 if (isset($DIC["tree"])) {
36 $this->tree = $DIC->repositoryTree();
37 }
38 }
39
40 public function getId(): string
41 {
42 return "survey_notification";
43 }
44
45 public function getTitle(): string
46 {
48
49 $lng->loadLanguageModule("survey");
50 return $lng->txt("survey_reminder_cron");
51 }
52
53 public function getDescription(): string
54 {
56
57 $lng->loadLanguageModule("survey");
58 return $lng->txt("survey_reminder_cron_info");
59 }
60
61 public function getDefaultScheduleType(): int
62 {
64 }
65
66 public function getDefaultScheduleValue(): ?int
67 {
68 return null;
69 }
70
71 public function hasAutoActivation(): bool
72 {
73 return true;
74 }
75
76 public function hasFlexibleSchedule(): bool
77 {
78 return false;
79 }
80
81 public function run(): ilCronJobResult
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 }
110}
const SCHEDULE_TYPE_DAILY
@depracated This will be replaced with an ENUM in ILIAS 9
language handling
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...
static getLogger(string $a_component_id)
Get component logger.
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
hasAutoActivation()
Is to be activated on "installation", does only work for ILIAS core cron jobs.
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
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
global $DIC
Definition: feed.php:28
$log
Definition: result.php:33
$message
Definition: xapiexit.php:32