45 protected static $gridId =
'SOCIALNETWORK_WORKGROUP_USER_LIST';
46 protected static $filterId =
'SOCIALNETWORK_WORKGROUP_USER_LIST';
59 parent::__construct($component);
72 $this->errorCollection[] = $error;
79 return $this->errorCollection->getErrorByCode($code);
88 return $this->errorCollection->toArray();
93 foreach ($this->errorCollection as $error)
99 public static function getActions(array $params = []): array
105 $groupId = (int)$params[
'GROUP_ID'];
106 $group = $params[
'GROUP'];
107 $currentUserRelation = $params[
'CURRENT_RELATION'];
108 $relation = $params[
'RELATION'];
113 $currentUserRelation,
116 if ($accessManager->canSetOwner())
121 if ($accessManager->canSetScrumMaster())
126 if ($accessManager->canSetModerator())
130 elseif ($accessManager->canRemoveModerator())
135 $canDeleteOutgoingRequest = $accessManager->canDeleteOutgoingRequest();
136 if ($accessManager->canDeleteOutgoingRequest())
140 elseif ($accessManager->canExclude())
145 if ($accessManager->canProcessIncomingRequest())
151 $canDeleteOutgoingRequest
152 && ModuleManager::isModuleInstalled(
'intranet')
153 && !empty($relation->getUser()->getConfirmCode())
159 if ($accessManager->canDeleteIncomingRequest())
173 $entityFilter = Filter\Factory::createEntityFilter(
176 'ID' => self::$filterId,
179 $result[
'FILTER'] = $entityFilter->getFieldArrays();
184 $result[
'CURRENT_PRESET_ID'] = self::getCurrentPresetId($mode);
185 $result[
'CURRENT_COUNTER'] = self::getCounter($mode);
186 $result[
'CUSTOM_FILTER'] = self::getCurrentCustomFilter($mode);
187 $result[
'FILTER_PRESETS'] = self::getFilterPresets($result[
'CURRENT_PRESET_ID'], $groupPerms);
192 private static function getCurrentPresetId(
string $mode): string
206 $result =
'tmp_filter';
212 private static function getCounter(
string $mode): string
229 private static function getCurrentCustomFilter(
string $mode): array
245 private static function getFilterPresets(
string $currentPresetId, array $groupPerms): array
249 $extranetAvailable = \Bitrix\Main\Filter\UserDataProvider::getExtranetAvailability();
252 'name' =>
Loc::getMessage(
'SOCIALNETWORK_GROUP_USER_LIST_FILTER_PRESET_ALL'),
261 if ($extranetAvailable)
263 $companyFilter[
'EXTRANET'] =
'N';
269 ?
Loc::getMessage(
'SOCIALNETWORK_GROUP_USER_LIST_FILTER_PRESET_COMPANY')
270 : Loc::getMessage(
'SOCIALNETWORK_GROUP_USER_LIST_FILTER_PRESET_MEMBERS')
272 'fields' => $companyFilter,
276 if ($extranetAvailable)
279 'name' =>
Loc::getMessage(
'SOCIALNETWORK_GROUP_USER_LIST_FILTER_PRESET_EXTERNAL'),
289 if ($groupPerms[
'UserCanProcessRequestsIn'] ??
null)
292 'name' =>
Loc::getMessage(
'SOCIALNETWORK_GROUP_USER_LIST_FILTER_PRESET_REQUESTS_IN'),
302 if ($groupPerms[
'UserCanInitiate'])
305 'name' =>
Loc::getMessage(
'SOCIALNETWORK_GROUP_USER_LIST_FILTER_PRESET_REQUESTS_OUT'),
static getMessage($code, $replace=null, $language=null)
const AJAX_ACTION_ACCEPT_INCOMING_REQUEST
const AVAILABLE_ACTION_SET_MODERATOR
const AVAILABLE_ACTION_DELETE_INCOMING_REQUEST
__construct($component=null)
const AJAX_ACTION_DELETE_OUTGOING_REQUEST
const AJAX_ACTION_SET_SCRUM_MASTER
static getActions(array $params=[])
const AVAILABLE_ACTION_SET_SCRUM_MASTER
const AVAILABLE_ACTION_VIEW_PROFILE
static prepareFilterResult(array $result, array $groupPerms, string $mode='')
const AJAX_ACTION_REMOVE_MODERATOR
const AVAILABLE_ACTION_SET_OWNER
const AJAX_ACTION_SET_OWNER
const AJAX_ACTION_REJECT_INCOMING_REQUEST
const AJAX_ACTION_DELETE_INCOMING_REQUEST
const AJAX_ACTION_EXCLUDE
const AVAILABLE_ACTION_DELETE_OUTGOING_REQUEST
const AVAILABLE_ACTION_EXCLUDE
const PRESET_REQUESTS_OUT
const AJAX_ACTION_REINVITE
const AVAILABLE_ACTION_REINVITE
const AJAX_ACTION_SET_MODERATOR
const AVAILABLE_ACTION_REMOVE_MODERATOR
const AVAILABLE_ACTION_PROCESS_INCOMING_REQUEST
const COUNTER_WORKGROUP_REQUESTS_IN
const COUNTER_WORKGROUP_REQUESTS_OUT