store search in session (#2735)
* allow to detect used query filters * allow to set label in action buttons * allow to reset last search from session * migrate invoice archive to new search system * display number of used search filters
This commit is contained in:
@@ -10,6 +10,7 @@
|
||||
namespace App\EventSubscriber\Actions;
|
||||
|
||||
use App\Event\PageActionsEvent;
|
||||
use App\Repository\Query\ActivityQuery;
|
||||
|
||||
class ActivitiesSubscriber extends AbstractActionsSubscriber
|
||||
{
|
||||
@@ -20,7 +21,12 @@ class ActivitiesSubscriber extends AbstractActionsSubscriber
|
||||
|
||||
public function onActions(PageActionsEvent $event): void
|
||||
{
|
||||
$event->addSearchToggle();
|
||||
$payload = $event->getPayload();
|
||||
|
||||
/** @var ActivityQuery $query */
|
||||
$query = $payload['query'];
|
||||
|
||||
$event->addSearchToggle($query);
|
||||
$event->addColumnToggle('#modal_activity_admin');
|
||||
$event->addQuickExport($this->path('activity_export'));
|
||||
|
||||
|
||||
@@ -10,6 +10,7 @@
|
||||
namespace App\EventSubscriber\Actions;
|
||||
|
||||
use App\Event\PageActionsEvent;
|
||||
use App\Repository\Query\CustomerQuery;
|
||||
|
||||
class CustomersSubscriber extends AbstractActionsSubscriber
|
||||
{
|
||||
@@ -20,7 +21,12 @@ class CustomersSubscriber extends AbstractActionsSubscriber
|
||||
|
||||
public function onActions(PageActionsEvent $event): void
|
||||
{
|
||||
$event->addSearchToggle();
|
||||
$payload = $event->getPayload();
|
||||
|
||||
/** @var CustomerQuery $query */
|
||||
$query = $payload['query'];
|
||||
|
||||
$event->addSearchToggle($query);
|
||||
$event->addColumnToggle('#modal_customer_admin');
|
||||
$event->addQuickExport($this->path('customer_export'));
|
||||
|
||||
|
||||
@@ -10,6 +10,7 @@
|
||||
namespace App\EventSubscriber\Actions;
|
||||
|
||||
use App\Event\PageActionsEvent;
|
||||
use App\Repository\Query\InvoiceArchiveQuery;
|
||||
|
||||
class InvoiceArchiveSubscriber extends AbstractActionsSubscriber
|
||||
{
|
||||
@@ -20,10 +21,16 @@ class InvoiceArchiveSubscriber extends AbstractActionsSubscriber
|
||||
|
||||
public function onActions(PageActionsEvent $event): void
|
||||
{
|
||||
$payload = $event->getPayload();
|
||||
|
||||
/** @var InvoiceArchiveQuery $query */
|
||||
$query = $payload['query'];
|
||||
|
||||
if ($this->isGranted('view_invoice')) {
|
||||
$event->addBack($this->path('invoice'));
|
||||
}
|
||||
$event->addSearchToggle();
|
||||
|
||||
$event->addSearchToggle($query);
|
||||
$event->addColumnToggle('#modal_invoices');
|
||||
$event->addQuickExport($this->path('invoice_export'));
|
||||
$event->addHelp($this->documentationLink('invoices.html'));
|
||||
|
||||
@@ -10,6 +10,7 @@
|
||||
namespace App\EventSubscriber\Actions;
|
||||
|
||||
use App\Event\PageActionsEvent;
|
||||
use App\Repository\Query\ProjectQuery;
|
||||
|
||||
class ProjectsSubscriber extends AbstractActionsSubscriber
|
||||
{
|
||||
@@ -20,7 +21,13 @@ class ProjectsSubscriber extends AbstractActionsSubscriber
|
||||
|
||||
public function onActions(PageActionsEvent $event): void
|
||||
{
|
||||
$event->addSearchToggle();
|
||||
$payload = $event->getPayload();
|
||||
|
||||
/** @var ProjectQuery $query */
|
||||
$query = $payload['query'];
|
||||
|
||||
$event->addSearchToggle($query);
|
||||
|
||||
$event->addColumnToggle('#modal_project_admin');
|
||||
$event->addQuickExport($this->path('project_export'));
|
||||
|
||||
|
||||
@@ -10,6 +10,7 @@
|
||||
namespace App\EventSubscriber\Actions;
|
||||
|
||||
use App\Event\PageActionsEvent;
|
||||
use App\Repository\Query\TagQuery;
|
||||
|
||||
class TagsSubscriber extends AbstractActionsSubscriber
|
||||
{
|
||||
@@ -20,7 +21,12 @@ class TagsSubscriber extends AbstractActionsSubscriber
|
||||
|
||||
public function onActions(PageActionsEvent $event): void
|
||||
{
|
||||
$event->addSearchToggle();
|
||||
$payload = $event->getPayload();
|
||||
|
||||
/** @var TagQuery $query */
|
||||
$query = $payload['query'];
|
||||
|
||||
$event->addSearchToggle($query);
|
||||
|
||||
if ($this->isGranted('manage_tag')) {
|
||||
$event->addCreate($this->path('tags_create'));
|
||||
|
||||
@@ -10,6 +10,7 @@
|
||||
namespace App\EventSubscriber\Actions;
|
||||
|
||||
use App\Event\PageActionsEvent;
|
||||
use App\Repository\Query\TeamQuery;
|
||||
|
||||
class TeamsSubscriber extends AbstractActionsSubscriber
|
||||
{
|
||||
@@ -20,7 +21,12 @@ class TeamsSubscriber extends AbstractActionsSubscriber
|
||||
|
||||
public function onActions(PageActionsEvent $event): void
|
||||
{
|
||||
$event->addSearchToggle();
|
||||
$payload = $event->getPayload();
|
||||
|
||||
/** @var TeamQuery $query */
|
||||
$query = $payload['query'];
|
||||
|
||||
$event->addSearchToggle($query);
|
||||
|
||||
if ($this->isGranted('create_team')) {
|
||||
$event->addCreate($this->path('admin_team_create'), false);
|
||||
|
||||
@@ -10,6 +10,7 @@
|
||||
namespace App\EventSubscriber\Actions;
|
||||
|
||||
use App\Event\PageActionsEvent;
|
||||
use App\Repository\Query\TimesheetQuery;
|
||||
|
||||
class TimesheetsSubscriber extends AbstractActionsSubscriber
|
||||
{
|
||||
@@ -20,7 +21,12 @@ class TimesheetsSubscriber extends AbstractActionsSubscriber
|
||||
|
||||
public function onActions(PageActionsEvent $event): void
|
||||
{
|
||||
$event->addSearchToggle();
|
||||
$payload = $event->getPayload();
|
||||
|
||||
/** @var TimesheetQuery $query */
|
||||
$query = $payload['query'];
|
||||
|
||||
$event->addSearchToggle($query);
|
||||
$event->addColumnToggle('#modal_timesheet');
|
||||
|
||||
if ($this->isGranted('export_own_timesheet')) {
|
||||
|
||||
@@ -10,6 +10,7 @@
|
||||
namespace App\EventSubscriber\Actions;
|
||||
|
||||
use App\Event\PageActionsEvent;
|
||||
use App\Repository\Query\TimesheetQuery;
|
||||
|
||||
class TimesheetsTeamSubscriber extends AbstractActionsSubscriber
|
||||
{
|
||||
@@ -20,7 +21,12 @@ class TimesheetsTeamSubscriber extends AbstractActionsSubscriber
|
||||
|
||||
public function onActions(PageActionsEvent $event): void
|
||||
{
|
||||
$event->addSearchToggle();
|
||||
$payload = $event->getPayload();
|
||||
|
||||
/** @var TimesheetQuery $query */
|
||||
$query = $payload['query'];
|
||||
|
||||
$event->addSearchToggle($query);
|
||||
$event->addColumnToggle('#modal_timesheet_admin');
|
||||
|
||||
if ($this->isGranted('export_other_timesheet')) {
|
||||
|
||||
@@ -10,6 +10,7 @@
|
||||
namespace App\EventSubscriber\Actions;
|
||||
|
||||
use App\Event\PageActionsEvent;
|
||||
use App\Repository\Query\UserQuery;
|
||||
|
||||
class UsersSubscriber extends AbstractActionsSubscriber
|
||||
{
|
||||
@@ -20,10 +21,17 @@ class UsersSubscriber extends AbstractActionsSubscriber
|
||||
|
||||
public function onActions(PageActionsEvent $event): void
|
||||
{
|
||||
$event->addSearchToggle();
|
||||
$payload = $event->getPayload();
|
||||
|
||||
/** @var UserQuery $query */
|
||||
$query = $payload['query'];
|
||||
|
||||
$event->addSearchToggle($query);
|
||||
|
||||
if ($event->isIndexView()) {
|
||||
$event->addColumnToggle('#modal_user_admin');
|
||||
}
|
||||
|
||||
$event->addQuickExport($this->path('user_export'));
|
||||
|
||||
if ($this->isGranted('create_user')) {
|
||||
|
||||
Reference in New Issue
Block a user