Bitrix-D7 23.9
 
Загрузка...
Поиск...
Не найдено
messagelead.php
1<?php
10
16
22{
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(),
83 )
84 ),
85 ],
86 ],
87 [
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}
static getMessage($code, $replace=null, $language=null)
Definition loc.php:29