mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2025-06-13 05:44:24 +00:00
add return path after changing location, and select2 on picking user location
This commit is contained in:
parent
832da83b27
commit
1742dd4951
@ -43,6 +43,7 @@ class UserCurrentLocationType extends AbstractType
|
|||||||
},
|
},
|
||||||
'placeholder' => 'Pick a location',
|
'placeholder' => 'Pick a location',
|
||||||
'required' => false,
|
'required' => false,
|
||||||
|
'attr' => ['class' => 'select2'],
|
||||||
]);
|
]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -16,6 +16,7 @@ use Chill\MainBundle\Notification\Counter\NotificationByUserCounter;
|
|||||||
use Chill\MainBundle\Routing\LocalMenuBuilderInterface;
|
use Chill\MainBundle\Routing\LocalMenuBuilderInterface;
|
||||||
use Chill\MainBundle\Workflow\Counter\WorkflowByUserCounter;
|
use Chill\MainBundle\Workflow\Counter\WorkflowByUserCounter;
|
||||||
use Symfony\Component\DependencyInjection\ParameterBag\ParameterBagInterface;
|
use Symfony\Component\DependencyInjection\ParameterBag\ParameterBagInterface;
|
||||||
|
use Symfony\Component\HttpFoundation\RequestStack;
|
||||||
use Symfony\Component\Security\Core\Security;
|
use Symfony\Component\Security\Core\Security;
|
||||||
use Symfony\Contracts\Translation\TranslatorInterface;
|
use Symfony\Contracts\Translation\TranslatorInterface;
|
||||||
|
|
||||||
@ -25,6 +26,8 @@ class UserMenuBuilder implements LocalMenuBuilderInterface
|
|||||||
|
|
||||||
private NotificationByUserCounter $notificationByUserCounter;
|
private NotificationByUserCounter $notificationByUserCounter;
|
||||||
|
|
||||||
|
private RequestStack $requestStack;
|
||||||
|
|
||||||
private Security $security;
|
private Security $security;
|
||||||
|
|
||||||
private TranslatorInterface $translator;
|
private TranslatorInterface $translator;
|
||||||
@ -36,13 +39,15 @@ class UserMenuBuilder implements LocalMenuBuilderInterface
|
|||||||
WorkflowByUserCounter $workflowByUserCounter,
|
WorkflowByUserCounter $workflowByUserCounter,
|
||||||
Security $security,
|
Security $security,
|
||||||
TranslatorInterface $translator,
|
TranslatorInterface $translator,
|
||||||
ParameterBagInterface $parameterBag
|
ParameterBagInterface $parameterBag,
|
||||||
|
RequestStack $requestStack
|
||||||
) {
|
) {
|
||||||
$this->notificationByUserCounter = $notificationByUserCounter;
|
$this->notificationByUserCounter = $notificationByUserCounter;
|
||||||
$this->workflowByUserCounter = $workflowByUserCounter;
|
$this->workflowByUserCounter = $workflowByUserCounter;
|
||||||
$this->security = $security;
|
$this->security = $security;
|
||||||
$this->translator = $translator;
|
$this->translator = $translator;
|
||||||
$this->parameterBag = $parameterBag;
|
$this->parameterBag = $parameterBag;
|
||||||
|
$this->requestStack = $requestStack;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function buildMenu($menuId, \Knp\Menu\MenuItem $menu, array $parameters)
|
public function buildMenu($menuId, \Knp\Menu\MenuItem $menu, array $parameters)
|
||||||
@ -59,7 +64,12 @@ class UserMenuBuilder implements LocalMenuBuilderInterface
|
|||||||
$menu
|
$menu
|
||||||
->addChild(
|
->addChild(
|
||||||
$locationTextMenu,
|
$locationTextMenu,
|
||||||
['route' => 'chill_main_user_currentlocation_edit']
|
[
|
||||||
|
'route' => 'chill_main_user_currentlocation_edit',
|
||||||
|
'routeParameters' => [
|
||||||
|
'returnPath' => $this->requestStack->getCurrentRequest()->getRequestUri(),
|
||||||
|
],
|
||||||
|
]
|
||||||
)
|
)
|
||||||
->setExtras([
|
->setExtras([
|
||||||
'order' => -9999999,
|
'order' => -9999999,
|
||||||
|
Loading…
x
Reference in New Issue
Block a user