ILIAS  release_10 Revision v10.1-43-ga1241a92c2f
ilMailCronNotification Class Reference

Mail notifications. More...

+ Inheritance diagram for ilMailCronNotification:
+ Collaboration diagram for ilMailCronNotification:

Public Member Functions

 getId ()
 
 getTitle ()
 
 getDescription ()
 
 getDefaultScheduleType ()
 
 getDefaultScheduleValue ()
 
 hasAutoActivation ()
 
 hasFlexibleSchedule ()
 
 hasCustomSettings ()
 
 run ()
 
 addCustomSettingsToForm (ilPropertyFormGUI $a_form)
 
 saveCustomSettings (ilPropertyFormGUI $a_form)
 
 activationWasToggled (ilDBInterface $db, ilSetting $setting, bool $a_currently_active)
 
- 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 Member Functions

 init ()
 

Protected Attributes

ilLanguage $lng
 
ilSetting $settings
 
bool $initDone = false
 
- Protected Attributes inherited from ilCronJob
CronJobScheduleType $schedule_type = null
 
int $schedule_value = null
 
Closure $date_time_provider = null
 

Private Attributes

GlobalHttpState $http
 

Detailed Description

Mail notifications.

Author
Nadia Ahmad nahma.nosp@m.d@da.nosp@m.tabay.nosp@m..de

Definition at line 28 of file class.ilMailCronNotification.php.

Member Function Documentation

◆ activationWasToggled()

ilMailCronNotification::activationWasToggled ( ilDBInterface  $db,
ilSetting  $setting,
bool  $a_currently_active 
)

Definition at line 129 of file class.ilMailCronNotification.php.

References ilSetting\set().

129  : void
130  {
131  $setting->set('mail_notification', (string) ((int) $a_currently_active));
132  }
set(string $a_key, string $a_val)
+ Here is the call graph for this function:

◆ addCustomSettingsToForm()

ilMailCronNotification::addCustomSettingsToForm ( ilPropertyFormGUI  $a_form)

Definition at line 107 of file class.ilMailCronNotification.php.

References ilPropertyFormGUI\addItem(), init(), ILIAS\Repository\lng(), and ILIAS\Repository\settings().

107  : void
108  {
109  $this->init();
110  $cb = new ilCheckboxInputGUI(
111  $this->lng->txt('cron_mail_notification_message'),
112  'mail_notification_message'
113  );
114  $cb->setInfo($this->lng->txt('cron_mail_notification_message_info'));
115  $cb->setChecked((bool) $this->settings->get('mail_notification_message', '0'));
116  $a_form->addItem($cb);
117  }
+ Here is the call graph for this function:

◆ getDefaultScheduleType()

ilMailCronNotification::getDefaultScheduleType ( )

Definition at line 72 of file class.ilMailCronNotification.php.

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

◆ getDefaultScheduleValue()

ilMailCronNotification::getDefaultScheduleValue ( )

Definition at line 77 of file class.ilMailCronNotification.php.

77  : ?int
78  {
79  return null;
80  }

◆ getDescription()

ilMailCronNotification::getDescription ( )

Definition at line 60 of file class.ilMailCronNotification.php.

References init(), and ILIAS\Repository\lng().

60  : string
61  {
62  $this->init();
63 
64  $this->lng->loadLanguageModule('mail');
65 
66  return sprintf(
67  $this->lng->txt('cron_mail_notification_desc'),
68  $this->lng->txt('mail_allow_external')
69  );
70  }
+ Here is the call graph for this function:

◆ getId()

ilMailCronNotification::getId ( )

Definition at line 48 of file class.ilMailCronNotification.php.

48  : string
49  {
50  return 'mail_notification';
51  }

◆ getTitle()

ilMailCronNotification::getTitle ( )

Definition at line 53 of file class.ilMailCronNotification.php.

References init(), and ILIAS\Repository\lng().

53  : string
54  {
55  $this->init();
56 
57  return $this->lng->txt('cron_mail_notification');
58  }
+ Here is the call graph for this function:

◆ hasAutoActivation()

ilMailCronNotification::hasAutoActivation ( )

Definition at line 82 of file class.ilMailCronNotification.php.

82  : bool
83  {
84  return false;
85  }

◆ hasCustomSettings()

ilMailCronNotification::hasCustomSettings ( )

Definition at line 92 of file class.ilMailCronNotification.php.

92  : bool
93  {
94  return true;
95  }

◆ hasFlexibleSchedule()

ilMailCronNotification::hasFlexibleSchedule ( )

Definition at line 87 of file class.ilMailCronNotification.php.

87  : bool
88  {
89  return false;
90  }

◆ init()

ilMailCronNotification::init ( )
protected

Definition at line 35 of file class.ilMailCronNotification.php.

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

Referenced by addCustomSettingsToForm(), getDescription(), getTitle(), and saveCustomSettings().

35  : void
36  {
37  global $DIC;
38 
39  if (!$this->initDone) {
40  $this->settings = $DIC->settings();
41  $this->lng = $DIC->language();
42  $this->http = $DIC->http();
43 
44  $this->initDone = true;
45  }
46  }
static http()
Fetches the global http state from ILIAS.
global $DIC
Definition: shib_login.php:25
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ run()

ilMailCronNotification::run ( )

Definition at line 97 of file class.ilMailCronNotification.php.

References ilCronJobResult\STATUS_OK.

98  {
99  $msn = new ilMailSummaryNotification();
100  $msn->send();
101 
102  $result = new ilCronJobResult();
103  $result->setStatus(ilCronJobResult::STATUS_OK);
104  return $result;
105  }

◆ saveCustomSettings()

ilMailCronNotification::saveCustomSettings ( ilPropertyFormGUI  $a_form)

Definition at line 119 of file class.ilMailCronNotification.php.

References ILIAS\FileDelivery\http(), init(), and ILIAS\Repository\settings().

119  : bool
120  {
121  $this->init();
122  $this->settings->set(
123  'mail_notification_message',
124  (string) ($this->http->wrapper()->post()->has('mail_notification_message') ? 1 : 0)
125  );
126  return true;
127  }
static http()
Fetches the global http state from ILIAS.
+ Here is the call graph for this function:

Field Documentation

◆ $http

GlobalHttpState ilMailCronNotification::$http
private

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

◆ $initDone

bool ilMailCronNotification::$initDone = false
protected

Definition at line 33 of file class.ilMailCronNotification.php.

◆ $lng

ilLanguage ilMailCronNotification::$lng
protected

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

◆ $settings

ilSetting ilMailCronNotification::$settings
protected

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


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