35 $mails =
array(
'cnt' => 0,
'cnt_unread' => 0,
'set' =>
array());
38 'mail_filter_sender' =>
'CONCAT(CONCAT(firstname, lastname), login)',
39 'mail_filter_recipients' => ($DIC->database()->getDBType() ==
'oracle' ?
40 "CONCAT(CONCAT(CAST(rcp_to AS VARCHAR2(4000)), CAST(rcp_cc AS VARCHAR2(4000))), CAST(rcp_bcc AS VARCHAR2(4000))))" :
41 "CONCAT(CONCAT(rcp_to, rcp_cc), rcp_bcc)"),
42 'mail_filter_subject' =>
'm_subject',
43 'mail_filter_body' =>
'm_message',
44 'mail_filter_attach' =>
'' 46 $filter_parts =
array();
47 if (isset(self::$filter[
'mail_filter']) && strlen(self::$filter[
'mail_filter'])) {
49 if (strlen(
$column) && isset(self::$filter[
$key]) && (
int) self::$filter[$key]) {
50 $filter_parts[] = $DIC->database()->like(
$column,
'text',
'%%' . self::$filter[
'mail_filter'] .
'%%',
false);
56 $filter_qry =
'AND (' . implode(
' OR ', $filter_parts) .
')';
59 $queryCount =
'SELECT COUNT(mail_id) cnt FROM mail ' 60 .
'LEFT JOIN usr_data ON usr_id = sender_id ' 61 .
'WHERE user_id = %s ' 62 .
'AND ((sender_id > 0 AND sender_id IS NOT NULL AND usr_id IS NOT NULL) OR (sender_id = 0 OR sender_id IS NULL)) ' 63 .
'AND folder_id = %s ' 66 .
'SELECT COUNT(mail_id) cnt FROM mail ' 67 .
'LEFT JOIN usr_data ON usr_id = sender_id ' 68 .
'WHERE user_id = %s ' 69 .
'AND ((sender_id > 0 AND sender_id IS NOT NULL AND usr_id IS NOT NULL) OR (sender_id = 0 OR sender_id IS NULL)) ' 70 .
'AND folder_id = %s ' 72 .
'AND m_status = %s';
74 if (self::$filtered_ids) {
75 $queryCount .=
' AND ' . $DIC->database()->in(
'mail_id', self::$filtered_ids,
false,
'integer') .
' ';
78 $res = $DIC->database()->queryf(
80 array(
'integer',
'integer',
'integer',
'integer',
'text'),
81 array(self::$userId, self::$folderId, self::$userId, self::$folderId,
'unread')
84 while ($cnt_row = $DIC->database()->fetchAssoc(
$res)) {
86 $mails[
'cnt'] = $cnt_row[
'cnt'];
88 $mails[
'cnt_unread'] = $cnt_row[
'cnt'];
97 if (self::$orderColumn ==
'rcp_to' && $DIC->database()->getDBType() ==
'oracle') {
98 $sortColumn =
", CAST(rcp_to AS VARCHAR2(4000)) SORTCOL";
102 if (self::$orderColumn ==
'from') {
106 WHEN (usr_id = ' . ANONYMOUS_USER_ID .
') THEN firstname 107 ELSE ' . $DIC->database()->quote(ilMail::_getIliasMailerName(),
'text') .
' 113 $query =
'SELECT mail.*' . $sortColumn .
' ' . $firstname .
' FROM mail ' 114 .
'LEFT JOIN usr_data ON usr_id = sender_id ' 115 .
'AND ((sender_id > 0 AND sender_id IS NOT NULL AND usr_id IS NOT NULL) OR (sender_id = 0 OR sender_id IS NULL)) ' 116 .
'WHERE user_id = %s ' 118 .
'AND folder_id = %s';
120 if (self::$filtered_ids) {
121 $query .=
' AND ' . $DIC->database()->in(
'mail_id', self::$filtered_ids,
false,
'integer') .
' ';
126 if (in_array(strtolower(self::$orderDirection),
array(
'desc',
'asc'))) {
133 if (self::$orderColumn ==
'rcp_to' && $DIC->database()->getDBType() ==
'oracle') {
135 } elseif (self::$orderColumn ==
'from') {
141 } elseif (strlen(self::$orderColumn)) {
142 if (!in_array(strtolower(self::$orderColumn),
array(
'm_subject',
'send_time',
'rcp_to')) &&
143 !$DIC->database()->tableColumnExists(
'mail', strtolower(self::$orderColumn))) {
145 self::$orderColumn =
'send_time';
150 $query .=
' ORDER BY send_time DESC';
153 $DIC->database()->setLimit(self::$limit, self::$offset);
154 $res = $DIC->database()->queryF(
156 array(
'integer',
'integer'),
157 array(self::$userId, self::$folderId)
159 while (
$row = $DIC->database()->fetchAssoc(
$res)) {
160 $row[
'attachments'] = unserialize(stripslashes(
$row[
'attachments']));
161 $row[
'm_type'] = unserialize(stripslashes(
$row[
'm_type']));
162 $mails[
'set'][] =
$row;
static _getMailBoxListData()
_getMailBoxListData
foreach($_POST as $key=> $value) $res
Create styles array
The data for the language used.