1C-Bitrix 25.700.0
Загрузка...
Поиск...
Не найдено
workgroup.php
См. документацию.
1<?php
2
9namespace Bitrix\Socialnetwork\Item;
10
11use Bitrix\Main;
12use Bitrix\Main\ArgumentException;
13use Bitrix\Main\Config\Option;
14use Bitrix\Main\Engine\CurrentUser;
15use Bitrix\Main\Localization\Loc;
16use Bitrix\Main\ModuleManager;
17use Bitrix\Main\ObjectPropertyException;
18use Bitrix\Main\SystemException;
19use Bitrix\Socialnetwork\Integration\UI\EntitySelector\Config;
20use Bitrix\Socialnetwork\Internals\Registry\GroupRegistry;
21use Bitrix\Socialnetwork\Item\Workgroup\Type;
22use Bitrix\Socialnetwork\Integration\Intranet\Structure\WorkgroupDepartmentsSynchronizer;
23use Bitrix\Socialnetwork\WorkgroupTable;
24use Bitrix\Socialnetwork\UserToGroupTable;
25use Bitrix\Socialnetwork\Helper;
26
27Loc::loadMessages(__FILE__);
28
30{
31 protected array $fields;
32 protected static $groupsIdToCheckList = [];
33
34 public static function createFromId(int $groupId = 0): static
35 {
36 return new static(['ID' => $groupId]);
37 }
38
39 public function __construct(array $fields = [])
40 {
41 $this->fields = $fields;
42 }
43
51 public static function getById($groupId = 0, $useCache = true): bool|static
52 {
53 $groupId = (int)$groupId;
54
55 if ($groupId <= 0)
56 {
57 return false;
58 }
59
60 $useCache = (bool)$useCache;
61
62 $registry = GroupRegistry::getInstance();
63
64 if (!$useCache)
65 {
66 $registry->invalidate($groupId);
67 }
68
69 $group = $registry->get($groupId);
70
71 if ($group === null)
72 {
73 return false; // disgusting! compatability...
74 }
75
76 return $group;
77 }
78
79 public function setFields(array $fields = []): void
80 {
81 $this->fields = $fields;
82 }
83
84 public function getFields(): array
85 {
86 return $this->fields;
87 }
88
89 public function getId(): int
90 {
91 return (int)($this->fields['ID'] ?? 0);
92 }
93
94 public function getName(): string
95 {
96 return (string)($this->fields['NAME'] ?? '');
97 }
98
99 public function getDescription(): string
100 {
101 return (string)($this->fields['DESCRIPTION'] ?? '');
102 }
103
104 public function getChatId(): int
105 {
106 return (int)($this->fields['CHAT_ID'] ?? 0);
107 }
108
109 public function getDialogId(): string
110 {
111 return (string)($this->fields['DIALOG_ID'] ?? '');
112 }
113
114 public function getImageId(): int
115 {
116 return (int)($this->fields['IMAGE_ID'] ?? 0);
117 }
118
119 public function getOwnerId(): int
120 {
121 return (int)($this->fields['OWNER_ID'] ?? 0);
122 }
123
124 public function getSiteId(): string
125 {
126 return (string)($this->fields['SITE_ID'] ?? '');
127 }
128
129 public function getSiteIds(): array
130 {
131 return (array)($this->fields['SITE_IDS'] ?? []);
132 }
133
134 public function isVisible(): bool
135 {
136 return ($this->fields['VISIBLE'] ?? null) === 'Y';
137 }
138
139 public function getType(): ?Type
140 {
141 $type = $this->fields['TYPE'] ?? null;
142 if ($type instanceof Type)
143 {
144 return $type;
145 }
146
147 return Type::tryFrom($type);
148 }
149
150 public function getAvatarType(): ?string
151 {
152 return $this->fields['AVATAR_TYPE'] ?? null;
153 }
154
155 public function getAvatarUrl(): string
156 {
157 $avatar = Helper\Workgroup::getAvatarEntitySelectorUrl($this->getAvatarType());
158 if (!empty($avatar))
159 {
160 return $avatar;
161 }
162
163 $extranetSiteId = Option::get('extranet', 'extranet_site');
164 $extranetSiteId = ($extranetSiteId && ModuleManager::isModuleInstalled('extranet') ? $extranetSiteId : false);
165 $isExtranet = in_array($extranetSiteId, $this->fields['SITE_IDS'] ?? [], true);
166 $type = ($isExtranet && !$this->isCollab()) ? 'extranet' : $this->getType()?->value;
167
168 $avatarTypes = Config::getProjectAvatarTypes();
169
170 return $avatarTypes[$type ?? 'default'] ?? $avatarTypes['default'];
171 }
172
174 {
175 $departments = $this->fields['UF_SG_DEPT'] ?? [];
176 if ($departments === [])
177 {
178 return [];
179 }
180
181 $departmentIds = $departments['VALUE'] ?? [];
182 if (empty($departmentIds))
183 {
184 return [];
185 }
186
188
189 return $departmentIds;
190 }
191
192 public function getUserMemberIds(): array
193 {
194 $memberIds = $this->fields['MEMBERS'] ?? [];
195 if ($memberIds === [])
196 {
197 return [];
198 }
199
201
202 return $memberIds;
203 }
204
205 public function getInvitedMemberIds(): array
206 {
207 $requestedIds = $this->fields['INVITED_MEMBERS'] ?? [];
208 if ($requestedIds === [])
209 {
210 return [];
211 }
212
214
215 return $requestedIds;
216 }
217
218 public function getModeratorMemberIds(): array
219 {
220 $moderatorIds = $this->fields['MODERATOR_MEMBERS'] ?? [];
221 if ($moderatorIds === [])
222 {
223 return [];
224 }
225
227
228 return $moderatorIds;
229 }
230
231 public function getOrdinaryMembers(): array
232 {
233 $ordinaryMemberIds = $this->fields['ORDINARY_MEMBERS'] ?? [];
234 if ($ordinaryMemberIds === [])
235 {
236 return [];
237 }
238
239 Main\Type\Collection::normalizeArrayValuesByInt($ordinaryMemberIds, false);
240
241 return $ordinaryMemberIds;
242 }
243
244 public function getMemberIdsWithRole(): array
245 {
246 $invited = array_fill_keys($this->getInvitedMemberIds(), UserToGroupTable::ROLE_REQUEST);
247 $ordinary = array_fill_keys($this->getOrdinaryMembers(), UserToGroupTable::ROLE_USER);
248 $moderators = array_fill_keys($this->getModeratorMemberIds(), UserToGroupTable::ROLE_MODERATOR);
249 $owner = [$this->getOwnerId() => UserToGroupTable::ROLE_OWNER];
250
251 return $invited + $ordinary + $moderators + $owner;
252 }
253
254 public function isProject(): bool
255 {
256 return (
257 isset($this->fields['PROJECT'])
258 && $this->fields['PROJECT'] === 'Y'
259 );
260 }
261
262 public function isScrumProject(): bool
263 {
264 return (!empty($this->fields['SCRUM_MASTER_ID']));
265 }
266
267 public function isCollab(): bool
268 {
269 return $this->getType() === Type::Collab;
270 }
271
272 public function getDefaultSprintDuration(): int
273 {
274 return ($this->fields['SCRUM_SPRINT_DURATION'] ? : 0);
275 }
276
277 public function getScrumMaster(): int
278 {
279 return ($this->fields['SCRUM_MASTER_ID'] ? : 0);
280 }
281
282 public function getScrumTaskResponsible(): string
283 {
284 if ($this->fields['SCRUM_TASK_RESPONSIBLE'])
285 {
286 $scrumTaskResponsible = $this->fields['SCRUM_TASK_RESPONSIBLE'];
287 $availableResponsibleTypes = ['A', 'M'];
288 return (
289 in_array($scrumTaskResponsible, $availableResponsibleTypes, true) ? $scrumTaskResponsible : 'A'
290 );
291 }
292
293 return 'A';
294 }
295
300 public function syncDeptConnection($exclude = false): void
301 {
302 $currentUserId = (int)CurrentUser::get()->getId();
303
304 WorkgroupDepartmentsSynchronizer::getInstance()->synchronize($this, $currentUserId, $exclude);
305 }
306
307 public function getGroupUrlData($params = array())
308 {
309 static $cache = array();
310
311 $groupFields = $this->getFields();
312 $userId = (int)($params['USER_ID'] ?? 0);
313
314 if (
315 !empty($cache)
316 && !empty($cache[$groupFields["ID"]])
317 )
318 {
319 $groupUrlTemplate = $cache[$groupFields['ID']]['URL_TEMPLATE'];
320 $groupSiteId = $cache[$groupFields['ID']]['SITE_ID'];
321 }
322 else
323 {
324 $groupSiteId = \CSocNetGroup::getDefaultSiteId($groupFields["ID"], $groupFields["SITE_ID"]);
325 $workgroupsPage = Option::get("socialnetwork", "workgroups_page", "/workgroups/", SITE_ID);
326 $groupUrlTemplate = Helper\Path::get('group_path_template');
327 $groupUrlTemplate = "#GROUPS_PATH#".mb_substr($groupUrlTemplate, mb_strlen($workgroupsPage), mb_strlen($groupUrlTemplate) - mb_strlen($workgroupsPage));
328
329 $cache[$groupFields["ID"]] = array(
330 'URL_TEMPLATE' => $groupUrlTemplate ,
331 'SITE_ID' => $groupSiteId,
332 );
333 }
334
335 $groupUrl = str_replace(array("#group_id#", "#GROUP_ID#"), $groupFields["ID"], $groupUrlTemplate);
336 $serverName = $domainName = '';
337
338 if ($userId > 0)
339 {
340 $tmp = \CSocNetLogTools::processPath(
341 [
342 'GROUP_URL' => $groupUrl,
343 ],
344 $userId,
345 $groupSiteId
346 );
347
348 $groupUrl = $tmp["URLS"]["GROUP_URL"];
349 $serverName = (mb_strpos($groupUrl, "http://") === 0 || mb_strpos($groupUrl, "https://") === 0 ? "" : $tmp["SERVER_NAME"]);
350 $domainName = (mb_strpos($groupUrl, "http://") === 0 || mb_strpos($groupUrl, "https://") === 0 ? "" : (isset($tmp["DOMAIN"]) && !empty($tmp["DOMAIN"]) ? "//".$tmp["DOMAIN"] : ""));
351 }
352
353 return [
354 'URL' => $groupUrl,
355 'SERVER_NAME' => $serverName,
356 'DOMAIN' => $domainName,
357 ];
358 }
359
360 public function isLandingGroup(): bool
361 {
362 return ($this->getFields()['LANDING'] ?? null) === 'Y';
363 }
364
365 public function getInitiatePermission(): ?string
366 {
367 return $this->fields['INITIATE_PERMS'] ?? null;
368 }
369
370 public function toArray(): array
371 {
372 return $this->getFields();
373 }
374
375 public function toJson($options = 0): array
376 {
377 return $this->toArray();
378 }
379
380 public static function onBeforeIBlockSectionUpdate($section)
381 {
382 if (
383 !isset($section['ID'], $section['IBLOCK_ID'])
384 || (int)$section['ID'] <= 0
385 || (int)$section['IBLOCK_ID'] <= 0
386 || (
387 isset($section['ACTIVE'])
388 && $section['ACTIVE'] === 'N'
389 )
390 || (int)$section['IBLOCK_ID'] !== (int)Option::get('intranet', 'iblock_structure', 0)
391 )
392 {
393 return true;
394 }
395
396 $rootSectionIdList = [];
397 $res = \CIBlockSection::getNavChain($section['IBLOCK_ID'], $section['ID'], array('ID'));
398 while ($rootSection = $res->fetch())
399 {
400 if ((int)$rootSection['ID'] !== (int)$section['ID'])
401 {
402 $rootSectionIdList[] = $rootSection['ID'];
403 }
404 }
405
406 if (!empty($rootSectionIdList))
407 {
408 $groupList = UserToGroup::getConnectedGroups($rootSectionIdList);
409 self::$groupsIdToCheckList = array_merge(self::$groupsIdToCheckList, $groupList);
410 }
411
412 return true;
413 }
414
415 public static function onAfterIBlockSectionUpdate($section)
416 {
417 if(
418 !isset($section['ID'], $section['IBLOCK_ID'])
419 || (int)$section['ID'] <= 0
420 || (int)$section['IBLOCK_ID'] <= 0
421 || (int)$section['IBLOCK_ID'] !== (int)Option::get('intranet', 'iblock_structure', 0)
422 )
423 {
424 return true;
425 }
426
427 $oldGroupsIdToCheckList = self::$groupsIdToCheckList;
428 $newGroupsIdToCheckList = [];
429
430 if (
431 isset($section['ACTIVE'])
432 && $section['ACTIVE'] === 'N'
433 )
434 {
435 self::disconnectSection($section['ID']);
436 }
437 else
438 {
439 $res = \CIBlockSection::getNavChain($section['IBLOCK_ID'], $section['ID'], array('ID'));
440 while ($rootSection = $res->fetch())
441 {
442 if ((int)$rootSection['ID'] !== (int)$section['ID'])
443 {
444 $rootSectionIdList[] = $rootSection['ID'];
445 }
446 }
447
448 if (!empty($rootSectionIdList))
449 {
450 $newGroupsIdToCheckList = UserToGroup::getConnectedGroups($rootSectionIdList);
451 }
452 }
453
454 if (!empty($oldGroupsIdToCheckList))
455 {
456 $oldGroupsIdToCheckList = array_unique($oldGroupsIdToCheckList);
457 foreach($oldGroupsIdToCheckList as $groupId)
458 {
459 $groupItem = self::getById($groupId, false);
460 $groupItem->syncDeptConnection(true);
461 }
462 }
463
464 if (!empty($newGroupsIdToCheckList))
465 {
466 $newGroupsIdToCheckList = array_unique($newGroupsIdToCheckList);
467 foreach($newGroupsIdToCheckList as $groupId)
468 {
469 $groupItem = self::getById($groupId, false);
470 $groupItem->syncDeptConnection();
471 }
472 }
473
474 return true;
475 }
476
477 public static function onBeforeIBlockSectionDelete($sectionId)
478 {
479 if ((int)$sectionId <= 0)
480 {
481 return true;
482 }
483
484 $res = \CIBlockSection::getList(
485 [],
486 [ 'ID' => $sectionId ],
487 false,
488 [ 'ID', 'IBLOCK_ID' ]
489 );
490 if (
491 !($section = $res->fetch())
492 || !isset($section['IBLOCK_ID'])
493 || (int)$section['IBLOCK_ID'] <= 0
494 || (
495 isset($section['ACTIVE'])
496 && $section['ACTIVE'] === 'N'
497 )
498 || (int)$section['IBLOCK_ID'] !== (int)Option::get('intranet', 'iblock_structure', 0)
499 )
500 {
501 return true;
502 }
503
504 $rootSectionIdList = [];
505 $res = \CIBlockSection::getNavChain($section['IBLOCK_ID'], $section['ID'], array('ID'));
506 while ($rootSection = $res->fetch())
507 {
508 if ((int)$rootSection['ID'] !== (int)$section['ID'])
509 {
510 $rootSectionIdList[] = $rootSection['ID'];
511 }
512 }
513
514 if (!empty($rootSectionIdList))
515 {
516 $groupList = UserToGroup::getConnectedGroups($rootSectionIdList);
517 self::$groupsIdToCheckList = array_merge(self::$groupsIdToCheckList, $groupList);
518 }
519
520 return true;
521 }
522
523 public static function onAfterIBlockSectionDelete($section): bool
524 {
525 if(
526 !isset($section['ID'], $section['IBLOCK_ID'])
527 || (int)$section['ID'] <= 0
528 || (int)$section['IBLOCK_ID'] <= 0
529 || (int)$section['IBLOCK_ID'] !== (int)Option::get('intranet', 'iblock_structure', 0)
530 )
531 {
532 return true;
533 }
534
535 self::disconnectSection($section['ID']);
536
537 if (!empty(self::$groupsIdToCheckList))
538 {
539 $groupsToCheck = array_unique(self::$groupsIdToCheckList);
540 foreach($groupsToCheck as $groupId)
541 {
542 $groupItem = self::getById($groupId, false);
543 $groupItem->syncDeptConnection();
544 }
545 }
546
547 return true;
548 }
549
550 private static function disconnectSection($sectionId): void
551 {
552 $groupList = array();
553 $res = WorkgroupTable::getList(array(
554 'filter' => array(
555 '=UF_SG_DEPT' => $sectionId,
556 ),
557 'select' => array('ID', 'UF_SG_DEPT'),
558 ));
559 while($group = $res->fetch())
560 {
561 $groupList[] = $group;
562 }
563
564 foreach($groupList as $group)
565 {
566 $departmentListOld = array_map('intval', $group['UF_SG_DEPT']);
567 $departmentListNew = array_diff($departmentListOld, array($sectionId));
568
569 \CSocNetGroup::update($group['ID'], array(
570 'UF_SG_DEPT' => $departmentListNew,
571 ));
572
573 $groupItem = self::getById($group['ID'], false);
574 $groupItem->syncDeptConnection(true);
575 }
576 }
577
578 public static function getTypes($params = []): array
579 {
580 return Helper\Workgroup::getTypes($params);
581 }
582
583 public static function getPresets($params = array()): array
584 {
585 return Helper\Workgroup::getPresets($params);
586 }
587
588 private static function getGroupContent($params = array()): string
589 {
590 static $fieldsList = null;;
591
592 $content = '';
593
594 $groupId = (int)($params['id'] ?? 0);
595
596 if ($groupId <= 0)
597 {
598 return $content;
599 }
600
601 if ($fieldsList === null)
602 {
603 $fieldsList = self::getContentFieldsList();
604 }
605
606 if (
607 isset($params['fields'])
608 && is_array($params['fields'])
609 && ($diff = array_diff($fieldsList, array_keys($params['fields'])))
610 && empty($diff)
611 )
612 {
613 $groupFieldsList = $params['fields'];
614 }
615 else
616 {
617 $res = WorkgroupTable::getList(array(
618 'filter' => array(
619 'ID' => $groupId,
620 ),
621 'select' => $fieldsList,
622 ));
623 $groupFieldsList = $res->fetch();
624 }
625
626 if (!empty($groupFieldsList))
627 {
628 $content .= $groupFieldsList['NAME'];
629 if (!empty($groupFieldsList['DESCRIPTION']))
630 {
631 $content .= ' '.$groupFieldsList['DESCRIPTION'];
632 }
633
634 if (!empty($groupFieldsList['KEYWORDS']))
635 {
636 $keywordList = explode(",", $groupFieldsList["KEYWORDS"]);
637 $tagList = array();
638 foreach($keywordList as $keyword)
639 {
640 $tagList[] = trim($keyword);
641 $tagList[] = '#'.trim($keyword);
642 }
643 if (!empty($tagList))
644 {
645 $content .= ' '.implode(' ', $tagList);
646 }
647 }
648
649 if (
650 !empty($groupFieldsList['OWNER_ID'])
651 && (int)$groupFieldsList['OWNER_ID'] > 0
652 )
653 {
654 $res = Main\UserTable::getList(array(
655 'filter' => array(
656 'ID' => (int)$groupFieldsList['OWNER_ID'],
657 ),
658 'select' => array('ID', 'NAME', 'LAST_NAME', 'SECOND_NAME', 'LOGIN', 'EMAIL'),
659 ));
660 if ($userFields = $res->fetch())
661 {
662 $content .= ' '.\CUser::formatName(\CSite::getNameFormat(null, $groupFieldsList['SITE_ID']), $userFields, true);
663 }
664 }
665 }
666
667 return $content;
668 }
669
670 public static function setIndex($params = array()): void
671 {
672 global $DB;
673
674 static $connection = null;
675
676 if (!is_array($params))
677 {
678 return;
679 }
680
681 $fields = (isset($params['fields']) ? $params['fields'] : array());
682
683 if (
684 !is_array($fields)
685 || empty($fields)
686 )
687 {
688 return;
689 }
690
691 $groupId = (isset($fields['ID']) ? intval($fields['ID']) : 0);
692
693 if ($groupId <= 0)
694 {
695 return;
696 }
697
698 $content = self::getGroupContent(array(
699 'id' => $groupId,
700 'fields' => $fields,
701 ));
702
703 $content = self::prepareToken($content);
704
705 $event = new Main\Event(
706 'socialnetwork',
707 'onWorkgroupIndexGetContent',
708 array(
709 'groupId' => $groupId,
710 )
711 );
712 $event->send();
713
714 foreach($event->getResults() as $eventResult)
715 {
716 if ($eventResult->getType() == \Bitrix\Main\EventResult::SUCCESS)
717 {
718 $eventParams = $eventResult->getParameters();
719
720 if (
721 is_array($eventParams)
722 && isset($eventParams['content'])
723 )
724 {
725 $eventContent = $eventParams['content'];
726 if (Main\Loader::includeModule('search'))
727 {
728 $eventContent = \CSearch::killTags($eventContent);
729 }
730 $eventContent = trim(str_replace(
731 array("\r", "\n", "\t"),
732 " ",
733 $eventContent
734 ));
735
736 $eventContent = self::prepareToken($eventContent);
737 if (!empty($eventContent))
738 {
739 $content .= ' '.$eventContent;
740 }
741 }
742 }
743 }
744
745 if (!empty($content))
746 {
747 if ($connection === null)
748 {
750 }
751
752 $value = $DB->forSql($content);
753 $encryptedValue = sha1($content);
754
755 $connection->query("UPDATE ".WorkgroupTable::getTableName()." SET SEARCH_INDEX = CASE WHEN " . $connection->getSqlHelper()->getSha1Function('SEARCH_INDEX') . " = '{$encryptedValue}' THEN SEARCH_INDEX ELSE '{$value}' END WHERE ID = {$groupId}");
756 }
757 }
758
759 public static function getContentFieldsList(): array
760 {
761 return [ 'NAME', 'DESCRIPTION', 'OWNER_ID', 'KEYWORDS', 'SITE_ID' ];
762 }
763
764 public static function prepareToken($str)
765 {
766 return str_rot13($str);
767 }
768
769 public static function getInitiatePermOptionsList(array $params = []): array
770 {
771 $ownerValue = Loc::getMessage('SOCIALNETWORK_ITEM_WORKGROUP_IP_OWNER');
772 $moderatorsValue = Loc::getMessage('SOCIALNETWORK_ITEM_WORKGROUP_IP_MOD');
773 $userValue = Loc::getMessage('SOCIALNETWORK_ITEM_WORKGROUP_IP_USER');
774
775 if (
776 isset($params['scrum'])
777 && $params['scrum']
778 )
779 {
780 $ownerValue = Loc::getMessage('SOCIALNETWORK_ITEM_WORKGROUP_IP_OWNER_SCRUM2');
781 $moderatorsValue = Loc::getMessage('SOCIALNETWORK_ITEM_WORKGROUP_IP_MOD_SCRUM2');
782 $userValue = Loc::getMessage('SOCIALNETWORK_ITEM_WORKGROUP_IP_USER_SCRUM');
783 }
784 elseif (
785 isset($params['project'])
786 && $params['project']
787 )
788 {
789 $ownerValue = Loc::getMessage('SOCIALNETWORK_ITEM_WORKGROUP_IP_OWNER_PROJECT');
790 $moderatorsValue = Loc::getMessage('SOCIALNETWORK_ITEM_WORKGROUP_IP_MOD_PROJECT');
791 $userValue = Loc::getMessage('SOCIALNETWORK_ITEM_WORKGROUP_IP_USER_PROJECT');
792 }
793
794 return [
795 UserToGroupTable::ROLE_OWNER => $ownerValue,
796 UserToGroupTable::ROLE_MODERATOR => $moderatorsValue,
797 UserToGroupTable::ROLE_USER => $userValue,
798 ];
799 }
800
801 public static function getSpamPermOptionsList(): array
802 {
803 return [
804 UserToGroupTable::ROLE_OWNER => Loc::getMessage('SOCIALNETWORK_ITEM_WORKGROUP_IP_OWNER'),
805 UserToGroupTable::ROLE_MODERATOR => Loc::getMessage('SOCIALNETWORK_ITEM_WORKGROUP_IP_MOD'),
806 UserToGroupTable::ROLE_USER => Loc::getMessage('SOCIALNETWORK_ITEM_WORKGROUP_IP_USER'),
807 SONET_ROLES_ALL => Loc::getMessage('SOCIALNETWORK_ITEM_WORKGROUP_IP_ALL'),
808 ];
809 }
810
816 public static function getByFeatureOperation(array $params = []): array
817 {
818 return Helper\Workgroup::getByFeatureOperation($params);
819 }
820
821 public static function getListSprintDuration(): array
822 {
823 return Helper\Workgroup::getListSprintDuration();
824 }
825
826 public static function getScrumTaskResponsibleList(): array
827 {
828 return Helper\Workgroup::getScrumTaskResponsibleList();
829 }
830
831 public static function getTypeCodeByParams($params)
832 {
833 return Helper\Workgroup::getTypeCodeByParams($params);
834 }
835
836 public static function getTypeByCode($params = [])
837 {
838 return Helper\Workgroup::getTypeByCode($params);
839 }
840
841 public static function getEditFeaturesAvailability()
842 {
843 return Helper\Workgroup::getEditFeaturesAvailability();
844 }
845
846 public static function canWorkWithClosedWorkgroups(): bool
847 {
848 static $optionValue = null;
849 if ($optionValue === null)
850 {
851 $optionValue = Option::get('socialnetwork', 'work_with_closed_groups', 'N');
852 }
853
854 return ($optionValue === 'Y');
855 }
856}
$connection
Определения actionsdefinitions.php:38
$type
Определения options.php:106
if(!is_object($USER)||! $USER->IsAuthorized()) $userId
Определения check_mail.php:18
static getConnection($name="")
Определения application.php:638
Определения event.php:5
static normalizeArrayValuesByInt(&$map, $sorted=true)
Определения collection.php:150
static getConnectedGroups($departmentList)
Определения usertogroup.php:450
static canWorkWithClosedWorkgroups()
Определения workgroup.php:846
static onBeforeIBlockSectionDelete($sectionId)
Определения workgroup.php:477
toJson($options=0)
Определения workgroup.php:375
static getTypes($params=[])
Определения workgroup.php:578
static onAfterIBlockSectionDelete($section)
Определения workgroup.php:523
static getListSprintDuration()
Определения workgroup.php:821
__construct(array $fields=[])
Определения workgroup.php:39
static onBeforeIBlockSectionUpdate($section)
Определения workgroup.php:380
static getContentFieldsList()
Определения workgroup.php:759
static getSpamPermOptionsList()
Определения workgroup.php:801
static getById($groupId=0, $useCache=true)
Определения workgroup.php:51
static onAfterIBlockSectionUpdate($section)
Определения workgroup.php:415
static createFromId(int $groupId=0)
Определения workgroup.php:34
static getTypeCodeByParams($params)
Определения workgroup.php:831
static getByFeatureOperation(array $params=[])
Определения workgroup.php:816
static $groupsIdToCheckList
Определения workgroup.php:32
static getInitiatePermOptionsList(array $params=[])
Определения workgroup.php:769
getGroupUrlData($params=array())
Определения workgroup.php:307
static getPresets($params=array())
Определения workgroup.php:583
static prepareToken($str)
Определения workgroup.php:764
syncDeptConnection($exclude=false)
Определения workgroup.php:300
static getTypeByCode($params=[])
Определения workgroup.php:836
static getEditFeaturesAvailability()
Определения workgroup.php:841
static getScrumTaskResponsibleList()
Определения workgroup.php:826
setFields(array $fields=[])
Определения workgroup.php:79
static setIndex($params=array())
Определения workgroup.php:670
static getTableName()
Определения workgroup.php:58
$options
Определения commerceml2.php:49
$str
Определения commerceml2.php:63
$content
Определения commerceml.php:144
if(!is_array($prop["VALUES"])) $tmp
Определения component_props.php:203
</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
global $DB
Определения cron_frame.php:29
$event
Определения prolog_after.php:141
if( $daysToExpire >=0 &&$daysToExpire< 60 elseif)( $daysToExpire< 0)
Определения prolog_main_admin.php:393
if($inWords) echo htmlspecialcharsbx(Number2Word_Rus(roundEx($totalVatSum $params['CURRENCY']
Определения template.php:799
$optionValue
Определения options.php:3512
const SONET_ROLES_ALL
Определения include.php:35
const SITE_ID
Определения sonet_set_content_view.php:12
$fields
Определения yandex_run.php:501