mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2025-06-07 18:44:08 +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',
|
||||
'required' => false,
|
||||
'attr' => ['class' => 'select2'],
|
||||
]);
|
||||
}
|
||||
}
|
||||
|
@ -16,6 +16,7 @@ use Chill\MainBundle\Notification\Counter\NotificationByUserCounter;
|
||||
use Chill\MainBundle\Routing\LocalMenuBuilderInterface;
|
||||
use Chill\MainBundle\Workflow\Counter\WorkflowByUserCounter;
|
||||
use Symfony\Component\DependencyInjection\ParameterBag\ParameterBagInterface;
|
||||
use Symfony\Component\HttpFoundation\RequestStack;
|
||||
use Symfony\Component\Security\Core\Security;
|
||||
use Symfony\Contracts\Translation\TranslatorInterface;
|
||||
|
||||
@ -25,6 +26,8 @@ class UserMenuBuilder implements LocalMenuBuilderInterface
|
||||
|
||||
private NotificationByUserCounter $notificationByUserCounter;
|
||||
|
||||
private RequestStack $requestStack;
|
||||
|
||||
private Security $security;
|
||||
|
||||
private TranslatorInterface $translator;
|
||||
@ -36,13 +39,15 @@ class UserMenuBuilder implements LocalMenuBuilderInterface
|
||||
WorkflowByUserCounter $workflowByUserCounter,
|
||||
Security $security,
|
||||
TranslatorInterface $translator,
|
||||
ParameterBagInterface $parameterBag
|
||||
ParameterBagInterface $parameterBag,
|
||||
RequestStack $requestStack
|
||||
) {
|
||||
$this->notificationByUserCounter = $notificationByUserCounter;
|
||||
$this->workflowByUserCounter = $workflowByUserCounter;
|
||||
$this->security = $security;
|
||||
$this->translator = $translator;
|
||||
$this->parameterBag = $parameterBag;
|
||||
$this->requestStack = $requestStack;
|
||||
}
|
||||
|
||||
public function buildMenu($menuId, \Knp\Menu\MenuItem $menu, array $parameters)
|
||||
@ -59,7 +64,12 @@ class UserMenuBuilder implements LocalMenuBuilderInterface
|
||||
$menu
|
||||
->addChild(
|
||||
$locationTextMenu,
|
||||
['route' => 'chill_main_user_currentlocation_edit']
|
||||
[
|
||||
'route' => 'chill_main_user_currentlocation_edit',
|
||||
'routeParameters' => [
|
||||
'returnPath' => $this->requestStack->getCurrentRequest()->getRequestUri(),
|
||||
],
|
||||
]
|
||||
)
|
||||
->setExtras([
|
||||
'order' => -9999999,
|
||||
|
Loading…
x
Reference in New Issue
Block a user