1C-Bitrix 25.700.0
Загрузка...
Поиск...
Не найдено
newstemplate.php
См. документацию.
1<?php
2
3namespace Bitrix\Im\Integration\Bizproc\Message;
4
5use Bitrix\Bizproc\FieldType;
6use Bitrix\Main\Error;
7use Bitrix\Main\Localization\Loc;
8
9Loc::loadMessages(__FILE__);
10
12{
13 protected const DEFAULT_BORDER_COLOR = '#468EE5';
14
15 protected string $title = '';
16
18 {
19 $attach = new \CIMMessageParamAttach(0, static::DEFAULT_BORDER_COLOR);
20
21 $attach->SetDescription($this->buildDescriptionText());
22
23 $attach->AddGrid([
24 [
25 'DISPLAY' => 'LINE',
26 'NAME' => $this->title,
27 'VALUE' => $this->buildMessageText(),
28 ]
29 ]);
30
31 $messageFields['ATTACH'] = $attach;
32
33 return $messageFields;
34 }
35
36 protected function getTextContents(): string
37 {
38 return $this->title . ' ' . $this->messageText;
39 }
40
41 protected function validate(): void
42 {
43 parent::validate();
44
45 if ($this->title === '')
46 {
47 $this->errors->setError(new Error(
48 Loc::getMessage('IM_BIZPROC_MESSAGE_NEWS_TEMPLATE_FIELD_NAME_MESSAGE_TITLE_ERROR')
49 ));
50 }
51 }
52
53 public function setFields(array $fields): self
54 {
55 parent::setFields($fields);
56
57 if (!empty($fields['MessageTitle']))
58 {
59 $this->title = trim(\CBPHelper::stringify($fields['MessageTitle']));
60 }
61
62 return $this;
63 }
64
65 public static function getFieldsMap(): array
66 {
67 return array_merge(
68 [
69 'MessageTitle' => [
70 'Name' => Loc::getMessage('IM_BIZPROC_MESSAGE_NEWS_TEMPLATE_FIELD_NAME_MESSAGE_TITLE'),
71 'FieldName' => 'title',
72 'Type' => FieldType::STRING,
73 'Required' => true,
74 'Multiple' => false,
75 ],
76 ],
77 parent::getFieldsMap(),
78 );
79 }
80}
$messageFields
Определения callback_ednaru.php:22
buildMessage(array $messageFields)
Определения newstemplate.php:17
Определения error.php:15
</td ></tr ></table ></td ></tr >< tr >< td class="bx-popup-label bx-width30"><?=GetMessage("PAGE_NEW_TAGS")?> array( $site)
Определения file_new.php:804
<? endif;?> window document title
Определения prolog_main_admin.php:76
$fields
Определения yandex_run.php:501