114 self::AVAILABLE_ACTION_VIEW,
117 $groupFields = $params[
'GROUP'];
118 $runtimeFields = $runtimeFieldsManager->get();
119 $queryInitAlias = $params[
'QUERY_INIT_ALIAS'];
122 'queryInitAlias' => $params[
'QUERY_INIT_ALIAS'],
125 if (in_array(
'CURRENT_RELATION', $runtimeFields,
true))
127 $group = $entityManager->wakeUpWorkgroupEntityObject($groupFields);
128 $currentUserRelation = $entityManager->wakeUpCurrentRelationEntityObject($groupFields, $queryInitAlias);
129 $favorites = $entityManager->wakeUpFavoritesEntityObject($groupFields);
131 $accessManager = new \Bitrix\Socialnetwork\Item\Workgroup\AccessManager(
133 $currentUserRelation,
134 $currentUserRelation,
136 'currentUserFavorites' => $favorites,
140 if ($accessManager->canEdit())
142 $result[] = self::AVAILABLE_ACTION_EDIT;
145 if ($accessManager->canSetOwner())
147 $result[] = self::AVAILABLE_ACTION_SET_CURRENT_USER_OWNER;
150 if ($accessManager->canSetScrumMaster())
152 $result[] = self::AVAILABLE_ACTION_SET_CURRENT_USER_SCRUM_MASTER;
155 if ($accessManager->canJoin())
157 $result[] = self::AVAILABLE_ACTION_JOIN;
160 if ($accessManager->canLeave())
162 $result[] = self::AVAILABLE_ACTION_LEAVE;
165 if ($accessManager->canDeleteIncomingRequest())
167 $result[] = self::AVAILABLE_ACTION_DELETE_INCOMING_REQUEST;
170 if ($accessManager->canAddToFavorites())
172 $result[] = self::AVAILABLE_ACTION_ADD_TO_FAVORITES;
175 if ($accessManager->canRemoveFromFavorites())
177 $result[] = self::AVAILABLE_ACTION_REMOVE_FROM_FAVORITES;
180 if ($accessManager->canAddToArchive())
182 $result[] = self::AVAILABLE_ACTION_ADD_TO_ARCHIVE;
185 if ($accessManager->canRemoveFromArchive())
187 $result[] = self::AVAILABLE_ACTION_REMOVE_FROM_ARCHIVE;
190 if ($accessManager->canDelete())
192 $result[] = self::AVAILABLE_ACTION_DELETE;
205 $gridId = (string)($params[
'GRID_ID'] ??
'');
206 $groupFields = ($params[
'GROUP'] ??
null);
215 $runtimeFields = $runtimeFieldsManager->get();
218 'queryInitAlias' => $params[
'QUERY_INIT_ALIAS'],
221 $group = $entityManager->wakeUpWorkgroupEntityObject($groupFields);
227 $groupId = (int)$group->get(
'ID');
230 if (in_array(
'PIN', $runtimeFields,
true))
232 $pinEntity = $entityManager->wakeUpPinEntityObject($groupFields);
233 $isPinned = ($pinEntity !==
null);
237 Grid\CellActions::PIN,
238 ($isPinned ? Grid\CellActionState::ACTIVE : Grid\CellActionState::SHOW_BY_HOVER),
241 'click' =>
'BX.Socialnetwork.UI.Grid.ActionController
242 .changePin.bind(BX.Socialnetwork.UI.Grid.ActionController, ' . $groupId .
')',
256 return in_array($action, [
257 self::AJAX_ACTION_JOIN,
258 self::AJAX_ACTION_SET_OWNER,
259 self::AJAX_ACTION_SET_SCRUM_MASTER,
260 self::AJAX_ACTION_DELETE_INCOMING_REQUEST,
261 self::AJAX_ACTION_REJECT_OUTGOING_REQUEST,
262 self::AJAX_ACTION_ADD_TO_ARCHIVE,
263 self::AJAX_ACTION_REMOVE_FROM_ARCHIVE,
299 $currentPreset = $this->filterOptions->getCurrentFilterId();
300 $isDefaultPreset = ($this->filterOptions->getDefaultFilterId() === $currentPreset);
301 $additionalFields = $this->filterOptions->getAdditionalPresetFields($currentPreset);
302 $isSearchStringEmpty = ($this->filterOptions->getSearchString() ===
'');
304 return (!$isSearchStringEmpty || !$isDefaultPreset || !empty($additionalFields));