11 public function delegateAction(array $taskIds,
int $toUserId,
int $fromUserId): ?array
19 if ($toUserId <= 0 || $fromUserId <= 0)
26 $currentUserId = $this->getCurrentUser()->getId();
29 new Bizproc\Api\Service\TaskAccessService($currentUserId)
33 $delegateTaskResult = $taskService->delegateTasks($tasksRequest);
35 if (!$delegateTaskResult->isSuccess())
37 $this->
addErrors($delegateTaskResult->getErrors());
43 'message' => $delegateTaskResult->getSuccessDelegateTaskMessage(),
50 private function getListAction(?
int $targetUserId =
null): ?array
52 $currentUserId = $this->getCurrentUser()->getId();
55 $targetUserId = $currentUserId;
61 new Bizproc\Api\Service\TaskAccessService($currentUserId)
65 additionalSelectFields: [
'NAME',
'DESCRIPTION'],
67 'USER_ID' => $targetUserId,
70 $getTasksResult = $taskService->getTasks($tasksRequest);
71 if (!$getTasksResult->isSuccess())
73 $this->
addErrors($getTasksResult->getErrors());
79 'tasks' => $getTasksResult->getTasks(),
83 public function doAction(
int $taskId, array $taskRequest): ?bool
85 $currentUserId = $this->getCurrentUser()->getId();
88 new Bizproc\Api\Service\TaskAccessService($currentUserId)
92 $getTasksResult = $taskService->doTask($taskId, $currentUserId, $taskRequest);
93 if (!$getTasksResult->isSuccess())
95 $this->
addErrors($getTasksResult->getErrors());
110 $currentUserId = $this->getCurrentUser()->getId();
112 $preparedTaskIds = [];
113 foreach ($taskIds as $id)
117 $preparedTaskIds[] = (int)$id;
122 taskIds: $preparedTaskIds,
123 userId: $currentUserId,
124 newTaskStatusId: $newStatus,
128 new Bizproc\Api\Service\TaskAccessService($request->userId),
131 $response = $service->doInlineTasks($request);
133 if (!$response->isSuccess())
135 $this->
addErrors($response->getErrors());
static getMessage($code, $replace=null, $language=null)