Bitrix-D7
23.9
Загрузка...
Поиск...
Не найдено
messagelead.php
1
<?php
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\Main\Diag\Helper
Definition
helper.php:5
Bitrix\Main\Localization\Loc
Definition
loc.php:11
Bitrix\Main\Localization\Loc\getMessage
static getMessage($code, $replace=null, $language=null)
Definition
loc.php:29
Bitrix\Sender\Connector\Base\getId
getId()
Definition
base.php:206
Bitrix\Sender\Entity\Message
Definition
message.php:27
Bitrix\Sender\Integration\Crm\ReturnCustomer\MessageBase
Definition
messagebase.php:24
Bitrix\Sender\Integration\Crm\ReturnCustomer\MessageBase\CODE_RC_LEAD
const CODE_RC_LEAD
Definition
messagebase.php:26
Bitrix\Sender\Integration\Crm\ReturnCustomer\MessageLead
Definition
messagelead.php:22
Bitrix\Sender\Integration\Crm\ReturnCustomer\MessageLead\CODE
const CODE
Definition
messagelead.php:23
Bitrix\Sender\Integration\Crm\ReturnCustomer\MessageLead\setConfigurationOptions
setConfigurationOptions()
Definition
messagelead.php:44
Bitrix\Sender\Integration\Crm\ReturnCustomer\MessageLead\getName
getName()
Definition
messagelead.php:29
Bitrix\Sender\Integration\Crm\ReturnCustomer\MessageLead\isHidden
isHidden()
Definition
messagelead.php:39
Bitrix\Sender\Integration\Crm\ReturnCustomer\Service\isLeadEnabled
static isLeadEnabled()
Definition
service.php:62
Bitrix\Sender\Internals\PrettyDate
Definition
prettydate.php:22
Bitrix\Sender\Message\ConfigurationOption\TYPE_USER_LIST
const TYPE_USER_LIST
Definition
configurationoption.php:33
Bitrix\Sender\PostingRecipientTable
Definition
posting.php:663
Bitrix\Sender\PostingRecipientTable\getPersonalizeList
static getPersonalizeList()
Definition
posting.php:762
Bitrix\Sender\Message\iHideable
Definition
ihideable.php:16
Bitrix\Sender\Integration\Crm\ReturnCustomer
Definition
messagebase.php:9
Bitrix\Sender\Message
Definition
adapter.php:9
modules
sender
lib
integration
crm
returncustomer
messagelead.php
Создано системой
1.10.0