3 include_once
'./Services/Mail/classes/class.ilMailCronOrphanedMailsNotificationCollectionObj.php';
4 include_once
'./Services/Mail/classes/class.ilMailCronOrphanedMailsFolderObject.php';
5 include_once
'./Services/Mail/classes/class.ilMailCronOrphanedMailsFolderMailObject.php';
33 $mail_notify_orphaned = (int)$ilSetting->get(
'mail_notify_orphaned');
34 $mail_threshold = (int)$ilSetting->get(
'mail_threshold');
36 if($mail_threshold > $mail_notify_orphaned )
38 $notify_days_before = $mail_threshold - $mail_notify_orphaned;
42 $notify_days_before = 1;
45 $ts_notify = strtotime(
"- ".$notify_days_before.
" days");
46 $ts_for_notification =
date(
'Y-m-d', $ts_notify).
' 23:59:59';
48 $res = $ilDB->query(
'SELECT mail_id FROM mail_cron_orphaned');
49 $already_notified =
array();
50 while(
$row = $ilDB->fetchAssoc(
$res))
52 $already_notified[] =
$row[
'mail_id'];
56 $types =
array(
'timestamp');
59 $notification_query =
" 60 SELECT mail_id, m.user_id, folder_id, send_time, m_subject, mdata.title 62 INNER JOIN mail_obj_data mdata ON obj_id = folder_id 63 WHERE send_time <= %s";
65 if((
int)$ilSetting->get(
'mail_only_inbox_trash') > 0)
67 $notification_query .=
" AND (mdata.m_type = %s OR mdata.m_type = %s)";
68 $types =
array(
'timestamp',
'text',
'text');
69 $data =
array($ts_for_notification,
'inbox',
'trash');
72 $notification_query .=
" AND " . $ilDB->in(
'mail_id', $already_notified,
true,
'integer')
73 .
" ORDER BY m.user_id, folder_id, mail_id";
75 $res = $ilDB->queryF($notification_query, $types,
$data);
77 $collection_obj = NULL;
80 while(
$row = $ilDB->fetchAssoc(
$res))
84 if(is_object($collection_obj))
90 if(!is_object($collection_obj))
95 if(is_object($collection_obj))
97 if(!$folder_obj = $collection_obj->getFolderObjectById(
$row[
'folder_id']))
100 $folder_obj->setFolderTitle(
$row[
'title']);
101 $collection_obj->addFolderObject($folder_obj);
104 if(is_object($folder_obj))
107 $folder_obj->addMailObject($orphaned_mail_obj);
111 if(is_object($collection_obj))
114 unset($collection_obj);
123 $this->collection[$collection_obj->
getUserId()] = $collection_obj;
132 if(isset($this->collection[$user_id]))
ilMailCronOrphanedMailsFolderObject
ilMailCronOrphanedMailsNotificationCollectionObj
ilMailCronOrphanedMailsFolderMailObject
addCollectionObject(ilMailCronOrphanedMailsNotificationCollectionObj $collection_obj)
date( 'd-M-Y', $objPHPExcel->getProperties() ->getCreated())
existsCollectionObjForUserId($user_id)
ilMailCronOrphanedMailsNotificationCollector
Create styles array
The data for the language used.