added tags for timesheets (#604)

This commit is contained in:
Mathias
2019-05-12 01:40:04 +02:00
committed by Kevin Papst
parent f31118292c
commit e29e183e84
84 changed files with 2132 additions and 158 deletions

View File

@@ -9,13 +9,14 @@
namespace App\Controller;
use App\Entity\Tag;
use App\Entity\Timesheet;
use App\Form\DeleteType;
use App\Form\TimesheetEditForm;
use App\Form\Toolbar\TimesheetToolbarForm;
use App\Repository\ActivityRepository;
use App\Repository\ProjectRepository;
use App\Repository\Query\TimesheetQuery;
use Doctrine\Common\Collections\ArrayCollection;
use Doctrine\ORM\ORMException;
use Pagerfanta\Pagerfanta;
use Sensio\Bundle\FrameworkExtraBundle\Configuration\Security;
@@ -59,6 +60,14 @@ class TimesheetTeamController extends AbstractController
}
}
if ($query->hasTags()) {
$query->setTags(
new ArrayCollection(
$this->getDoctrine()->getRepository(Tag::class)->findIdsByTagNameList(implode(',', $query->getTags()->toArray()))
)
);
}
/* @var $entries Pagerfanta */
$entries = $this->getRepository()->findByQuery($query);
@@ -137,7 +146,7 @@ class TimesheetTeamController extends AbstractController
}
/**
* @Route(path="/{id}/delete", defaults={"page": 1}, name="admin_timesheet_delete", methods={"GET", "POST"})
* @Route(path="/{id}/delete", name="admin_timesheet_delete", methods={"GET", "POST"})
* @Security("is_granted('delete', entry)")
*
* @param Timesheet $entry