Bitrix-D7 23.9
 
Загрузка...
Поиск...
Не найдено
element.php
1<?php
2
4
10
11Loc::loadMessages(__FILE__);
12
17class Element extends Base
18{
19 private const CACHE_DIR = '/rest/integration/element/';
20 private const DEFAULT_DATA = [
21 'application' => [
22 'CODE' => 'application',
23 'ELEMENT_CODE' => 'application',
24 'TITLE.MESSAGE_CODE' => 'REST_INTEGRATION_PATTERNS_1003_TITLE',
25 'ACTIVE' => 'Y',
26 'DESCRIPTION.MESSAGE_CODE' => 'REST_INTEGRATION_PATTERNS_1003_DESCRIPTION',
27 'DESCRIPTION_FULL.MESSAGE_CODE' => 'REST_INTEGRATION_PATTERNS_1003_DESCRIPTION_FULL',
28 'SECTION_CODE' => 'standard',
29 'ICON_CLASS' => 'rest-integration-tile-img-hidden',
30 'OPTIONS' => [
31 'QUERY_NEEDED' => 'D',
32 'OUTGOING_NEEDED' => 'D',
33 'WIDGET_NEEDED' => 'D',
34 'BOT_NEEDED' => 'D',
35 'APPLICATION_NEEDED' => 'Y',
36 'SCOPE' => [
37 'crm',
38 ],
39 'APPLICATION_DOWNLOAD_EXAMPLE_TYPE' => 'local_app',
40 'DESCRIPTION_SCOPE' => [
41 'DESCRIPTION.MESSAGE_CODE' => 'REST_INTEGRATION_PATTERNS_1003_DESCRIPTION_SCOPE_DESCRIPTION',
42 ],
43 ],
44 ],
45 'out-hook' => [
46 'CODE' => 'out-hook',
47 'ELEMENT_CODE' => 'out-hook',
48 'TITLE.MESSAGE_CODE' => 'REST_INTEGRATION_PATTERNS_1002_TITLE',
49 'ACTIVE' => 'Y',
50 'DESCRIPTION.MESSAGE_CODE' => 'REST_INTEGRATION_PATTERNS_1002_DESCRIPTION',
51 'SECTION_CODE' => 'standard',
52 'ICON_CLASS' => 'rest-integration-tile-img-hidden',
53 'OPTIONS' => [
54 'QUERY_NEEDED' => 'D',
55 'OUTGOING_NEEDED' => 'Y',
56 'SCOPE_NEEDED' => 'D',
57 'WIDGET_NEEDED' => 'D',
58 'BOT_NEEDED' => 'D',
59 'APPLICATION_NEEDED' => 'D',
60 'OUTGOING_DOWNLOAD_EXAMPLE_TYPE' => 'out_hook',
61 'SCOPE' => [],
62 'DESCRIPTION_SCOPE' => [],
63 ],
64 ],
65 'in-hook' => [
66 'CODE' => 'in-hook',
67 'ELEMENT_CODE' => 'in-hook',
68 'TITLE.MESSAGE_CODE' => 'REST_INTEGRATION_PATTERNS_1001_TITLE',
69 'ACTIVE' => 'Y',
70 'DESCRIPTION.MESSAGE_CODE' => 'REST_INTEGRATION_PATTERNS_1001_DESCRIPTION',
71 'SECTION_CODE' => 'standard',
72 'ICON_CLASS' => 'rest-integration-tile-img-hidden',
73 'OPTIONS' => [
74 'QUERY' => [
75 [
76 'CODE' => 'params',
77 'METHOD' => 'profile',
78 'ITEMS_TITLE.MESSAGE_CODE' => 'REST_INTEGRATION_PATTERNS_1001_INCOMING_QUERY_TITLE_ITEMS',
79 'ITEMS' => [],
80 'METHOD_DOWNLOAD_EXAMPLE_TYPE' => 'in_hook',
81 ],
82 ],
83 'OUTGOING_NEEDED' => 'D',
84 'WIDGET_NEEDED' => 'D',
85 'BOT_NEEDED' => 'D',
86 'APPLICATION_NEEDED' => 'D',
87 'SCOPE' => [],
88 'DESCRIPTION_SCOPE' => [],
89 ],
90 ],
91 'contact-sync' => [
92 'CODE' => 'contact-sync',
93 'ELEMENT_CODE' => 'contact-sync',
94 'TITLE.MESSAGE_CODE' => 'REST_INTEGRATION_PATTERNS_10_TITLE',
95 'ACTIVE' => 'Y',
96 'DESCRIPTION.MESSAGE_CODE' => 'REST_INTEGRATION_PATTERNS_10_DESCRIPTION',
97 'SECTION_CODE' => 'external',
98 'ICON_CLASS' => 'rest-integration-tile-img-hidden',
99 'OPTIONS' => [
100 'QUERY' => [
101 [
102 'ITEMS_TITLE.MESSAGE_CODE' => 'REST_INTEGRATION_PATTERNS_10_INCOMING_QUERY_TITLE',
103 'CODE' => 'params',
104 'METHOD' => 'crm.contact.get',
105 'METHOD_DOWNLOAD_EXAMPLE_TYPE' => 'custom_sync',
106 'QUERY_INFORMATION_URL.MESSAGE_CODE' => 'REST_INTEGRATION_PATTERNS_10_INCOMING_QUERY_INFORMATION_URL',
107 'ITEMS' => [
108 [
109 'title' => 'ID',
110 'value' => '42',
111 ],
112 ],
113 'QUERY_INFORMATION_URL' => 'https://dev.1c-bitrix.ru/rest_help/crm/contacts/crm_contact_get.php',
114 ],
115 ],
116 'OUTGOING_NEEDED' => 'Y',
117 'OUTGOING_DOWNLOAD_EXAMPLE_TYPE' => 'custom_sync',
118 'OUTGOING_EVENTS' => [
119 'ONCRMCONTACTUPDATE',
120 ],
121 'WIDGET_NEEDED' => 'D',
122 'BOT_NEEDED' => 'D',
123 'APPLICATION_NEEDED' => 'D',
124 'SCOPE' => [
125 'crm',
126 ],
127 'DESCRIPTION_OUTGOING' => [
128 'DESCRIPTION.MESSAGE_CODE' => 'REST_INTEGRATION_PATTERNS_10_DESCRIPTION_OUTGOING_DESCRIPTION',
129 ],
130 'DESCRIPTION_SCOPE' => [
131 'DESCRIPTION.MESSAGE_CODE' => 'REST_INTEGRATION_PATTERNS_10_DESCRIPTION_SCOPE_DESCRIPTION',
132 ],
133 ],
134 ],
135 'contact-add' => [
136 'CODE' => 'contact-add',
137 'SECTION_CODE' => 'migration',
138 'ELEMENT_CODE' => 'contact-add',
139 'TITLE.MESSAGE_CODE' => 'REST_INTEGRATION_PATTERNS_2_TITLE',
140 'ACTIVE' => 'Y',
141 'DESCRIPTION.MESSAGE_CODE' => 'REST_INTEGRATION_PATTERNS_2_DESCRIPTION',
142 'ICON_CLASS' => 'rest-integration-tile-img-hidden',
143 'OPTIONS' => [
144 'QUERY' => [
145 [
146 'ITEMS_TITLE.MESSAGE_CODE' => 'REST_INTEGRATION_PATTERNS_2_INCOMING_QUERY_TITLE',
147 'METHOD' => 'crm.contact.add',
148 'METHOD_DOWNLOAD_EXAMPLE_TYPE' => 'query',
149 'QUERY_INFORMATION_URL.MESSAGE_CODE' => 'REST_INTEGRATION_PATTERNS_2_INCOMING_QUERY_INFORMATION_URL',
150 'DESCRIPTION_METHOD' => [
151 'DESCRIPTION.MESSAGE_CODE' => 'REST_INTEGRATION_PATTERNS_2_DESCRIPTION_METHOD_DESCRIPTION',
152 ],
153 'CODE' => 'params',
154 'ITEMS' => [
155 [
156 'title' => 'FIELDS[NAME]',
157 'value.MESSAGE_CODE' => 'REST_INTEGRATION_PATTERNS_2_INCOMING_QUERY_ITEMS_VALUE_0',
158 ],
159 [
160 'title' => 'FIELDS[LAST_NAME]',
161 'value.MESSAGE_CODE' => 'REST_INTEGRATION_PATTERNS_2_INCOMING_QUERY_ITEMS_VALUE_1',
162 ],
163 [
164 'title' => 'FIELDS[EMAIL][0][VALUE]',
165 'value.MESSAGE_CODE' => 'REST_INTEGRATION_PATTERNS_2_INCOMING_QUERY_ITEMS_VALUE_2',
166 'value' => 'mail@example.com',
167 ],
168 [
169 'title' => 'FIELDS[EMAIL][0][VALUE_TYPE]',
170 'value' => 'WORK',
171 ],
172 [
173 'title' => 'FIELDS[PHONE][0][VALUE]',
174 'value.MESSAGE_CODE' => 'REST_INTEGRATION_PATTERNS_2_INCOMING_QUERY_ITEMS_VALUE_3',
175 'value' => '555888',
176 ],
177 [
178 'title' => 'FIELDS[PHONE][0][VALUE_TYPE]',
179 'value' => 'WORK',
180 ],
181 ],
182 'QUERY_INFORMATION_URL' => 'https://dev.1c-bitrix.ru/rest_help/crm/contacts/crm_contact_add.php',
183 ],
184 ],
185 'OUTGOING_NEEDED' => 'N',
186 'WIDGET_NEEDED' => 'D',
187 'SCOPE' => [
188 'crm',
189 ],
190 'BOT_NEEDED' => 'D',
191 'APPLICATION_NEEDED' => 'D',
192 'OUTGOING_EVENTS' => [
193 'ONCRMCONTACTADD',
194 'ONCRMCONTACTUPDATE',
195 'ONCRMCONTACTDELETE',
196 ],
197 'DESCRIPTION_OUTGOING' => [],
198 'DESCRIPTION_SCOPE' => [
199 'DESCRIPTION.MESSAGE_CODE' => 'REST_INTEGRATION_PATTERNS_2_DESCRIPTION_SCOPE_DESCRIPTION',
200 ],
201 ],
202 ],
203 'export-email-new-contact' => [
204 'CODE' => 'export-email-new-contact',
205 'ELEMENT_CODE' => 'export-email-new-contact',
206 'TITLE.MESSAGE_CODE' => 'REST_INTEGRATION_PATTERNS_3_TITLE',
207 'ACTIVE' => 'Y',
208 'DESCRIPTION.MESSAGE_CODE' => 'REST_INTEGRATION_PATTERNS_3_DESCRIPTION',
209 'SECTION_CODE' => 'migration',
210 'ICON_CLASS' => 'rest-integration-tile-img-hidden',
211 'OPTIONS' => [
212 'QUERY' => [
213 [
214 'ITEMS_TITLE.MESSAGE_CODE' => 'REST_INTEGRATION_PATTERNS_3_INCOMING_QUERY_TITLE',
215 'CODE' => 'params',
216 'METHOD' => 'crm.contact.list',
217 'METHOD_DOWNLOAD_EXAMPLE_TYPE' => 'query',
218 'QUERY_INFORMATION_URL.MESSAGE_CODE' => 'REST_INTEGRATION_PATTERNS_3_INCOMING_QUERY_INFORMATION_URL',
219 'DESCRIPTION_METHOD' => [
220 'DESCRIPTION.MESSAGE_CODE' => 'REST_INTEGRATION_PATTERNS_3_DESCRIPTION_METHOD_DESCRIPTION',
221 ],
222 'ITEMS' => [
223 [
224 'title' => 'FILTER[>DATE_CREATE]',
225 'value' => '2019-01-01',
226 ],
227 [
228 'title' => 'SELECT[]',
229 'value' => 'NAME',
230 ],
231 [
232 'title' => 'SELECT[]',
233 'value' => 'LAST_NAME',
234 ],
235 [
236 'title' => 'SELECT[]',
237 'value' => 'EMAIL',
238 ],
239 ],
240 'QUERY_INFORMATION_URL' => 'https://dev.1c-bitrix.ru/rest_help/crm/contacts/crm_contact_list.php',
241 ],
242 ],
243 'OUTGOING_NEEDED' => 'D',
244 'WIDGET_NEEDED' => 'D',
245 'BOT_NEEDED' => 'D',
246 'APPLICATION_NEEDED' => 'D',
247 'SCOPE' => [
248 'crm',
249 ],
250 'DESCRIPTION_SCOPE' => [
251 'DESCRIPTION.MESSAGE_CODE' => 'REST_INTEGRATION_PATTERNS_3_DESCRIPTION_SCOPE_DESCRIPTION',
252 ],
253 ],
254 ],
255 'user-add' => [
256 'CODE' => 'user-add',
257 'ELEMENT_CODE' => 'user-add',
258 'TITLE.MESSAGE_CODE' => 'REST_INTEGRATION_PATTERNS_4_TITLE',
259 'ACTIVE' => 'N',
260 'DESCRIPTION.MESSAGE_CODE' => 'REST_INTEGRATION_PATTERNS_4_DESCRIPTION',
261 'SECTION_CODE' => 'migration',
262 'ICON_CLASS' => 'rest-integration-tile-img-hidden',
263 'OPTIONS' => [
264 'QUERY' => [
265 [
266 'ITEMS_TITLE.MESSAGE_CODE' => 'REST_INTEGRATION_PATTERNS_4_INCOMING_QUERY_TITLE',
267 'METHOD' => 'user.add',
268 'METHOD_DOWNLOAD_EXAMPLE_TYPE' => 'query',
269 'QUERY_INFORMATION_URL.MESSAGE_CODE' => 'REST_INTEGRATION_PATTERNS_4_INCOMING_QUERY_INFORMATION_URL',
270 'DESCRIPTION_METHOD' => [
271 'DESCRIPTION.MESSAGE_CODE' => 'REST_INTEGRATION_PATTERNS_4_DESCRIPTION_METHOD_DESCRIPTION',
272 ],
273 'CODE' => 'params',
274 'ITEMS' => [
275 [
276 'title' => 'MESSAGE_TEXT',
277 'value.MESSAGE_CODE' => 'REST_INTEGRATION_PATTERNS_4_INCOMING_QUERY_ITEMS_VALUE_0',
278 ],
279 [
280 'title' => 'EMAIL',
281 'value.MESSAGE_CODE' => 'REST_INTEGRATION_PATTERNS_4_INCOMING_QUERY_ITEMS_VALUE_1',
282 'value' => 'mail@example.com',
283 ],
284 [
285 'title' => 'UF_DEPARTMENT[]',
286 'value' => '1',
287 ],
288 ],
289 'QUERY_INFORMATION_URL' => 'https://dev.1c-bitrix.ru/rest_help/users/user_add.php',
290 ],
291 ],
292 'OUTGOING_NEEDED' => 'D',
293 'WIDGET_NEEDED' => 'D',
294 'BOT_NEEDED' => 'D',
295 'APPLICATION_NEEDED' => 'D',
296 'SCOPE' => [
297 'user',
298 ],
299 'DESCRIPTION_SCOPE' => [
300 'DESCRIPTION.MESSAGE_CODE' => 'REST_INTEGRATION_PATTERNS_4_DESCRIPTION_SCOPE_DESCRIPTION',
301 ],
302 ],
303 ],
304 'lead-change-status' => [
305 'CODE' => 'lead-change-status',
306 'ELEMENT_CODE' => 'lead-change-status',
307 'TITLE.MESSAGE_CODE' => 'REST_INTEGRATION_PATTERNS_5_TITLE',
308 'ACTIVE' => 'Y',
309 'DESCRIPTION.MESSAGE_CODE' => 'REST_INTEGRATION_PATTERNS_5_DESCRIPTION',
310 'SECTION_CODE' => 'auto-sales',
311 'ICON_CLASS' => 'rest-integration-tile-img-hidden',
312 'OPTIONS' => [
313 'QUERY' => [
314 [
315 'ITEMS_TITLE.MESSAGE_CODE' => 'REST_INTEGRATION_PATTERNS_5_INCOMING_QUERY_TITLE',
316 'CODE' => 'params',
317 'METHOD' => 'crm.lead.update',
318 'METHOD_DOWNLOAD_EXAMPLE_TYPE' => 'query',
319 'QUERY_INFORMATION_URL.MESSAGE_CODE' => 'REST_INTEGRATION_PATTERNS_5_INCOMING_QUERY_INFORMATION_URL',
320 'DESCRIPTION_METHOD' => [
321 'DESCRIPTION.MESSAGE_CODE' => 'REST_INTEGRATION_PATTERNS_5_DESCRIPTION_METHOD_DESCRIPTION',
322 ],
323 'ITEMS' => [
324 [
325 'title' => 'ID',
326 'value' => '42',
327 ],
328 [
329 'title' => 'FIELDS[STATUS_ID]',
330 'value' => 'CONVERTED',
331 ],
332 ],
333 'QUERY_INFORMATION_URL' => 'https://dev.1c-bitrix.ru/rest_help/crm/leads/crm_lead_update.php',
334 ],
335 ],
336 'OUTGOING_NEEDED' => 'D',
337 'WIDGET_NEEDED' => 'D',
338 'BOT_NEEDED' => 'D',
339 'APPLICATION_NEEDED' => 'D',
340 'SCOPE' => [
341 'crm',
342 ],
343 'DESCRIPTION_SCOPE' => [
344 'DESCRIPTION.MESSAGE_CODE' => 'REST_INTEGRATION_PATTERNS_5_DESCRIPTION_SCOPE_DESCRIPTION',
345 ],
346 ],
347 ],
348 'tasks-task-add' => [
349 'CODE' => 'tasks-task-add',
350 'ELEMENT_CODE' => 'tasks-task-add',
351 'TITLE.MESSAGE_CODE' => 'REST_INTEGRATION_PATTERNS_6_TITLE',
352 'ACTIVE' => 'N',
353 'DESCRIPTION.MESSAGE_CODE' => 'REST_INTEGRATION_PATTERNS_6_DESCRIPTION',
354 'SECTION_CODE' => 'auto-control',
355 'ICON_CLASS' => 'rest-integration-tile-img-hidden',
356 'OPTIONS' => [
357 'QUERY' => [
358 [
359 'ITEMS_TITLE.MESSAGE_CODE' => 'REST_INTEGRATION_PATTERNS_6_INCOMING_QUERY_TITLE',
360 'CODE' => 'params',
361 'METHOD' => 'tasks.task.add',
362 'METHOD_DOWNLOAD_EXAMPLE_TYPE' => 'query',
363 'QUERY_INFORMATION_URL.MESSAGE_CODE' => 'REST_INTEGRATION_PATTERNS_6_INCOMING_QUERY_INFORMATION_URL',
364 'DESCRIPTION_METHOD' => [
365 'DESCRIPTION.MESSAGE_CODE' => 'REST_INTEGRATION_PATTERNS_6_DESCRIPTION_METHOD_DESCRIPTION',
366 ],
367 'ITEMS' => [
368 [
369 'title' => 'fields[TITLE]',
370 'value.MESSAGE_CODE' => 'REST_INTEGRATION_PATTERNS_6_INCOMING_QUERY_ITEMS_VALUE_0',
371 ],
372 [
373 'title' => 'fields[DESCRIPTION]',
374 'value.MESSAGE_CODE' => 'REST_INTEGRATION_PATTERNS_6_INCOMING_QUERY_ITEMS_VALUE_1',
375 ],
376 [
377 'title' => 'fields[RESPONSIBLE_ID]',
378 'value' => '1',
379 ],
380 ],
381 'QUERY_INFORMATION_URL' => 'https://dev.1c-bitrix.ru/rest_help/tasks/task/tasks/tasks_task_add.php',
382 ],
383 ],
384 'OUTGOING_NEEDED' => 'D',
385 'WIDGET_NEEDED' => 'D',
386 'BOT_NEEDED' => 'D',
387 'APPLICATION_NEEDED' => 'D',
388 'SCOPE' => [
389 'task',
390 ],
391 'DESCRIPTION_SCOPE' => [
392 'DESCRIPTION.MESSAGE_CODE' => 'REST_INTEGRATION_PATTERNS_6_DESCRIPTION_SCOPE_DESCRIPTION',
393 ],
394 ],
395 ],
396 'send-notify' => [
397 'CODE' => 'send-notify',
398 'ELEMENT_CODE' => 'send-notify',
399 'TITLE.MESSAGE_CODE' => 'REST_INTEGRATION_PATTERNS_7_TITLE',
400 'ACTIVE' => 'Y',
401 'DESCRIPTION.MESSAGE_CODE' => 'REST_INTEGRATION_PATTERNS_7_DESCRIPTION',
402 'SECTION_CODE' => 'auto-control',
403 'ICON_CLASS' => 'rest-integration-tile-img-hidden',
404 'OPTIONS' => [
405 'QUERY' => [
406 [
407 'ITEMS_TITLE.MESSAGE_CODE' => 'REST_INTEGRATION_PATTERNS_7_INCOMING_QUERY_TITLE',
408 'CODE' => 'params',
409 'METHOD' => 'im.notify',
410 'METHOD_DOWNLOAD_EXAMPLE_TYPE' => 'query',
411 'QUERY_INFORMATION_URL.MESSAGE_CODE' => 'REST_INTEGRATION_PATTERNS_7_INCOMING_QUERY_INFORMATION_URL',
412 'DESCRIPTION_METHOD' => [
413 'DESCRIPTION.MESSAGE_CODE' => 'REST_INTEGRATION_PATTERNS_7_DESCRIPTION_METHOD_DESCRIPTION',
414 ],
415 'ITEMS' => [
416 [
417 'title' => 'TO',
418 'value' => '1',
419 ],
420 [
421 'title' => 'MESSAGE',
422 'value.MESSAGE_CODE' => 'REST_INTEGRATION_PATTERNS_7_INCOMING_QUERY_ITEMS_VALUE_0',
423 ],
424 [
425 'title' => 'TYPE',
426 'value' => 'SYSTEM',
427 ],
428 ],
429 'QUERY_INFORMATION_URL' => 'https://dev.1c-bitrix.ru/learning/course/index.php?COURSE_ID=93&CHAPTER_ID=07693',
430 ],
431 ],
432 'OUTGOING_NEEDED' => 'D',
433 'WIDGET_NEEDED' => 'D',
434 'BOT_NEEDED' => 'D',
435 'APPLICATION_NEEDED' => 'D',
436 'SCOPE' => [
437 'im',
438 ],
439 'DESCRIPTION_SCOPE' => [
440 'DESCRIPTION.MESSAGE_CODE' => 'REST_INTEGRATION_PATTERNS_7_DESCRIPTION_SCOPE_DESCRIPTION',
441 ],
442 ],
443 ],
444 'blogpost-add' => [
445 'CODE' => 'blogpost-add',
446 'ELEMENT_CODE' => 'blogpost-add',
447 'TITLE.MESSAGE_CODE' => 'REST_INTEGRATION_PATTERNS_8_TITLE',
448 'ACTIVE' => 'Y',
449 'DESCRIPTION.MESSAGE_CODE' => 'REST_INTEGRATION_PATTERNS_8_DESCRIPTION',
450 'SECTION_CODE' => 'auto-control',
451 'ICON_CLASS' => 'rest-integration-tile-img-hidden',
452 'OPTIONS' => [
453 'QUERY' => [
454 [
455 'ITEMS_TITLE.MESSAGE_CODE' => 'REST_INTEGRATION_PATTERNS_8_INCOMING_QUERY_TITLE',
456 'CODE' => 'params',
457 'METHOD' => 'log.blogpost.add',
458 'METHOD_DOWNLOAD_EXAMPLE_TYPE' => 'query',
459 'QUERY_INFORMATION_URL.MESSAGE_CODE' => 'REST_INTEGRATION_PATTERNS_8_INCOMING_QUERY_INFORMATION_URL',
460 'DESCRIPTION_METHOD' => [
461 'DESCRIPTION.MESSAGE_CODE' => 'REST_INTEGRATION_PATTERNS_8_DESCRIPTION_METHOD_DESCRIPTION',
462 ],
463 'ITEMS' => [
464 [
465 'title' => 'POST_TITLE',
466 'value.MESSAGE_CODE' => 'REST_INTEGRATION_PATTERNS_8_INCOMING_QUERY_ITEMS_VALUE_0',
467 ],
468 [
469 'title' => 'POST_MESSAGE',
470 'value.MESSAGE_CODE' => 'REST_INTEGRATION_PATTERNS_8_INCOMING_QUERY_ITEMS_VALUE_1',
471 ],
472 [
473 'title' => 'DEST',
474 'value' => 'UA',
475 ],
476 ],
477 'QUERY_INFORMATION_URL' => 'https://dev.1c-bitrix.ru/rest_help/log/log_blogpost_add.php',
478 ],
479 ],
480 'OUTGOING_NEEDED' => 'D',
481 'WIDGET_NEEDED' => 'D',
482 'BOT_NEEDED' => 'D',
483 'APPLICATION_NEEDED' => 'D',
484 'SCOPE' => [
485 'log',
486 ],
487 'DESCRIPTION_SCOPE' => [
488 'DESCRIPTION.MESSAGE_CODE' => 'REST_INTEGRATION_PATTERNS_8_DESCRIPTION_SCOPE_DESCRIPTION',
489 ],
490 ],
491 ],
492 'deal-change-status' => [
493 'CODE' => 'deal-change-status',
494 'ELEMENT_CODE' => 'deal-change-status',
495 'TITLE.MESSAGE_CODE' => 'REST_INTEGRATION_PATTERNS_9_TITLE',
496 'ACTIVE' => 'Y',
497 'DESCRIPTION.MESSAGE_CODE' => 'REST_INTEGRATION_PATTERNS_9_DESCRIPTION',
498 'SECTION_CODE' => 'auto-sales',
499 'ICON_CLASS' => 'rest-integration-tile-img-hidden',
500 'OPTIONS' => [
501 'QUERY' => [
502 [
503 'ITEMS_TITLE.MESSAGE_CODE' => 'REST_INTEGRATION_PATTERNS_9_INCOMING_QUERY_TITLE',
504 'CODE' => 'params',
505 'METHOD' => 'crm.deal.update',
506 'METHOD_DOWNLOAD_EXAMPLE_TYPE' => 'query',
507 'QUERY_INFORMATION_URL.MESSAGE_CODE' => 'REST_INTEGRATION_PATTERNS_9_INCOMING_QUERY_INFORMATION_URL',
508 'DESCRIPTION_METHOD' => [
509 'DESCRIPTION.MESSAGE_CODE' => 'REST_INTEGRATION_PATTERNS_9_DESCRIPTION_METHOD_DESCRIPTION',
510 ],
511 'ITEMS' => [
512 [
513 'title' => 'ID',
514 'value' => '42',
515 ],
516 [
517 'title' => 'FIELDS[STAGE_ID]',
518 'value' => 'WON',
519 ],
520 [
521 'title' => 'FIELDS[CLOSED]',
522 'value' => '1',
523 ],
524 ],
525 'QUERY_INFORMATION_URL' => 'https://dev.1c-bitrix.ru/rest_help/crm/cdeals/crm_deal_update.php',
526 ],
527 ],
528 'OUTGOING_NEEDED' => 'D',
529 'WIDGET_NEEDED' => 'D',
530 'BOT_NEEDED' => 'D',
531 'APPLICATION_NEEDED' => 'D',
532 'SCOPE' => [
533 'crm',
534 ],
535 'DESCRIPTION_SCOPE' => [
536 'DESCRIPTION.MESSAGE_CODE' => 'REST_INTEGRATION_PATTERNS_9_DESCRIPTION_SCOPE_DESCRIPTION',
537 ],
538 ],
539 ],
540 'tasks-task-get' => [
541 'CODE' => 'tasks-task-get',
542 'ELEMENT_CODE' => 'tasks-task-get',
543 'TITLE.MESSAGE_CODE' => 'REST_INTEGRATION_PATTERNS_11_TITLE',
544 'ACTIVE' => 'N',
545 'DESCRIPTION.MESSAGE_CODE' => 'REST_INTEGRATION_PATTERNS_11_DESCRIPTION',
546 'SECTION_CODE' => 'auto-control',
547 'ICON_CLASS' => 'rest-integration-tile-img-hidden',
548 'OPTIONS' => [
549 'QUERY' => [
550 [
551 'ITEMS_TITLE.MESSAGE_CODE' => 'REST_INTEGRATION_PATTERNS_11_INCOMING_QUERY_TITLE',
552 'CODE' => 'params',
553 'METHOD' => 'tasks.task.get',
554 'METHOD_DOWNLOAD_EXAMPLE_TYPE' => 'query',
555 'QUERY_INFORMATION_URL.MESSAGE_CODE' => 'REST_INTEGRATION_PATTERNS_11_INCOMING_QUERY_INFORMATION_URL',
556 'DESCRIPTION_METHOD' => [
557 'DESCRIPTION.MESSAGE_CODE' => 'REST_INTEGRATION_PATTERNS_11_DESCRIPTION_METHOD_DESCRIPTION',
558 ],
559 'ITEMS' => [
560 [
561 'title' => 'taskId',
562 'value' => '42',
563 ],
564 ],
565 'QUERY_INFORMATION_URL' => 'https://dev.1c-bitrix.ru/rest_help/tasks/task/tasks/tasks_task_get.php',
566 ],
567 ],
568 'OUTGOING_NEEDED' => 'Y',
569 'OUTGOING_EVENTS' => [
570 'ONTASKUPDATE',
571 ],
572 'WIDGET_NEEDED' => 'N',
573 'WIDGET_DOWNLOAD_EXAMPLE' => '',
574 'BOT_NEEDED' => 'D',
575 'APPLICATION_NEEDED' => 'D',
576 'SCOPE' => [
577 'task',
578 ],
579 'DESCRIPTION_OUTGOING' => [
580 'DESCRIPTION.MESSAGE_CODE' => 'REST_INTEGRATION_PATTERNS_11_DESCRIPTION_OUTGOING_DESCRIPTION',
581 ],
582 'DESCRIPTION_WIDGET' => [],
583 'DESCRIPTION_SCOPE' => [
584 'DESCRIPTION.MESSAGE_CODE' => 'REST_INTEGRATION_PATTERNS_11_DESCRIPTION_SCOPE_DESCRIPTION',
585 ],
586 ],
587 ],
588 'widget-contact-detail-tab' => [
589 'CODE' => 'widget-contact-detail-tab',
590 'ELEMENT_CODE' => 'widget-contact-detail-tab',
591 'TITLE.MESSAGE_CODE' => 'REST_INTEGRATION_PATTERNS_12_TITLE',
592 'ACTIVE' => 'Y',
593 'DESCRIPTION.MESSAGE_CODE' => 'REST_INTEGRATION_PATTERNS_12_DESCRIPTION',
594 'SECTION_CODE' => 'widget',
595 'ICON_CLASS' => 'rest-integration-tile-img-hidden',
596 'OPTIONS' => [
597 'QUERY' => [
598 [
599 'ITEMS_TITLE.MESSAGE_CODE' => 'REST_INTEGRATION_PATTERNS_12_INCOMING_QUERY_TITLE',
600 'CODE' => 'params',
601 'METHOD' => 'crm.contact.get',
602 'METHOD_DOWNLOAD_EXAMPLE_TYPE' => 'query',
603 'QUERY_INFORMATION_URL.MESSAGE_CODE' => 'REST_INTEGRATION_PATTERNS_12_INCOMING_QUERY_INFORMATION_URL',
604 'DESCRIPTION_METHOD' => [
605 'DESCRIPTION.MESSAGE_CODE' => 'REST_INTEGRATION_PATTERNS_12_DESCRIPTION_METHOD_DESCRIPTION',
606 ],
607 'ITEMS' => [
608 [
609 'title' => 'ID',
610 'value' => '42',
611 ],
612 ],
613 'QUERY_INFORMATION_URL' => 'https://dev.1c-bitrix.ru/rest_help/crm/contacts/crm_contact_get.php',
614 ],
615 ],
616 'OUTGOING_NEEDED' => 'D',
617 'WIDGET_NEEDED' => 'Y',
618 'WIDGET_LIST' => [
619 'CRM_CONTACT_DETAIL_TAB',
620 ],
621 'WIDGET_DOWNLOAD_EXAMPLE' => '',
622 'BOT_NEEDED' => 'D',
623 'APPLICATION_NEEDED' => 'D',
624 'SCOPE' => [
625 'crm',
626 'placement',
627 ],
628 'DESCRIPTION_WIDGET' => [
629 'DESCRIPTION.MESSAGE_CODE' => 'REST_INTEGRATION_PATTERNS_12_DESCRIPTION_WIDGET_DESCRIPTION',
630 ],
631 'DESCRIPTION_SCOPE' => [
632 'DESCRIPTION.MESSAGE_CODE' => 'REST_INTEGRATION_PATTERNS_12_DESCRIPTION_SCOPE_DESCRIPTION',
633 ],
634 ],
635 ],
636 'widget-contact-detail-activity' => [
637 'CODE' => 'widget-contact-detail-activity',
638 'ELEMENT_CODE' => 'widget-contact-detail-activity',
639 'TITLE.MESSAGE_CODE' => 'REST_INTEGRATION_PATTERNS_13_TITLE',
640 'ACTIVE' => 'Y',
641 'DESCRIPTION.MESSAGE_CODE' => 'REST_INTEGRATION_PATTERNS_13_DESCRIPTION',
642 'SECTION_CODE' => 'widget',
643 'ICON_CLASS' => 'rest-integration-tile-img-hidden',
644 'OPTIONS' => [
645 'QUERY' => [
646 [
647 'ITEMS_TITLE.MESSAGE_CODE' => 'REST_INTEGRATION_PATTERNS_13_INCOMING_QUERY_TITLE',
648 'CODE' => 'params',
649 'METHOD' => 'crm.contact.update',
650 'METHOD_DOWNLOAD_EXAMPLE_TYPE' => 'query',
651 'QUERY_INFORMATION_URL.MESSAGE_CODE' => 'REST_INTEGRATION_PATTERNS_13_INCOMING_QUERY_INFORMATION_URL',
652 'DESCRIPTION_METHOD' => [
653 'DESCRIPTION.MESSAGE_CODE' => 'REST_INTEGRATION_PATTERNS_13_DESCRIPTION_METHOD_DESCRIPTION',
654 ],
655 'ITEMS' => [
656 [
657 'title' => 'ID',
658 'value' => '42',
659 ],
660 ],
661 'QUERY_INFORMATION_URL' => 'https://dev.1c-bitrix.ru/rest_help/crm/contacts/crm_contact_get.php',
662 ],
663 ],
664 'WIDGET_LIST' => [
665 'CRM_CONTACT_DETAIL_TAB',
666 ],
667 'OUTGOING_NEEDED' => 'D',
668 'WIDGET_NEEDED' => 'Y',
669 'WIDGET_DOWNLOAD_EXAMPLE' => '',
670 'BOT_NEEDED' => 'D',
671 'APPLICATION_NEEDED' => 'D',
672 'SCOPE' => [
673 'crm',
674 'placement',
675 ],
676 'DESCRIPTION_WIDGET' => [
677 'DESCRIPTION.MESSAGE_CODE' => 'REST_INTEGRATION_PATTERNS_13_DESCRIPTION_WIDGET_DESCRIPTION',
678 ],
679 'DESCRIPTION_SCOPE' => [
680 'DESCRIPTION.MESSAGE_CODE' => 'REST_INTEGRATION_PATTERNS_13_DESCRIPTION_SCOPE_DESCRIPTION',
681 ],
682 ],
683 ],
684 'widget-call-cart' => [
685 'CODE' => 'widget-call-cart',
686 'ELEMENT_CODE' => 'widget-call-cart',
687 'TITLE.MESSAGE_CODE' => 'REST_INTEGRATION_PATTERNS_14_TITLE',
688 'ACTIVE' => 'Y',
689 'DESCRIPTION.MESSAGE_CODE' => 'REST_INTEGRATION_PATTERNS_14_DESCRIPTION',
690 'SECTION_CODE' => 'widget',
691 'ICON_CLASS' => 'rest-integration-tile-img-hidden',
692 'OPTIONS' => [
693 'QUERY' => [
694 [
695 'ITEMS_TITLE.MESSAGE_CODE' => 'REST_INTEGRATION_PATTERNS_14_INCOMING_QUERY_TITLE',
696 'CODE' => 'params',
697 'METHOD' => 'crm.lead.get',
698 'METHOD_DOWNLOAD_EXAMPLE_TYPE' => 'query',
699 'QUERY_INFORMATION_URL.MESSAGE_CODE' => 'REST_INTEGRATION_PATTERNS_14_INCOMING_QUERY_INFORMATION_URL',
700 'DESCRIPTION_METHOD' => [
701 'DESCRIPTION.MESSAGE_CODE' => 'REST_INTEGRATION_PATTERNS_14_DESCRIPTION_METHOD_DESCRIPTION',
702 ],
703 'ITEMS' => [
704 [
705 'title' => 'ID',
706 'value' => '42',
707 ],
708 ],
709 'QUERY_INFORMATION_URL' => 'https://dev.1c-bitrix.ru/rest_help/crm/leads/crm_lead_get.php',
710 ],
711 ],
712 'OUTGOING_NEEDED' => 'D',
713 'WIDGET_NEEDED' => 'Y',
714 'WIDGET_LIST' => [
715 'CALL_CARD',
716 ],
717 'WIDGET_DOWNLOAD_EXAMPLE' => '',
718 'BOT_NEEDED' => 'D',
719 'APPLICATION_NEEDED' => 'D',
720 'SCOPE' => [
721 'crm',
722 'telephony',
723 'placement',
724 ],
725 'DESCRIPTION_WIDGET' => [
726 'DESCRIPTION.MESSAGE_CODE' => 'REST_INTEGRATION_PATTERNS_14_DESCRIPTION_WIDGET_DESCRIPTION',
727 ],
728 'DESCRIPTION_SCOPE' => [
729 'DESCRIPTION.MESSAGE_CODE' => 'REST_INTEGRATION_PATTERNS_14_DESCRIPTION_SCOPE_DESCRIPTION',
730 ],
731 ],
732 ],
733 'creat-invoice-by-tasks-time' => [
734 'CODE' => 'creat-invoice-by-tasks-time',
735 'ELEMENT_CODE' => 'creat-invoice-by-tasks-time',
736 'TITLE.MESSAGE_CODE' => 'REST_INTEGRATION_PATTERNS_15_TITLE',
737 'ACTIVE' => 'Y',
738 'DESCRIPTION.MESSAGE_CODE' => 'REST_INTEGRATION_PATTERNS_15_DESCRIPTION',
739 'SECTION_CODE' => 'widget',
740 'ICON_CLASS' => 'rest-integration-tile-img-hidden',
741 'OPTIONS' => [
742 'QUERY' => [
743 [
744 'ITEMS_TITLE.MESSAGE_CODE' => 'REST_INTEGRATION_PATTERNS_15_INCOMING_QUERY_TITLE',
745 'DESCRIPTION_METHOD' => [
746 'DESCRIPTION.MESSAGE_CODE' => 'REST_INTEGRATION_PATTERNS_15_DESCRIPTION_METHOD_DESCRIPTION',
747 ],
748 'CODE' => 'params',
749 'METHOD' => 'task.elapseditem.getlist',
750 'METHOD_DOWNLOAD_EXAMPLE_TYPE' => 'query',
751 'QUERY_INFORMATION_URL.MESSAGE_CODE' => 'REST_INTEGRATION_PATTERNS_15_INCOMING_QUERY_INFORMATION_URL',
752 'ITEMS' => [
753 [
754 'title' => 'FIELDS[TITLE]',
755 ],
756 ],
757 'QUERY_INFORMATION_URL' => 'https://dev.1c-bitrix.ru/rest_help/tasks/task/elapseditem/getlist.php',
758 ],
759 ],
760 'OUTGOING_NEEDED' => 'Y',
761 'OUTGOING_EVENTS' => [],
762 'WIDGET_LIST' => [
763 'CRM_TASK_DETAIL',
764 ],
765 'WIDGET_NEEDED' => 'N',
766 'WIDGET_DOWNLOAD_EXAMPLE' => '',
767 'BOT_NEEDED' => 'D',
768 'APPLICATION_NEEDED' => 'D',
769 'SCOPE' => [
770 'crm',
771 'task',
772 ],
773 'DESCRIPTION_OUTGOING' => [],
774 'DESCRIPTION_WIDGET' => [
775 'DESCRIPTION.MESSAGE_CODE' => 'REST_INTEGRATION_PATTERNS_15_DESCRIPTION_WIDGET_DESCRIPTION',
776 ],
777 'DESCRIPTION_SCOPE' => [
778 'DESCRIPTION.MESSAGE_CODE' => 'REST_INTEGRATION_PATTERNS_15_DESCRIPTION_SCOPE_DESCRIPTION',
779 ],
780 ],
781 ],
782 'custom-widget' => [
783 'CODE' => 'custom-widget',
784 'ELEMENT_CODE' => 'custom-widget',
785 'TITLE.MESSAGE_CODE' => 'REST_INTEGRATION_PATTERNS_17_TITLE',
786 'ACTIVE' => 'Y',
787 'DESCRIPTION.MESSAGE_CODE' => 'REST_INTEGRATION_PATTERNS_17_DESCRIPTION',
788 'SECTION_CODE' => 'migration',
789 'ICON_CLASS' => 'rest-integration-tile-img-hidden',
790 'OPTIONS' => [
791 'QUERY' => [
792 [
793 'METHOD' => 'crm.lead.get',
794 'METHOD_DOWNLOAD_EXAMPLE_TYPE' => 'query',
795 'QUERY_INFORMATION_URL.MESSAGE_CODE' => 'REST_INTEGRATION_PATTERNS_17_INCOMING_QUERY_INFORMATION_URL',
796 'DESCRIPTION_METHOD' => [],
797 'ITEMS_TITLE.MESSAGE_CODE' => 'REST_INTEGRATION_PATTERNS_17_INCOMING_QUERY_TITLE',
798 'CODE' => 'params',
799 'ITEMS' => [
800 [
801 'title' => 'ID',
802 'value' => '42',
803 ],
804 ],
805 'QUERY_INFORMATION_URL' => 'https://dev.1c-bitrix.ru/rest_help/crm/leads/crm_lead_get.php',
806 ],
807 ],
808 'OUTGOING_NEEDED' => 'D',
809 'WIDGET_NEEDED' => 'Y',
810 'OUTGOING_EVENTS' => [
811 'ONCRMLEADADD',
812 ],
813 'WIDGET_DOWNLOAD_EXAMPLE' => '',
814 'BOT_NEEDED' => 'D',
815 'APPLICATION_NEEDED' => 'D',
816 'SCOPE' => [
817 'crm',
818 'task',
819 ],
820 'DESCRIPTION_WIDGET' => [],
821 'DESCRIPTION_SCOPE' => [],
822 ],
823 ],
824 'bot-notify-staff' => [
825 'CODE' => 'bot-notify-staff',
826 'ELEMENT_CODE' => 'bot-notify-staff',
827 'TITLE.MESSAGE_CODE' => 'REST_INTEGRATION_PATTERNS_18_TITLE',
828 'ACTIVE' => 'Y',
829 'DESCRIPTION.MESSAGE_CODE' => 'REST_INTEGRATION_PATTERNS_18_DESCRIPTION',
830 'SECTION_CODE' => 'chat-bot',
831 'ICON_CLASS' => 'rest-integration-tile-img-hidden',
832 'OPTIONS' => [
833 'QUERY' => [
834 [
835 'ITEMS_TITLE.MESSAGE_CODE' => 'REST_INTEGRATION_PATTERNS_18_INCOMING_QUERY_TITLE',
836 'CODE' => 'params',
837 'METHOD' => 'imbot.message.add',
838 'METHOD_DOWNLOAD_EXAMPLE_TYPE' => 'query',
839 'DESCRIPTION_METHOD' => [],
840 'ITEMS' => [
841 [
842 'title' => 'BOT_ID',
843 'value' => '',
844 ],
845 [
846 'title' => 'CLIENT_ID',
847 'value' => '',
848 ],
849 [
850 'title' => 'DIALOG_ID',
851 'value' => '1',
852 ],
853 [
854 'title' => 'MESSAGE',
855 'value.MESSAGE_CODE' => 'REST_INTEGRATION_PATTERNS_18_INCOMING_QUERY_ITEMS_VALUE_0',
856 ],
857 ],
858 ],
859 ],
860 'OUTGOING_NEEDED' => 'D',
861 'WIDGET_NEEDED' => 'D',
862 'BOT_NEEDED' => 'Y',
863 'APPLICATION_NEEDED' => 'D',
864 'SCOPE' => [
865 'imbot',
866 ],
867 'DESCRIPTION_OUTGOING' => [],
868 'DESCRIPTION_WIDGET' => [],
869 'DESCRIPTION_SCOPE' => [],
870 ],
871 ],
872 'lead-add' => [
873 'CODE' => 'lead-add',
874 'SECTION_CODE' => 'external',
875 'ELEMENT_CODE' => 'lead-add',
876 'TITLE.MESSAGE_CODE' => 'REST_INTEGRATION_PATTERNS_1_TITLE',
877 'ACTIVE' => 'Y',
878 'DESCRIPTION.MESSAGE_CODE' => 'REST_INTEGRATION_PATTERNS_1_DESCRIPTION',
879 'ICON_CLASS' => 'rest-integration-tile-img-hidden',
880 'ADMIN_ONLY' => 'Y',
881 'OPTIONS' => [
882 'QUERY' => [
883 [
884 'CODE' => 'params',
885 'ITEMS_TITLE.MESSAGE_CODE' => 'REST_INTEGRATION_PATTERNS_1_INCOMING_QUERY_TITLE',
886 'METHOD' => 'crm.lead.add',
887 'METHOD_DOWNLOAD_EXAMPLE_TYPE' => 'query',
888 'QUERY_INFORMATION_URL.MESSAGE_CODE' => 'REST_INTEGRATION_PATTERNS_1_INCOMING_QUERY_INFORMATION_URL',
889 'ITEMS' => [
890 [
891 'title' => 'FIELDS[TITLE]',
892 'value.MESSAGE_CODE' => 'REST_INTEGRATION_PATTERNS_1_INCOMING_QUERY_ITEMS_VALUE_0',
893 ],
894 [
895 'title' => 'FIELDS[NAME]',
896 'value.MESSAGE_CODE' => 'REST_INTEGRATION_PATTERNS_1_INCOMING_QUERY_ITEMS_VALUE_1',
897 ],
898 [
899 'title' => 'FIELDS[LAST_NAME]',
900 'value.MESSAGE_CODE' => 'REST_INTEGRATION_PATTERNS_1_INCOMING_QUERY_ITEMS_VALUE_2',
901 ],
902 [
903 'title' => 'FIELDS[EMAIL][0][VALUE]',
904 'value.MESSAGE_CODE' => 'REST_INTEGRATION_PATTERNS_1_INCOMING_QUERY_ITEMS_VALUE_3',
905 'value' => 'mail@example.com',
906 ],
907 [
908 'title' => 'FIELDS[EMAIL][0][VALUE_TYPE]',
909 'value' => 'WORK',
910 ],
911 [
912 'title' => 'FIELDS[PHONE][0][VALUE]',
913 'value.MESSAGE_CODE' => 'REST_INTEGRATION_PATTERNS_1_INCOMING_QUERY_ITEMS_VALUE_4',
914 'value' => '555888',
915 ],
916 [
917 'title' => 'FIELDS[PHONE][0][VALUE_TYPE]',
918 'value' => 'WORK',
919 ],
920 ],
921 'QUERY_INFORMATION_URL' => 'https://dev.1c-bitrix.ru/rest_help/crm/leads/crm_lead_add.php',
922 ],
923 ],
924 'OUTGOING_NEEDED' => 'D',
925 'WIDGET_NEEDED' => 'D',
926 'BOT_NEEDED' => 'D',
927 'APPLICATION_NEEDED' => 'D',
928 'SCOPE' => [
929 'crm',
930 ],
931 'DESCRIPTION_SCOPE' => [
932 'DESCRIPTION.MESSAGE_CODE' => 'REST_INTEGRATION_PATTERNS_1_DESCRIPTION_SCOPE_DESCRIPTION',
933 ],
934 ],
935 ],
936 'bot-action-chat' => [
937 'CODE' => 'bot-action-chat',
938 'ELEMENT_CODE' => 'bot-action-chat',
939 'TITLE.MESSAGE_CODE' => 'REST_INTEGRATION_PATTERNS_19_TITLE',
940 'ACTIVE' => 'Y',
941 'DESCRIPTION.MESSAGE_CODE' => 'REST_INTEGRATION_PATTERNS_19_DESCRIPTION',
942 'SECTION_CODE' => 'chat-bot',
943 'ICON_CLASS' => 'rest-integration-tile-img-hidden',
944 'OPTIONS' => [
945 'QUERY' => [
946 [
947 'ITEMS_TITLE.MESSAGE_CODE' => 'REST_INTEGRATION_PATTERNS_19_INCOMING_QUERY_TITLE',
948 'CODE' => 'params',
949 'METHOD' => 'crm.lead.add',
950 'METHOD_DOWNLOAD_EXAMPLE_TYPE' => 'query',
951 'DESCRIPTION_METHOD' => [
952 'TITLE.MESSAGE_CODE' => 'REST_INTEGRATION_PATTERNS_19_TITLE',
953 ],
954 'ITEMS' => [
955 [
956 'title' => 'BOT_ID',
957 'value' => '',
958 ],
959 [
960 'title' => 'CLIENT_ID',
961 'value' => '',
962 ],
963 [
964 'title' => 'DIALOG_ID',
965 'value' => 'chat1',
966 ],
967 [
968 'title' => 'FIELDS[TITLE]',
969 'value.MESSAGE_CODE' => 'REST_INTEGRATION_PATTERNS_19_INCOMING_QUERY_ITEMS_VALUE_0',
970 ],
971 ],
972 ],
973 ],
974 'OUTGOING_NEEDED' => 'Y',
975 'OUTGOING_EVENTS' => [
976 'ONCRMLEADADD',
977 'ONCRMINVOICEDELETE',
978 ],
979 'WIDGET_NEEDED' => 'N',
980 'WIDGET_DOWNLOAD_EXAMPLE' => '',
981 'BOT_NEEDED' => 'Y',
982 'APPLICATION_NEEDED' => 'D',
983 'SCOPE' => [
984 'crm',
985 'task',
986 ],
987 'DESCRIPTION_OUTGOING' => [],
988 'DESCRIPTION_WIDGET' => [],
989 'DESCRIPTION_SCOPE' => [],
990 ],
991 ],
992 ];
993 public const DEFAULT_APPLICATION = 'application';
994 public const DEFAULT_IN_WEBHOOK = 'in-hook';
995 public const DEFAULT_OUT_WEBHOOK = 'out-hook';
996
1003 public static function get($code) : array
1004 {
1005 $result = [];
1006 $cache = Cache::createInstance();
1007 if ($cache->initCache(static::CACHE_TIME, 'item_' . $code . LANGUAGE_ID, static::CACHE_DIR))
1008 {
1009 $result = $cache->getVars();
1010 }
1011 elseif ($cache->startDataCache())
1012 {
1013 $remoteDictionary = new Integration();
1014 $dictionary = $remoteDictionary->toArray();
1015 if (!empty($dictionary))
1016 {
1017 $dictionaryCode = array_column($dictionary, 'code');
1018 $key = array_search($code, $dictionaryCode, true);
1019 if ($key !== false)
1020 {
1021 $el = $dictionary[$key];
1022 if (!empty($el['option']))
1023 {
1024 $data = Json::decode(base64_decode($el['option']));
1025 if (is_array($data))
1026 {
1027 $data = static::changeMessage($data);
1028 $data['CODE'] = $data['ELEMENT_CODE'];
1029 $result = $data;
1030 }
1031 }
1032 }
1033 }
1034 if (empty($result) && !empty(static::DEFAULT_DATA[$code]))
1035 {
1036 $result = static::changeMessage(static::DEFAULT_DATA[$code]);
1037 }
1038
1039 $cache->endDataCache($result);
1040 }
1041
1042 return $result;
1043 }
1044
1051 public static function getList($sectionCode) : array
1052 {
1053 $result = [];
1054 $cache = Cache::createInstance();
1055 if ($cache->initCache(static::CACHE_TIME, 'section_' . $sectionCode . LANGUAGE_ID, static::CACHE_DIR))
1056 {
1057 $result = $cache->getVars();
1058 }
1059 elseif ($cache->startDataCache())
1060 {
1061 $dictionary = new Integration();
1062
1063 foreach ($dictionary as $el)
1064 {
1065 if (!empty($el['option']))
1066 {
1067 $data = Json::decode(base64_decode($el['option']));
1068 if (is_array($data) && $sectionCode === $data['SECTION_CODE'])
1069 {
1070 $data = static::changeMessage($data);
1071 $data['CODE'] = $data['ELEMENT_CODE'];
1072 $result[$data['CODE']] = $data;
1073 }
1074 }
1075 }
1076
1077 if (empty($result))
1078 {
1079 foreach (static::DEFAULT_DATA as $data)
1080 {
1081 if ($sectionCode === $data['SECTION_CODE'])
1082 {
1083 $data = static::changeMessage($data);
1084 $result[$data['CODE']] = $data;
1085 }
1086 }
1087 }
1088
1089 $cache->endDataCache($result);
1090 }
1091
1092 return $result;
1093 }
1094}
static loadMessages($file)
Definition loc.php:64
static getList($sectionCode)
Definition element.php:1051