Run symfonysetlist up to symfony_70

This commit is contained in:
2025-05-28 15:46:25 +02:00
parent abb786495a
commit 13a9e14450
128 changed files with 515 additions and 518 deletions

View File

@@ -21,7 +21,7 @@ class AbsenceController extends AbstractController
{
public function __construct(private readonly ChillSecurity $security, private readonly \Doctrine\Persistence\ManagerRegistry $managerRegistry) {}
#[Route(path: '/{_locale}/absence', name: 'chill_main_user_absence_index', methods: ['GET', 'POST'])]
#[\Symfony\Component\Routing\Attribute\Route(path: '/{_locale}/absence', name: 'chill_main_user_absence_index', methods: ['GET', 'POST'])]
public function setAbsence(Request $request): \Symfony\Component\HttpFoundation\RedirectResponse|\Symfony\Component\HttpFoundation\Response
{
$user = $this->security->getUser();
@@ -38,11 +38,11 @@ class AbsenceController extends AbstractController
return $this->render('@ChillMain/Menu/absence.html.twig', [
'user' => $user,
'form' => $form->createView(),
'form' => $form,
]);
}
#[Route(path: '/{_locale}/absence/unset', name: 'chill_main_user_absence_unset', methods: ['GET', 'POST'])]
#[\Symfony\Component\Routing\Attribute\Route(path: '/{_locale}/absence/unset', name: 'chill_main_user_absence_unset', methods: ['GET', 'POST'])]
public function unsetAbsence(Request $request): \Symfony\Component\HttpFoundation\RedirectResponse
{
$user = $this->security->getUser();

View File

@@ -33,7 +33,7 @@ class AddressApiController extends ApiController
/**
* Duplicate an existing address.
*/
#[Route(path: '/api/1.0/main/address/{id}/duplicate.json', name: 'chill_api_main_address_duplicate', methods: ['POST'])]
#[\Symfony\Component\Routing\Attribute\Route(path: '/api/1.0/main/address/{id}/duplicate.json', name: 'chill_api_main_address_duplicate', methods: ['POST'])]
public function duplicate(#[MapEntity(id: 'id')] Address $address): JsonResponse
{
$this->denyAccessUnlessGranted('ROLE_USER');

View File

@@ -29,7 +29,7 @@ final class AddressReferenceAPIController extends ApiController
{
public function __construct(private readonly AddressReferenceRepository $addressReferenceRepository, private readonly PaginatorFactory $paginatorFactory) {}
#[Route(path: '/api/1.0/main/address-reference/by-postal-code/{id}/search.json')]
#[\Symfony\Component\Routing\Attribute\Route(path: '/api/1.0/main/address-reference/by-postal-code/{id}/search.json')]
public function search(#[MapEntity(id: 'id')] PostalCode $postalCode, Request $request): JsonResponse
{
$this->denyAccessUnlessGranted('ROLE_USER');

View File

@@ -26,7 +26,7 @@ class AddressToReferenceMatcherController
{
public function __construct(private readonly Security $security, private readonly EntityManagerInterface $entityManager, private readonly SerializerInterface $serializer) {}
#[Route(path: '/api/1.0/main/address/reference-match/{id}/set/reviewed', methods: ['POST'])]
#[\Symfony\Component\Routing\Attribute\Route(path: '/api/1.0/main/address/reference-match/{id}/set/reviewed', methods: ['POST'])]
public function markAddressAsReviewed(#[MapEntity(id: 'id')] Address $address): JsonResponse
{
if (!$this->security->isGranted('ROLE_USER')) {
@@ -48,7 +48,7 @@ class AddressToReferenceMatcherController
/**
* Set an address back to "to review". Only if the address is in "reviewed" state.
*/
#[Route(path: '/api/1.0/main/address/reference-match/{id}/set/to_review', methods: ['POST'])]
#[\Symfony\Component\Routing\Attribute\Route(path: '/api/1.0/main/address/reference-match/{id}/set/to_review', methods: ['POST'])]
public function markAddressAsToReview(#[MapEntity(id: 'id')] Address $address): JsonResponse
{
if (!$this->security->isGranted('ROLE_USER')) {
@@ -71,7 +71,7 @@ class AddressToReferenceMatcherController
);
}
#[Route(path: '/api/1.0/main/address/reference-match/{id}/sync-with-reference', methods: ['POST'])]
#[\Symfony\Component\Routing\Attribute\Route(path: '/api/1.0/main/address/reference-match/{id}/sync-with-reference', methods: ['POST'])]
public function syncAddressWithReference(#[MapEntity(id: 'id')] Address $address): JsonResponse
{
if (null === $address->getAddressReference()) {

View File

@@ -16,31 +16,31 @@ use Symfony\Component\Routing\Annotation\Route;
class AdminController extends AbstractController
{
#[Route(path: '/{_locale}/admin', name: 'chill_main_admin_central')]
#[\Symfony\Component\Routing\Attribute\Route(path: '/{_locale}/admin', name: 'chill_main_admin_central')]
public function indexAction(): \Symfony\Component\HttpFoundation\Response
{
return $this->render('@ChillMain/Admin/index.html.twig');
}
#[Route(path: '/{_locale}/admin/language', name: 'chill_main_language_admin')]
#[\Symfony\Component\Routing\Attribute\Route(path: '/{_locale}/admin/language', name: 'chill_main_language_admin')]
public function indexLanguageAction(): \Symfony\Component\HttpFoundation\Response
{
return $this->render('@ChillMain/Admin/indexLanguage.html.twig');
}
#[Route(path: '/{_locale}/admin/location', name: 'chill_main_location_admin')]
#[\Symfony\Component\Routing\Attribute\Route(path: '/{_locale}/admin/location', name: 'chill_main_location_admin')]
public function indexLocationAction(): \Symfony\Component\HttpFoundation\Response
{
return $this->render('@ChillMain/Admin/indexLocation.html.twig');
}
#[Route(path: '/{_locale}/admin/user', name: 'chill_main_user_admin')]
#[\Symfony\Component\Routing\Attribute\Route(path: '/{_locale}/admin/user', name: 'chill_main_user_admin')]
public function indexUserAction(): \Symfony\Component\HttpFoundation\Response
{
return $this->render('@ChillMain/Admin/indexUser.html.twig');
}
#[Route(path: '/{_locale}/admin/dashboard', name: 'chill_main_dashboard_admin')]
#[\Symfony\Component\Routing\Attribute\Route(path: '/{_locale}/admin/dashboard', name: 'chill_main_dashboard_admin')]
public function indexDashboardAction(): \Symfony\Component\HttpFoundation\Response
{
return $this->render('@ChillMain/Admin/indexDashboard.html.twig');

View File

@@ -25,7 +25,7 @@ final readonly class DashboardApiController
/**
* Get user dashboard config (not yet based on user id and still hardcoded for now).
*/
#[Route(path: '/api/1.0/main/dashboard-config-item.json', methods: ['get'])]
#[\Symfony\Component\Routing\Attribute\Route(path: '/api/1.0/main/dashboard-config-item.json', methods: ['get'])]
public function getDashboardConfiguration(): JsonResponse
{
$data = [];

View File

@@ -18,7 +18,7 @@ use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
*/
class DefaultController extends AbstractController
{
#[\Symfony\Component\Routing\Annotation\Route(path: '/{_locale}/homepage', name: 'chill_main_homepage')]
#[\Symfony\Component\Routing\Attribute\Route(path: '/{_locale}/homepage', name: 'chill_main_homepage')]
public function indexAction(): \Symfony\Component\HttpFoundation\RedirectResponse|\Symfony\Component\HttpFoundation\Response
{
if ($this->isGranted('ROLE_ADMIN')) {
@@ -28,7 +28,7 @@ class DefaultController extends AbstractController
return $this->render('@ChillMain/layout.html.twig');
}
#[\Symfony\Component\Routing\Annotation\Route(path: '/homepage', name: 'chill_main_homepage_without_locale')]
#[\Symfony\Component\Routing\Attribute\Route(path: '/homepage', name: 'chill_main_homepage_without_locale')]
public function indexWithoutLocaleAction(): \Symfony\Component\HttpFoundation\RedirectResponse
{
return $this->redirectToRoute('chill_main_homepage');

View File

@@ -66,7 +66,7 @@ class ExportController extends AbstractController
$this->filterStatsByCenters = $parameterBag->get('chill_main')['acl']['filter_stats_by_center'];
}
#[Route(path: '/{_locale}/exports/download/{alias}', name: 'chill_main_export_download', methods: ['GET'])]
#[\Symfony\Component\Routing\Attribute\Route(path: '/{_locale}/exports/download/{alias}', name: 'chill_main_export_download', methods: ['GET'])]
public function downloadResultAction(Request $request, mixed $alias): Response
{
/** @var ExportManager $exportManager */
@@ -107,7 +107,7 @@ class ExportController extends AbstractController
*
* @param string $alias
*/
#[Route(path: '/{_locale}/exports/generate/{alias}', name: 'chill_main_export_generate', methods: ['GET'])]
#[\Symfony\Component\Routing\Attribute\Route(path: '/{_locale}/exports/generate/{alias}', name: 'chill_main_export_generate', methods: ['GET'])]
public function generateAction(Request $request, $alias): Response
{
/** @var ExportManager $exportManager */
@@ -128,7 +128,7 @@ class ExportController extends AbstractController
/**
* @throws \RedisException
*/
#[Route(path: '/{_locale}/exports/generate-from-saved/{id}', name: 'chill_main_export_generate_from_saved')]
#[\Symfony\Component\Routing\Attribute\Route(path: '/{_locale}/exports/generate-from-saved/{id}', name: 'chill_main_export_generate_from_saved')]
public function generateFromSavedExport(#[MapEntity(id: 'id')] SavedExport $savedExport): RedirectResponse
{
$this->denyAccessUnlessGranted(SavedExportVoter::GENERATE, $savedExport);
@@ -150,7 +150,7 @@ class ExportController extends AbstractController
/**
* Render the list of available exports.
*/
#[Route(path: '/{_locale}/exports/', name: 'chill_main_export_index')]
#[\Symfony\Component\Routing\Attribute\Route(path: '/{_locale}/exports/', name: 'chill_main_export_index')]
public function indexAction(): Response
{
$exportManager = $this->exportManager;
@@ -174,7 +174,7 @@ class ExportController extends AbstractController
* 3. 'generate': gather data from session from the previous steps, and
* make a redirection to the "generate" action with data in query (HTTP GET)
*/
#[Route(path: '/{_locale}/exports/new/{alias}', name: 'chill_main_export_new')]
#[\Symfony\Component\Routing\Attribute\Route(path: '/{_locale}/exports/new/{alias}', name: 'chill_main_export_new')]
public function newAction(Request $request, string $alias): Response
{
// first check for ACL
@@ -198,7 +198,7 @@ class ExportController extends AbstractController
};
}
#[Route(path: '/{_locale}/export/saved/update-from-key/{id}/{key}', name: 'chill_main_export_saved_edit_options_from_key')]
#[\Symfony\Component\Routing\Attribute\Route(path: '/{_locale}/export/saved/update-from-key/{id}/{key}', name: 'chill_main_export_saved_edit_options_from_key')]
public function editSavedExportOptionsFromKey(#[MapEntity(id: 'id')] SavedExport $savedExport, string $key): Response
{
$this->denyAccessUnlessGranted('ROLE_USER');
@@ -218,7 +218,7 @@ class ExportController extends AbstractController
return $this->redirectToRoute('chill_main_export_saved_edit', ['id' => $savedExport->getId()]);
}
#[Route(path: '/{_locale}/export/save-from-key/{alias}/{key}', name: 'chill_main_export_save_from_key')]
#[\Symfony\Component\Routing\Attribute\Route(path: '/{_locale}/export/save-from-key/{alias}/{key}', name: 'chill_main_export_save_from_key')]
public function saveFromKey(string $alias, string $key, Request $request): Response
{
$this->denyAccessUnlessGranted('ROLE_USER');
@@ -250,7 +250,7 @@ class ExportController extends AbstractController
return $this->render(
'@ChillMain/SavedExport/new.html.twig',
[
'form' => $form->createView(),
'form' => $form,
'saved_export' => $savedExport,
]
);
@@ -368,7 +368,7 @@ class ExportController extends AbstractController
}
return $this->render('@ChillMain/Export/new.html.twig', [
'form' => $form->createView(),
'form' => $form,
'export_alias' => $alias,
'export' => $export,
'export_group' => $this->getExportGroup($export),
@@ -418,7 +418,7 @@ class ExportController extends AbstractController
return $this->render(
'@ChillMain/Export/new_formatter_step.html.twig',
[
'form' => $form->createView(),
'form' => $form,
'export' => $export,
'export_group' => $this->getExportGroup($export),
]
@@ -560,7 +560,7 @@ class ExportController extends AbstractController
return $this->render(
'@ChillMain/Export/new_centers_step.html.twig',
[
'form' => $form->createView(),
'form' => $form,
'export' => $export,
'export_group' => $this->getExportGroup($export),
]

View File

@@ -27,7 +27,7 @@ class GeographicalUnitByAddressApiController
{
public function __construct(private readonly PaginatorFactory $paginatorFactory, private readonly GeographicalUnitRepositoryInterface $geographicalUnitRepository, private readonly Security $security, private readonly SerializerInterface $serializer) {}
#[Route(path: '/api/1.0/main/geographical-unit/by-address/{id}.{_format}', requirements: ['_format' => 'json'])]
#[\Symfony\Component\Routing\Attribute\Route(path: '/api/1.0/main/geographical-unit/by-address/{id}.{_format}', requirements: ['_format' => 'json'])]
public function getGeographicalUnitCoveringAddress(#[MapEntity(id: 'id')] Address $address): JsonResponse
{
if (!$this->security->isGranted('ROLE_USER')) {

View File

@@ -34,7 +34,7 @@ class LoginController extends AbstractController
/**
* Show a login form.
*/
#[\Symfony\Component\Routing\Annotation\Route(path: '/login', name: 'login')]
#[\Symfony\Component\Routing\Attribute\Route(path: '/login', name: 'login')]
public function loginAction(Request $request): Response
{
return $this->render('@ChillMain/Login/login.html.twig', [

View File

@@ -30,7 +30,7 @@ class NewsItemApiController
/**
* Get list of news items filtered on start and end date.
*/
#[Route(path: '/api/1.0/main/news/current.json', methods: ['get'])]
#[\Symfony\Component\Routing\Attribute\Route(path: '/api/1.0/main/news/current.json', methods: ['get'])]
public function listCurrentNewsItems(): JsonResponse
{
$total = $this->newsItemRepository->countCurrentNews();

View File

@@ -34,7 +34,7 @@ final readonly class NewsItemHistoryController
private readonly Environment $environment,
) {}
#[Route(path: '/{_locale}/news-items/history', name: 'chill_main_news_items_history')]
#[\Symfony\Component\Routing\Attribute\Route(path: '/{_locale}/news-items/history', name: 'chill_main_news_items_history')]
public function list(): Response
{
$filter = $this->buildFilterOrder();
@@ -55,7 +55,7 @@ final readonly class NewsItemHistoryController
* @throws RuntimeError
* @throws LoaderError
*/
#[Route(path: '/{_locale}/news-items/{id}', name: 'chill_main_single_news_item')]
#[\Symfony\Component\Routing\Attribute\Route(path: '/{_locale}/news-items/{id}', name: 'chill_main_single_news_item')]
public function showSingleItem(#[MapEntity(id: 'id')] NewsItem $newsItem, Request $request): Response
{
return new Response($this->environment->render(

View File

@@ -27,24 +27,24 @@ use Symfony\Component\Security\Core\Exception\AccessDeniedException;
use Symfony\Bundle\SecurityBundle\Security;
use Symfony\Component\Serializer\SerializerInterface;
#[Route(path: '/api/1.0/main/notification')]
#[\Symfony\Component\Routing\Attribute\Route(path: '/api/1.0/main/notification')]
class NotificationApiController
{
public function __construct(private readonly EntityManagerInterface $entityManager, private readonly NotificationRepository $notificationRepository, private readonly PaginatorFactory $paginatorFactory, private readonly Security $security, private readonly SerializerInterface $serializer) {}
#[Route(path: '/{id}/mark/read', name: 'chill_api_main_notification_mark_read', methods: ['POST'])]
#[\Symfony\Component\Routing\Attribute\Route(path: '/{id}/mark/read', name: 'chill_api_main_notification_mark_read', methods: ['POST'])]
public function markAsRead(#[MapEntity(id: 'id')] Notification $notification): JsonResponse
{
return $this->markAs('read', $notification);
}
#[Route(path: '/{id}/mark/unread', name: 'chill_api_main_notification_mark_unread', methods: ['POST'])]
#[\Symfony\Component\Routing\Attribute\Route(path: '/{id}/mark/unread', name: 'chill_api_main_notification_mark_unread', methods: ['POST'])]
public function markAsUnread(#[MapEntity(id: 'id')] Notification $notification): JsonResponse
{
return $this->markAs('unread', $notification);
}
#[Route(path: '/my/unread')]
#[\Symfony\Component\Routing\Attribute\Route(path: '/my/unread')]
public function myUnreadNotifications(Request $request): JsonResponse
{
$total = $this->notificationRepository->countUnreadByUser($this->security->getUser());
@@ -96,7 +96,7 @@ class NotificationApiController
return new JsonResponse(null, JsonResponse::HTTP_ACCEPTED, [], false);
}
#[Route(path: '/mark/allread', name: 'chill_api_main_notification_mark_allread', methods: ['POST'])]
#[\Symfony\Component\Routing\Attribute\Route(path: '/mark/allread', name: 'chill_api_main_notification_mark_allread', methods: ['POST'])]
public function markAllRead(): JsonResponse
{
$user = $this->security->getUser();
@@ -110,7 +110,7 @@ class NotificationApiController
return new JsonResponse($modifiedNotificationIds);
}
#[Route(path: '/mark/undoallread', name: 'chill_api_main_notification_mark_undoallread', methods: ['POST'])]
#[\Symfony\Component\Routing\Attribute\Route(path: '/mark/undoallread', name: 'chill_api_main_notification_mark_undoallread', methods: ['POST'])]
public function undoAllRead(Request $request): JsonResponse
{
$user = $this->security->getUser();

View File

@@ -36,12 +36,12 @@ use Symfony\Component\Routing\Annotation\Route;
use Symfony\Contracts\Translation\TranslatorInterface;
use function in_array;
#[Route(path: '/{_locale}/notification')]
#[\Symfony\Component\Routing\Attribute\Route(path: '/{_locale}/notification')]
class NotificationController extends AbstractController
{
public function __construct(private readonly EntityManagerInterface $em, private readonly LoggerInterface $chillLogger, private readonly LoggerInterface $logger, private readonly ChillSecurity $security, private readonly NotificationRepository $notificationRepository, private readonly NotificationHandlerManager $notificationHandlerManager, private readonly PaginatorFactory $paginatorFactory, private readonly TranslatorInterface $translator, private readonly UserRepository $userRepository, private readonly \Doctrine\Persistence\ManagerRegistry $managerRegistry) {}
#[Route(path: '/create', name: 'chill_main_notification_create')]
#[\Symfony\Component\Routing\Attribute\Route(path: '/create', name: 'chill_main_notification_create')]
public function createAction(Request $request): Response
{
$this->denyAccessUnlessGranted('IS_AUTHENTICATED_REMEMBERED');
@@ -93,13 +93,13 @@ class NotificationController extends AbstractController
}
return $this->render('@ChillMain/Notification/create.html.twig', [
'form' => $form->createView(),
'form' => $form,
'handler' => $handler,
'notification' => $notification,
]);
}
#[Route(path: '/{id}/edit', name: 'chill_main_notification_edit')]
#[\Symfony\Component\Routing\Attribute\Route(path: '/{id}/edit', name: 'chill_main_notification_edit')]
public function editAction(#[MapEntity(id: 'id')] Notification $notification, Request $request): Response
{
$this->denyAccessUnlessGranted(NotificationVoter::NOTIFICATION_UPDATE, $notification);
@@ -121,13 +121,13 @@ class NotificationController extends AbstractController
}
return $this->render('@ChillMain/Notification/edit.html.twig', [
'form' => $form->createView(),
'form' => $form,
'handler' => $this->notificationHandlerManager->getHandler($notification),
'notification' => $notification,
]);
}
#[Route(path: '/{id}/access_key', name: 'chill_main_notification_grant_access_by_access_key')]
#[\Symfony\Component\Routing\Attribute\Route(path: '/{id}/access_key', name: 'chill_main_notification_grant_access_by_access_key')]
public function getAccessByAccessKey(#[MapEntity(id: 'id')] Notification $notification, Request $request): Response
{
$this->denyAccessUnlessGranted('IS_AUTHENTICATED_REMEMBERED');
@@ -167,7 +167,7 @@ class NotificationController extends AbstractController
return $this->redirectToRoute('chill_main_notification_show', ['id' => $notification->getId()]);
}
#[Route(path: '/inbox', name: 'chill_main_notification_my')]
#[\Symfony\Component\Routing\Attribute\Route(path: '/inbox', name: 'chill_main_notification_my')]
public function inboxAction(): Response
{
$this->denyAccessUnlessGranted('ROLE_USER');
@@ -191,7 +191,7 @@ class NotificationController extends AbstractController
]);
}
#[Route(path: '/sent', name: 'chill_main_notification_sent')]
#[\Symfony\Component\Routing\Attribute\Route(path: '/sent', name: 'chill_main_notification_sent')]
public function sentAction(): Response
{
$this->denyAccessUnlessGranted('IS_AUTHENTICATED_REMEMBERED');
@@ -215,7 +215,7 @@ class NotificationController extends AbstractController
]);
}
#[Route(path: '/{id}/show', name: 'chill_main_notification_show')]
#[\Symfony\Component\Routing\Attribute\Route(path: '/{id}/show', name: 'chill_main_notification_show')]
public function showAction(#[MapEntity(id: 'id')] Notification $notification, Request $request): Response
{
$this->denyAccessUnlessGranted(NotificationVoter::NOTIFICATION_SEE, $notification);

View File

@@ -44,13 +44,13 @@ final class PasswordController extends AbstractController
/**
* @return Response
*/
#[Route(path: '/public/{_locale}/password/request-changed', name: 'password_request_recover_changed')]
#[\Symfony\Component\Routing\Attribute\Route(path: '/public/{_locale}/password/request-changed', name: 'password_request_recover_changed')]
public function changeConfirmedAction(): \Symfony\Component\HttpFoundation\Response
{
return $this->render('@ChillMain/Password/recover_password_changed.html.twig');
}
#[Route(path: '/public/{_locale}/password/recover', name: 'password_recover')]
#[\Symfony\Component\Routing\Attribute\Route(path: '/public/{_locale}/password/recover', name: 'password_recover')]
public function recoverAction(Request $request): Response|\Symfony\Component\HttpFoundation\RedirectResponse
{
if (false === $this->isGranted(PasswordRecoverVoter::ASK_TOKEN)) {
@@ -109,7 +109,7 @@ final class PasswordController extends AbstractController
}
return $this->render('@ChillMain/Password/recover_password_form.html.twig', [
'form' => $form->createView(),
'form' => $form,
]);
}
@@ -117,7 +117,7 @@ final class PasswordController extends AbstractController
* @throws \Doctrine\ORM\NoResultException
* @throws \Doctrine\ORM\NonUniqueResultException
*/
#[Route(path: '/public/{_locale}/password/request-recover', name: 'password_request_recover')]
#[\Symfony\Component\Routing\Attribute\Route(path: '/public/{_locale}/password/request-recover', name: 'password_request_recover')]
public function requestRecoverAction(Request $request): Response|\Symfony\Component\HttpFoundation\RedirectResponse
{
if (false === $this->isGranted(PasswordRecoverVoter::ASK_TOKEN)) {
@@ -182,14 +182,14 @@ final class PasswordController extends AbstractController
}
return $this->render('@ChillMain/Password/request_recover_password.html.twig', [
'form' => $form->createView(),
'form' => $form,
]);
}
/**
* @return Response
*/
#[Route(path: '/public/{_locale}/password/request-confirm', name: 'password_request_recover_confirm')]
#[\Symfony\Component\Routing\Attribute\Route(path: '/public/{_locale}/password/request-confirm', name: 'password_request_recover_confirm')]
public function requestRecoverConfirmAction(): \Symfony\Component\HttpFoundation\Response
{
return $this->render('@ChillMain/Password/request_recover_password_confirm.html.twig');
@@ -198,7 +198,7 @@ final class PasswordController extends AbstractController
/**
* @return Response
*/
#[Route(path: '/{_locale}/my/password', name: 'change_my_password')]
#[\Symfony\Component\Routing\Attribute\Route(path: '/{_locale}/my/password', name: 'change_my_password')]
public function UserPasswordAction(Request $request): \Symfony\Component\HttpFoundation\RedirectResponse|\Symfony\Component\HttpFoundation\Response
{
if (!$this->security->isGranted('ROLE_USER')) {
@@ -239,7 +239,7 @@ final class PasswordController extends AbstractController
// render into a template
return $this->render('@ChillMain/Password/password.html.twig', [
'form' => $form->createView(),
'form' => $form,
]);
}

View File

@@ -26,7 +26,7 @@ class PermissionApiController extends AbstractController
/**
* @throws \Symfony\Component\Serializer\Exception\ExceptionInterface
*/
#[Route(path: '/api/1.0/main/permissions/info.json', methods: ['POST'])]
#[\Symfony\Component\Routing\Attribute\Route(path: '/api/1.0/main/permissions/info.json', methods: ['POST'])]
public function getPermissions(Request $request): JsonResponse
{
$this->denyAccessUnlessGranted('ROLE_USER');

View File

@@ -50,7 +50,7 @@ final class PermissionsGroupController extends AbstractController
private readonly RoleScopeRepository $roleScopeRepository,
) {}
#[\Symfony\Component\Routing\Annotation\Route(path: '/{_locale}/admin/permissionsgroup/{id}/add_link_role_scope', name: 'admin_permissionsgroup_add_role_scope', methods: ['POST'])]
#[\Symfony\Component\Routing\Attribute\Route(path: '/{_locale}/admin/permissionsgroup/{id}/add_link_role_scope', name: 'admin_permissionsgroup_add_role_scope', methods: ['POST'])]
public function addLinkRoleScopeAction(Request $request, int $id): Response
{
$permissionsGroup = $this->permissionsGroupRepository->find($id);
@@ -118,18 +118,18 @@ final class PermissionsGroupController extends AbstractController
return $this->render('@ChillMain/PermissionsGroup/edit.html.twig', [
'entity' => $permissionsGroup,
'edit_form' => $editForm->createView(),
'edit_form' => $editForm,
'role_scopes_sorted' => $roleScopesSorted,
'expanded_roles' => $this->getExpandedRoles($permissionsGroup->getRoleScopes()->toArray()),
'delete_role_scopes_form' => array_map(static fn ($form) => $form->createView(), $deleteRoleScopesForm),
'add_role_scopes_form' => $addRoleScopesForm->createView(),
'add_role_scopes_form' => $addRoleScopesForm,
]);
}
/**
* Creates a new PermissionsGroup entity.
*/
#[\Symfony\Component\Routing\Annotation\Route(path: '/{_locale}/admin/permissionsgroup/create', name: 'admin_permissionsgroup_create', methods: ['POST'])]
#[\Symfony\Component\Routing\Attribute\Route(path: '/{_locale}/admin/permissionsgroup/create', name: 'admin_permissionsgroup_create', methods: ['POST'])]
public function createAction(Request $request): Response
{
$permissionsGroup = new PermissionsGroup();
@@ -145,14 +145,14 @@ final class PermissionsGroupController extends AbstractController
return $this->render('@ChillMain/PermissionsGroup/new.html.twig', [
'entity' => $permissionsGroup,
'form' => $form->createView(),
'form' => $form,
]);
}
/**
* remove an association between permissionsGroup and roleScope.
*/
#[\Symfony\Component\Routing\Annotation\Route(path: '/{_locale}/admin/permissionsgroup/{pgid}/delete_link_role_scope/{rsid}', name: 'admin_permissionsgroup_delete_role_scope', methods: ['POST'])]
#[\Symfony\Component\Routing\Attribute\Route(path: '/{_locale}/admin/permissionsgroup/{pgid}/delete_link_role_scope/{rsid}', name: 'admin_permissionsgroup_delete_role_scope', methods: ['POST'])]
public function deleteLinkRoleScopeAction(int $pgid, int $rsid): Response
{
$permissionsGroup = $this->permissionsGroupRepository->find($pgid);
@@ -209,7 +209,7 @@ final class PermissionsGroupController extends AbstractController
/**
* Displays a form to edit an existing PermissionsGroup entity.
*/
#[Route(path: '/{_locale}/admin/permissionsgroup/{id}/edit', name: 'admin_permissionsgroup_edit')]
#[\Symfony\Component\Routing\Attribute\Route(path: '/{_locale}/admin/permissionsgroup/{id}/edit', name: 'admin_permissionsgroup_edit')]
public function editAction(int $id): Response
{
$permissionsGroup = $this->permissionsGroupRepository->find($id);
@@ -246,17 +246,17 @@ final class PermissionsGroupController extends AbstractController
return $this->render('@ChillMain/PermissionsGroup/edit.html.twig', [
'entity' => $permissionsGroup,
'role_scopes_sorted' => $roleScopesSorted,
'edit_form' => $editForm->createView(),
'edit_form' => $editForm,
'expanded_roles' => $this->getExpandedRoles($permissionsGroup->getRoleScopes()->toArray()),
'delete_role_scopes_form' => array_map(static fn ($form) => $form->createView(), $deleteRoleScopesForm),
'add_role_scopes_form' => $addRoleScopesForm->createView(),
'add_role_scopes_form' => $addRoleScopesForm,
]);
}
/**
* Lists all PermissionsGroup entities.
*/
#[Route(path: '/{_locale}/admin/permissionsgroup/', name: 'admin_permissionsgroup')]
#[\Symfony\Component\Routing\Attribute\Route(path: '/{_locale}/admin/permissionsgroup/', name: 'admin_permissionsgroup')]
public function indexAction(): Response
{
$entities = $this->permissionsGroupRepository->findAllOrderedAlphabetically();
@@ -269,7 +269,7 @@ final class PermissionsGroupController extends AbstractController
/**
* Displays a form to create a new PermissionsGroup entity.
*/
#[Route(path: '/{_locale}/admin/permissionsgroup/new', name: 'admin_permissionsgroup_new')]
#[\Symfony\Component\Routing\Attribute\Route(path: '/{_locale}/admin/permissionsgroup/new', name: 'admin_permissionsgroup_new')]
public function newAction(): Response
{
$permissionsGroup = new PermissionsGroup();
@@ -277,14 +277,14 @@ final class PermissionsGroupController extends AbstractController
return $this->render('@ChillMain/PermissionsGroup/new.html.twig', [
'entity' => $permissionsGroup,
'form' => $form->createView(),
'form' => $form,
]);
}
/**
* Finds and displays a PermissionsGroup entity.
*/
#[Route(path: '/{_locale}/admin/permissionsgroup/{id}/show', name: 'admin_permissionsgroup_show')]
#[\Symfony\Component\Routing\Attribute\Route(path: '/{_locale}/admin/permissionsgroup/{id}/show', name: 'admin_permissionsgroup_show')]
public function showAction(int $id): Response
{
$permissionsGroup = $this->permissionsGroupRepository->find($id);
@@ -336,7 +336,7 @@ final class PermissionsGroupController extends AbstractController
/**
* Edits an existing PermissionsGroup entity.
*/
#[Route(path: '/{_locale}/admin/permissionsgroup/{id}/update', name: 'admin_permissionsgroup_update', methods: ['POST', 'PUT'])]
#[\Symfony\Component\Routing\Attribute\Route(path: '/{_locale}/admin/permissionsgroup/{id}/update', name: 'admin_permissionsgroup_update', methods: ['POST', 'PUT'])]
public function updateAction(Request $request, int $id): Response
{
$permissionsGroup = $this->permissionsGroupRepository
@@ -380,10 +380,10 @@ final class PermissionsGroupController extends AbstractController
return $this->render('@ChillMain/PermissionsGroup/edit.html.twig', [
'entity' => $permissionsGroup,
'role_scopes_sorted' => $roleScopesSorted,
'edit_form' => $editForm->createView(),
'edit_form' => $editForm,
'expanded_roles' => $this->getExpandedRoles($permissionsGroup->getRoleScopes()->toArray()),
'delete_role_scopes_form' => array_map(static fn ($form) => $form->createView(), $deleteRoleScopesForm),
'add_role_scopes_form' => $addRoleScopesForm->createView(),
'add_role_scopes_form' => $addRoleScopesForm,
]);
}

View File

@@ -28,7 +28,7 @@ final class PostalCodeAPIController extends ApiController
{
public function __construct(private readonly CountryRepository $countryRepository, private readonly PostalCodeRepositoryInterface $postalCodeRepository, private readonly PaginatorFactory $paginatorFactory) {}
#[Route(path: '/api/1.0/main/postal-code/search.json')]
#[\Symfony\Component\Routing\Attribute\Route(path: '/api/1.0/main/postal-code/search.json')]
public function search(Request $request): JsonResponse
{
$this->denyAccessUnlessGranted('ROLE_USER');

View File

@@ -37,7 +37,7 @@ class PostalCodeController extends AbstractController
/**
* @return JsonResponse
*/
#[Route(path: '{_locale}/postalcode/search')]
#[\Symfony\Component\Routing\Attribute\Route(path: '{_locale}/postalcode/search')]
public function searchAction(Request $request)
{
$pattern = $request->query->getAlnum('q', '');

View File

@@ -37,7 +37,7 @@ class SavedExportController
{
public function __construct(private readonly \Twig\Environment $templating, private readonly EntityManagerInterface $entityManager, private readonly ExportManager $exportManager, private readonly FormFactoryInterface $formFactory, private readonly SavedExportRepositoryInterface $savedExportRepository, private readonly Security $security, private readonly RequestStack $requestStack, private readonly TranslatorInterface $translator, private readonly UrlGeneratorInterface $urlGenerator) {}
#[Route(path: '/{_locale}/exports/saved/{id}/delete', name: 'chill_main_export_saved_delete')]
#[\Symfony\Component\Routing\Attribute\Route(path: '/{_locale}/exports/saved/{id}/delete', name: 'chill_main_export_saved_delete')]
public function delete(#[MapEntity(id: 'id')] SavedExport $savedExport, Request $request): Response
{
if (!$this->security->isGranted(SavedExportVoter::DELETE, $savedExport)) {
@@ -70,7 +70,7 @@ class SavedExportController
);
}
#[Route(path: '/{_locale}/exports/saved/{id}/edit', name: 'chill_main_export_saved_edit')]
#[\Symfony\Component\Routing\Attribute\Route(path: '/{_locale}/exports/saved/{id}/edit', name: 'chill_main_export_saved_edit')]
public function edit(#[MapEntity(id: 'id')] SavedExport $savedExport, Request $request): Response
{
if (!$this->security->isGranted(SavedExportVoter::EDIT, $savedExport)) {
@@ -101,7 +101,7 @@ class SavedExportController
);
}
#[Route(path: '/{_locale}/exports/saved/my', name: 'chill_main_export_saved_list_my')]
#[\Symfony\Component\Routing\Attribute\Route(path: '/{_locale}/exports/saved/my', name: 'chill_main_export_saved_list_my')]
public function list(): Response
{
$user = $this->security->getUser();

View File

@@ -35,7 +35,7 @@ class ScopeController extends AbstractController
/**
* Creates a new Scope entity.
*/
#[\Symfony\Component\Routing\Annotation\Route(path: '/{_locale}/admin/scope/create', name: 'admin_scope_create', methods: ['POST'])]
#[\Symfony\Component\Routing\Attribute\Route(path: '/{_locale}/admin/scope/create', name: 'admin_scope_create', methods: ['POST'])]
public function createAction(Request $request): \Symfony\Component\HttpFoundation\RedirectResponse|\Symfony\Component\HttpFoundation\Response
{
$scope = new Scope();
@@ -52,14 +52,14 @@ class ScopeController extends AbstractController
return $this->render('@ChillMain/Scope/new.html.twig', [
'entity' => $scope,
'form' => $form->createView(),
'form' => $form,
]);
}
/**
* Displays a form to edit an existing Scope entity.
*/
#[Route(path: '/{_locale}/admin/scope/{id}/edit', name: 'admin_scope_edit')]
#[\Symfony\Component\Routing\Attribute\Route(path: '/{_locale}/admin/scope/{id}/edit', name: 'admin_scope_edit')]
public function editAction(#[MapEntity(id: 'id')] Scope $scope, Request $request): Response
{
$editForm = $this->createEditForm($scope);
@@ -73,14 +73,14 @@ class ScopeController extends AbstractController
return $this->render('@ChillMain/Scope/edit.html.twig', [
'entity' => $scope,
'edit_form' => $editForm->createView(),
'edit_form' => $editForm,
]);
}
/**
* Lists all Scope entities.
*/
#[Route(path: '/{_locale}/admin/scope/', name: 'admin_scope')]
#[\Symfony\Component\Routing\Attribute\Route(path: '/{_locale}/admin/scope/', name: 'admin_scope')]
public function indexAction(): \Symfony\Component\HttpFoundation\Response
{
$em = $this->managerRegistry->getManager();
@@ -95,7 +95,7 @@ class ScopeController extends AbstractController
/**
* Displays a form to create a new Scope entity.
*/
#[Route(path: '/{_locale}/admin/scope/new', name: 'admin_scope_new')]
#[\Symfony\Component\Routing\Attribute\Route(path: '/{_locale}/admin/scope/new', name: 'admin_scope_new')]
public function newAction(): \Symfony\Component\HttpFoundation\Response
{
$scope = new Scope();
@@ -103,7 +103,7 @@ class ScopeController extends AbstractController
return $this->render('@ChillMain/Scope/new.html.twig', [
'entity' => $scope,
'form' => $form->createView(),
'form' => $form,
]);
}

View File

@@ -34,7 +34,7 @@ class SearchController extends AbstractController
{
public function __construct(protected SearchProvider $searchProvider, protected TranslatorInterface $translator, protected PaginatorFactory $paginatorFactory, protected SearchApi $searchApi) {}
#[\Symfony\Component\Routing\Annotation\Route(path: '/{_locale}/search/advanced/{name}', name: 'chill_main_advanced_search')]
#[\Symfony\Component\Routing\Attribute\Route(path: '/{_locale}/search/advanced/{name}', name: 'chill_main_advanced_search')]
public function advancedSearchAction(mixed $name, Request $request): \Symfony\Component\HttpFoundation\RedirectResponse|\Symfony\Component\HttpFoundation\Response
{
try {
@@ -79,7 +79,7 @@ class SearchController extends AbstractController
);
}
#[\Symfony\Component\Routing\Annotation\Route(path: '/{_locale}/search/advanced', name: 'chill_main_advanced_search_list')]
#[\Symfony\Component\Routing\Attribute\Route(path: '/{_locale}/search/advanced', name: 'chill_main_advanced_search_list')]
public function advancedSearchListAction(Request $request): \Symfony\Component\HttpFoundation\RedirectResponse|\Symfony\Component\HttpFoundation\Response
{
/** @var Chill\MainBundle\Search\SearchProvider $variable */
@@ -96,7 +96,7 @@ class SearchController extends AbstractController
return $this->render('@ChillMain/Search/choose_list.html.twig');
}
#[\Symfony\Component\Routing\Annotation\Route(path: '/{_locale}/search.{_format}', name: 'chill_main_search', requirements: ['_format' => 'html|json', '_locale' => '[a-z]{1,3}'], defaults: ['_format' => 'html'])]
#[\Symfony\Component\Routing\Attribute\Route(path: '/{_locale}/search.{_format}', name: 'chill_main_search', requirements: ['_format' => 'html|json', '_locale' => '[a-z]{1,3}'], defaults: ['_format' => 'html'])]
public function searchAction(Request $request, mixed $_format)
{
$pattern = trim((string) $request->query->get('q', ''));
@@ -186,7 +186,7 @@ class SearchController extends AbstractController
);
}
#[\Symfony\Component\Routing\Annotation\Route(path: '/api/1.0/search.{_format}', name: 'chill_main_search_global', requirements: ['_format' => 'json'], defaults: ['_format' => 'json'])]
#[\Symfony\Component\Routing\Attribute\Route(path: '/api/1.0/search.{_format}', name: 'chill_main_search_global', requirements: ['_format' => 'json'], defaults: ['_format' => 'json'])]
public function searchApi(Request $request, mixed $_format): JsonResponse
{
// TODO this is an incomplete implementation

View File

@@ -22,7 +22,7 @@ class TimelineCenterController extends AbstractController
{
public function __construct(protected TimelineBuilder $timelineBuilder, protected PaginatorFactory $paginatorFactory, private readonly Security $security) {}
#[Route(path: '/{_locale}/center/timeline', name: 'chill_center_timeline', methods: ['GET'])]
#[\Symfony\Component\Routing\Attribute\Route(path: '/{_locale}/center/timeline', name: 'chill_center_timeline', methods: ['GET'])]
public function centerAction(Request $request): \Symfony\Component\HttpFoundation\Response
{
// collect reachable center for each group

View File

@@ -24,7 +24,7 @@ class UserApiController extends ApiController
{
public function __construct(private readonly ChillSecurity $security) {}
#[Route(path: '/api/1.0/main/user-current-location.{_format}', name: 'chill_main_user_current_location', requirements: ['_format' => 'json'])]
#[\Symfony\Component\Routing\Attribute\Route(path: '/api/1.0/main/user-current-location.{_format}', name: 'chill_main_user_current_location', requirements: ['_format' => 'json'])]
public function currentLocation(mixed $_format): JsonResponse
{
if (!$this->isGranted('ROLE_USER')) {
@@ -39,7 +39,7 @@ class UserApiController extends ApiController
);
}
#[Route(path: '/api/1.0/main/whoami.{_format}', name: 'chill_main_user_whoami', requirements: ['_format' => 'json'])]
#[\Symfony\Component\Routing\Attribute\Route(path: '/api/1.0/main/whoami.{_format}', name: 'chill_main_user_whoami', requirements: ['_format' => 'json'])]
public function whoami(mixed $_format): JsonResponse
{
return $this->json(

View File

@@ -53,7 +53,7 @@ class UserController extends CRUDController
private readonly ManagerRegistry $managerRegistry,
) {}
#[Route(path: '/{_locale}/admin/main/user/{uid}/add_link_groupcenter', name: 'admin_user_add_groupcenter')]
#[\Symfony\Component\Routing\Attribute\Route(path: '/{_locale}/admin/main/user/{uid}/add_link_groupcenter', name: 'admin_user_add_groupcenter')]
public function addLinkGroupCenterAction(Request $request, mixed $uid): Response
{
$em = $this->managerRegistry->getManager();
@@ -98,7 +98,7 @@ class UserController extends CRUDController
'entity' => $user,
'access_permissions_group_list' => $this->parameterBag->get('chill_main.access_permissions_group_list'),
'edit_form' => $this->createEditForm($user)->createView(),
'add_groupcenter_form' => $this->createAddLinkGroupCenterForm($user, $request)->createView(),
'add_groupcenter_form' => $this->createAddLinkGroupCenterForm($user, $request),
'delete_groupcenter_form' => array_map(
static fn (Form $form) => $form->createView(),
iterator_to_array($this->getDeleteLinkGroupCenterByUser($user, $request), true)
@@ -106,7 +106,7 @@ class UserController extends CRUDController
]);
}
#[Route(path: '/{_locale}/admin/main/user/{uid}/delete_link_groupcenter/{gcid}', name: 'admin_user_delete_groupcenter')]
#[\Symfony\Component\Routing\Attribute\Route(path: '/{_locale}/admin/main/user/{uid}/delete_link_groupcenter/{gcid}', name: 'admin_user_delete_groupcenter')]
public function deleteLinkGroupCenterAction(mixed $uid, mixed $gcid, Request $request): RedirectResponse
{
$em = $this->managerRegistry->getManager();
@@ -204,7 +204,7 @@ class UserController extends CRUDController
/**
* Displays a form to edit the user current location.
*/
#[Route(path: '/{_locale}/main/user/current-location/edit', name: 'chill_main_user_currentlocation_edit')]
#[\Symfony\Component\Routing\Attribute\Route(path: '/{_locale}/main/user/current-location/edit', name: 'chill_main_user_currentlocation_edit')]
public function editCurrentLocationAction(Request $request): RedirectResponse|Response
{
$user = $this->security->getUser();
@@ -228,14 +228,14 @@ class UserController extends CRUDController
return $this->render('@ChillMain/User/edit_current_location.html.twig', [
'entity' => $user,
'edit_form' => $form->createView(),
'edit_form' => $form,
]);
}
/**
* Displays a form to edit the user password.
*/
#[Route(path: '/{_locale}/admin/user/{id}/edit_password', name: 'admin_user_edit_password')]
#[\Symfony\Component\Routing\Attribute\Route(path: '/{_locale}/admin/user/{id}/edit_password', name: 'admin_user_edit_password')]
public function editPasswordAction(#[MapEntity(id: 'id')] User $user, Request $request): RedirectResponse|Response
{
$editForm = $this->createEditPasswordForm($user);
@@ -263,7 +263,7 @@ class UserController extends CRUDController
return $this->render('@ChillMain/User/edit_password.html.twig', [
'entity' => $user,
'edit_form' => $editForm->createView(),
'edit_form' => $editForm,
]);
}

View File

@@ -34,7 +34,7 @@ final readonly class UserExportController
* @throws \League\Csv\Exception
* @throws \League\Csv\UnavailableStream
*/
#[Route(path: '/{_locale}/admin/main/users/export/list.{_format}', requirements: ['_format' => 'csv'], name: 'chill_main_users_export_list')]
#[\Symfony\Component\Routing\Attribute\Route(path: '/{_locale}/admin/main/users/export/list.{_format}', requirements: ['_format' => 'csv'], name: 'chill_main_users_export_list')]
public function userList(Request $request, string $_format = 'csv'): StreamedResponse
{
if (!$this->security->isGranted('ROLE_ADMIN')) {
@@ -95,7 +95,7 @@ final readonly class UserExportController
* @throws \League\Csv\Exception
* @throws \League\Csv\UnavailableStream
*/
#[Route(path: '/{_locale}/admin/main/users/export/permissions.{_format}', requirements: ['_format' => 'csv'], name: 'chill_main_users_export_permissions')]
#[\Symfony\Component\Routing\Attribute\Route(path: '/{_locale}/admin/main/users/export/permissions.{_format}', requirements: ['_format' => 'csv'], name: 'chill_main_users_export_permissions')]
public function userPermissionsList(string $_format = 'csv'): StreamedResponse
{
if (!$this->security->isGranted('ROLE_ADMIN')) {

View File

@@ -50,7 +50,7 @@ final readonly class UserGroupController
private ChillEntityRenderManagerInterface $chillEntityRenderManager,
) {}
#[Route('/{_locale}/main/user-groups/my', name: 'chill_main_user_groups_my')]
#[\Symfony\Component\Routing\Attribute\Route('/{_locale}/main/user-groups/my', name: 'chill_main_user_groups_my')]
public function myUserGroups(): Response
{
if (!$this->security->isGranted('ROLE_USER')) {
@@ -80,7 +80,7 @@ final readonly class UserGroupController
]));
}
#[Route('/{_locale}/main/user-groups/{id}/append', name: 'chill_main_user_groups_append_users')]
#[\Symfony\Component\Routing\Attribute\Route('/{_locale}/main/user-groups/{id}/append', name: 'chill_main_user_groups_append_users')]
public function appendUsersToGroup(UserGroup $userGroup, Request $request, Session $session): Response
{
if (!$this->security->isGranted(UserGroupVoter::APPEND_TO_GROUP, $userGroup)) {
@@ -130,7 +130,7 @@ final readonly class UserGroupController
/**
* @ParamConverter("user", class=User::class, options={"id" = "userId"})
*/
#[Route('/{_locale}/main/user-group/{id}/user/{userId}/remove', name: 'chill_main_user_groups_remove_user')]
#[\Symfony\Component\Routing\Attribute\Route('/{_locale}/main/user-group/{id}/user/{userId}/remove', name: 'chill_main_user_groups_remove_user')]
public function removeUserToGroup(UserGroup $userGroup, User $user, Session $session): Response
{
if (!$this->security->isGranted(UserGroupVoter::APPEND_TO_GROUP, $userGroup)) {

View File

@@ -24,7 +24,7 @@ class UserJobScopeHistoriesController extends AbstractController
private readonly Environment $engine,
) {}
#[Route(path: '/{_locale}/admin/main/user/{id}/job-scope-history', name: 'admin_user_job_scope_history')]
#[\Symfony\Component\Routing\Attribute\Route(path: '/{_locale}/admin/main/user/{id}/job-scope-history', name: 'admin_user_job_scope_history')]
public function indexAction(#[MapEntity(id: 'id')] User $user): Response
{
$jobHistories = $user->getUserJobHistoriesOrdered();

View File

@@ -33,7 +33,7 @@ final class UserProfileController extends AbstractController
/**
* User profile that allows editing of phonenumber and visualization of certain data.
*/
#[Route(path: '/{_locale}/main/user/my-profile', name: 'chill_main_user_profile')]
#[\Symfony\Component\Routing\Attribute\Route(path: '/{_locale}/main/user/my-profile', name: 'chill_main_user_profile')]
public function __invoke(Request $request): \Symfony\Component\HttpFoundation\RedirectResponse|\Symfony\Component\HttpFoundation\Response
{
if (!$this->security->isGranted('ROLE_USER')) {
@@ -57,7 +57,7 @@ final class UserProfileController extends AbstractController
return $this->render('@ChillMain/User/profile.html.twig', [
'user' => $user,
'form' => $editForm->createView(),
'form' => $editForm,
]);
}

View File

@@ -38,7 +38,7 @@ final readonly class WorkflowAddSignatureController
private Security $security,
) {}
#[Route(path: '/{_locale}/main/workflow/signature/{id}/sign', name: 'chill_main_workflow_signature_add', methods: 'GET')]
#[\Symfony\Component\Routing\Attribute\Route(path: '/{_locale}/main/workflow/signature/{id}/sign', name: 'chill_main_workflow_signature_add', methods: 'GET')]
public function __invoke(EntityWorkflowStepSignature $signature, Request $request): Response
{
if (!$this->security->isGranted(EntityWorkflowStepSignatureVoter::SIGN, $signature)) {

View File

@@ -35,7 +35,7 @@ class WorkflowApiController
/**
* Return a list of workflow which are waiting an action for the user.
*/
#[Route(path: '/api/1.0/main/workflow/my', methods: ['GET'])]
#[\Symfony\Component\Routing\Attribute\Route(path: '/api/1.0/main/workflow/my', methods: ['GET'])]
public function myWorkflow(Request $request): JsonResponse
{
if (!$this->security->isGranted('ROLE_USER') || !$this->security->getUser() instanceof User) {
@@ -73,7 +73,7 @@ class WorkflowApiController
/**
* Return a list of workflow which are waiting an action for the user.
*/
#[Route(path: '/api/1.0/main/workflow/my-cc', methods: ['GET'])]
#[\Symfony\Component\Routing\Attribute\Route(path: '/api/1.0/main/workflow/my-cc', methods: ['GET'])]
public function myWorkflowCc(Request $request): JsonResponse
{
if (!$this->security->isGranted('ROLE_USER') || !$this->security->getUser() instanceof User) {
@@ -108,13 +108,13 @@ class WorkflowApiController
);
}
#[Route(path: '/api/1.0/main/workflow/{id}/subscribe', methods: ['POST'])]
#[\Symfony\Component\Routing\Attribute\Route(path: '/api/1.0/main/workflow/{id}/subscribe', methods: ['POST'])]
public function subscribe(#[MapEntity(id: 'id')] EntityWorkflow $entityWorkflow, Request $request): Response
{
return $this->handleSubscription($entityWorkflow, $request, 'subscribe');
}
#[Route(path: '/api/1.0/main/workflow/{id}/unsubscribe', methods: ['POST'])]
#[\Symfony\Component\Routing\Attribute\Route(path: '/api/1.0/main/workflow/{id}/unsubscribe', methods: ['POST'])]
public function unsubscribe(#[MapEntity(id: 'id')] EntityWorkflow $entityWorkflow, Request $request): Response
{
return $this->handleSubscription($entityWorkflow, $request, 'unsubscribe');

View File

@@ -37,7 +37,7 @@ class WorkflowAttachmentController
private readonly AddAttachmentAction $addAttachmentAction,
) {}
#[Route('/api/1.0/main/workflow/{id}/attachment', methods: ['POST'])]
#[\Symfony\Component\Routing\Attribute\Route('/api/1.0/main/workflow/{id}/attachment', methods: ['POST'])]
public function addAttachment(EntityWorkflow $entityWorkflow, Request $request): JsonResponse
{
if (!$this->security->isGranted(EntityWorkflowVoter::SEE, $entityWorkflow)) {
@@ -69,7 +69,7 @@ class WorkflowAttachmentController
);
}
#[Route('/api/1.0/main/workflow/attachment/{id}', methods: ['DELETE'])]
#[\Symfony\Component\Routing\Attribute\Route('/api/1.0/main/workflow/attachment/{id}', methods: ['DELETE'])]
public function removeAttachment(EntityWorkflowAttachment $attachment): Response
{
if (!$this->security->isGranted(EntityWorkflowVoter::SEE, $attachment->getEntityWorkflow())) {
@@ -82,7 +82,7 @@ class WorkflowAttachmentController
return new Response(null, Response::HTTP_NO_CONTENT);
}
#[Route('/api/1.0/main/workflow/{id}/attachment', methods: ['GET'])]
#[\Symfony\Component\Routing\Attribute\Route('/api/1.0/main/workflow/{id}/attachment', methods: ['GET'])]
public function listAttachmentsForEntityWorkflow(EntityWorkflow $entityWorkflow): JsonResponse
{
if (!$this->security->isGranted(EntityWorkflowVoter::SEE, $entityWorkflow)) {

View File

@@ -57,7 +57,7 @@ class WorkflowController extends AbstractController
private readonly EntityWorkflowStepSignatureRepository $entityWorkflowStepSignatureRepository,
) {}
#[Route(path: '/{_locale}/main/workflow/create', name: 'chill_main_workflow_create')]
#[\Symfony\Component\Routing\Attribute\Route(path: '/{_locale}/main/workflow/create', name: 'chill_main_workflow_create')]
public function create(Request $request): Response
{
if (!$request->query->has('entityClass')) {
@@ -101,7 +101,7 @@ class WorkflowController extends AbstractController
return $this->redirectToRoute('chill_main_workflow_show', ['id' => $entityWorkflow->getId()]);
}
#[Route(path: '/{_locale}/main/workflow/{id}/delete', name: 'chill_main_workflow_delete')]
#[\Symfony\Component\Routing\Attribute\Route(path: '/{_locale}/main/workflow/{id}/delete', name: 'chill_main_workflow_delete')]
public function delete(#[MapEntity(id: 'id')] EntityWorkflow $entityWorkflow, Request $request): Response
{
$this->denyAccessUnlessGranted(EntityWorkflowVoter::DELETE, $entityWorkflow);
@@ -121,12 +121,12 @@ class WorkflowController extends AbstractController
return $this->render('@ChillMain/Workflow/delete.html.twig', [
'entityWorkflow' => $entityWorkflow,
'delete_form' => $form->createView(),
'delete_form' => $form,
'handler' => $this->entityWorkflowManager->getHandler($entityWorkflow),
]);
}
#[Route(path: '/{_locale}/main/workflow-step/{id}/access_key', name: 'chill_main_workflow_grant_access_by_key')]
#[\Symfony\Component\Routing\Attribute\Route(path: '/{_locale}/main/workflow-step/{id}/access_key', name: 'chill_main_workflow_grant_access_by_key')]
public function getAccessByAccessKey(#[MapEntity(id: 'id')] EntityWorkflowStep $entityWorkflowStep, Request $request): Response
{
if (null === $accessKey = $request->query->get('accessKey', null)) {
@@ -155,7 +155,7 @@ class WorkflowController extends AbstractController
/**
* Previous workflows where the user has applyed a transition.
*/
#[Route(path: '/{_locale}/main/workflow/list/previous_transitionned', name: 'chill_main_workflow_list_previous_transitionned')]
#[\Symfony\Component\Routing\Attribute\Route(path: '/{_locale}/main/workflow/list/previous_transitionned', name: 'chill_main_workflow_list_previous_transitionned')]
public function myPreviousWorkflowsTransitionned(Request $request): Response
{
$this->denyAccessUnlessGranted('IS_AUTHENTICATED_REMEMBERED');
@@ -184,7 +184,7 @@ class WorkflowController extends AbstractController
/**
* Previous workflows where the user was mentioned, but did not give any reaction.
*/
#[Route(path: '/{_locale}/main/workflow/list/previous_without_reaction', name: 'chill_main_workflow_list_previous_without_reaction')]
#[\Symfony\Component\Routing\Attribute\Route(path: '/{_locale}/main/workflow/list/previous_without_reaction', name: 'chill_main_workflow_list_previous_without_reaction')]
public function myPreviousWorkflowsWithoutReaction(Request $request): Response
{
$this->denyAccessUnlessGranted('IS_AUTHENTICATED_REMEMBERED');
@@ -210,7 +210,7 @@ class WorkflowController extends AbstractController
);
}
#[Route(path: '/{_locale}/main/workflow/list/cc', name: 'chill_main_workflow_list_cc')]
#[\Symfony\Component\Routing\Attribute\Route(path: '/{_locale}/main/workflow/list/cc', name: 'chill_main_workflow_list_cc')]
public function myWorkflowsCc(Request $request): Response
{
$this->denyAccessUnlessGranted('IS_AUTHENTICATED_REMEMBERED');
@@ -235,7 +235,7 @@ class WorkflowController extends AbstractController
);
}
#[Route(path: '/{_locale}/main/workflow/list/dest', name: 'chill_main_workflow_list_dest')]
#[\Symfony\Component\Routing\Attribute\Route(path: '/{_locale}/main/workflow/list/dest', name: 'chill_main_workflow_list_dest')]
public function myWorkflowsDest(Request $request): Response
{
$this->denyAccessUnlessGranted('IS_AUTHENTICATED_REMEMBERED');
@@ -260,7 +260,7 @@ class WorkflowController extends AbstractController
);
}
#[Route(path: '/{_locale}/main/workflow/list/subscribed', name: 'chill_main_workflow_list_subscribed')]
#[\Symfony\Component\Routing\Attribute\Route(path: '/{_locale}/main/workflow/list/subscribed', name: 'chill_main_workflow_list_subscribed')]
public function myWorkflowsSubscribed(Request $request): Response
{
$this->denyAccessUnlessGranted('IS_AUTHENTICATED_REMEMBERED');
@@ -288,7 +288,7 @@ class WorkflowController extends AbstractController
/**
* @throws NonUniqueResultException
*/
#[Route(path: '/{_locale}/main/workflow/{id}/show', name: 'chill_main_workflow_show')]
#[\Symfony\Component\Routing\Attribute\Route(path: '/{_locale}/main/workflow/{id}/show', name: 'chill_main_workflow_show')]
public function show(#[MapEntity(id: 'id')] EntityWorkflow $entityWorkflow, Request $request): Response
{
$this->denyAccessUnlessGranted(EntityWorkflowVoter::SEE, $entityWorkflow);
@@ -372,7 +372,7 @@ class WorkflowController extends AbstractController
return $lines;
}
#[Route(path: '/{_locale}/main/workflow/signature/{signature_id}/metadata', name: 'chill_main_workflow_signature_metadata')]
#[\Symfony\Component\Routing\Attribute\Route(path: '/{_locale}/main/workflow/signature/{signature_id}/metadata', name: 'chill_main_workflow_signature_metadata')]
public function addSignatureMetadata(int $signature_id, Request $request): Response
{
$signature = $this->entityWorkflowStepSignatureRepository->find($signature_id);
@@ -427,7 +427,7 @@ class WorkflowController extends AbstractController
return $this->render(
'@ChillMain/Workflow/signature_metadata.html.twig',
[
'metadata_form' => $metadataForm->createView(),
'metadata_form' => $metadataForm,
'person' => $signature->getSigner(),
]
);

View File

@@ -35,7 +35,7 @@ class WorkflowOnHoldController
private readonly UrlGeneratorInterface $urlGenerator,
) {}
#[Route(path: '/{_locale}/main/workflow/{id}/hold', name: 'chill_main_workflow_on_hold')]
#[\Symfony\Component\Routing\Attribute\Route(path: '/{_locale}/main/workflow/{id}/hold', name: 'chill_main_workflow_on_hold')]
public function putOnHold(EntityWorkflow $entityWorkflow, Request $request): Response
{
$currentStep = $entityWorkflow->getCurrentStep();
@@ -65,7 +65,7 @@ class WorkflowOnHoldController
);
}
#[Route(path: '/{_locale}/main/workflow/{id}/remove_hold', name: 'chill_main_workflow_remove_hold')]
#[\Symfony\Component\Routing\Attribute\Route(path: '/{_locale}/main/workflow/{id}/remove_hold', name: 'chill_main_workflow_remove_hold')]
public function removeOnHold(EntityWorkflowStep $entityWorkflowStep): Response
{
$user = $this->security->getUser();

View File

@@ -37,7 +37,7 @@ final readonly class WorkflowSignatureStateChangeController
private ChillUrlGeneratorInterface $chillUrlGenerator,
) {}
#[Route('/{_locale}/main/workflow/signature/{id}/cancel', name: 'chill_main_workflow_signature_cancel')]
#[\Symfony\Component\Routing\Attribute\Route('/{_locale}/main/workflow/signature/{id}/cancel', name: 'chill_main_workflow_signature_cancel')]
public function cancelSignature(EntityWorkflowStepSignature $signature, Request $request): Response
{
return $this->markSignatureAction(
@@ -49,7 +49,7 @@ final readonly class WorkflowSignatureStateChangeController
);
}
#[Route('/{_locale}/main/workflow/signature/{id}/reject', name: 'chill_main_workflow_signature_reject')]
#[\Symfony\Component\Routing\Attribute\Route('/{_locale}/main/workflow/signature/{id}/reject', name: 'chill_main_workflow_signature_reject')]
public function rejectSignature(EntityWorkflowStepSignature $signature, Request $request): Response
{
return $this->markSignatureAction(

View File

@@ -40,7 +40,7 @@ final readonly class WorkflowViewSendPublicController
private MessageBusInterface $messageBus,
) {}
#[Route('/public/main/workflow/send/{uuid}/view/{verificationKey}', name: 'chill_main_workflow_send_view_public', methods: ['GET'])]
#[\Symfony\Component\Routing\Attribute\Route('/public/main/workflow/send/{uuid}/view/{verificationKey}', name: 'chill_main_workflow_send_view_public', methods: ['GET'])]
public function __invoke(EntityWorkflowSend $workflowSend, string $verificationKey, Request $request): Response
{
if (50 < $workflowSend->getNumberOfErrorTrials()) {