5include_once
"./Services/Cron/classes/class.ilCronJob.php";
6include_once
"./Services/Cron/classes/class.ilCronJobResult.php";
7require_once
'./Services/Logging/classes/public/class.ilLoggerFactory.php';
22 $lng->loadLanguageModule(
'mail');
31 return "mail_orphaned_mails";
40 return $lng->txt(
"mail_orphaned_mails");
49 return $lng->txt(
"mail_orphaned_mails_desc");
103 parent::addCustomSettingsToForm($a_form);
106 $threshold->setInfo(
$lng->txt(
'mail_threshold_info'));
107 $threshold->allowDecimals(
false);
108 $threshold->setSuffix(
$lng->txt(
'days'));
109 $threshold->setMinValue(1);
110 $threshold->setValue(
$ilSetting->get(
'mail_threshold'));
115 $mail_folder->setInfo(
$lng->txt(
'only_inbox_trash_info'));
116 $mail_folder->setChecked(
$ilSetting->get(
'mail_only_inbox_trash'));
117 $a_form->
addItem($mail_folder);
119 $notification =
new ilNumberInputGUI(
$lng->txt(
'mail_notify_orphaned'),
'mail_notify_orphaned');
120 $notification->setInfo(
$lng->txt(
'mail_notify_orphaned_info'));
121 $notification->allowDecimals(
false);
122 $notification->setSuffix(
$lng->txt(
'days'));
123 $notification->setMinValue(0);
125 $mail_threshold = isset(
$_POST[
'mail_threshold']) ? (int)
$_POST[
'mail_threshold'] :
$ilSetting->get(
'mail_threshold');
126 $maxvalue = $mail_threshold-1;
127 $notification->setMaxValue($maxvalue);
128 $notification->setValue(
$ilSetting->get(
'mail_notify_orphaned'));
129 $a_form->
addItem($notification);
141 $ilSetting->set(
'mail_only_inbox_trash', (
int)$a_form->
getInput(
'mail_only_inbox_trash'));
142 $ilSetting->set(
'mail_notify_orphaned', (
int)$a_form->
getInput(
'mail_notify_orphaned'));
144 if(
$ilSetting->get(
'mail_notify_orphaned') == 0)
148 $ilDB->manipulate(
'DELETE FROM mail_cron_orphaned');
151 "Deleted all scheduled mail deletions because a reminder should't be sent (login: %s|usr_id: %s) anymore!",
$ilUser->getLogin(),
$ilUser->getId()
166 $mail_threshold = (int)
$ilSetting->get(
'mail_threshold');
169 'Started mail deletion job with threshold: %s day(s)', var_export($mail_threshold, 1)
172 if((
int)
$ilSetting->get(
'mail_notify_orphaned') >= 1 && $mail_threshold >= 1)
177 if((
int)$ilSetting->get(
'last_cronjob_start_ts') && $mail_threshold >= 1)
187 'Finished mail deletion job with threshold: %s day(s)', var_export($mail_threshold, 1)
195 include_once
'./Services/Mail/classes/class.ilMailCronOrphanedMailsNotificationCollector.php';
198 include_once
'./Services/Mail/classes/class.ilMailCronOrphanedMailsNotifier.php';
200 $notifier->processNotification();
205 include_once
'./Services/Mail/classes/class.ilMailCronOrphanedMailsDeletionCollector.php';
208 include_once
'./Services/Mail/classes/class.ilMailCronOrphanedMailsDeletionProcessor.php';
210 $processor->processDeletion();
sprintf('%.4f', $callTime)
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
static getLogger($a_component_id)
Get component logger.
ilMailCronOrphanedMailsDeletionCollector
ilMailCronOrphanedMailsDeletionProcessor
ilMailCronOrphanedMailsNotificationCollector
ilMailCronOrphanedMailNotifier
addCustomSettingsToForm(ilPropertyFormGUI $a_form)
hasFlexibleSchedule()
Can the schedule be configured?
getDefaultScheduleValue()
Get schedule value.
saveCustomSettings(ilPropertyFormGUI $a_form)
hasAutoActivation()
Is to be activated on "installation".
getDefaultScheduleType()
Get schedule type.