Битрикс24
- 517 ответов
- 0 вопросов
325
Вклад в тег
.crm-kanban-item.flah_repeated {
background-color: red !important;
}
BX.addCustomEvent("Kanban.Grid:onRender", function(kanbanGrid){
if ( kanbanGrid.getData().entityType != 'LEAD' )
{
return;
}
let kanbanItems = kanbanGrid.getItems();
for (let key in kanbanItems)
{
if ( key < 1 ) continue;
let kanbanItem = kanbanItems[key];
if ( kanbanItem.getDataKey('return') )
{
BX.addClass(kanbanItem.container, "flah_repeated");
}
}
});
use Bitrix\Main\Mail;
/**
* Get from b_event table
* @var integer Existed event id
*/
$displayedEventId = 336020;
/**
* List of site ids, for event theme generation
* must be replaced by current site id in public
* @var array
*/
$arSites = [
's1'
];
try
{
/**
* First, try to find event
*/
$arEvent = Mail\Internal\EventTable::getRow([
'filter' => [
'=ID' => $displayedEventId,
]
]);
if ( !$arEvent )
{
throw new \Exception('Event not found');
}
$arEvent['FIELDS'] = $arEvent['C_FIELDS'];
/**
* Try to find all message templates for
* sites. In event handler we send for one letter
* per site.
*/
$arEventMessageFilter = [
'=ACTIVE' => 'Y',
'=EVENT_NAME' => $arEvent["EVENT_NAME"],
'=EVENT_MESSAGE_SITE.SITE_ID' => $arSites,
];
$messageDb = Mail\Internal\EventMessageTable::getList([
'select' => ['ID'],
'filter' => $arEventMessageFilter,
'group' => ['ID']
]);
foreach ($messageDb as $arMessage)
{
$eventMessage = Mail\Internal\EventMessageTable::getRowById($arMessage['ID']);
$eventMessage['FILES'] = array();
$attachmentDb = Mail\Internal\EventMessageAttachmentTable::getList(array(
'select' => array('FILE_ID'),
'filter' => array('=EVENT_MESSAGE_ID' => $arMessage['ID']),
));
while($arAttachmentDb = $attachmentDb->fetch())
{
$eventMessage['FILE'][] = $arAttachmentDb['FILE_ID'];
}
$arFields = $arEvent['FIELDS'];
// get message object for send mail
$arMessageParams = array(
'EVENT' => $arEvent,
'FIELDS' => $arFields,
'MESSAGE' => $eventMessage,
'SITE' => $arSites,
'CHARSET' => $charset,
);
$message = Mail\EventMessageCompiler::createInstance($arMessageParams);
$message->compile();
echo $message->getMailBody();
}
}
catch( \Exception $e )
{
var_dump($e);
}