Bitrix-D7 23.9
 
Загрузка...
Поиск...
Не найдено
lead.php
1<?php
3
4use Bitrix;
5use CCrmCurrencyHelper;
6use CCrmStatus;
7
8class Lead extends BasePersonalize
9{
10 public static function getEntityFields($entityType)
11 {
12 \Bitrix\Main\Localization\Loc::loadMessages(
13 $_SERVER['DOCUMENT_ROOT'].BX_ROOT.'/components/bitrix/crm.'.strtolower($entityType).'.edit/component.php'
14 );
15 $addressLabels = Bitrix\Crm\EntityAddress::getShortLabels();
16
17 $arResult = array(
18 'ID' => array(
19 'Name' => GetMessage('CRM_FIELD_ID'),
20 'Type' => 'int',
21 'Filterable' => true,
22 'Editable' => false,
23 'Required' => false,
24 // 'personalizeCode' => 'ID'
25 ),
26 'TITLE' => array(
27 'Name' => GetMessage('CRM_FIELD_TITLE_LEAD'),
28 'Type' => 'string',
29 'Filterable' => true,
30 'Editable' => true,
31 'Required' => true,
32 // 'personalizeCode' => 'NAME'
33 ),
34 'STATUS_ID' => array(
35 'Name' => GetMessage('CRM_FIELD_STATUS_ID'),
36 'Type' => 'select',
37 'Options' => CCrmStatus::GetStatusListEx('STATUS'),
38 'Filterable' => true,
39 'Editable' => true,
40 'Required' => false,
41 ),
42 'STATUS_DESCRIPTION' => array(
43 'Name' => GetMessage('CRM_FIELD_STATUS_DESCRIPTION'),
44 'Type' => 'text',
45 'Filterable' => false,
46 'Editable' => true,
47 'Required' => false,
48 ),
49 "OPENED" => array(
50 "Name" => GetMessage("CRM_FIELD_OPENED"),
51 "Type" => "bool",
52 "Filterable" => true,
53 "Editable" => true,
54 "Required" => false,
55 ),
56 'OPPORTUNITY' => array(
57 'Name' => GetMessage('CRM_FIELD_OPPORTUNITY'),
58 'Type' => 'string',
59 'Filterable' => true,
60 'Editable' => true,
61 'Required' => false,
62 ),
63 'CURRENCY_ID' => array(
64 'Name' => GetMessage('CRM_FIELD_CURRENCY_ID'),
65 'Type' => 'select',
66 'Options' => CCrmCurrencyHelper::PrepareListItems(),
67 'Filterable' => true,
68 'Editable' => true,
69 'Required' => false,
70 ),
71 );
72
73 $arResult += array(
74 'COMMENTS' => array(
75 'Name' => GetMessage('CRM_FIELD_COMMENTS'),
76 'Type' => 'text',
77 'Filterable' => false,
78 'Editable' => true,
79 'Required' => false,
80 ),
81 'NAME' => array(
82 'Name' => GetMessage('CRM_LEAD_FIELD_NAME'),
83 'Type' => 'string',
84 'Filterable' => true,
85 'Editable' => true,
86 'Required' => false,
87 ),
88 'LAST_NAME' => array(
89 'Name' => GetMessage('CRM_FIELD_LAST_NAME'),
90 'Type' => 'string',
91 'Filterable' => true,
92 'Editable' => true,
93 'Required' => false,
94 ),
95 'SECOND_NAME' => array(
96 'Name' => GetMessage('CRM_FIELD_SECOND_NAME'),
97 'Type' => 'string',
98 'Filterable' => true,
99 'Editable' => true,
100 'Required' => false,
101 ),
102 'HONORIFIC' => array(
103 'Name' => GetMessage('CRM_FIELD_HONORIFIC'),
104 'Type' => 'select',
105 'Options' => CCrmStatus::GetStatusListEx('HONORIFIC'),
106 'Editable' => true,
107 'Required' => false,
108 ),
109 'BIRTHDATE' => array(
110 'Name' => GetMessage('CRM_LEAD_EDIT_FIELD_BIRTHDATE'),
111 'Type' => 'datetime',
112 'Filterable' => true,
113 'Editable' => true,
114 'Required' => false,
115 ),
116 'EMAIL' => array(
117 'Name' => GetMessage('CRM_FIELD_EMAIL'),
118 'Type' => 'email',
119 'Filterable' => true,
120 'Editable' => true,
121 'Required' => false,
122 // 'personalizeCode' => 'EMAIL'
123 ),
124 'PHONE' => array(
125 'Name' => GetMessage('CRM_FIELD_PHONE'),
126 'Type' => 'phone',
127 'Filterable' => true,
128 'Editable' => true,
129 'Required' => false,
130 // 'personalizeCode' => 'PHONE'
131 ),
132 'WEB' => array(
133 'Name' => GetMessage('CRM_FIELD_WEB'),
134 'Type' => 'web',
135 'Filterable' => true,
136 'Editable' => true,
137 'Required' => false,
138 ),
139 'IM' => array(
140 'Name' => GetMessage('CRM_FIELD_MESSENGER'),
141 'Type' => 'im',
142 'Filterable' => true,
143 'Editable' => true,
144 'Required' => false,
145 ),
146 'COMPANY_TITLE' => array(
147 'Name' => GetMessage('CRM_FIELD_COMPANY_TITLE'),
148 'Type' => 'string',
149 'Filterable' => true,
150 'Editable' => true,
151 'Required' => false,
152 ),
153 'POST' => array(
154 'Name' => GetMessage('CRM_FIELD_POST'),
155 'Type' => 'string',
156 'Filterable' => true,
157 'Editable' => true,
158 'Required' => false,
159 ),
160 'FULL_ADDRESS' => array(
161 'Name' => GetMessage('CRM_FIELD_ADDRESS'),
162 'Type' => 'text',
163 'Filterable' => false,
164 'Editable' => false,
165 'Required' => false,
166 ),
167 'ADDRESS' => array(
168 'Name' => $addressLabels['ADDRESS'],
169 'Type' => 'text',
170 'Filterable' => true,
171 'Editable' => true,
172 'Required' => false,
173 ),
174 'ADDRESS_2' => array(
175 'Name' => $addressLabels['ADDRESS_2'],
176 'Type' => 'text',
177 'Filterable' => true,
178 'Editable' => true,
179 'Required' => false,
180 ),
181 'ADDRESS_CITY' => array(
182 'Name' => $addressLabels['CITY'],
183 'Type' => 'text',
184 'Filterable' => true,
185 'Editable' => true,
186 'Required' => false,
187 ),
188 'ADDRESS_POSTAL_CODE' => array(
189 'Name' => $addressLabels['POSTAL_CODE'],
190 'Type' => 'text',
191 'Filterable' => true,
192 'Editable' => true,
193 'Required' => false,
194 ),
195 'ADDRESS_REGION' => array(
196 'Name' => $addressLabels['REGION'],
197 'Type' => 'text',
198 'Filterable' => true,
199 'Editable' => true,
200 'Required' => false,
201 ),
202 'ADDRESS_COUNTRY' => array(
203 'Name' => $addressLabels['COUNTRY'],
204 'Type' => 'text',
205 'Filterable' => true,
206 'Editable' => true,
207 'Required' => false,
208 ),
209 'SOURCE_ID' => array(
210 'Name' => GetMessage('CRM_FIELD_SOURCE_ID'),
211 'Type' => 'select',
212 'Options' => CCrmStatus::GetStatusListEx('SOURCE'),
213 'Filterable' => true,
214 'Editable' => true,
215 'Required' => false,
216 ),
217 'SOURCE_DESCRIPTION' => array(
218 'Name' => GetMessage('CRM_FIELD_SOURCE_DESCRIPTION'),
219 'Type' => 'text',
220 'Filterable' => false,
221 'Editable' => true,
222 'Required' => false,
223 ),
224 "DATE_CREATE" => array(
225 "Name" => GetMessage("CRM_LEAD_EDIT_FIELD_DATE_CREATE"),
226 "Type" => "datetime",
227 "Filterable" => true,
228 "Editable" => false,
229 "Required" => false,
230 ),
231 "DATE_MODIFY" => array(
232 "Name" => GetMessage("CRM_LEAD_EDIT_FIELD_DATE_MODIFY"),
233 "Type" => "datetime",
234 "Filterable" => true,
235 "Editable" => false,
236 "Required" => false,
237 ),
238 'IS_RETURN_CUSTOMER' => array(
239 'Name' => GetMessage('CRM_DOCUMENT_LEAD_IS_RETURN_CUSTOMER'),
240 'Type' => 'bool',
241 'Editable' => false,
242 ),
243 );
244
245 $arResult += parent::getEntityFields($entityType);
246
247 return $arResult;
248 }
249
250}