ILIAS  release_5-3 Revision v5.3.23-19-g915713cf615
class.ilSurveyCronNotification.php
Go to the documentation of this file.
1<?php
2
3/* Copyright (c) 1998-2010 ILIAS open source, Extended GPL, see docs/LICENSE */
4
5include_once "Services/Cron/classes/class.ilCronJob.php";
6
14{
18 protected $lng;
19
23 protected $tree;
24
25
29 public function __construct()
30 {
31 global $DIC;
32
33 $this->lng = $DIC->language();
34 if (isset($DIC["tree"])) {
35 $this->tree = $DIC->repositoryTree();
36 }
37 }
38
39 public function getId()
40 {
41 return "survey_notification";
42 }
43
44 public function getTitle()
45 {
47
48 $lng->loadLanguageModule("survey");
49 return $lng->txt("survey_reminder_setting");
50 }
51
52 public function getDescription()
53 {
55
56 $lng->loadLanguageModule("survey");
57 return $lng->txt("survey_reminder_cron_info");
58 }
59
60 public function getDefaultScheduleType()
61 {
63 }
64
65 public function getDefaultScheduleValue()
66 {
67 return;
68 }
69
70 public function hasAutoActivation()
71 {
72 return true;
73 }
74
75 public function hasFlexibleSchedule()
76 {
77 return false;
78 }
79
80 public function run()
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 }
109}
$result
An exception for terminatinating execution or to throw for unit testing.
Cron job result data container.
Cron job application base class.
const SCHEDULE_TYPE_DAILY
Cron for survey notifications.
hasAutoActivation()
Is to be activated on "installation".
hasFlexibleSchedule()
Can the schedule be configured?
catch(Exception $e) $message
global $DIC
Definition: saml.php:7