56 if(isset(self::$global_mail_services_cache[self::CACHE_TYPE_REF_ID]) &&
57 null !== self::$global_mail_services_cache[self::CACHE_TYPE_REF_ID])
59 return self::$global_mail_services_cache[self::CACHE_TYPE_REF_ID];
65 $res = $ilDB->queryf(
' 66 SELECT object_reference.ref_id FROM object_reference, tree, object_data 67 WHERE tree.parent = %s 68 AND object_data.type = %s 69 AND object_reference.ref_id = tree.child 70 AND object_reference.obj_id = object_data.obj_id',
71 array(
'integer',
'text'),
72 array(SYSTEM_FOLDER_ID,
'mail'));
74 while(
$row = $ilDB->fetchAssoc(
$res))
76 self::$global_mail_services_cache[self::CACHE_TYPE_REF_ID] =
$row[
'ref_id'];
81 self::$global_mail_services_cache[self::CACHE_TYPE_REF_ID] = MAIL_SETTINGS_ID;
84 return self::$global_mail_services_cache[self::CACHE_TYPE_REF_ID];
106 if(isset(self::$global_mail_services_cache[self::CACHE_TYPE_NEW_MAILS][$usr_id]) &&
107 null !== self::$global_mail_services_cache[self::CACHE_TYPE_NEW_MAILS][$usr_id])
109 return self::$global_mail_services_cache[self::CACHE_TYPE_NEW_MAILS][$usr_id];
113 $res = $ilDB->queryf(
' 114 SELECT COUNT(mail_id) cnt FROM mail 118 array(
'integer',
'integer',
'text'),
119 array(
'0', $usr_id,
'unread'));
123 $res = $ilDB->queryf(
' 124 SELECT COUNT(mail_id) cnt FROM mail m,mail_obj_data mo 125 WHERE m.user_id = mo.user_id 126 AND m.folder_id = mo.obj_id 129 AND m.m_status = %s',
130 array(
'text',
'integer',
'text'),
131 array(
'inbox', $usr_id,
'unread'));
134 $row2 = $ilDB->fetchAssoc(
$res);
136 self::$global_mail_services_cache[self::CACHE_TYPE_NEW_MAILS][$usr_id] =
$row[
'cnt'] + $row2[
'cnt'];
138 return self::$global_mail_services_cache[self::CACHE_TYPE_NEW_MAILS][$usr_id];
Class for global mail information (e.g.
static $global_mail_services_cache
Create styles array
The data for the language used.
const CACHE_TYPE_NEW_MAILS
static getMailObjectRefId()
Determines the reference id of the mail object and stores this information in a local cache variable...
static getNumberOfNewMailsByUserId($usr_id)
Determines the number of new mails for the passed user id and stores this information in a local cach...