Bitrix-D7
23.9
Загрузка...
Поиск...
Не найдено
messagedeal.php
1
<?php
9
namespace
Bitrix\Sender\Integration\Crm\ReturnCustomer
;
10
11
use Bitrix\Crm\Category\DealCategory;
12
use
Bitrix\Main\Localization\Loc
;
13
use
Bitrix\Sender\Integration\Crm\Connectors\Helper
;
14
use
Bitrix\Sender\Internals\PrettyDate
;
15
use
Bitrix\Sender\Message
;
16
use
Bitrix\Sender\PostingRecipientTable
;
17
22
class
MessageDeal
extends
MessageBase
23
{
24
const
CODE
=
self::CODE_RC_DEAL
;
25
30
public
function
getName
()
31
{
32
return
Loc::getMessage
(
'SENDER_INTEGRATION_CRM_RC_MESSAGE_NAME_DEAL'
);
33
}
34
35
protected
function
setConfigurationOptions
()
36
{
37
global $USER;
38
if
($this->configuration->hasOptions())
39
{
40
return
;
41
}
42
43
$this->configuration->setArrayOptions([
44
[
45
'type'
=>
'string'
,
46
'code'
=>
'TITLE'
,
47
'name'
=>
Loc::getMessage
(
'SENDER_INTEGRATION_CRM_RC_MESSAGE_CONFIG_TITLE_DEAL'
),
48
'required'
=>
true
,
49
'value'
=>
Loc::getMessage
(
'SENDER_INTEGRATION_CRM_RC_MESSAGE_CONFIG_TITLE_DEAL_DEF'
, [
'%date%'
=> PrettyDate::formatDate()]),
50
'hint'
=> [
51
'menu'
=> array_map(
52
function
($item)
53
{
54
return
array(
55
'id'
=>
'#'
. ($item[
'CODE'
] ??
''
) .
'#'
,
56
'text'
=> $item[
'NAME'
] ??
''
,
57
'title'
=> $item[
'DESC'
] ??
''
,
58
'items'
=> isset($item[
'ITEMS'
]) ? array_map(
59
function
($item)
60
{
61
return
array(
62
'id'
=>
'#'
. ($item[
'CODE'
] ??
''
) .
'#'
,
63
'text'
=> $item[
'NAME'
] ??
''
,
64
'title'
=> $item[
'DESC'
] ??
''
65
);
66
}, $item[
'ITEMS'
]
67
) : []
68
);
69
},
70
array_merge(
71
Helper::getPersonalizeFieldsFromConnectors(),
72
PostingRecipientTable::getPersonalizeList
()
73
)
74
),
75
],
76
],
77
[
78
'type'
=>
Message
\
ConfigurationOption::TYPE_USER_LIST
,
79
'code'
=>
'ASSIGNED_BY'
,
80
'name'
=>
Loc::getMessage
(
'SENDER_INTEGRATION_CRM_RC_MESSAGE_CONFIG_ASSIGNED_BY'
),
81
'required'
=>
true
,
82
'hint'
=>
Loc::getMessage
(
'SENDER_INTEGRATION_CRM_RC_MESSAGE_CONFIG_ASSIGNED_BY_HINT'
),
83
'value'
=> $USER ? $USER->
getId
() :
''
,
84
],
85
[
86
'type'
=> Message\ConfigurationOption::TYPE_CHECKBOX,
87
'code'
=>
'CHECK_WORK_TIME'
,
88
'name'
=>
Loc::getMessage
(
'SENDER_INTEGRATION_CRM_RC_MESSAGE_CONFIG_CHECK_WORK_TIME'
),
89
'hint'
=>
Loc::getMessage
(
'SENDER_INTEGRATION_CRM_RC_MESSAGE_CONFIG_CHECK_WORK_TIME_HINT'
),
90
'required'
=>
false
,
91
],
92
[
93
'type'
=> Message\ConfigurationOption::TYPE_CHECKBOX,
94
'code'
=>
'ALWAYS_ADD'
,
95
'name'
=>
Loc::getMessage
(
'SENDER_INTEGRATION_CRM_RC_MESSAGE_CONFIG_ALWAYS_ADD_DEAL'
),
96
'required'
=>
false
,
97
'hint'
=>
Loc::getMessage
(
'SENDER_INTEGRATION_CRM_RC_MESSAGE_CONFIG_ALWAYS_ADD_HINT'
),
98
],
99
[
100
'type'
=> Message\ConfigurationOption::TYPE_CHECKBOX,
101
'code'
=>
'LINK_WITH_RESPONSIBLE'
,
102
'name'
=>
Loc::getMessage
(
'SENDER_INTEGRATION_CRM_RC_MESSAGE_CONFIG_LINK_DEAL_WITH_RESPONSIBLE'
),
103
'required'
=>
false
,
104
],
105
[
106
'type'
=> Message\ConfigurationOption::TYPE_CHECKBOX,
107
'code'
=>
'FROM_PREVIOUS'
,
108
'name'
=>
Loc::getMessage
(
'SENDER_INTEGRATION_CRM_RC_MESSAGE_CONFIG_CREATE_FROM_PREVIOUS'
),
109
'required'
=>
false
,
110
'hint'
=>
Loc::getMessage
(
'SENDER_INTEGRATION_CRM_RC_MESSAGE_CONFIG_CREATE_FROM_PREVIOUS_HINT'
),
111
],
112
[
113
'type'
=> Message\ConfigurationOption::TYPE_NUMBER,
114
'code'
=>
'DEAL_DAYS_AGO'
,
115
'name'
=>
Loc::getMessage
(
'SENDER_INTEGRATION_CRM_RC_MESSAGE_CONFIG_DEAL_DAYS_AGO'
),
116
'required'
=>
false
,
117
'value'
=> 1,
118
'min_value'
=> 0,
119
'max_value'
=> 366,
120
'hint'
=>
Loc::getMessage
(
'SENDER_INTEGRATION_CRM_RC_MESSAGE_CONFIG_DEAL_DAYS_AGO_HINT'
),
121
],
122
[
123
'type'
=>
'text'
,
124
'code'
=>
'COMMENT'
,
125
'name'
=>
Loc::getMessage
(
'SENDER_INTEGRATION_CRM_RC_MESSAGE_CONFIG_COMMENT'
),
126
'required'
=>
false
,
127
'placeholder'
=>
Loc::getMessage
(
'SENDER_INTEGRATION_CRM_RC_MESSAGE_CONFIG_COMMENT_HINT'
),
128
],
129
[
130
'type'
=>
'list'
,
131
'code'
=>
'CATEGORY_ID'
,
132
'name'
=>
Loc::getMessage
(
'SENDER_INTEGRATION_CRM_RC_MESSAGE_CONFIG_DEAL_CATEGORY_ID'
),
133
'required'
=>
false
,
134
'show_in_filter'
=>
true
,
135
'items'
=> array_merge(
136
array_map(
137
function
($category)
138
{
139
return
[
140
'code'
=> $category[
'ID'
],
141
'value'
=> $category[
'NAME'
],
142
];
143
},
144
DealCategory::getAll(
true
)
145
),
146
[[
147
'code'
=>
''
,
148
'value'
=>
Loc::getMessage
(
'SENDER_INTEGRATION_CRM_RC_MESSAGE_CONFIG_DEAL_CATEGORY_ID_LAST'
)
149
]]
150
)
151
],
152
]);
153
}
154
}
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_DEAL
const CODE_RC_DEAL
Definition
messagebase.php:27
Bitrix\Sender\Integration\Crm\ReturnCustomer\MessageDeal
Definition
messagedeal.php:23
Bitrix\Sender\Integration\Crm\ReturnCustomer\MessageDeal\CODE
const CODE
Definition
messagedeal.php:24
Bitrix\Sender\Integration\Crm\ReturnCustomer\MessageDeal\setConfigurationOptions
setConfigurationOptions()
Definition
messagedeal.php:35
Bitrix\Sender\Integration\Crm\ReturnCustomer\MessageDeal\getName
getName()
Definition
messagedeal.php:30
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\Integration\Crm\ReturnCustomer
Definition
messagebase.php:9
Bitrix\Sender\Message
Definition
adapter.php:9
modules
sender
lib
integration
crm
returncustomer
messagedeal.php
Создано системой
1.10.0