34 'fieldId' => $fieldId,
42 $userId = (int)(CurrentUser::get()?->getId() ?? 0);
43 $taskUserIds = \CBPTaskService::getTaskUserIds($taskId);
45 if (!in_array($userId, $taskUserIds,
true))
50 $task = \CBPTaskService::getList(
51 arFilter: [
'ID' => $taskId],
52 arSelectFields: [
'ACTIVITY',
'PARAMETERS',
'STATUS']
55 if ($task && (
int)$task[
'STATUS'] === \CBPTaskStatus::Running)
57 $taskFields = \CBPDocument::getTaskControls($task)[
'FIELDS'] ?? [];
59 $editableFields = array_filter(
61 static fn($field) => $field[
'Id'] === $fieldId && in_array($field[
'Type'], [
'file',
'S:DiskFile']),
64 return count($editableFields) > 0;