1C-Bitrix 25.700.0
Загрузка...
Поиск...
Не найдено
report_helper.php
См. документацию.
1<?php
2
3use Bitrix\Crm\Service\Container;
4use Bitrix\Crm\UserField\Types\ElementType;
8
9abstract class CReportHelper
10{
11 const UF_DATETIME_SHORT_POSTFIX = '_DTSHORT';
12 const UF_TEXT_TRIM_POSTFIX = '_TRIMTX';
13 const UF_BOOLEAN_POSTFIX = '_BLINL';
14 const UF_MONEY_NUMBER_POSTFIX = '_MNNUMB_FLTR';
15 const UF_MONEY_CURRENCY_POSTFIX = '_MNCRCY_FLTR';
16
17 protected static $userNameFormat = null;
18
19 protected static $arUFId = null;
20 protected static $ufInfo = null;
21 protected static $ufEnumerations = null;
22 protected static $ufFiles = array();
23 protected static $ufEmployees = array();
24 protected static $ufDiskFiles = array();
25 protected static $ufCrmElements = array();
26 protected static $ufCrmStatuses = array();
27 protected static $ufIblockElements = array();
28 protected static $ufIblockSections = array();
29
30 public static function getEntityName()
31 {
32 throw new \Bitrix\Main\SystemException('Method "getEntityName" must be defined in child class.');
33 }
34
35 public static function getOwnerId()
36 {
37 throw new \Bitrix\Main\SystemException('Method "getOwnerId" must be defined in child class.');
38 }
39
40 public static function getColumnList()
41 {
42 throw new \Bitrix\Main\SystemException('Method "getColumnList" must be defined in child class.');
43 }
44
45 public static function getAlternatePhrasesOfColumns()
46 {
47 return [];
48 }
49
50 public static function getDefaultColumns()
51 {
52 throw new \Bitrix\Main\SystemException('Method "getDefaultColumns" must be defined in child class.');
53 }
54
55 public static function getPeriodFilter($date_from, $date_to)
56 {
57 throw new \Bitrix\Main\SystemException('Method "getPeriodFilter" must be defined in child class.');
58 }
59
60 protected static function prepareUFInfo()
61 {
62 if (!is_array(self::$arUFId) || count(self::$arUFId) <= 0 || is_array(self::$ufInfo))
63 return;
64
65 self::$arUFId = array();
66 self::$ufInfo = array();
67 self::$ufEnumerations = array();
68 }
69
70 public static function &getUFInfo()
71 {
72 static::prepareUFInfo();
73
74 return self::$ufInfo;
75 }
76
77 protected static function prepareUFEnumerations($usedUFMap = null)
78 {
79 if (!is_array(self::$ufEnumerations))
80 {
81 self::$ufEnumerations = array();
82 }
83 }
84
85 public static function &getUFEnumerations($usedUFMap = null)
86 {
87 static::prepareUFEnumerations($usedUFMap);
88
89 return self::$ufEnumerations;
90 }
91
92 public static function detectUserField($field)
93 {
94 static::prepareUFInfo();
95
96 $arUF = array(
97 'isUF' => false,
98 'ufInfo' => null
99 );
100
101 if ($field instanceof \Bitrix\Main\Entity\ExpressionField && is_array(self::$ufInfo) && count(self::$ufInfo) > 0)
102 {
103 $ufKey = $field->getName();
104 $ufId = $field->getEntity()->getUFId();
105 if (is_string($ufId) && !empty($ufId) && array_key_exists($ufId, self::$ufInfo)
106 && is_array(self::$ufInfo[$ufId])
107 && array_key_exists($ufKey, self::$ufInfo[$ufId]))
108 {
109 $arUF['isUF'] = true;
110 $arUF['ufInfo'] = self::$ufInfo[$ufId][$ufKey];
111 }
112 }
113
114 return $arUF;
115 }
116
117 public static function getUserFieldDataType($arUF)
118 {
119 $result = false;
120
121 if (is_array($arUF) && isset($arUF['isUF']) && $arUF['isUF'] === true && isset($arUF['ufInfo'])
122 && is_array($arUF['ufInfo']) && isset($arUF['ufInfo']['USER_TYPE_ID']))
123 {
124 $result = $arUF['ufInfo']['USER_TYPE_ID'];
125 }
126
127 return $result;
128 }
129
130 public static function getFieldDataType($field)
131 {
132 static::prepareUFInfo();
133
135 $dataType = $field->getDataType();
136
137 // until the date type is not supported
138 if ($dataType === 'date')
139 $dataType = 'datetime';
140
141 $ufInfo = null;
142 if ($field instanceof Entity\ExpressionField && is_array(self::$ufInfo) && count(self::$ufInfo) > 0)
143 {
144 $ufKey = $field->getName();
145 $ufId = $field->getEntity()->getUFId();
146 if (is_string($ufId) && !empty($ufId) && array_key_exists($ufId, self::$ufInfo)
147 && is_array(self::$ufInfo[$ufId])
148 && array_key_exists($ufKey, self::$ufInfo[$ufId]))
149 {
150 $ufInfo = self::$ufInfo[$ufId][$ufKey];
151 }
152 unset($ufKey);
153 }
154
155 if (is_array($ufInfo) && isset($ufInfo['USER_TYPE_ID']))
156 {
157 switch ($ufInfo['USER_TYPE_ID'])
158 {
159 case 'integer':
160 $dataType = 'integer';
161 break;
162 case 'double':
163 $dataType = 'float';
164 break;
165 case 'boolean':
166 $dataType = 'boolean';
167 break;
168 case 'date':
169 $dataType = 'datetime';
170 break;
171 case 'datetime':
172 $dataType = 'datetime';
173 break;
174 case 'enumeration':
175 $dataType = 'enum';
176 break;
177 case 'employee':
178 $dataType = 'employee';
179 break;
180 case 'file':
181 $dataType = 'file';
182 break;
183 case 'disk_file':
184 $dataType = 'disk_file';
185 break;
186 case 'crm':
187 $dataType = 'crm';
188 break;
189 case 'crm_status':
190 $dataType = 'crm_status';
191 break;
192 case 'iblock_element':
193 $dataType = 'iblock_element';
194 break;
195 case 'iblock_section':
196 $dataType = 'iblock_section';
197 break;
198 case 'money':
199 $dataType = 'money';
200 break;
201 }
202 }
203
204 return $dataType;
205 }
206
207 public static function getUserFieldEnumerationValue($valueKey, $ufInfo)
208 {
209 $value = '';
210 $ufId = isset($ufInfo['ENTITY_ID']) ? strval($ufInfo['ENTITY_ID']) : '';
211 $ufName = isset($ufInfo['FIELD_NAME']) ? strval($ufInfo['FIELD_NAME']) : '';
212
213 if (!empty($ufId) && !empty($ufName))
214 {
215 if (!is_array(self::$ufEnumerations) || !isset(self::$ufEnumerations[$ufId][$ufName]))
216 {
217 static::prepareUFEnumerations(array($ufId => array($ufName => true)));
218 }
219
220 if (is_array(self::$ufEnumerations) && isset(self::$ufEnumerations[$ufId][$ufName][$valueKey]['VALUE']))
221 $value = self::$ufEnumerations[$ufId][$ufName][$valueKey]['VALUE'];
222 }
223
224 return $value;
225 }
226
227 public static function getUserFieldFileValue($valueKey, $ufInfo)
228 {
229 $valueKey = intval($valueKey);
230 $value = '';
231
232 if ($valueKey > 0)
233 {
234 if (is_array(self::$ufFiles) && is_array(self::$ufFiles[$valueKey]))
235 {
236 $arFile = self::$ufFiles[$valueKey];
237 $file = new CFile();
238 $value = htmlspecialcharsbx($arFile['ORIGINAL_NAME'].' ('.$file->FormatSize($arFile['FILE_SIZE']).')');
239 }
240 else
241 {
242 $value = htmlspecialcharsbx(GetMessage('REPORT_FILE_NOT_FOUND'));
243 }
244 }
245
246 return $value;
247 }
248
249 public static function getUserFieldFileValueForChart($valueKey, $ufInfo)
250 {
251 $valueKey = intval($valueKey);
252 $value = '';
253
254 if ($valueKey > 0)
255 {
256 if (is_array(self::$ufFiles) && is_array(self::$ufFiles[$valueKey]))
257 {
258 $arFile = self::$ufFiles[$valueKey];
259 $value = htmlspecialcharsbx($arFile['ORIGINAL_NAME']);
260 }
261 else
262 {
263 $value = htmlspecialcharsbx(GetMessage('REPORT_FILE_NOT_FOUND'));
264 }
265 }
266
267 return $value;
268 }
269
270 public static function getUserFieldDiskFileValue($valueKey, $ufInfo)
271 {
272 $valueKey = intval($valueKey);
273 $value = '';
274
275 if ($valueKey > 0)
276 {
277 if (is_array(self::$ufDiskFiles) && is_array(self::$ufDiskFiles[$valueKey]))
278 {
279 $arDiskFile = self::$ufDiskFiles[$valueKey];
280 $src = isset($arDiskFile['DOWNLOAD_URL']) ? strval($arDiskFile['DOWNLOAD_URL']) : '';
281 $file = new CFile();
282 if (!empty($src))
283 {
284 $value = '<a target="_blank" href="'.htmlspecialcharsbx($src).'" title="'.
285 htmlspecialcharsbx($file->FormatSize($arDiskFile['SIZE'])).'">'.
286 htmlspecialcharsbx($arDiskFile['NAME']).'</a>';
287 }
288 else
289 {
290 $value = htmlspecialcharsbx($arDiskFile['NAME'].' ('.$file->FormatSize($arDiskFile['SIZE']).')');
291 }
292 }
293 else
294 {
295 $value = htmlspecialcharsbx(GetMessage('REPORT_FILE_NOT_FOUND'));
296 }
297 }
298
299 return $value;
300 }
301
302 public static function getUserFieldDiskFileValueForChart($valueKey, $ufInfo)
303 {
304 $valueKey = intval($valueKey);
305 $value = '';
306
307 if ($valueKey > 0)
308 {
309 if (is_array(self::$ufDiskFiles) && is_array(self::$ufDiskFiles[$valueKey]))
310 {
311 $arFile = self::$ufDiskFiles[$valueKey];
312 $value = htmlspecialcharsbx($arFile['NAME']);
313 }
314 else
315 {
316 $value = htmlspecialcharsbx(GetMessage('REPORT_FILE_NOT_FOUND'));
317 }
318 }
319
320 return $value;
321 }
322
323 public static function getUserFieldEmployeeValue($valueKey, $ufInfo)
324 {
325 $valueKey = intval($valueKey);
326 $value = '';
327
328 if ($valueKey > 0)
329 {
330 if (is_array(self::$ufEmployees) && is_array(self::$ufEmployees[$valueKey]))
331 {
332 $employeeName = CUser::FormatName(self::getUserNameFormat(), self::$ufEmployees[$valueKey], true);
333 if (!empty($employeeName))
334 {
335 $employeeLink = str_replace(
336 array('#ID#', '#USER_ID#'),
337 urlencode($valueKey),
338 COption::GetOptionString('intranet', 'path_user', '/company/personal/user/#USER_ID#/')
339 );
340 if (empty($employeeLink))
341 $value = $employeeName;
342 else
343 $value = '<a href="'.$employeeLink.'">'.$employeeName.'</a>';
344 }
345 }
346 else
347 {
348 $value = htmlspecialcharsbx(GetMessage('REPORT_USER_NOT_FOUND'));
349 }
350 }
351
352 return $value;
353 }
354
355 public static function getUserFieldEmployeeValueForChart($valueKey, $ufInfo)
356 {
357 $valueKey = intval($valueKey);
358 $value = '';
359
360 if ($valueKey > 0)
361 {
362 if (is_array(self::$ufEmployees) && is_array(self::$ufEmployees[$valueKey]))
363 {
364 $employeeName = CUser::FormatName(self::getUserNameFormat(), self::$ufEmployees[$valueKey], true);
365 if (!empty($employeeName))
366 $value = $employeeName;
367 }
368 else
369 {
370 $value = htmlspecialcharsbx(GetMessage('REPORT_USER_NOT_FOUND'));
371 }
372 }
373
374 return $value;
375 }
376
377 public static function getUserFieldCrmTypePrefixMap(): array
378 {
379 $result = [];
380
381 if (Loader::includeModule('crm'))
382 {
383 $userPermissions = Container::getInstance()->getUserPermissions();
384 foreach (array_keys(ElementType::getPossibleEntityTypes()) as $entityTypeName)
385 {
386 $entityTypeNameLower = mb_strtolower($entityTypeName);
387 $entityTypeId = CCrmOwnerType::ResolveID($entityTypeName);
388 if (
389 $entityTypeId !== CCrmOwnerType::Undefined
390 && $userPermissions->entityType()->canReadItems($entityTypeId)
391 )
392 {
393 $result[$entityTypeNameLower] =
394 CCrmOwnerTypeAbbr::ResolveByTypeName($entityTypeName)
395 ;
396 }
397 }
398 }
399
400 return $result;
401 }
402
403 public static function getUserFieldCrmValue($valueKey, $ufInfo)
404 {
405 $valueKey = trim(strval($valueKey));
406 $value = '';
407
408 if ($valueKey <> '')
409 {
410 $prefixByType = static::getUserFieldCrmTypePrefixMap();
411
412 $maxPrefixLength = 3; // 'SSI'
413 $singleTypePrefix = '';
414 if (is_array($ufInfo['SETTINGS']))
415 {
416 $supportedTypes = array();
417 foreach ($ufInfo['SETTINGS'] as $type => $supported)
418 {
419 if ($supported === 'Y')
420 $supportedTypes[$type] = true;
421 }
422 $supportedTypes = array_keys($supportedTypes);
423 if (count($supportedTypes) === 1)
424 {
425 if (isset($prefixByType[mb_strtolower($supportedTypes[0])]))
426 $singleTypePrefix = $prefixByType[mb_strtolower($supportedTypes[0])];
427 }
428 unset($supportedTypes, $type, $supported);
429 }
430
431 $prefix = '';
432 if (($pos = mb_strpos(mb_substr($valueKey, 0, $maxPrefixLength + 1), '_')) !== false && $pos > 0)
433 $prefix = mb_substr($valueKey, 0, $pos);
434 if (empty($prefix))
435 $valueKey = $singleTypePrefix . '_' . $valueKey;
436 unset($prefix, $pos);
437
438 if (is_array(self::$ufCrmElements) && is_array(self::$ufCrmElements[$valueKey]))
439 {
440 $element = self::$ufCrmElements[$valueKey];
441 $item = explode('_', $valueKey);
442 if ($item[0] !== '' && $item[1] !== '')
443 {
444 $entityTitle = $element['title'];
445 $entityUrl = $element['url'];
446 if ($entityTitle !== '')
447 {
448 if ($entityUrl !== '')
449 {
450 $value =
451 '<a target="_blank" href="' . $entityUrl . '">'
452 . htmlspecialcharsbx($entityTitle) .'</a>'
453 ;
454 }
455 else
456 {
457 $value = htmlspecialcharsbx($entityTitle);
458 }
459 }
460 }
461 }
462 }
463
464 return $value;
465 }
466
467 public static function getUserFieldCrmValueForChart($valueKey, $ufInfo)
468 {
469 $valueKey = trim(strval($valueKey));
470 $value = '';
471
472 if ($valueKey <> '')
473 {
474 $prefixByType = static::getUserFieldCrmTypePrefixMap();
475
476 $maxPrefixLength = 3; // 'SSI'
477 $singleTypePrefix = '';
478 if (is_array($ufInfo['SETTINGS']))
479 {
480 $supportedTypes = array();
481 foreach ($ufInfo['SETTINGS'] as $type => $supported)
482 {
483 if ($supported === 'Y')
484 $supportedTypes[$type] = true;
485 }
486 $supportedTypes = array_keys($supportedTypes);
487 if (count($supportedTypes) === 1)
488 {
489 if (isset($prefixByType[mb_strtolower($supportedTypes[0])]))
490 $singleTypePrefix = $prefixByType[mb_strtolower($supportedTypes[0])];
491 }
492 unset($supportedTypes, $type, $supported);
493 }
494
495 $prefix = '';
496 if (($pos = mb_strpos(mb_substr($valueKey, 0, $maxPrefixLength + 1), '_')) !== false && $pos > 0)
497 $prefix = mb_substr($valueKey, 0, $pos);
498 if (empty($prefix))
499 $valueKey = $singleTypePrefix . '_' . $valueKey;
500 unset($prefix, $pos);
501
502 if (is_array(self::$ufCrmElements) && is_array(self::$ufCrmElements[$valueKey]))
503 {
504 $element = self::$ufCrmElements[$valueKey];
505 $item = explode('_', $valueKey);
506 if ($item[0] <> '' && $item[1] <> '')
507 {
508 $value = htmlspecialcharsbx($element['title']);
509 }
510 }
511 }
512
513 return htmlspecialcharsbx($value);
514 }
515
516 public static function getUserFieldCrmStatusValue($valueKey, $ufInfo)
517 {
518 $entityType = isset($ufInfo['SETTINGS']['ENTITY_TYPE']) ? strval($ufInfo['SETTINGS']['ENTITY_TYPE']) : '';
519 $valueKey = trim(strval($valueKey));
520 $value = '';
521
522 if (!empty($entityType) && $valueKey <> '')
523 {
524 if (is_array(self::$ufCrmStatuses) && isset(self::$ufCrmStatuses[$entityType][$valueKey]))
525 $value = htmlspecialcharsbx(self::$ufCrmStatuses[$entityType][$valueKey]);
526 }
527
528 return $value;
529 }
530
531 public static function getUserFieldIblockElementValue($valueKey, $ufInfo)
532 {
533 $valueKey = intval($valueKey);
534 $value = '';
535
536 if ($valueKey > 0)
537 {
538 if (is_array(self::$ufIblockElements) && is_array(self::$ufIblockElements[$valueKey]))
539 {
540 $element = self::$ufIblockElements[$valueKey];
541 $elementLink = '';
542 $elementName = $element['~NAME'];
543 if (!empty($element['~DETAIL_PAGE_URL']))
544 $elementLink = $element['~DETAIL_PAGE_URL'];
545 if ($elementName <> '')
546 {
547 if ($elementLink <> '')
548 {
549 $value = '<a target="_blank" href="'.$elementLink.'">'.
550 htmlspecialcharsbx($elementName).'</a>';
551 }
552 else
553 $value = htmlspecialcharsbx($elementName);
554 }
555 }
556 }
557
558 return $value;
559 }
560
561 public static function getUserFieldIblockElementValueForChart($valueKey, $ufInfo)
562 {
563 $valueKey = intval($valueKey);
564 $value = '';
565
566 if ($valueKey > 0)
567 {
568 if (is_array(self::$ufIblockElements) && is_array(self::$ufIblockElements[$valueKey]))
569 {
570 $element = self::$ufIblockElements[$valueKey];
571 $elementName = $element['~NAME'];
572 if ($elementName <> '')
573 $value = htmlspecialcharsbx($elementName);
574 }
575 }
576
577 return $value;
578 }
579
580 public static function getUserFieldIblockSectionValue($valueKey, $ufInfo)
581 {
582 $valueKey = intval($valueKey);
583 $value = '';
584
585 if ($valueKey > 0)
586 {
587 if (is_array(self::$ufIblockSections) && is_array(self::$ufIblockSections[$valueKey]))
588 {
589 $section = self::$ufIblockSections[$valueKey];
590 $sectionLink = '';
591 $sectionName = $section['~NAME'];
592 if (!empty($section['~SECTION_PAGE_URL']))
593 $sectionLink = $section['~SECTION_PAGE_URL'];
594 if ($sectionName <> '')
595 {
596 if ($sectionLink <> '')
597 {
598 $value = '<a target="_blank" href="'.$sectionLink.'">'.
599 htmlspecialcharsbx($sectionName).'</a>';
600 }
601 else
602 $value = htmlspecialcharsbx($sectionName);
603 }
604 }
605 }
606
607 return $value;
608 }
609
610 public static function getUserFieldIblockSectionValueForChart($valueKey, $ufInfo)
611 {
612 $valueKey = intval($valueKey);
613 $value = '';
614
615 if ($valueKey > 0)
616 {
617 if (is_array(self::$ufIblockSections) && is_array(self::$ufIblockSections[$valueKey]))
618 {
619 $section = self::$ufIblockSections[$valueKey];
620 $sectionName = $section['~NAME'];
621 if ($sectionName <> '')
622 $value = htmlspecialcharsbx($sectionName);
623 }
624 }
625
626 return $value;
627 }
628
629 public static function getUserFieldMoneyValue($valueKey, $ufInfo)
630 {
631 $value = $valueKey;
632
633 if (is_array($ufInfo) && is_array($ufInfo['USER_TYPE'])
634 && isset($ufInfo['USER_TYPE']['VIEW_CALLBACK'])
635 && is_callable($ufInfo['USER_TYPE']['VIEW_CALLBACK']))
636 {
637 $value = ['VALUE' => $value];
638 $value = call_user_func_array($ufInfo['USER_TYPE']["VIEW_CALLBACK"], [$value]);
639 }
640
641 return $value;
642 }
643
644 public static function getUserFieldMoneyValueForChart($valueKey, $ufInfo)
645 {
646 $value = $valueKey;
647
648 if (is_array($ufInfo) && is_array($ufInfo['USER_TYPE']) && isset($ufInfo['USER_TYPE']['CLASS_NAME'])
649 && is_string($ufInfo['USER_TYPE']['CLASS_NAME']) && $ufInfo['USER_TYPE']['CLASS_NAME'] !== ''
650 && is_callable(array($ufInfo['USER_TYPE']['CLASS_NAME'], 'getPublicText')))
651 {
652 $value = ['VALUE' => $value];
653 $value = htmlspecialcharsbx(
654 call_user_func_array([$ufInfo['USER_TYPE']['CLASS_NAME'], 'getPublicText'], [$value])
655 );
656 }
657
658 return $value;
659 }
660
661 public static function setRuntimeFields(\Bitrix\Main\Entity\Base $entity, $sqlTimeInterval)
662 {
663 // do nothing here, could be overwritten in children
664 }
665
666 public static function getCustomColumnTypes()
667 {
668 return array();
669 }
670
671 public static function getGrcColumns()
672 {
673 return array();
674 }
675
676 public static function getCalcVariations()
677 {
678 return array(
679 'integer' => array(
680 'MIN',
681 'AVG',
682 'MAX',
683 'SUM',
684 'COUNT_DISTINCT'
685 ),
686 'float' => array(
687 'MIN',
688 'AVG',
689 'MAX',
690 'SUM',
691 'COUNT_DISTINCT'
692 ),
693 'string' => array(
694 'COUNT_DISTINCT'
695 ),
696 'text' => array(
697 'COUNT_DISTINCT'
698 ),
699 'boolean' => array(
700 'SUM'
701 ),
702 'datetime' => array(
703 'MIN',
704 'MAX',
705 'COUNT_DISTINCT'
706 ),
707 'enum' => array(
708 'COUNT_DISTINCT'
709 ),
710 'file' => array(
711 'COUNT_DISTINCT'
712 ),
713 'disk_file' => array(
714 'COUNT_DISTINCT'
715 ),
716 'employee' => array(
717 'COUNT_DISTINCT'
718 ),
719 'crm' => array(
720 'COUNT_DISTINCT'
721 ),
722 'crm_status' => array(
723 'COUNT_DISTINCT'
724 ),
725 'iblock_element' => array(
726 'COUNT_DISTINCT'
727 ),
728 'iblock_section' => array(
729 'COUNT_DISTINCT'
730 ),
731 'money' => array(
732 'COUNT_DISTINCT'
733 )
734 );
735 }
736
737 public static function getCompareVariations()
738 {
739 return array(
740 'integer' => array(
741 'EQUAL',
742 'GREATER_OR_EQUAL',
743 'GREATER',
744 'LESS',
745 'LESS_OR_EQUAL',
746 'NOT_EQUAL'
747 ),
748 'float' => array(
749 'EQUAL',
750 'GREATER_OR_EQUAL',
751 'GREATER',
752 'LESS',
753 'LESS_OR_EQUAL',
754 'NOT_EQUAL'
755 ),
756 'string' => array(
757 'EQUAL',
758 'START_WITH',
759 'CONTAINS',
760 'NOT_CONTAINS',
761 'NOT_EQUAL'
762 ),
763 'text' => array(
764 'EQUAL',
765 'START_WITH',
766 'CONTAINS',
767 'NOT_CONTAINS',
768 'NOT_EQUAL'
769 ),
770 'boolean' => array(
771 'EQUAL'
772 ),
773 'datetime' => array(
774 'EQUAL',
775 'GREATER_OR_EQUAL',
776 'GREATER',
777 'LESS',
778 'LESS_OR_EQUAL',
779 'NOT_EQUAL'
780 ),
781 '\Bitrix\Main\User' => array(
782 'EQUAL'
783 ),
784 '\Bitrix\Socialnetwork\Workgroup' => array(
785 'EQUAL'
786 ),
787 'enum' => array(
788 'EQUAL',
789 'NOT_EQUAL'
790 ),
791 'file' => array(
792 'EQUAL',
793 'NOT_EQUAL'
794 ),
795 'disk_file' => array(
796 'EQUAL',
797 'NOT_EQUAL'
798 ),
799 'employee' => array(
800 'EQUAL',
801 'NOT_EQUAL'
802 ),
803 'crm' => array(
804 'EQUAL',
805 'NOT_EQUAL'
806 ),
807 'crm_status' => array(
808 'EQUAL',
809 'NOT_EQUAL'
810 ),
811 'iblock_element' => array(
812 'EQUAL',
813 'NOT_EQUAL'
814 ),
815 'iblock_section' => array(
816 'EQUAL',
817 'NOT_EQUAL'
818 ),
819 'money' => array(
820 'EQUAL',
821 'GREATER_OR_EQUAL',
822 'GREATER',
823 'LESS',
824 'LESS_OR_EQUAL',
825 'NOT_EQUAL'
826 )
827 );
828 }
829
830 public static function getFiltrableColumnGroups()
831 {
832 return [];
833 }
834
835 public static function buildHTMLSelectTreePopup($tree, $withReferencesChoose = false, $level = 0)
836 {
837 if (is_array($withReferencesChoose))
838 {
839 $filtrableGroups = $withReferencesChoose;
840 $isRefChoose = true;
841 }
842 else
843 {
844 $filtrableGroups = [];
845 $isRefChoose = $withReferencesChoose;
846 }
847
848 $html = '';
849
850 $i = 0;
851
852 foreach($tree as $treeElem)
853 {
854 $isLastElem = (++$i == count($tree));
855
856 $fieldDefinition = $treeElem['fieldName'];
857 $branch = $treeElem['branch'];
858
859 $fieldType = null;
860 $customColumnTypes = static::getCustomColumnTypes();
861 if (array_key_exists($fieldDefinition, $customColumnTypes))
862 {
863 $fieldType = $customColumnTypes[$fieldDefinition];
864 }
865 else
866 {
867 $fieldType = $treeElem['field'] ? static::getFieldDataType($treeElem['field']) : null;
868 }
869
870 // file fields is not filtrable
871 if ($isRefChoose && ($fieldType === 'file' || $fieldType === 'disk_file'))
872 {
873 continue;
874 }
875
876 // multiple money fields is not filtrable
877 if ($isRefChoose && $fieldType === 'money'
878 && $treeElem['isUF'] === true
879 && is_array($treeElem['ufInfo'])
880 && isset($treeElem['ufInfo']['MULTIPLE'])
881 && $treeElem['ufInfo']['MULTIPLE'] === 'Y')
882 {
883 continue;
884 }
885
886 if (empty($branch))
887 {
888 // single field
889 $htmlElem = static::buildSelectTreePopupElelemnt(
890 $treeElem['humanTitle'],
891 $treeElem['fullHumanTitle'],
892 $fieldDefinition,
893 $fieldType,
894 (($treeElem['isUF'] ?? false) === true && is_array($treeElem['ufInfo']))
895 ? $treeElem['ufInfo']
896 : array()
897 );
898
899 if ($isLastElem && $level > 0)
900 {
901 $htmlElem = str_replace(
902 '<div class="reports-add-popup-item">',
903 '<div class="reports-add-popup-item reports-add-popup-item-last">',
904 $htmlElem
905 );
906
907 }
908
909 $html .= $htmlElem;
910 }
911 else
912 {
913 // add branch
914
915 $scalarTypes = array('integer', 'float', 'string', 'text', 'boolean', 'file', 'disk_file', 'datetime',
916 'enum', 'employee', 'crm', 'crm_status', 'iblock_element', 'iblock_section', 'money');
917 if ($isRefChoose
918 && !in_array($fieldDefinition, $filtrableGroups, true)
919 && (in_array($fieldType, $scalarTypes) || empty($fieldType))
920 )
921 {
922 // ignore virtual branches (without references)
923 continue;
924 }
925
926 $html .= sprintf('<div class="reports-add-popup-item reports-add-popup-it-node">
927 <span class="reports-add-popup-arrow"></span><span
928 class="reports-add-popup-it-text">%s</span>
929 </div>', $treeElem['humanTitle']);
930
931 $html .= '<div class="reports-add-popup-it-children">';
932
933 // add self
934 if ($isRefChoose)
935 {
936 $html .= static::buildSelectTreePopupElelemnt(
937 GetMessage('REPORT_CHOOSE').'...',
938 $treeElem['humanTitle'],
939 $fieldDefinition,
940 $fieldType
941 );
942 }
943
944 $html .= static::buildHTMLSelectTreePopup($branch, $withReferencesChoose, $level+1);
945
946 $html .= '</div>';
947 }
948 }
949
950 return $html;
951 }
952
953 public static function buildSelectTreePopupElelemnt($humanTitle, $fullHumanTitle, $fieldDefinition, $fieldType, $ufInfo = array())
954 {
955 // replace by static:: when php 5.3 available
956 $grcFields = static::getGrcColumns();
957
958 $isUF = false;
959 $isMultiple = false;
960 $ufId = $ufName = '';
961 if (is_array($ufInfo) && isset($ufInfo['ENTITY_ID']) && isset($ufInfo['FIELD_NAME']))
962 {
963 $ufId = $ufInfo['ENTITY_ID'];
964 $ufName = $ufInfo['FIELD_NAME'];
965 if (isset($ufInfo['MULTIPLE']) && $ufInfo['MULTIPLE'] === 'Y')
966 $isMultiple = true;
967 $isUF = true;
968 }
969
970 $htmlCheckbox = sprintf(
971 '<input type="checkbox" name="%s" title="%s" fieldType="%s" isGrc="%s" isUF="%s"%s class="reports-add-popup-checkbox" />',
972 htmlspecialcharsbx($fieldDefinition), htmlspecialcharsbx($fullHumanTitle), htmlspecialcharsbx($fieldType),
973 (int) in_array($fieldDefinition, $grcFields), (int)$isUF,
974 ($isUF ? 'ufId="'.htmlspecialcharsbx($ufId).'"' : '').($isUF ? 'isMultiple="'.(int)$isMultiple.'" ufName="'.htmlspecialcharsbx($ufName).'"' : '')
975 );
976
977 $htmlElem = sprintf('<div class="reports-add-popup-item">
978 <span class="reports-add-pop-left-bord"></span><span
979 class="reports-add-popup-checkbox-block">
980 %s
981 </span><span class="reports-add-popup-it-text%s">%s</span>
982 </div>', $htmlCheckbox, $isUF ? ' uf' : '', htmlspecialcharsbx($humanTitle));
983
984 return $htmlElem;
985 }
986
987 public static function getCustomSelectFields($select, $fList)
988 {
989 return array();
990 }
991
992 public static function fillFilterReferenceColumns(&$filters, &$fieldList)
993 {
994 foreach ($filters as &$filter)
995 {
996 foreach ($filter as &$fElem)
997 {
998 if (is_array($fElem) && $fElem['type'] == 'field')
999 {
1000 $field = $fieldList[$fElem['name']];
1001
1002 if ($field instanceof Entity\ReferenceField)
1003 static::fillFilterReferenceColumn($fElem, $field);
1004 }
1005 }
1006 }
1007 }
1008
1009 public static function fillFilterReferenceColumn(&$filterElement, Entity\ReferenceField $field)
1010 {
1011 if ($field->getRefEntityName() == '\Bitrix\Main\User')
1012 {
1013 // USER
1014 if ($filterElement['value'])
1015 {
1016 $res = CUser::GetByID($filterElement['value']);
1017 $user = $res->fetch();
1018
1019 if ($user)
1020 {
1021 $username = CUser::FormatName(static::getUserNameFormat(), $user, true, false);
1022 $filterElement['value'] = array('id' => $user['ID'], 'name' => $username);
1023 }
1024 else
1025 {
1026 $filterElement['value'] = array('id' => $filterElement['value'], 'name' => GetMessage('REPORT_USER_NOT_FOUND'));
1027 }
1028 }
1029 else
1030 {
1031 $filterElement['value'] = array('id' => '');
1032 }
1033 }
1034 else if ($field->getRefEntityName() == '\Bitrix\Socialnetwork\Workgroup')
1035 {
1036 // GROUP
1037 if ($filterElement['value'])
1038 {
1039 $group = CSocNetGroup::GetByID($filterElement['value']);
1040
1041 if ($group)
1042 {
1043 $filterElement['value'] = array(array('id' => $group['ID'], 'title' => $group['NAME']));
1044 }
1045 else
1046 {
1047 $filterElement['value'] = array(array('id' => $filterElement['value'], 'title' => GetMessage('REPORT_PROJECT_NOT_FOUND')));
1048 }
1049 }
1050 else
1051 {
1052 $filterElement['value'] = array(array('id' => ''));
1053 }
1054 }
1055 }
1056
1057 public static function fillFilterUFColumns(&$filters, &$fieldList)
1058 {
1059 foreach ($filters as &$filter)
1060 {
1061 foreach ($filter as &$fElem)
1062 {
1063 if (is_array($fElem) && $fElem['type'] == 'field')
1064 {
1065 $field = $fieldList[$fElem['name']];
1066
1067 $arUF = static::detectUserField($field);
1068 if ($arUF['isUF'] && is_array($arUF['ufInfo']) && isset($arUF['ufInfo']['USER_TYPE_ID']))
1069 static::fillFilterUFColumn($fElem, $field, $arUF['ufInfo']);
1070 }
1071 }
1072 }
1073 }
1074
1075 public static function fillFilterUFColumn(&$filterElement, $field, $ufInfo)
1076 {
1077 if ($ufInfo['USER_TYPE_ID'] === 'employee')
1078 {
1079 $value = intval($filterElement['value']);
1080 if ($value > 0)
1081 {
1082 $user = new CUser();
1083 $res = $user->GetByID($value);
1084 $arUser = $res->fetch();
1085
1086 if ($arUser)
1087 {
1088 $userName = CUser::FormatName(self::getUserNameFormat(), $arUser, true);
1089 $filterElement['value'] = array('id' => $arUser['ID'], 'name' => $userName);
1090 }
1091 else
1092 {
1093 $filterElement['value'] = array('id' => $filterElement['value'], 'name' => GetMessage('REPORT_USER_NOT_FOUND'));
1094 }
1095 }
1096 else
1097 {
1098 $filterElement['value'] = array('id' => '');
1099 }
1100 }
1101 }
1102
1103 public static function beforeFilterBackReferenceRewrite(&$filter, $viewColumns)
1104 {
1105 }
1106
1107 public static function getEntityFilterPrimaryFieldName($fElem)
1108 {
1109 return 'ID';
1110 }
1111
1112 public static function confirmFilterBackReferenceRewrite($fElem, $chain)
1113 {
1114 return true;
1115 }
1116
1117 public static function confirmSelectBackReferenceRewrite($elem, $chain)
1118 {
1119 return true;
1120 }
1121
1122 public static function beforeViewDataQuery(&$select, &$filter, &$group, &$order, &$limit, &$options, &$runtime = null)
1123 {
1124 }
1125
1126 public static function rewriteResultRowValues(&$row, &$columnInfo)
1127 {
1128 }
1129
1130 public static function collectUFValues($rows, $columnInfo, $total)
1131 {
1132 // uf columns
1133 $fileColumns = array();
1134 $diskFileColumns = array();
1135 $employeeColumns = array();
1136 $crmColumns = array();
1137 $crmStatusColumns = array();
1138 $iblockElementColumns = array();
1139 $iblockSectionColumns = array();
1140 if (is_array($columnInfo))
1141 {
1142 foreach ($columnInfo as $k => $cInfo)
1143 {
1144 if (
1145 ($cInfo['isUF'] ?? false)
1146 && isset($cInfo['ufInfo'])
1147 && is_array($cInfo['ufInfo'])
1148 && isset($cInfo['ufInfo']['USER_TYPE_ID'])
1149 )
1150 {
1151 switch ($cInfo['ufInfo']['USER_TYPE_ID'])
1152 {
1153 case 'file':
1154 $fileColumns[$k] = true;
1155 break;
1156 case 'disk_file':
1157 $diskFileColumns[$k] = true;
1158 break;
1159 case 'employee':
1160 $employeeColumns[$k] = true;
1161 break;
1162 case 'crm':
1163 $crmColumns[$k] = true;
1164 break;
1165 case 'crm_status':
1166 $crmStatusColumns[$k] = true;
1167 break;
1168 case 'iblock_element':
1169 $iblockElementColumns[$k] = true;
1170 break;
1171 case 'iblock_section':
1172 $iblockSectionColumns[$k] = true;
1173 break;
1174 }
1175 }
1176 }
1177 }
1178
1179 $arFileID = array();
1180 $arDiskFileID = array();
1181 $arEmployeeID = array();
1182 $arCrmID = array();
1183 $arCrmStatusID = array();
1184 $arCrmStatusEntityType = array();
1185 $arIblockElementID = array();
1186 $arIblockSectionID = array();
1187 if (count($fileColumns) > 0 || count($diskFileColumns) > 0 || count($employeeColumns) > 0
1188 || count($crmColumns) > 0 || count($crmStatusColumns) > 0 || count($iblockElementColumns) > 0
1189 || count($iblockSectionColumns) > 0)
1190 {
1191 foreach ($rows as $row)
1192 {
1193 foreach ($row as $k => $v)
1194 {
1195 // file
1196 if (isset($fileColumns[$k]))
1197 {
1198 if (is_array($v))
1199 foreach ($v as $subv)
1200 {
1201 $value = intval($subv);
1202 if ($value > 0)
1203 $arFileID[] = $value;
1204 }
1205 else
1206 {
1207 $value = intval($v);
1208 if ($value > 0)
1209 $arFileID[] = $value;
1210 }
1211 }
1212
1213 // disk file
1214 if (isset($diskFileColumns[$k]))
1215 {
1216 if (is_array($v))
1217 foreach ($v as $subv)
1218 {
1219 $value = intval($subv);
1220 if ($value > 0)
1221 $arDiskFileID[] = $value;
1222 }
1223 else
1224 {
1225 $value = intval($v);
1226 if ($value > 0)
1227 $arDiskFileID[] = $value;
1228 }
1229 }
1230
1231 // employee
1232 if (isset($employeeColumns[$k]))
1233 {
1234 if (is_array($v))
1235 foreach ($v as $subv)
1236 {
1237 $value = intval($subv);
1238 if ($value > 0)
1239 $arEmployeeID[] = $value;
1240 }
1241 else
1242 {
1243 $value = intval($v);
1244 if ($value > 0)
1245 $arEmployeeID[] = $value;
1246 }
1247 }
1248
1249 // crm
1250 if (isset($crmColumns[$k]))
1251 {
1252 $prefixByType = static::getUserFieldCrmTypePrefixMap();
1253
1254 $maxPrefixLength = 3; // 'SSI'
1255 $singleTypePrefix = '';
1256 if (is_array($columnInfo[$k]['ufInfo']['SETTINGS']))
1257 {
1258 $supportedTypes = array();
1259 foreach ($columnInfo[$k]['ufInfo']['SETTINGS'] as $type => $supported)
1260 {
1261 if ($supported === 'Y')
1262 $supportedTypes[$type] = true;
1263 }
1264 $supportedTypes = array_keys($supportedTypes);
1265 if (count($supportedTypes) === 1)
1266 {
1267 if (isset($prefixByType[mb_strtolower($supportedTypes[0])]))
1268 $singleTypePrefix = $prefixByType[mb_strtolower($supportedTypes[0])];
1269 }
1270 unset($supportedTypes, $type, $supported);
1271 }
1272
1273 if (is_array($v))
1274 {
1275 foreach ($v as $subv)
1276 {
1277 $subv = strval($subv);
1278 if ($subv <> '')
1279 {
1280 $prefix = '';
1281 if (($pos = mb_strpos(mb_substr($subv, 0, $maxPrefixLength + 1), '_')) !== false && $pos > 0)
1282 $prefix = mb_substr($subv, 0, $pos);
1283 if (empty($prefix))
1284 $subv = $singleTypePrefix . '_' . $subv;
1285 unset($prefix, $pos);
1286
1287 $value = explode('_', trim($subv));
1288 if ($value[0] <> '' && $value[1] <> '')
1289 {
1290 if (!(isset($arCrmID[$value[0]]) && is_array($arCrmID[$value[0]])))
1291 $arCrmID[$value[0]] = array();
1292 $arCrmID[$value[0]][] = $value[1];
1293 }
1294 }
1295 }
1296 }
1297 else
1298 {
1299 $v = strval($v);
1300 if ($v <> '')
1301 {
1302 $prefix = '';
1303 if (($pos = mb_strpos(mb_substr($v, 0, $maxPrefixLength + 1), '_')) !== false && $pos > 0)
1304 $prefix = mb_substr($v, 0, $pos);
1305 if (empty($prefix))
1306 $v = $singleTypePrefix . '_' . $v;
1307 unset($prefix, $pos);
1308
1309 $value = explode('_', trim($v));
1310 if ($value[0] <> '' && $value[1] <> '')
1311 {
1312 if (!(isset($arCrmID[$value[0]]) && is_array($arCrmID[$value[0]])))
1313 $arCrmID[$value[0]] = array();
1314 $arCrmID[$value[0]][] = $value[1];
1315 }
1316 }
1317 }
1318
1319 unset($maxPrefixLength);
1320 }
1321
1322 // crm_status
1323 if (isset($crmStatusColumns[$k]))
1324 {
1325 if (!isset($arCrmStatusEntityType[$k]))
1326 {
1327 if (isset($columnInfo[$k]['ufInfo']['SETTINGS']['ENTITY_TYPE']))
1328 {
1329 $arCrmStatusEntityType[$k] =
1330 strval($columnInfo[$k]['ufInfo']['SETTINGS']['ENTITY_TYPE']);
1331 }
1332 }
1333 if (!empty($arCrmStatusEntityType[$k]))
1334 {
1335 if (is_array($v))
1336 foreach ($v as $subv)
1337 {
1338 if ($subv <> '')
1339 {
1340 if (!is_array($arCrmStatusID[$arCrmStatusEntityType[$k]]))
1341 $arCrmStatusID[$arCrmStatusEntityType[$k]] = array();
1342 $arCrmStatusID[$arCrmStatusEntityType[$k]][] = $subv;
1343 }
1344 }
1345 else
1346 {
1347 if ($v <> '')
1348 {
1349 if (!is_array($arCrmStatusID[$arCrmStatusEntityType[$k]]))
1350 $arCrmStatusID[$arCrmStatusEntityType[$k]] = array();
1351 $arCrmStatusID[$arCrmStatusEntityType[$k]][] = $v;
1352 }
1353 }
1354 }
1355 }
1356
1357 // iblock_element
1358 if (isset($iblockElementColumns[$k]))
1359 {
1360 if (is_array($v))
1361 foreach ($v as $subv)
1362 {
1363 $value = intval($subv);
1364 if ($value > 0)
1365 $arIblockElementID[] = $value;
1366 }
1367 else
1368 {
1369 $value = intval($v);
1370 if ($value > 0)
1371 $arIblockElementID[] = $value;
1372 }
1373 }
1374
1375 // iblock_section
1376 if (isset($iblockSectionColumns[$k]))
1377 {
1378 if (is_array($v))
1379 foreach ($v as $subv)
1380 {
1381 $value = intval($subv);
1382 if ($value > 0)
1383 $arIblockSectionID[] = $value;
1384 }
1385 else
1386 {
1387 $value = intval($v);
1388 if ($value > 0)
1389 $arIblockSectionID[] = $value;
1390 }
1391 }
1392 }
1393 }
1394 }
1395
1396 // collect files
1397 if (count($fileColumns) > 0)
1398 {
1399 if (count($arFileID) > 0)
1400 $arFileID = array_unique($arFileID);
1401
1402 $i = 0;
1403 $cnt = 0;
1404 $stepCnt = 500;
1405 $nIDs = count($arFileID);
1406 $arID = array();
1407 $file = new CFile();
1408 foreach ($arFileID as $fileID)
1409 {
1410 $arID[$cnt++] = $fileID;
1411 $i++;
1412
1413 if ($cnt === $stepCnt || $i === $nIDs)
1414 {
1415 $res = $file->GetList(array(), array('@ID' => implode(',', $arID)));
1416 if (is_object($res))
1417 {
1418 while ($arFile = $res->Fetch())
1419 {
1420 if($arFile)
1421 {
1422 if(array_key_exists("~src", $arFile))
1423 {
1424 if($arFile["~src"])
1425 $arFile["SRC"] = $arFile["~src"];
1426 else
1427 $arFile["SRC"] = $file->GetFileSRC($arFile, false, false);
1428 }
1429 else
1430 {
1431 $arFile["SRC"] = $file->GetFileSRC($arFile, false);
1432 }
1433
1434 self::$ufFiles[intval($arFile['ID'])] = $arFile;
1435 }
1436 }
1437 }
1438
1439 $cnt = 0;
1440 $arID = array();
1441 }
1442 }
1443 }
1444
1445 // collect disk files
1446 if (count($diskFileColumns) > 0)
1447 {
1448 if (count($arDiskFileID) > 0)
1449 $arDiskFileID = array_unique($arDiskFileID);
1450
1451 $i = 0;
1452 $cnt = 0;
1453 $stepCnt = 500;
1454 $nIDs = count($arDiskFileID);
1455 $arID = array();
1456 foreach ($arDiskFileID as $diskFileID)
1457 {
1458 $arID[$cnt++] = $diskFileID;
1459 $i++;
1460
1461 if ($cnt === $stepCnt || $i === $nIDs)
1462 {
1463 $res = \Bitrix\Disk\AttachedObject::getList(array(
1464 'filter' => array('ID' => $arID),
1465 'select' => array(
1466 'ID', 'NAME' => 'OBJECT.NAME', 'SIZE' => 'OBJECT.SIZE'
1467 ),
1468 ));
1469 $urlManager = \Bitrix\Disk\Driver::getInstance()->getUrlManager();
1470 if (is_object($res))
1471 {
1472 while ($arDiskFile = $res->Fetch())
1473 {
1474 if($arDiskFile)
1475 {
1476 $arDiskFile['DOWNLOAD_URL'] = $urlManager->getUrlUfController(
1477 'download',
1478 array('attachedId' => $arDiskFile['ID'])
1479 );
1480 self::$ufDiskFiles[intval($arDiskFile['ID'])] = $arDiskFile;
1481 }
1482 }
1483 }
1484
1485 $cnt = 0;
1486 $arID = array();
1487 }
1488 }
1489 }
1490
1491 // collect employees
1492 if (count($employeeColumns) > 0)
1493 {
1494 if (count($arEmployeeID) > 0)
1495 $arEmployeeID = array_unique($arEmployeeID);
1496
1497 $i = 0;
1498 $cnt = 0;
1499 $stepCnt = 500;
1500 $nIDs = count($arEmployeeID);
1501 $arID = array();
1502 foreach ($arEmployeeID as $employeeID)
1503 {
1504 $arID[$cnt++] = $employeeID;
1505 $i++;
1506
1507 if ($cnt === $stepCnt || $i === $nIDs)
1508 {
1510 array(
1511 'filter' => array('ID' => $arID),
1512 'select' => array('ID', 'LOGIN', 'NAME', 'LAST_NAME', 'SECOND_NAME', 'TITLE')
1513 )
1514 );
1515 if (is_object($res))
1516 {
1517 while ($arUser = $res->fetch())
1518 self::$ufEmployees[intval($arUser['ID'])] = $arUser;
1519 }
1520
1521 $cnt = 0;
1522 $arID = array();
1523 }
1524 }
1525 }
1526
1527 // collect crm elements
1528 if (count($crmColumns) > 0 && Loader::includeModule('crm'))
1529 {
1530 foreach ($arCrmID as $typeIndex => $arSubID)
1531 {
1532 if (count($arSubID) > 0)
1533 $arCrmID[$typeIndex] = array_unique($arSubID);
1534
1535 $i = 0;
1536 $cnt = 0;
1537 $stepCnt = 500;
1538 $nIDs = count($arSubID);
1539 $arID = array();
1540 foreach ($arSubID as $crmID)
1541 {
1542 $arID[$cnt++] = $crmID;
1543 $i++;
1544
1545 if ($cnt === $stepCnt || $i === $nIDs)
1546 {
1547 $entityTypeName = CCrmOwnerTypeAbbr::ResolveName($typeIndex);
1548 $settings = [mb_strtoupper($entityTypeName) => 'Y'];
1549 $selectorParams = ElementType::getDestSelectorParametersForFilter($settings, true);
1550 $selectorEntityTypeOptions = ElementType::getDestSelectorOptions($selectorParams);
1551 if ($description = reset($selectorEntityTypeOptions))
1552 {
1553 $provider = Entities::getProviderByEntityType(key($selectorEntityTypeOptions));
1554 if (
1555 $provider !== false
1556 && is_callable([$provider, 'getByIds'])
1557 )
1558 {
1559 $options = (!empty($description['options']) ? $description['options'] : array());
1560 foreach ($provider->getByIds($arID, $options) as $item)
1561 {
1562 self::$ufCrmElements[$typeIndex . '_' . $item['entityId']] = [
1563 'id' => $item['entityId'],
1564 'type' => $entityTypeName,
1565 'title' => htmlspecialcharsback($item['name']) ?? '',
1566 'url' => $item['url'] ?? '',
1567 ];
1568 }
1569 }
1570 }
1571
1572 $cnt = 0;
1573 $arID = array();
1574 }
1575 }
1576 }
1577 }
1578
1579 // collect crm statuses
1580 if (count($crmStatusColumns) > 0 && CModule::IncludeModule('crm'))
1581 {
1582 foreach ($arCrmStatusID as $entityType => $arSubID)
1583 {
1584 if (count($arSubID) > 0)
1585 $arCrmID[$entityType] = array_unique($arSubID);
1586
1587 $res = null;
1588 $res = CCrmStatus::GetStatusList($entityType);
1589 if (is_array($res) && count($res) > 0)
1590 {
1591 foreach ($arSubID as $crmStatusID)
1592 {
1593 if (isset($res[$crmStatusID]))
1594 if (!isset(self::$ufCrmStatuses[$entityType]))
1595 self::$ufCrmStatuses[$entityType] = array();
1596 self::$ufCrmStatuses[$entityType][$crmStatusID] = $res[$crmStatusID];
1597 }
1598 }
1599 }
1600 }
1601
1602 // collect iblock elements
1603 if (count($iblockElementColumns) > 0 && CModule::IncludeModule('iblock'))
1604 {
1605 if (count($arIblockElementID) > 0)
1606 $arIblockElementID = array_unique($arIblockElementID);
1607
1608 $i = 0;
1609 $cnt = 0;
1610 $stepCnt = 500;
1611 $nIDs = count($arIblockElementID);
1612 $arID = array();
1613 foreach ($arIblockElementID as $iblockElementID)
1614 {
1615 $arID[$cnt++] = $iblockElementID;
1616 $i++;
1617
1618 if ($cnt === $stepCnt || $i === $nIDs)
1619 {
1620 $res = CIBlockElement::GetList(array('SORT'=>'ASC'), array('=ID' => $arID));
1621 if (is_object($res))
1622 {
1623 while ($arIblockElement = $res->GetNext())
1624 self::$ufIblockElements[intval($arIblockElement['ID'])] = $arIblockElement;
1625 }
1626
1627 $cnt = 0;
1628 $arID = array();
1629 }
1630 }
1631 }
1632
1633 // collect iblock sections
1634 if (count($iblockSectionColumns) > 0 && CModule::IncludeModule('iblock'))
1635 {
1636 if (count($arIblockSectionID) > 0)
1637 $arIblockSectionID = array_unique($arIblockSectionID);
1638
1639 $i = 0;
1640 $cnt = 0;
1641 $stepCnt = 500;
1642 $nIDs = count($arIblockSectionID);
1643 $arID = array();
1644 foreach ($arIblockSectionID as $iblockSectionID)
1645 {
1646 $arID[$cnt++] = $iblockSectionID;
1647 $i++;
1648
1649 if ($cnt === $stepCnt || $i === $nIDs)
1650 {
1651 $res = CIBlockSection::GetList(
1652 array('left_margin' => 'asc'),
1653 array('ID' => $arID),
1654 false, array('ID', 'NAME', 'SECTION_PAGE_URL')
1655 );
1656 if (is_object($res))
1657 {
1658 while ($arIblockSection = $res->GetNext())
1659 self::$ufIblockSections[intval($arIblockSection['ID'])] = $arIblockSection;
1660 }
1661
1662 $cnt = 0;
1663 $arID = array();
1664 }
1665 }
1666 }
1667 }
1668
1669 public static function prepareValueToRound($value)
1670 {
1671 if (!is_int($value) && !is_float($value))
1672 {
1673 if (is_string($value) && $value !== '')
1674 {
1675 if (is_numeric($value))
1676 {
1677 $value = (float)$value;
1678 }
1679 else
1680 {
1681 $value = 0;
1682 }
1683 }
1684 else
1685 {
1686 $value = 0;
1687 }
1688 }
1689
1690 return $value;
1691 }
1692
1693 public static function formatResults(&$rows, &$columnInfo, $total)
1694 {
1695 foreach ($rows as &$row)
1696 {
1697 foreach ($row as $k => &$v)
1698 {
1699 if (!array_key_exists($k, $columnInfo))
1700 {
1701 continue;
1702 }
1703
1704 $cInfo = $columnInfo[$k];
1705
1706 if (is_array($v))
1707 {
1708 foreach ($v as &$subv)
1709 {
1710 // replace by static:: when php 5.3 available
1711 self::formatResultValue($k, $subv, $row, $cInfo, $total);
1712 }
1713 }
1714 else
1715 {
1716 // replace by static:: when php 5.3 available
1717 self::formatResultValue($k, $v, $row, $cInfo, $total);
1718 }
1719 }
1720 }
1721
1722 unset($row, $v, $subv);
1723 }
1724
1725 public static function formatResultValue($k, &$v, &$row, &$cInfo, $total, &$customChartValue = null)
1726 {
1728 $field = $cInfo['field'];
1729
1730 $dataType = self::getFieldDataType($field);
1731
1732 $isUF = false;
1733 $ufInfo = null;
1734 if (isset($cInfo['isUF']) && $cInfo['isUF'])
1735 {
1736 $isUF = true;
1737 $ufInfo = $cInfo['ufInfo'];
1738 }
1739
1740 if ($isUF && $dataType == 'float' && (empty($cInfo['aggr']) || $cInfo['aggr'] !== 'COUNT_DISTINCT')
1741 && !mb_strlen($cInfo['prcnt']))
1742 {
1743 $precision = $defaultPrecision = 1;
1744 if (is_array($ufInfo) && is_array($ufInfo['SETTINGS']) && isset($ufInfo['SETTINGS']['PRECISION']))
1745 $precision = (int)$ufInfo['SETTINGS']['PRECISION'];
1746 if ($precision < 0)
1747 $precision = $defaultPrecision;
1748
1749 $v = static::prepareValueToRound($v);
1750 $v = round($v, $precision);
1751 }
1752 elseif ($isUF && $dataType === 'enum' && !empty($v)
1753 && (empty($cInfo['aggr']) || $cInfo['aggr'] !== 'COUNT_DISTINCT')
1754 && !mb_strlen($cInfo['prcnt']))
1755 {
1756 $v = htmlspecialcharsbx(static::getUserFieldEnumerationValue($v, $ufInfo));
1757 }
1758 elseif ($isUF && $dataType === 'file' && !empty($v)
1759 && (empty($cInfo['aggr']) || $cInfo['aggr'] !== 'COUNT_DISTINCT')
1760 && !mb_strlen($cInfo['prcnt']))
1761 {
1762 $valueKey = $v;
1763 $v = static::getUserFieldFileValue($valueKey, $ufInfo);
1764 // unformatted value for charts
1765 $customChartValue['exist'] = true;
1766 $customChartValue['type'] = 'string';
1767 $customChartValue['value'] = static::getUserFieldFileValueForChart($valueKey, $ufInfo);
1768 }
1769 elseif ($isUF && $dataType === 'disk_file' && !empty($v)
1770 && (empty($cInfo['aggr']) || $cInfo['aggr'] !== 'COUNT_DISTINCT')
1771 && !mb_strlen($cInfo['prcnt']))
1772 {
1773 $valueKey = $v;
1774 $v = static::getUserFieldDiskFileValue($valueKey, $ufInfo);
1775 // unformatted value for charts
1776 $customChartValue['exist'] = true;
1777 $customChartValue['type'] = 'string';
1778 $customChartValue['value'] = static::getUserFieldDiskFileValueForChart($valueKey, $ufInfo);
1779 }
1780 elseif ($isUF && $dataType === 'employee' && !empty($v)
1781 && (empty($cInfo['aggr']) || $cInfo['aggr'] !== 'COUNT_DISTINCT')
1782 && !mb_strlen($cInfo['prcnt']))
1783 {
1784 $valueKey = $v;
1785 $v = static::getUserFieldEmployeeValue($valueKey, $ufInfo);
1786 // unformatted value for charts
1787 $customChartValue['exist'] = true;
1788 $customChartValue['type'] = 'string';
1789 $customChartValue['value'] = static::getUserFieldEmployeeValueForChart($valueKey, $ufInfo);
1790 }
1791 elseif ($isUF && $dataType === 'crm' && !empty($v)
1792 && (empty($cInfo['aggr']) || $cInfo['aggr'] !== 'COUNT_DISTINCT')
1793 && !mb_strlen($cInfo['prcnt']))
1794 {
1795 $valueKey = $v;
1796 $v = static::getUserFieldCrmValue($valueKey, $ufInfo);
1797 // unformatted value for charts
1798 $customChartValue['exist'] = true;
1799 $customChartValue['type'] = 'string';
1800 $customChartValue['value'] = static::getUserFieldCrmValueForChart($valueKey, $ufInfo);
1801 }
1802 elseif ($isUF && $dataType === 'crm_status' && !empty($v)
1803 && (empty($cInfo['aggr']) || $cInfo['aggr'] !== 'COUNT_DISTINCT')
1804 && !mb_strlen($cInfo['prcnt']))
1805 {
1806 $valueKey = $v;
1807 $v = static::getUserFieldCrmStatusValue($valueKey, $ufInfo);
1808 }
1809 elseif ($isUF && $dataType === 'iblock_element' && !empty($v)
1810 && (empty($cInfo['aggr']) || $cInfo['aggr'] !== 'COUNT_DISTINCT')
1811 && !mb_strlen($cInfo['prcnt']))
1812 {
1813 $valueKey = $v;
1814 $v = static::getUserFieldIblockElementValue($valueKey, $ufInfo);
1815 // unformatted value for charts
1816 $customChartValue['exist'] = true;
1817 $customChartValue['type'] = 'string';
1818 $customChartValue['value'] = static::getUserFieldIblockElementValueForChart($valueKey, $ufInfo);
1819 }
1820 elseif ($isUF && $dataType === 'iblock_section' && !empty($v)
1821 && (empty($cInfo['aggr']) || $cInfo['aggr'] !== 'COUNT_DISTINCT')
1822 && !mb_strlen($cInfo['prcnt']))
1823 {
1824 $valueKey = $v;
1825 $v = static::getUserFieldIblockSectionValue($valueKey, $ufInfo);
1826 // unformatted value for charts
1827 $customChartValue['exist'] = true;
1828 $customChartValue['type'] = 'string';
1829 $customChartValue['value'] = static::getUserFieldIblockSectionValueForChart($valueKey, $ufInfo);
1830 }
1831 elseif ($isUF && $dataType === 'money' && !empty($v)
1832 && (empty($cInfo['aggr']) || $cInfo['aggr'] !== 'COUNT_DISTINCT')
1833 && !mb_strlen($cInfo['prcnt']))
1834 {
1835 $valueKey = $v;
1836 $v = static::getUserFieldMoneyValue($valueKey, $ufInfo);
1837 // unformatted value for charts
1838 $customChartValue['exist'] = true;
1839 $customChartValue['type'] = 'string';
1840 $customChartValue['value'] = static::getUserFieldMoneyValueForChart($valueKey, $ufInfo);
1841 }
1842 elseif ($dataType == 'datetime' && !empty($v)
1843 && (empty($cInfo['aggr']) || $cInfo['aggr'] !== 'COUNT_DISTINCT')
1844 && !mb_strlen($cInfo['prcnt'])
1845 )
1846 {
1847 $v = ($v instanceof \Bitrix\Main\Type\DateTime || $v instanceof \Bitrix\Main\Type\Date) ? ConvertTimeStamp($v->getTimestamp(), 'SHORT') : '';
1848 }
1849 elseif ($dataType == 'float' && !empty($v) && !$isUF && !mb_strlen($cInfo['prcnt']))
1850 {
1851 $v = static::prepareValueToRound($v);
1852 $v = round($v, 1);
1853 }
1854 elseif (mb_substr($k, -11) == '_SHORT_NAME' && (empty($cInfo['aggr']) || $cInfo['aggr'] == 'GROUP_CONCAT'))
1855 {
1856 $v = str_replace(
1857 array('#NOBR#', '#/NOBR#'),
1858 array('<NOBR>', '</NOBR>'),
1859 htmlspecialcharsbx($v));
1860 }
1861 elseif (mb_substr($k, -6) == '_PRCNT' && !mb_strlen($cInfo['prcnt']))
1862 {
1863 $v = static::prepareValueToRound($v);
1864 $v = round($v, 2). '%';
1865 }
1866 elseif ($dataType == 'boolean' && empty($cInfo['aggr']))
1867 {
1868 if ($isUF && empty($v))
1869 $v = 0;
1870
1871 if($v <> '')
1872 {
1873 // get bool value "yes/no"
1875 $boolValues = ($isUF? array(0, 1) : $field->GetValues());
1876 $fValues = array_flip($boolValues);
1877 $fValue = (bool)$fValues[$v];
1878
1879 $mess = 'REPORT_BOOLEAN_VALUE_'.($fValue? 'TRUE' : 'FALSE');
1880 $v = htmlspecialcharsbx(GetMessage($mess));
1881 }
1882 }
1883 elseif($cInfo['prcnt'] <> '')
1884 {
1885 if($cInfo['prcnt'] == 'self_column')
1886 {
1887 if(array_key_exists('TOTAL_'.$k, $total) && $total['TOTAL_'.$k] > 0)
1888 {
1889 $v = round($v / $total['TOTAL_'.$k] * 100, 2);
1890 }
1891 else
1892 {
1893 $v = '--';
1894 }
1895 }
1896 else
1897 {
1898 $v = static::prepareValueToRound($v);
1899 $v = round($v, 2);
1900 }
1901
1902 $v = $v.'%';
1903 }
1904 else
1905 {
1906 $v = htmlspecialcharsbx($v);
1907 }
1908 }
1909
1910 public static function formatResultsTotal(&$total, &$columnInfo, &$customChartTotal = null)
1911 {
1912 foreach ($total as $k => $v)
1913 {
1914 // remove prefix TOTAL_
1915 $original_k = mb_substr($k, 6);
1916
1917 $cInfo = $columnInfo[$original_k];
1918 $field = $cInfo['field'];
1919
1920 $dataType = self::getFieldDataType($field);
1921
1922 $isUF = false;
1923 $ufInfo = null;
1924 if (isset($cInfo['isUF']) && $cInfo['isUF'])
1925 {
1926 $isUF = true;
1927 $ufInfo = $cInfo['ufInfo'];
1928 }
1929
1930 if ($field->getName() == 'ID' && empty($cInfo['aggr']) && $cInfo['prcnt'] == '')
1931 {
1932 unset($total[$k]);
1933 }
1934 elseif($cInfo['prcnt'] <> '')
1935 {
1936 if($cInfo['prcnt'] == 'self_column')
1937 {
1938 if(array_key_exists($k, $total) && $v > 0)
1939 {
1940 $v = round($v / $total[$k] * 100, 2);
1941 }
1942 else
1943 {
1944 $v = '--';
1945 }
1946 }
1947 else
1948 {
1949 $v = static::prepareValueToRound($v);
1950 $v = round($v, 2);
1951 }
1952
1953 $total[$k] = $v.'%';
1954 }
1955 elseif (mb_substr($k, -6) == '_PRCNT' && !mb_strlen($cInfo['prcnt']))
1956 {
1957 $v = static::prepareValueToRound($v);
1958 $total[$k] = round($v, 2). '%';
1959 }
1960 elseif ($isUF && $dataType == 'float')
1961 {
1962 $precision = $defaultPrecision = 1;
1963 if (is_array($ufInfo) && is_array($ufInfo['SETTINGS']) && isset($ufInfo['SETTINGS']['PRECISION']))
1964 $precision = (int)$ufInfo['SETTINGS']['PRECISION'];
1965 if ($precision < 0)
1966 $precision = $defaultPrecision;
1967
1968 $v = static::prepareValueToRound($v);
1969 $total[$k] = round($v, $precision);
1970 }
1971 }
1972 }
1973
1974 public static function getDefaultElemHref($elem, $fList)
1975 {
1976 return '';
1977 }
1978
1979 public static function getDefaultReports()
1980 {
1981 return array();
1982 }
1983
1984 public static function getFirstVersion()
1985 {
1986 // usually it's first version of default reports
1987 return '11.0.1';
1988 }
1989
1990 public static function getCurrentVersion()
1991 {
1992 // usually it's version of helper's module
1993 return '11.0.1';
1994 }
1995
1996 public static function setUserNameFormat($userNameFormat)
1997 {
1998 self::$userNameFormat = $userNameFormat;
1999 }
2000
2001 public static function getUserNameFormat()
2002 {
2003 if (self::$userNameFormat === null)
2004 {
2005 $site = new CSite();
2006 self::$userNameFormat = $site->GetNameFormat(false);
2007 }
2008
2009 return self::$userNameFormat;
2010 }
2011
2012 public static function renderUserSearch($id, $searchInputId, $dataInputId, $componentName, $siteId = '', $nameFormat = '', $delay = 0)
2013 {
2014 $id = strval($id);
2015 $searchInputId = strval($searchInputId);
2016 $dataInputId = strval($dataInputId);
2018
2019 $siteId = strval($siteId);
2020 if($siteId === '')
2021 {
2022 $siteId = SITE_ID;
2023 }
2024
2025 $nameFormat = strval($nameFormat);
2026 if($nameFormat === '')
2027 {
2028 $nameFormat = CSite::getNameFormat(false);
2029 }
2030
2031 $delay = intval($delay);
2032 if($delay < 0)
2033 {
2034 $delay = 0;
2035 }
2036
2037 echo '<input type="text" id="', htmlspecialcharsbx($searchInputId) ,'" style="width:200px;">',
2038 '<input type="hidden" id="', htmlspecialcharsbx($dataInputId),'" name="',
2039 htmlspecialcharsbx($dataInputId),'" value="">';
2040
2041 echo '<script>',
2042 'BX.ready(function(){',
2043 'BX.ReportUserSearchPopup.deletePopup("', $id, '");',
2044 'BX.ReportUserSearchPopup.create("', $id, '", { searchInput: BX("',
2045 CUtil::jSEscape($searchInputId), '"), dataInput: BX("',
2046 CUtil::jSEscape($dataInputId),'"), componentName: "',
2047 CUtil::jSEscape($componentName),'", user: {} }, ', $delay,');',
2048 '});</script>';
2049
2050 $GLOBALS['APPLICATION']->includeComponent(
2051 'bitrix:intranet.user.selector.new',
2052 '',
2053 array(
2054 'MULTIPLE' => 'N',
2055 'NAME' => $componentName,
2056 'INPUT_NAME' => $searchInputId,
2057 'SHOW_EXTRANET_USERS' => 'NONE',
2058 'POPUP' => 'Y',
2059 'SITE_ID' => $siteId,
2060 'NAME_TEMPLATE' => $nameFormat,
2061 'ON_CHANGE' => 'reports.onResponsiblesChange',
2062 ),
2063 null,
2064 array('HIDE_ICONS' => 'Y')
2065 );
2066 }
2067}
$type
Определения options.php:106
if(!Loader::includeModule('messageservice')) $provider
Определения callback_ednaruimhpx.php:21
Определения loader.php:13
static includeModule($moduleName)
Определения loader.php:67
static getList(array $parameters=array())
Определения datamanager.php:431
Определения file.php:25
Определения report_helper.php:10
static $ufEnumerations
Определения report_helper.php:21
static $ufCrmElements
Определения report_helper.php:25
static renderUserSearch($id, $searchInputId, $dataInputId, $componentName, $siteId='', $nameFormat='', $delay=0)
Определения report_helper.php:2012
static getUserFieldCrmValue($valueKey, $ufInfo)
Определения report_helper.php:403
static confirmFilterBackReferenceRewrite($fElem, $chain)
Определения report_helper.php:1112
static getDefaultReports()
Определения report_helper.php:1979
static getUserFieldCrmStatusValue($valueKey, $ufInfo)
Определения report_helper.php:516
const UF_DATETIME_SHORT_POSTFIX
Определения report_helper.php:11
static buildSelectTreePopupElelemnt($humanTitle, $fullHumanTitle, $fieldDefinition, $fieldType, $ufInfo=array())
Определения report_helper.php:953
static getColumnList()
Определения report_helper.php:40
static getGrcColumns()
Определения report_helper.php:671
static & getUFEnumerations($usedUFMap=null)
Определения report_helper.php:85
static $userNameFormat
Определения report_helper.php:17
const UF_TEXT_TRIM_POSTFIX
Определения report_helper.php:12
static getUserFieldMoneyValue($valueKey, $ufInfo)
Определения report_helper.php:629
static getUserFieldCrmTypePrefixMap()
Определения report_helper.php:377
static getUserFieldMoneyValueForChart($valueKey, $ufInfo)
Определения report_helper.php:644
static beforeFilterBackReferenceRewrite(&$filter, $viewColumns)
Определения report_helper.php:1103
static getCurrentVersion()
Определения report_helper.php:1990
static getUserFieldDiskFileValueForChart($valueKey, $ufInfo)
Определения report_helper.php:302
static getCompareVariations()
Определения report_helper.php:737
static getCustomSelectFields($select, $fList)
Определения report_helper.php:987
static getUserFieldEnumerationValue($valueKey, $ufInfo)
Определения report_helper.php:207
static getUserFieldFileValueForChart($valueKey, $ufInfo)
Определения report_helper.php:249
static prepareUFEnumerations($usedUFMap=null)
Определения report_helper.php:77
static confirmSelectBackReferenceRewrite($elem, $chain)
Определения report_helper.php:1117
static getUserNameFormat()
Определения report_helper.php:2001
static getUserFieldEmployeeValueForChart($valueKey, $ufInfo)
Определения report_helper.php:355
static beforeViewDataQuery(&$select, &$filter, &$group, &$order, &$limit, &$options, &$runtime=null)
Определения report_helper.php:1122
static fillFilterReferenceColumn(&$filterElement, Entity\ReferenceField $field)
Определения report_helper.php:1009
static collectUFValues($rows, $columnInfo, $total)
Определения report_helper.php:1130
static setRuntimeFields(\Bitrix\Main\Entity\Base $entity, $sqlTimeInterval)
Определения report_helper.php:661
static getFiltrableColumnGroups()
Определения report_helper.php:830
static buildHTMLSelectTreePopup($tree, $withReferencesChoose=false, $level=0)
Определения report_helper.php:835
static prepareValueToRound($value)
Определения report_helper.php:1669
static & getUFInfo()
Определения report_helper.php:70
static $ufFiles
Определения report_helper.php:22
static getDefaultElemHref($elem, $fList)
Определения report_helper.php:1974
static fillFilterReferenceColumns(&$filters, &$fieldList)
Определения report_helper.php:992
static $ufCrmStatuses
Определения report_helper.php:26
const UF_BOOLEAN_POSTFIX
Определения report_helper.php:13
static getUserFieldIblockSectionValue($valueKey, $ufInfo)
Определения report_helper.php:580
static $ufDiskFiles
Определения report_helper.php:24
static getCustomColumnTypes()
Определения report_helper.php:666
static getAlternatePhrasesOfColumns()
Определения report_helper.php:45
static getUserFieldFileValue($valueKey, $ufInfo)
Определения report_helper.php:227
static getOwnerId()
Определения report_helper.php:35
const UF_MONEY_CURRENCY_POSTFIX
Определения report_helper.php:15
static getUserFieldDataType($arUF)
Определения report_helper.php:117
static prepareUFInfo()
Определения report_helper.php:60
static formatResults(&$rows, &$columnInfo, $total)
Определения report_helper.php:1693
static setUserNameFormat($userNameFormat)
Определения report_helper.php:1996
static getUserFieldIblockSectionValueForChart($valueKey, $ufInfo)
Определения report_helper.php:610
static getUserFieldCrmValueForChart($valueKey, $ufInfo)
Определения report_helper.php:467
const UF_MONEY_NUMBER_POSTFIX
Определения report_helper.php:14
static getPeriodFilter($date_from, $date_to)
Определения report_helper.php:55
static getUserFieldDiskFileValue($valueKey, $ufInfo)
Определения report_helper.php:270
static formatResultsTotal(&$total, &$columnInfo, &$customChartTotal=null)
Определения report_helper.php:1910
static $ufInfo
Определения report_helper.php:20
static detectUserField($field)
Определения report_helper.php:92
static $arUFId
Определения report_helper.php:19
static rewriteResultRowValues(&$row, &$columnInfo)
Определения report_helper.php:1126
static getUserFieldEmployeeValue($valueKey, $ufInfo)
Определения report_helper.php:323
static getDefaultColumns()
Определения report_helper.php:50
static $ufIblockSections
Определения report_helper.php:28
static $ufEmployees
Определения report_helper.php:23
static getUserFieldIblockElementValue($valueKey, $ufInfo)
Определения report_helper.php:531
static getUserFieldIblockElementValueForChart($valueKey, $ufInfo)
Определения report_helper.php:561
static $ufIblockElements
Определения report_helper.php:27
static getFirstVersion()
Определения report_helper.php:1984
static fillFilterUFColumns(&$filters, &$fieldList)
Определения report_helper.php:1057
static getEntityFilterPrimaryFieldName($fElem)
Определения report_helper.php:1107
static fillFilterUFColumn(&$filterElement, $field, $ufInfo)
Определения report_helper.php:1075
static getEntityName()
Определения report_helper.php:30
static getCalcVariations()
Определения report_helper.php:676
Определения site.php:991
Определения user.php:6037
$options
Определения commerceml2.php:49
$componentName
Определения component_props2.php:49
$nameFormat
Определения discount_coupon_list.php:278
</td ></tr ></table ></td ></tr >< tr >< td class="bx-popup-label bx-width30"><?=GetMessage("PAGE_NEW_TAGS")?> array( $site)
Определения file_new.php:804
$res
Определения filter_act.php:7
$result
Определения get_property_values.php:14
$entity
if(Loader::includeModule( 'bitrix24')) elseif(Loader::includeModule('intranet') &&CIntranetUtils::getPortalZone() !=='ru') $description
Определения .description.php:24
$select
Определения iblock_catalog_list.php:194
$filter
Определения iblock_catalog_list.php:54
$siteId
Определения ajax.php:8
htmlspecialcharsback($str)
Определения tools.php:2693
htmlspecialcharsbx($string, $flags=ENT_COMPAT, $doubleEncode=true)
Определения tools.php:2701
ConvertTimeStamp($timestamp=false, $type="SHORT", $site=false, $bSearchInSitesOnly=false)
Определения tools.php:733
GetMessage($name, $aReplace=null)
Определения tools.php:3397
Определения ufield.php:9
$user
Определения mysql_to_pgsql.php:33
$order
Определения payment.php:8
$settings
Определения product_settings.php:43
if( $daysToExpire >=0 &&$daysToExpire< 60 elseif)( $daysToExpire< 0)
Определения prolog_main_admin.php:393
$i
Определения factura.php:643
else $userName
Определения order_form.php:75
</p ></td >< td valign=top style='border-top:none;border-left:none;border-bottom:solid windowtext 1.0pt;border-right:solid windowtext 1.0pt;padding:0cm 2.0pt 0cm 2.0pt;height:9.0pt'>< p class=Normal align=center style='margin:0cm;margin-bottom:.0001pt;text-align:center;line-height:normal'>< a name=ТекстовоеПоле54 ></a ><?=($taxRate > count( $arTaxList) > 0) ? $taxRate."%"
Определения waybill.php:936
$precision
Определения template.php:403
const SITE_ID
Определения sonet_set_content_view.php:12
$rows
Определения options.php:264
$k
Определения template_pdf.php:567
$GLOBALS['_____370096793']
Определения update_client.php:1
$site
Определения yandex_run.php:614