File: /home/timetracker.panomity.com/tm.old/EventSubscriber/TasksSubscriber.php
<?php
/*
* This file is part of the TaskManagementBundle for Kimai 2.
* All rights reserved by Kevin Papst (www.kevinpapst.de).
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace KimaiPlugin\TaskManagementBundle\EventSubscriber;
use App\Event\PageActionsEvent;
use App\EventSubscriber\Actions\AbstractActionsSubscriber;
class TasksSubscriber extends AbstractActionsSubscriber
{
public static function getActionName(): string
{
return 'tasks';
}
public function onActions(PageActionsEvent $event): void
{
$event->addSearchToggle();
$event->addColumnToggle('#modal_tasks');
$event->addQuickExport($this->path('tasks_export'));
if ($this->isGranted('task_edit_other')) {
$event->addCreate($this->path('tasks_create'));
} elseif ($this->isGranted('task_edit_own')) {
$event->addCreate($this->path('tasks_create_my'));
}
if ($this->isGranted('view_reporting') && $this->isGranted('task_view')) {
$event->addAction('reporting', ['url' => $this->path('report_tasks_assigned')]);
}
$event->addHelp('https://www.kimai.org/store/task-management-bundle.html');
}
}