1C-Bitrix
25.700.0
Загрузка...
Поиск...
Не найдено
messagelead.php
См. документацию.
1
<?php
8
9
namespace
Bitrix\Sender\Integration\Crm\ReturnCustomer;
10
11
use Bitrix\Main\Localization\Loc;
12
use Bitrix\Sender\Integration\Crm\Connectors\Helper;
13
use Bitrix\Sender\Internals\PrettyDate;
14
use Bitrix\Sender\Message;
15
use Bitrix\Sender\PostingRecipientTable;
16
21
class
MessageLead
extends
MessageBase
implements
Message\iHideable
22
{
23
const
CODE
= self::CODE_RC_LEAD;
24
29
public
function
getName
()
30
{
31
return
Loc::getMessage(
'SENDER_INTEGRATION_CRM_RC_MESSAGE_NAME_LEAD'
);
32
}
33
39
public
function
isHidden
()
40
{
41
return
!
Service::isLeadEnabled
();
42
}
43
44
protected
function
setConfigurationOptions
()
45
{
46
if
($this->configuration->hasOptions())
47
{
48
return
;
49
}
50
51
global
$USER
;
52
53
$this->configuration->setArrayOptions([
54
[
55
'type'
=>
'string'
,
56
'code'
=>
'TITLE'
,
57
'name'
=> Loc::getMessage(
'SENDER_INTEGRATION_CRM_RC_MESSAGE_CONFIG_TITLE_LEAD'
),
58
'required'
=>
true
,
59
'value'
=> Loc::getMessage(
'SENDER_INTEGRATION_CRM_RC_MESSAGE_CONFIG_TITLE_LEAD_DEF'
, [
'%date%'
=> PrettyDate::formatDate()]),
60
'hint'
=> [
61
'menu'
=> array_map(
62
function
($item)
63
{
64
return
array
(
65
'id'
=>
'#'
. ($item[
'CODE'
] ??
''
) .
'#'
,
66
'text'
=> $item[
'NAME'
] ??
''
,
67
'title'
=> $item[
'DESC'
] ??
''
,
68
'items'
=> isset($item[
'ITEMS'
]) ? array_map(
69
function
($item)
70
{
71
return
array
(
72
'id'
=>
'#'
. ($item[
'CODE'
] ??
''
) .
'#'
,
73
'text'
=> $item[
'NAME'
] ??
''
,
74
'title'
=> $item[
'DESC'
] ??
''
75
);
76
}, $item[
'ITEMS'
]
77
) : []
78
);
79
},
80
array_merge(
81
Helper::getPersonalizeFieldsFromConnectors(),
82
PostingRecipientTable::getPersonalizeList
()
83
)
84
),
85
],
86
],
87
[
88
'type'
=>
Message\ConfigurationOption::TYPE_USER_LIST
,
89
'code'
=>
'ASSIGNED_BY'
,
90
'name'
=> Loc::getMessage(
'SENDER_INTEGRATION_CRM_RC_MESSAGE_CONFIG_ASSIGNED_BY'
),
91
'required'
=>
true
,
92
'hint'
=> Loc::getMessage(
'SENDER_INTEGRATION_CRM_RC_MESSAGE_CONFIG_ASSIGNED_BY_HINT'
),
93
'value'
=>
$USER
?
$USER
->getId() :
''
,
94
],
95
[
96
'type'
=>
Message\ConfigurationOption::TYPE_CHECKBOX
,
97
'code'
=>
'CHECK_WORK_TIME'
,
98
'name'
=> Loc::getMessage(
'SENDER_INTEGRATION_CRM_RC_MESSAGE_CONFIG_CHECK_WORK_TIME'
),
99
'hint'
=> Loc::getMessage(
'SENDER_INTEGRATION_CRM_RC_MESSAGE_CONFIG_CHECK_WORK_TIME_HINT'
),
100
'required'
=>
false
,
101
],
102
[
103
'type'
=>
Message\ConfigurationOption::TYPE_CHECKBOX
,
104
'code'
=>
'ALWAYS_ADD'
,
105
'name'
=> Loc::getMessage(
'SENDER_INTEGRATION_CRM_RC_MESSAGE_CONFIG_ALWAYS_ADD_LEAD'
),
106
'required'
=>
false
,
107
'hint'
=> Loc::getMessage(
'SENDER_INTEGRATION_CRM_RC_MESSAGE_CONFIG_ALWAYS_ADD_HINT'
),
108
],
109
[
110
'type'
=>
Message\ConfigurationOption::TYPE_CHECKBOX
,
111
'code'
=>
'LINK_WITH_RESPONSIBLE'
,
112
'name'
=> Loc::getMessage(
'SENDER_INTEGRATION_CRM_RC_MESSAGE_CONFIG_LINK_LEAD_WITH_RESPONSIBLE'
),
113
'required'
=>
false
,
114
],
115
[
116
'type'
=>
'text'
,
117
'code'
=>
'COMMENT'
,
118
'name'
=> Loc::getMessage(
'SENDER_INTEGRATION_CRM_RC_MESSAGE_CONFIG_COMMENT'
),
119
'required'
=>
true
,
120
'placeholder'
=> Loc::getMessage(
'SENDER_INTEGRATION_CRM_RC_MESSAGE_CONFIG_COMMENT_HINT'
),
121
],
122
]);
123
}
124
}
Bitrix\Sender\Integration\Crm\ReturnCustomer\MessageBase
Определения
messagebase.php:24
Bitrix\Sender\Integration\Crm\ReturnCustomer\MessageLead
Определения
messagelead.php:22
Bitrix\Sender\Integration\Crm\ReturnCustomer\MessageLead\CODE
const CODE
Определения
messagelead.php:23
Bitrix\Sender\Integration\Crm\ReturnCustomer\MessageLead\setConfigurationOptions
setConfigurationOptions()
Определения
messagelead.php:44
Bitrix\Sender\Integration\Crm\ReturnCustomer\MessageLead\getName
getName()
Определения
messagelead.php:29
Bitrix\Sender\Integration\Crm\ReturnCustomer\MessageLead\isHidden
isHidden()
Определения
messagelead.php:39
Bitrix\Sender\Integration\Crm\ReturnCustomer\Service\isLeadEnabled
static isLeadEnabled()
Определения
service.php:62
Bitrix\Sender\Message\ConfigurationOption\TYPE_CHECKBOX
const TYPE_CHECKBOX
Определения
configurationoption.php:19
Bitrix\Sender\Message\ConfigurationOption\TYPE_USER_LIST
const TYPE_USER_LIST
Определения
configurationoption.php:33
Bitrix\Sender\PostingRecipientTable\getPersonalizeList
static getPersonalizeList()
Определения
posting.php:773
array
</td ></tr ></table ></td ></tr >< tr >< td class="bx-popup-label bx-width30"><?=GetMessage("PAGE_NEW_TAGS")?> array( $site)
Определения
file_new.php:804
Bitrix\Sender\Message\iHideable
Определения
ihideable.php:16
$USER
global $USER
Определения
csv_new_run.php:40
bitrix
modules
sender
lib
integration
crm
returncustomer
messagelead.php
Создано системой
1.14.0