1C-Bitrix 25.700.0
Загрузка...
Поиск...
Не найдено
taskcomment.php
См. документацию.
1<?php
2namespace Bitrix\Landing\Note\Source;
3
4use \Bitrix\Forum\MessageTable;
5
6class TaskComment extends Entity
7{
13 public static function getData(int $sourceId): ?array
14 {
15 if (
16 \Bitrix\Main\Loader::includeModule('tasks') &&
17 \Bitrix\Main\Loader::includeModule('forum')
18 )
19 {
20 $res = MessageTable::getList([
21 'select' => [
22 'TOPIC_ID', 'POST_MESSAGE'
23 ],
24 'filter' => [
25 'ID' => $sourceId,
26 '=APPROVED' => 'Y'
27 ],
28 'limit' => 1
29 ]);
30 if ($comment = $res->fetch())
31 {
32 [$tasks, ] = \CTaskItem::fetchList(
34 [],
35 ['FORUM_TOPIC_ID' => $comment['TOPIC_ID']]
36 );
37 if ($tasks)
38 {
39 $params = [];
40 $taskData = $tasks[0]->getData();
41 $blocks = [[
42 'type' => 'header',
43 'content' => $taskData['TITLE']
44 ]];
45 if (\Bitrix\Main\Loader::includeModule('disk'))
46 {
47 $params = [
48 'files' => self::getDiskFiles(
49 $sourceId,
50 \Bitrix\Disk\Uf\ForumMessageConnector::class,
51 'forum'
52 )
53 ];
54 }
55 $blocks = array_merge(
56 $blocks,
57 Parser::textToBlocks($comment['POST_MESSAGE'], $params)
58 );
59 return [
60 'TITLE' => \truncateText($taskData['TITLE'], self::TITLE_LENGTH),
61 'BLOCKS' => $blocks
62 ];
63 }
64 }
65 }
66
67 return null;
68 }
69}
static getUserId()
Определения manager.php:107
static getDiskFiles(int $sourceId, string $entityType, string $module)
Определения entity.php:18
static textToBlocks(string $text, array $params=[])
Определения parser.php:212
static getData(int $sourceId)
Определения taskcomment.php:13
</td ></tr ></table ></td ></tr >< tr >< td class="bx-popup-label bx-width30"><?=GetMessage("PAGE_NEW_TAGS")?> array( $site)
Определения file_new.php:804
$res
Определения filter_act.php:7
Определения agent.php:3
$comment
Определения template.php:15
if($inWords) echo htmlspecialcharsbx(Number2Word_Rus(roundEx($totalVatSum $params['CURRENCY']
Определения template.php:799