ILIAS  release_5-1 Revision 5.0.0-5477-g43f3e3fab5f
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{
15 public function getId()
16 {
17 return "survey_notification";
18 }
19
20 public function getTitle()
21 {
22 global $lng;
23
24 $lng->loadLanguageModule("survey");
25 return $lng->txt("survey_reminder_setting");
26 }
27
28 public function getDescription()
29 {
30 global $lng;
31
32 $lng->loadLanguageModule("survey");
33 return $lng->txt("survey_reminder_cron_info");
34 }
35
36 public function getDefaultScheduleType()
37 {
39 }
40
41 public function getDefaultScheduleValue()
42 {
43 return;
44 }
45
46 public function hasAutoActivation()
47 {
48 return true;
49 }
50
51 public function hasFlexibleSchedule()
52 {
53 return false;
54 }
55
56 public function run()
57 {
58 global $tree;
59
60 include_once "Modules/Survey/classes/class.ilObjSurvey.php";
61
63 $message = array();
64
65 $root = $tree->getNodeData(ROOT_FOLDER_ID);
66 foreach($tree->getSubTree($root, false, "svy") as $svy_ref_id)
67 {
68 $svy = new ilObjSurvey($svy_ref_id);
69 $num = $svy->checkReminder();
70 if($num !== false)
71 {
72 $message[] = $svy_ref_id."(".$num.")";
74 }
75 }
76
78 $result->setStatus($status);
79
80 if(sizeof($message))
81 {
82 $result->setMessage("Ref-Ids: ".implode(", ", $message));
83 $result->setCode("#".sizeof($message));
84 }
85
86 return $result;
87 }
88}
89
90?>
$result
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?
global $lng
Definition: privfeed.php:40