34 $createdDate = $this->getCreatedDate();
35 if (isset($createdDate))
38 $this->task->isCompleted()
39 ? $this->task->getModified()->getTimestamp() - $createdDate->getTimestamp()
40 : (
new DateTime())->getTimestamp() - $createdDate->getTimestamp()
43 return DurationFormatter::roundTimeInSeconds($duration, 2);
71 if (!$this->checkViewRights())
75 'status' => $this->task->getStatus(),
79 foreach ($this->task->getTaskUsers() as $taskUser)
82 'id' => $taskUser->getUserId(),
83 'status' => $taskUser->getStatus(),
86 if ($taskUser->hasDateUpdate() && $taskUser->get(
'DATE_UPDATE') !==
null)
88 $dateUpdate = $taskUser->get(
'DATE_UPDATE');
95 if ($this->getCreatedDate())
97 $userData[
'executionTime'] = $dateUpdate->getTimestamp() - $this->getCreatedDate()->getTimestamp();
100 $users[] = $userData;
105 'id' => $this->task->getId(),
106 'name' => html_entity_decode($this->task->getName()),
107 'status' => $this->task->getStatus(),
108 'modified' => $this->task->getModified()->getTimestamp(),
111 'url' => $this->getTaskUrl(),
114 if ($this->approveType)
116 $viewData[
'approveType'] = $this->approveType;