get('accept_tasks', 0) : 0); // get a registry of the requested task record $taskRegistry = VBOTaskTaskregistry::getRecordInstance((int) $taskId); if (!$taskRegistry->getID()) { // task record not found throw new Exception('Cannot find task details', 404); } // get the task assignee IDs $assingeeIds = $taskRegistry->getAssigneeIds(); if ((!$assingeeIds && !$accept_tasks) || ($assingeeIds && !in_array($operator['id'], $assingeeIds))) { // task record not accessible by the current operator throw new Exception('Cannot access task details', 403); } // get the current task area object wrapper $taskArea = VBOTaskArea::getRecordInstance($taskRegistry->getAreaID()); if ($taskArea->isPrivate()) { // the area of this task seems to be private throw new Exception('Cannot access this area', 403); } // inject current area in task registry wrapper $taskRegistry->setArea($taskArea); // access data for backward navigation $calendar_back_type = $data['filters']['calendar_back_type'] ?? 'month'; $calendar_back_type = in_array($calendar_back_type, ['month', 'day']) ? $calendar_back_type : 'month'; // access the task manager object $taskManager = VBOFactory::getTaskManager(); // load task assignees $assignees = $taskRegistry->getAssigneeDetails(); // load task tags $tags = $taskRegistry->getTags() ? $taskRegistry->getTagRecords() : []; // get task status object $status = $taskManager->statusTypeExists($taskRegistry->getStatus()) ? $taskManager->getStatusTypeInstance($taskRegistry->getStatus()) : null; // load all the available status types $statusTypes = []; foreach ($taskManager->getStatusGroupElements($taskArea->getStatuses()) as $groupId => $group) { // push group button $statusTypes[] = [ 'id' => null, 'text' => $group['text'], ]; // iterate over the statuses of this group foreach ($group['elements'] as $statusType) { // push status button $statusTypes[] = [ 'id' => $statusType['id'], 'text' => $statusType['text'], 'color' => $statusType['color'], ]; } } $roomInfo = null; ?>