Task report

This commit is contained in:
Hillel Coren 2016-09-18 22:28:37 +03:00
parent a41066b2e5
commit c1696ef8d8
2 changed files with 8 additions and 2 deletions

View File

@ -130,7 +130,7 @@ class ReportController extends BaseController
private function generateTaskReport($startDate, $endDate, $isExport) private function generateTaskReport($startDate, $endDate, $isExport)
{ {
$columns = ['client', 'date', 'duration']; $columns = ['client', 'date', 'description', 'duration'];
$displayData = []; $displayData = [];
$tasks = Task::scope() $tasks = Task::scope()
@ -141,7 +141,8 @@ class ReportController extends BaseController
foreach ($tasks->get() as $task) { foreach ($tasks->get() as $task) {
$displayData[] = [ $displayData[] = [
$task->client ? ($isExport ? $task->client->getDisplayName() : $task->client->present()->link) : trans('texts.unassigned'), $task->client ? ($isExport ? $task->client->getDisplayName() : $task->client->present()->link) : trans('texts.unassigned'),
$task->getStartTime(), link_to($task->present()->url, $task->getStartTime()),
$task->present()->description,
Utils::formatTime($task->getDuration()), Utils::formatTime($task->getDuration()),
]; ];
} }

View File

@ -21,6 +21,11 @@ class TaskPresenter extends EntityPresenter
return $this->entity->user->getDisplayName(); return $this->entity->user->getDisplayName();
} }
public function description()
{
return substr($this->entity->description, 0, 40) . (strlen($this->entity->description) > 40 ? '...' : '');
}
/** /**
* @param $account * @param $account
* @return mixed * @return mixed