8namespace Bitrix\Sender\Templates;
10use Bitrix\Main\Application;
11use Bitrix\Main\Localization\Loc;
12use Bitrix\Main\Entity\ExpressionField;
14use Bitrix\Sender\Entity;
15use Bitrix\Sender\Security;
17Loc::loadMessages(__FILE__);
25 private static $maxCount = 4;
26 private static $cacheTtl = 3600;
48 return self::getTemplates($messageCode);
51 private static function getTemplates($messageCode =
null)
61 '!=TEMPLATE_TYPE' =>
null,
62 '!=TEMPLATE_ID' =>
null,
71 $filter[
'=MESSAGE_CODE'] = $messageCode;
74 $chains = Entity\Letter::getList(
array(
75 'select' =>
array(
'TEMPLATE_TYPE',
'TEMPLATE_ID'),
77 'runtime' =>
array(
new ExpressionField(
'MAX_ID',
'MAX(%s)',
'ID')),
78 'limit' => self::$maxCount + 1,
79 'cache' =>
array(
'ttl' => self::$cacheTtl),
80 'group' =>
array(
'TEMPLATE_TYPE',
'TEMPLATE_ID'),
81 'order' =>
array(
'MAX_ID' =>
'DESC'),
83 foreach ($chains as $chain)
86 ->withTypeId($chain[
'TEMPLATE_TYPE'])
87 ->withId($chain[
'TEMPLATE_ID'])
if(!is_object($USER)||! $USER->IsAuthorized()) $userId
static onPresetTemplateList($templateType=null, $templateId=null, $messageCode=null)
</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."%"