5 include_once
"./Services/Cron/classes/class.ilCronJob.php";
6 include_once
"./Services/Cron/classes/class.ilCronJobResult.php";
20 $lng->loadLanguageModule(
'mail');
29 return "mail_orphaned_mails";
38 return $lng->txt(
"mail_orphaned_mails");
47 return $lng->txt(
"mail_orphaned_mails_desc");
74 return self::SCHEDULE_TYPE_DAILY;
101 parent::addCustomSettingsToForm($a_form);
103 $threshold =
new ilNumberInputGUI($lng->txt(
'mail_threshold'),
'mail_threshold');
104 $threshold->
setInfo($lng->txt(
'mail_threshold_info'));
105 $threshold->allowDecimals(
false);
106 $threshold->setSuffix($lng->txt(
'days'));
107 $threshold->setMinValue(1);
108 $threshold->setValue($ilSetting->get(
'mail_threshold'));
112 $mail_folder =
new ilCheckboxInputGUI($lng->txt(
'only_inbox_trash'),
'mail_only_inbox_trash');
113 $mail_folder->
setInfo($lng->txt(
'only_inbox_trash_info'));
114 $mail_folder->setChecked($ilSetting->get(
'mail_only_inbox_trash'));
115 $a_form->
addItem($mail_folder);
117 $notification =
new ilNumberInputGUI($lng->txt(
'mail_notify_orphaned'),
'mail_notify_orphaned');
118 $notification->
setInfo($lng->txt(
'mail_notify_orphaned_info'));
119 $notification->allowDecimals(
false);
120 $notification->setSuffix($lng->txt(
'days'));
121 $notification->setMinValue(0);
123 $mail_threshold = isset(
$_POST[
'mail_threshold']) ? (int)
$_POST[
'mail_threshold'] : $ilSetting->get(
'mail_threshold');
124 $maxvalue = $mail_threshold-1;
125 $notification->setMaxValue($maxvalue);
126 $notification->setValue($ilSetting->get(
'mail_notify_orphaned'));
127 $a_form->
addItem($notification);
138 $ilSetting->set(
'mail_threshold', (
int)$a_form->
getInput(
'mail_threshold'));
139 $ilSetting->set(
'mail_only_inbox_trash', (
int)$a_form->
getInput(
'mail_only_inbox_trash'));
140 $ilSetting->set(
'mail_notify_orphaned', (
int)$a_form->
getInput(
'mail_notify_orphaned'));
142 if($ilSetting->get(
'mail_notify_orphaned') == 0)
146 $ilDB->manipulate(
'DELETE FROM mail_cron_orphaned');
160 $mail_threshold = (int)$ilSetting->get(
'mail_threshold');
162 if( (
int)$ilSetting->get(
'mail_notify_orphaned') >= 1 && $mail_threshold >= 1)
167 if((
int)$ilSetting->get(
'last_cronjob_start_ts') && $mail_threshold >= 1)
180 include_once
'./Services/Mail/classes/class.ilMailCronOrphanedMailsNotificationCollector.php';
183 include_once
'./Services/Mail/classes/class.ilMailCronOrphanedMailsNotifier.php';
185 $notifier->processNotification();
190 include_once
'./Services/Mail/classes/class.ilMailCronOrphanedMailsDeletionCollector.php';
193 include_once
'./Services/Mail/classes/class.ilMailCronOrphanedMailsDeletionProcessor.php';
195 $processor->processDeletion();
hasAutoActivation()
Is to be activated on "installation".
Cron job application base class.
getDefaultScheduleType()
Get schedule type.
getDefaultScheduleValue()
Get schedule value.
addCustomSettingsToForm(ilPropertyFormGUI $a_form)
hasFlexibleSchedule()
Can the schedule be configured?
ilMailCronOrphanedMailsDeletionProcessor
saveCustomSettings(ilPropertyFormGUI $a_form)
ilMailCronOrphanedMailsDeletionCollector
ilMailCronOrphanedMailsNotificationCollector
ilMailCronOrphanedMailNotifier
Cron job result data container.