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