1C-Bitrix
25.700.0
Загрузка...
Поиск...
Не найдено
newstemplate.php
См. документацию.
1
<?php
2
3
namespace
Bitrix\Im\Integration\Bizproc\Message;
4
5
use Bitrix\Bizproc\FieldType;
6
use Bitrix\Main\Error;
7
use Bitrix\Main\Localization\Loc;
8
9
Loc::loadMessages(__FILE__);
10
11
class
NewsTemplate
extends
PlainTemplate
12
{
13
protected
const
DEFAULT_BORDER_COLOR
=
'#468EE5'
;
14
15
protected
string
$title
=
''
;
16
17
public
function
buildMessage
(
array
$messageFields
):
array
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
$messageFields
Определения
callback_ednaru.php:22
Bitrix\Im\Integration\Bizproc\Message\NewsTemplate
Определения
newstemplate.php:12
Bitrix\Im\Integration\Bizproc\Message\NewsTemplate\DEFAULT_BORDER_COLOR
const DEFAULT_BORDER_COLOR
Определения
newstemplate.php:13
Bitrix\Im\Integration\Bizproc\Message\NewsTemplate\validate
validate()
Определения
newstemplate.php:41
Bitrix\Im\Integration\Bizproc\Message\NewsTemplate\getFieldsMap
static getFieldsMap()
Определения
newstemplate.php:65
Bitrix\Im\Integration\Bizproc\Message\NewsTemplate\$title
string $title
Определения
newstemplate.php:15
Bitrix\Im\Integration\Bizproc\Message\NewsTemplate\buildMessage
buildMessage(array $messageFields)
Определения
newstemplate.php:17
Bitrix\Im\Integration\Bizproc\Message\NewsTemplate\setFields
setFields(array $fields)
Определения
newstemplate.php:53
Bitrix\Im\Integration\Bizproc\Message\NewsTemplate\getTextContents
getTextContents()
Определения
newstemplate.php:36
Bitrix\Im\Integration\Bizproc\Message\PlainTemplate
Определения
plaintemplate.php:12
Bitrix\Im\Integration\Bizproc\Message\PlainTemplate\buildMessageText
buildMessageText()
Определения
plaintemplate.php:22
Bitrix\Im\Integration\Bizproc\Message\PlainTemplate\$messageText
string $messageText
Определения
plaintemplate.php:13
Bitrix\Im\Integration\Bizproc\Message\PlainTemplate\buildDescriptionText
buildDescriptionText()
Определения
plaintemplate.php:34
Bitrix\Main\Error
Определения
error.php:15
array
</td ></tr ></table ></td ></tr >< tr >< td class="bx-popup-label bx-width30"><?=GetMessage("PAGE_NEW_TAGS")?> array( $site)
Определения
file_new.php:804
title
<? endif;?> window document title
Определения
prolog_main_admin.php:76
$fields
$fields
Определения
yandex_run.php:501
bitrix
modules
im
lib
integration
bizproc
message
newstemplate.php
Создано системой
1.14.0