...Человеческий поиск в разработке...
- Модуль: tasks
- Путь к файлу: ~/bitrix/modules/tasks/lib/control/handler/taskfieldhandler.php
- Класс: BitrixTasksControlHandlerTaskFieldHandler
- Вызов: TaskFieldHandler::prepareParents
public function prepareParents(): self { if (!array_key_exists('PARENT_ID', $this->fields)) { return $this; } $parentId = (int)$this->fields['PARENT_ID']; if (!$parentId) { $this->fields['PARENT_ID'] = false; return $this; } $this->fields['PARENT_ID'] = $parentId; $parentTask = (TaskRegistry::getInstance())->getObject($parentId); if ( !$parentTask || $parentTask->isDeleted() || !TaskAccessController::can($this->userId, ActionDictionary::ACTION_TASK_READ, $parentId) ) { throw new TaskFieldValidateException(Loc::getMessage('TASKS_BAD_PARENT_ID')); } if (!$this->taskId) { return $this; } if (ProjectDependenceTable::checkLinkExists($this->taskId, $parentId, ['BIDIRECTIONAL' => true])) { throw new TaskFieldValidateException(Loc::getMessage('TASKS_IS_LINKED_SET_PARENT')); } $result = Dependence::canAttach($this->taskId, $parentId); if (!$result->isSuccess() && ($errors = $result->getErrors())) { $messages = $errors->getMessages(); throw new TaskFieldValidateException(array_shift($messages)); } return $this; }