feat: assignable managers for accommodation bookings
This commit is contained in:
1 parent
8e4afc0813
commit
736128476b
9 files changed
+247
-1
No files matched your search
@@ -5,6 +5,7 @@ declare(strict_types=1);
|
||||
namespace App\Controller\Admin\AccommodationBooking;
|
||||
|
||||
use App\Entity\Groups\AccommodationBooking;
|
||||
use App\Entity\User;
|
||||
use App\Form\Admin\Groups\AccommodationBookingCreateType;
|
||||
use App\Htmx\HxRedirectResponse;
|
||||
use App\Service\AccommodationBookingService;
|
||||
@@ -31,6 +32,14 @@ class CreateController extends AbstractController
|
||||
{
|
||||
$booking = new AccommodationBooking();
|
||||
|
||||
// Whoever creates a booking in the backoffice looks after it until someone else is
|
||||
// assigned in the edit form. The route is behind ROLE_GROUPS_MANAGER, so the creator
|
||||
// is always eligible as Betreuer.
|
||||
$user = $this->getUser();
|
||||
if ($user instanceof User) {
|
||||
$booking->setManagedBy($user);
|
||||
}
|
||||
|
||||
$form = $this->createForm(AccommodationBookingCreateType::class, $booking, [
|
||||
'hx_post' => $request->getRequestUri(),
|
||||
]);
|
||||
|
||||
Reference in new issue
Block a user