3namespace Bitrix\Mail\Helper;
4use Bitrix\Mail\Internals\Entity\MailboxDirectory;
6use Bitrix\Main\Localization\Loc;
7use Bitrix\Mail\Internals\MailboxDirectoryTable;
8use Bitrix\Mail\Internals\MailCounterTable;
24 if ($idsUnseenCount > 0 && (is_null($dirForMoveMessages) || !$dirForMoveMessages->
isInvisibleToCounters()))
27 '=MAILBOX_ID' => $mailboxId,
28 '=ENTITY_TYPE' =>
'DIR',
29 '=ENTITY_ID' => $dirForMoveMessagesId
35 'MAILBOX_ID' => $mailboxId,
36 'ENTITY_TYPE' =>
'DIR',
37 'ENTITY_ID' => $dirForMoveMessagesId
47 'MAILBOX_ID' => $mailboxId,
48 'ENTITY_TYPE' =>
'DIR',
49 'ENTITY_ID' => $dirForMoveMessagesId,
50 "VALUE" => $idsUnseenCount,
58 if($dirWithMessagesId)
61 '=MAILBOX_ID' => $mailboxId,
62 '=ENTITY_TYPE' =>
'DIR',
63 '=ENTITY_ID' => $dirWithMessagesId,
64 '>=VALUE' => $idsUnseenCount
69 'MAILBOX_ID' => $mailboxId,
70 'ENTITY_TYPE' =>
'DIR',
71 'ENTITY_ID' => $dirWithMessagesId
74 "VALUE" =>
new \
Bitrix\
Main\
DB\
SqlExpression(
"CASE WHEN ?# >= $idsUnseenCount THEN ?# - $idsUnseenCount ELSE 0 END",
"VALUE",
"VALUE")
83 $dirWithMessagesId = MailboxDirectoryTable::getList([
87 'Bitrix\Mail\MailMessageUidTable',
89 '=this.DIR_MD5' =>
'ref.DIR_MD5',
90 '=this.MAILBOX_ID' =>
'ref.MAILBOX_ID',
93 'join_type' =>
'INNER',
101 '@UID.ID' => $messagesIds,
102 '=MAILBOX_ID' => $mailboxId,
107 if(isset($dirWithMessagesId[0][
'ID']))
109 return $dirWithMessagesId[0][
'ID'];
122 if (!empty($mailboxOptions[
'imap'][
'dirsMd5']))
124 $names = array_filter(
125 $mailboxOptions[
'imap'][
'dirsMd5'],
126 function (
$hash) use ($messageFolderHash)
128 return $hash == $messageFolderHash;
131 if (
count($names) == 1)
133 $folderName = array_keys($names)[0];
142 if (!empty($mailboxOptions[
'imap'][
'dirsMd5']))
144 $name = static::getFolderNameByType($folderType, $mailboxOptions);
145 $hashes = array_filter(
146 $mailboxOptions[
'imap'][
'dirsMd5'],
147 function ($_name) use (
$name)
149 return $_name ==
$name;
153 if (
count($hashes) == 1)
155 $folderHash = array_values($hashes)[0];
164 if (!empty($mailboxOptions[
'imap']) && is_array($mailboxOptions[
'imap']))
166 $imapOptions = $mailboxOptions[
'imap'];
167 if (!empty($imapOptions[$folderType]) && isset($imapOptions[$folderType][0]))
169 return $imapOptions[$folderType][0];
177 $disabled = empty($mailboxOptions[
'imap'][
'disabled']) ? [] : $mailboxOptions[
'imap'][
'disabled'];
178 $ignore = empty($mailboxOptions[
'imap'][
'ignore']) ? [] : $mailboxOptions[
'imap'][
'ignore'];
179 return array_merge($disabled, $ignore);
184 return in_array($folder, static::getDisabledFolders($mailboxOptions),
true);
189 $root = array_shift(
$path);
191 if (mb_strtolower($root) ==
'inbox' && !static::isDisabledFolder($root, $mailboxOptions))
193 $root = Loc::getMessage(
'MAIL_CLIENT_INBOX_ALIAS');
196 array_unshift(
$path, $root);
203 $path = static::getFormattedPath(
$path, $mailboxOptions);
205 return $full ? join(
' / ',
$path) : end(
$path);
static getFolderNameByType($folderType, $mailboxOptions)
static getFolderHashByType($folderType, $mailboxOptions)
static getFormattedPath(array $path, $mailboxOptions)
static getDisabledFolders($mailboxOptions)
static isDisabledFolder($folder, $mailboxOptions)
static decreaseDirCounter($mailboxId, $dirWithMessagesId, $idsUnseenCount)
static getFormattedName(array $path, $mailboxOptions, $full=true)
static getFolderNameByHash($messageFolderHash, $mailboxOptions)
static getDirIdForMessages($mailboxId, $messagesIds)
static increaseDirCounter($mailboxId, ?MailboxDirectory $dirForMoveMessages, $dirForMoveMessagesId, $idsUnseenCount)
static getCount($filter=array(), array $cache=array())
static update($primary, array $data)
</td ></tr ></table ></td ></tr >< tr >< td class="bx-popup-label bx-width30"><?=GetMessage("PAGE_NEW_TAGS")?> array( $site)
</p ></td >< td valign=top style='border-top:none;border-left:none;border-bottom:solid windowtext 1.0pt;border-right:solid windowtext 1.0pt;padding:0cm 2.0pt 0cm 2.0pt;height:9.0pt'>< p class=Normal align=center style='margin:0cm;margin-bottom:.0001pt;text-align:center;line-height:normal'>< a name=ТекстовоеПоле54 ></a ><?=($taxRate > count( $arTaxList) > 0) ? $taxRate."%"