Feat: Streamline and extend logging
This commit is contained in:
@@ -69,7 +69,8 @@ class UserDataHandler
|
||||
$teamer->setCrmSelections($crmSelections);
|
||||
$user->setTeamer($teamer);
|
||||
$this->logger->info('Create teamer', [
|
||||
'uuid' => $teamer->getUuid(),
|
||||
'id' => $teamer->getId(),
|
||||
'name' => $teamer->getFullName(),
|
||||
]);
|
||||
}
|
||||
|
||||
@@ -77,7 +78,8 @@ class UserDataHandler
|
||||
$this->entityManager->flush();
|
||||
|
||||
$this->logger->info('Create user', [
|
||||
'uuid' => $user->getUuid(),
|
||||
'id' => $user->getId(),
|
||||
'email' => $user->getEmail(),
|
||||
]);
|
||||
|
||||
return $user;
|
||||
@@ -103,6 +105,11 @@ class UserDataHandler
|
||||
;
|
||||
}
|
||||
|
||||
$this->logger->info('Update user', [
|
||||
'id' => $user->getId(),
|
||||
'email' => $user->getEmail(),
|
||||
]);
|
||||
|
||||
$this->entityManager->flush();
|
||||
}
|
||||
}
|
||||
@@ -28,7 +28,8 @@ class DeleteController extends AbstractController
|
||||
|
||||
$this->addFlash('success', 'Die Bewerbung wurde gelöscht');
|
||||
$this->logger->info('Delete application', [
|
||||
'application' => $application->getUuid(),
|
||||
'application_id' => $application->getId(),
|
||||
'teamer' => (string) $application->getTeamer(),
|
||||
]);
|
||||
|
||||
return $this->redirectToRoute('app_admin_assignment_detail', [
|
||||
|
||||
@@ -33,7 +33,9 @@ class DisposeController extends AbstractController
|
||||
|
||||
$this->addFlash('success', 'Der Teamer wurde eingeteilt');
|
||||
$this->logger->info('Create disposition', [
|
||||
'disposition' => $disposition->getUuid(),
|
||||
'application_id' => $application->getId(),
|
||||
'disposition_id' => $disposition->getId(),
|
||||
'teamer' => (string) $application->getTeamer(),
|
||||
]);
|
||||
|
||||
return $this->redirectToRoute('app_admin_assignment_detail', [
|
||||
|
||||
@@ -44,8 +44,9 @@ class StatusController extends AbstractController
|
||||
|
||||
$this->addFlash('success', 'Der Status der Bewerbung wurde aktualisiert');
|
||||
$this->logger->info('Update application status', [
|
||||
'application' => $application->getUuid(),
|
||||
'application_id' => $application->getId(),
|
||||
'status_new' => $formData->getStatus(),
|
||||
'teamer' => (string) $application->getTeamer(),
|
||||
]);
|
||||
|
||||
$response->setCloseAndRedirect($this->generateUrl('app_admin_assignment_detail', [
|
||||
|
||||
@@ -35,7 +35,9 @@ class CreateController extends AbstractController
|
||||
$this->addFlash('success', 'Der Einsatz wurde angelegt');
|
||||
|
||||
$this->logger->info('Create assignment', [
|
||||
'assignment' => $assignment->getUuid(),
|
||||
'assignment_id' => $assignment->getId(),
|
||||
'destination' => (string) $assignment->getDestination(),
|
||||
'job_profile' => $assignment->getJobProfile()->getName(),
|
||||
]);
|
||||
|
||||
return $this->redirectToRoute('app_admin_assignment_index');
|
||||
|
||||
@@ -26,7 +26,9 @@ class DeleteController extends AbstractController
|
||||
$this->entityManager->flush();
|
||||
|
||||
$this->logger->info('Delete assignment', [
|
||||
'assignment' => $assignment->getUuid(),
|
||||
'assignment_id' => $assignment->getId(),
|
||||
'destination' => (string) $assignment->getDestination(),
|
||||
'job_profile' => $assignment->getJobProfile()->getName(),
|
||||
]);
|
||||
|
||||
$this->addFlash('success', 'Der Einsatz wurde gelöscht');
|
||||
|
||||
@@ -36,7 +36,10 @@ class DuplicateController extends AbstractController
|
||||
$this->addFlash('success', 'Der Einsatz wurde dupliziert');
|
||||
|
||||
$this->logger->info('Duplicate assignment', [
|
||||
'assignment' => $assignment->getUuid(),
|
||||
'original_id' => $assignment->getId(),
|
||||
'duplicate_id' => $copy->getId(),
|
||||
'destination' => (string) $assignment->getDestination(),
|
||||
'job_profile' => $assignment->getJobProfile()->getName(),
|
||||
]);
|
||||
|
||||
return $this->redirectToRoute('app_admin_assignment_edit', [
|
||||
|
||||
@@ -33,7 +33,9 @@ class EditController extends AbstractController
|
||||
$this->addFlash('success', 'Der Einsatz wurde aktualisiert');
|
||||
|
||||
$this->logger->info('Edit assignment', [
|
||||
'assignment' => $assignment->getUuid(),
|
||||
'assignment_id' => $assignment->getId(),
|
||||
'destination' => (string) $assignment->getDestination(),
|
||||
'job_profile' => $assignment->getJobProfile()->getName(),
|
||||
]);
|
||||
|
||||
return $this->redirectToRoute('app_admin_assignment_index');
|
||||
|
||||
@@ -83,7 +83,9 @@ class CheckController extends AbstractController
|
||||
|
||||
$this->addFlash('success', 'Das Dokument wurde abgelehnt');
|
||||
$this->logger->info('Reject document', [
|
||||
'document' => $document->getOriginalFilename(),
|
||||
'document_id' => $document->getId(),
|
||||
'document_filename' => $document->getOriginalFilename(),
|
||||
'owner' => $document->getOwner()->getFullName(),
|
||||
]);
|
||||
|
||||
$transition = Upload::TYPE_CONTRACT === $document->getType() ? 'reject_contract' : 'reject_invoice';
|
||||
@@ -97,7 +99,9 @@ class CheckController extends AbstractController
|
||||
$document->setStatus($status);
|
||||
$this->addFlash('success', 'Das Dokument wurde bestätigt');
|
||||
$this->logger->info('Confirm document', [
|
||||
'document' => $document->getOriginalFilename(),
|
||||
'document_id' => $document->getId(),
|
||||
'document_filename' => $document->getOriginalFilename(),
|
||||
'owner' => $document->getOwner()->getFullName(),
|
||||
]);
|
||||
|
||||
if (true === $this->workflow->can($document->getDisposition(), $transition)) {
|
||||
|
||||
@@ -37,8 +37,9 @@ class CreateController extends AbstractController
|
||||
$this->entityManager->flush();
|
||||
|
||||
$this->addFlash('success', 'Der Zeitraum wurde hinzugefügt.');
|
||||
$this->logger->info('Add availability', [
|
||||
'availability' => $availability,
|
||||
$this->logger->info('Create availability', [
|
||||
'availability_id' => $availability->getId(),
|
||||
'availability_range' => (string) $availability,
|
||||
]);
|
||||
|
||||
$redirectUrl = $this->generateUrl('app_admin_system_availability_index');
|
||||
|
||||
@@ -27,7 +27,8 @@ class DeleteController extends AbstractController
|
||||
|
||||
$this->addFlash('success', 'Die Verfügbarkeit wurde gelöscht');
|
||||
$this->logger->info('Delete availability', [
|
||||
'availability' => $availability,
|
||||
'availability_id' => $availability->getId(),
|
||||
'availability_range' => (string) $availability,
|
||||
]);
|
||||
|
||||
return $this->redirectToRoute('app_admin_system_availability_index');
|
||||
|
||||
@@ -39,7 +39,10 @@ class DuplicateController extends AbstractController
|
||||
|
||||
$this->addFlash('success', 'Der Zeitraum wurde dupliziert.');
|
||||
$this->logger->info('Duplicate availability', [
|
||||
'availability' => $availability,
|
||||
'original_id' => $availability->getId(),
|
||||
'duplicate_id' => $copy->getId(),
|
||||
'original_range' => (string) $availability,
|
||||
'duplicate_range' => (string) $copy,
|
||||
]);
|
||||
|
||||
$redirectUrl = $this->generateUrl('app_admin_system_availability_index');
|
||||
|
||||
@@ -36,7 +36,8 @@ class EditController extends AbstractController
|
||||
|
||||
$this->addFlash('success', 'Die Verfügbarkeit wurde aktualisiert');
|
||||
$this->logger->info('Edit availability', [
|
||||
'availability' => $availability,
|
||||
'availability_id' => $availability->getId(),
|
||||
'availability_range' => (string) $availability,
|
||||
]);
|
||||
|
||||
$redirectUrl = $this->generateUrl('app_admin_system_availability_index');
|
||||
|
||||
@@ -64,7 +64,8 @@ class CreateController extends AbstractController
|
||||
$this->entityManager->flush();
|
||||
$this->addFlash('success', 'Der Ansprechpartner wurde hinzugefügt');
|
||||
$this->logger->info('Create contact', [
|
||||
'contact' => $contact->getName(),
|
||||
'contact_id' => $contact->getId(),
|
||||
'contact_name' => $contact->getName(),
|
||||
]);
|
||||
|
||||
$response->setCloseAndRedirect($this->generateUrl('app_admin_system_contact_index'));
|
||||
|
||||
@@ -27,7 +27,8 @@ class DeleteController extends AbstractController
|
||||
|
||||
$this->addFlash('success', 'Der Ansprechpartner wurde gelöscht');
|
||||
$this->logger->info('Delete contact', [
|
||||
'contact' => $contact->getName(),
|
||||
'contact_id' => $contact->getId(),
|
||||
'contact_name' => $contact->getName(),
|
||||
]);
|
||||
|
||||
return $this->redirectToRoute('app_admin_system_contact_index');
|
||||
|
||||
@@ -61,7 +61,8 @@ class EditController extends AbstractController
|
||||
$this->entityManager->flush();
|
||||
$this->addFlash('success', 'Der Ansprechpartner wurde aktualisiert');
|
||||
$this->logger->info('Edit contact', [
|
||||
'contact' => $contact->getName(),
|
||||
'contact_id' => $contact->getId(),
|
||||
'contact_name' => $contact->getName(),
|
||||
]);
|
||||
|
||||
$response->setCloseAndRedirect($this->generateUrl('app_admin_system_contact_index'));
|
||||
|
||||
@@ -28,7 +28,8 @@ class DeleteController extends AbstractController
|
||||
|
||||
$this->addFlash('success', 'Das Dokument wurde gelöscht');
|
||||
$this->logger->info('Delete document', [
|
||||
'document' => $document->getOriginalFilename(),
|
||||
'document_id' => $document->getId(),
|
||||
'document_filename' => $document->getOriginalFilename(),
|
||||
]);
|
||||
|
||||
return $this->redirectToRoute('app_admin_system_document_index');
|
||||
|
||||
@@ -28,6 +28,8 @@ class RenameController extends AbstractController
|
||||
$response = new AjaxModalResponseDto();
|
||||
$formAction = $this->generateUrl('app_admin_system_document_rename', ['uuid' => $upload->getUuid()]);
|
||||
|
||||
$nameBefore = $upload->getDisplayName();
|
||||
|
||||
$form = $this
|
||||
->createFormBuilder($upload, ['action' => $formAction, 'ajax_submit' => true])
|
||||
->add('displayName', TextType::class, [
|
||||
@@ -40,7 +42,13 @@ class RenameController extends AbstractController
|
||||
if ($form->isSubmitted() && $form->isValid()) {
|
||||
$this->entityManager->flush();
|
||||
$this->addFlash('success', 'Das Dokument wurden umbenannt');
|
||||
$this->logger->info('Rename document');
|
||||
|
||||
$this->logger->info('Rename document', [
|
||||
'document_id' => $upload->getId(),
|
||||
'document_filename' => $upload->getOriginalFilename(),
|
||||
'document_name_before' => $nameBefore,
|
||||
'document_name_after' => $upload->getDisplayName(),
|
||||
]);
|
||||
|
||||
$response->setCloseAndRedirect($this->generateUrl('app_admin_system_document_index'));
|
||||
} else {
|
||||
|
||||
@@ -41,6 +41,8 @@ class ReplaceController extends AbstractController
|
||||
$response = new AjaxModalResponseDto();
|
||||
$formAction = $this->generateUrl('app_admin_system_document_replace', ['uuid' => $upload->getUuid()]);
|
||||
|
||||
$filenameBefore = $upload->getOriginalFilename();
|
||||
|
||||
$form = $this
|
||||
->createFormBuilder(null, ['action' => $formAction, 'ajax_submit' => true])
|
||||
->getForm()
|
||||
@@ -49,7 +51,11 @@ class ReplaceController extends AbstractController
|
||||
|
||||
if ($form->isSubmitted() && $form->isValid()) {
|
||||
$this->addFlash('success', 'Das Dokument wurden ersetzt');
|
||||
$this->logger->info('Replace document');
|
||||
$this->logger->info('Replace document', [
|
||||
'document_id' => $upload->getId(),
|
||||
'document_filename_before' => $filenameBefore,
|
||||
'document_filename_after' => $upload->getOriginalFilename(),
|
||||
]);
|
||||
|
||||
$response->setCloseAndRedirect($this->generateUrl('app_admin_system_document_index'));
|
||||
} else {
|
||||
|
||||
@@ -29,11 +29,13 @@ class UploadController extends AbstractController
|
||||
{
|
||||
// Handle upload independently from form submission to avoid issues with failing validation
|
||||
$uploadSession = $this->uploadHandler->getUploadSession();
|
||||
$uploadedDocuments = [];
|
||||
if (true === $request->isMethod('POST') && 0 < $uploadSession->getCount()) {
|
||||
/** @var User $user */
|
||||
$user = $this->getUser();
|
||||
foreach ($uploadSession->getUploads() as $upload) {
|
||||
$document = Upload::fromUploadDto($upload, $user, Upload::TYPE_DOCUMENT);
|
||||
$uploadedDocuments[] = $document;
|
||||
$this->entityManager->persist($document);
|
||||
}
|
||||
$this->entityManager->flush();
|
||||
@@ -52,7 +54,14 @@ class UploadController extends AbstractController
|
||||
|
||||
if ($form->isSubmitted() && $form->isValid()) {
|
||||
$this->addFlash('success', 'Das/die Dokument/e wurden hochgeladen');
|
||||
$this->logger->info('Upload document');
|
||||
$loggerContext = [];
|
||||
foreach ($uploadedDocuments as $document) {
|
||||
$loggerContext[] = [
|
||||
'document_id' => $document->getId(),
|
||||
'document_filename' => $document->getOriginalFilename(),
|
||||
];
|
||||
}
|
||||
$this->logger->info('Upload document(s)', $loggerContext);
|
||||
|
||||
$response->setCloseAndRedirect($this->generateUrl('app_admin_system_document_index'));
|
||||
} else {
|
||||
|
||||
@@ -34,7 +34,8 @@ class CreateController extends AbstractController
|
||||
|
||||
$this->addFlash('success', 'Der FAQ-Eintrag wurde angelegt');
|
||||
$this->logger->info('Create faq', [
|
||||
'faq' => $faq->getQuestion(),
|
||||
'faq_id' => $faq->getId(),
|
||||
'faq_question' => $faq->getQuestion(),
|
||||
]);
|
||||
|
||||
return $this->redirectToRoute('app_admin_system_faq_index');
|
||||
|
||||
@@ -27,7 +27,8 @@ class DeleteController extends AbstractController
|
||||
|
||||
$this->addFlash('success', 'Der FAQ-Eintrag wurde gelöscht');
|
||||
$this->logger->info('Delete faq', [
|
||||
'faq' => $faq->getQuestion(),
|
||||
'faq_id' => $faq->getId(),
|
||||
'faq_question' => $faq->getQuestion(),
|
||||
]);
|
||||
|
||||
return $this->redirectToRoute('app_admin_system_faq_index');
|
||||
|
||||
@@ -32,7 +32,8 @@ class EditController extends AbstractController
|
||||
|
||||
$this->addFlash('success', 'Der FAQ-Eintrag wurde aktualisiert');
|
||||
$this->logger->info('Edit faq', [
|
||||
'faq' => $faq->getQuestion(),
|
||||
'faq_id' => $faq->getId(),
|
||||
'faq_question' => $faq->getQuestion(),
|
||||
]);
|
||||
|
||||
return $this->redirectToRoute('app_admin_system_faq_index');
|
||||
|
||||
@@ -38,7 +38,8 @@ class CreateController extends AbstractController
|
||||
|
||||
$this->addFlash('success', 'Das Honorar wurde angelegt');
|
||||
$this->logger->info('Create fee', [
|
||||
'fee' => $fee->getNameInternal(),
|
||||
'fee_id' => $fee->getId(),
|
||||
'fee_name' => $fee->getNameInternal() ?? $fee->getName(),
|
||||
]);
|
||||
|
||||
$redirectUrl = $this->generateUrl('app_admin_system_fee_index');
|
||||
|
||||
@@ -27,7 +27,8 @@ class DeleteController extends AbstractController
|
||||
|
||||
$this->addFlash('success', 'Das Honorar wurde gelöscht');
|
||||
$this->logger->info('Delete fee', [
|
||||
'fee' => $fee->getName(),
|
||||
'fee_id' => $fee->getId(),
|
||||
'fee_name' => $fee->getNameInternal() ?? $fee->getName(),
|
||||
]);
|
||||
|
||||
return $this->redirectToRoute('app_admin_system_fee_index');
|
||||
|
||||
@@ -39,7 +39,10 @@ class DuplicateController extends AbstractController
|
||||
|
||||
$this->addFlash('success', 'Das Honorar wurde dupliziert');
|
||||
$this->logger->info('Duplicate fee', [
|
||||
'fee' => $fee->getNameInternal(),
|
||||
'original_id' => $fee->getId(),
|
||||
'duplicate_id' => $copy->getId(),
|
||||
'original_name' => $fee->getNameInternal() ?? $fee->getName(),
|
||||
'duplicate_name' => $copy->getNameInternal() ?? $copy->getName(),
|
||||
]);
|
||||
|
||||
$redirectUrl = $this->generateUrl('app_admin_system_fee_index');
|
||||
|
||||
@@ -36,7 +36,8 @@ class EditController extends AbstractController
|
||||
|
||||
$this->addFlash('success', 'Das Honorar wurde aktualisiert');
|
||||
$this->logger->info('Edit fee', [
|
||||
'fee' => $fee->getNameInternal(),
|
||||
'fee_id' => $fee->getId(),
|
||||
'fee_name' => $fee->getNameInternal() ?? $fee->getName(),
|
||||
]);
|
||||
|
||||
$redirectUrl = $this->generateUrl('app_admin_system_fee_index');
|
||||
|
||||
@@ -34,7 +34,8 @@ class CreateController extends AbstractController
|
||||
|
||||
$this->addFlash('success', 'Das Job-Profil wurde angelegt');
|
||||
$this->logger->info('Create Job profile', [
|
||||
'job_profile' => $jobProfile->getName(),
|
||||
'job_profile_id' => $jobProfile->getId(),
|
||||
'job_profile_name' => $jobProfile->getName(),
|
||||
]);
|
||||
|
||||
return $this->redirectToRoute('app_admin_system_job_profile_index');
|
||||
|
||||
@@ -27,7 +27,8 @@ class DeleteController extends AbstractController
|
||||
|
||||
$this->addFlash('success', 'Das Job-Profil wurde gelöscht');
|
||||
$this->logger->info('Delete job-profile', [
|
||||
'job_profile' => $jobProfile->getName(),
|
||||
'job_profile_id' => $jobProfile->getId(),
|
||||
'job_profile_name' => $jobProfile->getName(),
|
||||
]);
|
||||
|
||||
return $this->redirectToRoute('app_admin_system_job_profile_index');
|
||||
|
||||
@@ -32,7 +32,8 @@ class EditController extends AbstractController
|
||||
|
||||
$this->addFlash('success', 'Das Job-Profil wurde aktualisiert');
|
||||
$this->logger->info('Edit Job profile', [
|
||||
'job_profile' => $jobProfile->getName(),
|
||||
'job_profile_id' => $jobProfile->getId(),
|
||||
'job_profile_name' => $jobProfile->getName(),
|
||||
]);
|
||||
|
||||
return $this->redirectToRoute('app_admin_system_job_profile_index');
|
||||
|
||||
@@ -38,7 +38,8 @@ class CreateController extends AbstractController
|
||||
|
||||
$this->addFlash('success', 'Die Fortbildung wurde angelegt');
|
||||
$this->logger->info('Create training', [
|
||||
'training' => $training->getName(),
|
||||
'training_id' => $training->getId(),
|
||||
'training_name' => $training->getName(),
|
||||
]);
|
||||
|
||||
$redirectUrl = $this->generateUrl('app_admin_system_training_index');
|
||||
|
||||
@@ -27,7 +27,8 @@ class DeleteController extends AbstractController
|
||||
|
||||
$this->addFlash('success', 'Die Fortbildung wurde gelöscht');
|
||||
$this->logger->info('Delete training', [
|
||||
'training' => $training->getName(),
|
||||
'training_id' => $training->getId(),
|
||||
'training_name' => $training->getName(),
|
||||
]);
|
||||
|
||||
return $this->redirectToRoute('app_admin_system_training_index');
|
||||
|
||||
@@ -36,7 +36,8 @@ class EditController extends AbstractController
|
||||
|
||||
$this->addFlash('success', 'Die Fortbildung wurde aktualisiert');
|
||||
$this->logger->info('Edit training', [
|
||||
'training' => $training->getName(),
|
||||
'training_id' => $training->getId(),
|
||||
'training_name' => $training->getName(),
|
||||
]);
|
||||
|
||||
$redirectUrl = $this->generateUrl('app_admin_system_training_index');
|
||||
|
||||
@@ -42,8 +42,11 @@ class DeleteController extends AbstractController
|
||||
$this->entityManager->flush();
|
||||
|
||||
$this->addFlash('success', 'Der Zeitraum wurde entfernt/gelöscht.');
|
||||
$this->logger->info('Delete availability', [
|
||||
'teamer' => $teamer->getUuid(),
|
||||
$this->logger->info('Delete teamer availability', [
|
||||
'availability_id' => $availability->getId(),
|
||||
'availability_range' => (string) $availability,
|
||||
'teamer_id' => $teamer->getId(),
|
||||
'teamer_name' => (string) $teamer,
|
||||
]);
|
||||
|
||||
$redirectUrl = $this->getReturnUrl($request, 'app_admin_teamer_profile', ['uuid' => $teamer->getUuid()]);
|
||||
|
||||
@@ -61,8 +61,11 @@ class CreateController extends AbstractController
|
||||
|
||||
$this->addFlash('success', 'Die Teilnahme wurde hinzugefügt');
|
||||
$this->logger->info('Create training attendance', [
|
||||
'teamer' => $teamer->getUuid(),
|
||||
'training' => $training->getName(),
|
||||
'attendance_id' => $attendance->getId(),
|
||||
'teamer_id' => $teamer->getId(),
|
||||
'teamer_name' => (string) $teamer,
|
||||
'training_id' => $training->getId(),
|
||||
'training_name' => $training->getName(),
|
||||
]);
|
||||
|
||||
$redirectUrl = $this->generateUrl('app_admin_teamer_skills', ['uuid' => $teamer->getUuid()]);
|
||||
|
||||
@@ -29,7 +29,11 @@ class DeleteController extends AbstractController
|
||||
|
||||
$this->addFlash('success', 'Die Teilnahme an der Fortbilundg wurde gelöscht');
|
||||
$this->logger->info('Delete training attendance', [
|
||||
'teamer' => $teamer->getUuid(),
|
||||
'attendance_id' => $attendance->getId(),
|
||||
'teamer_id' => $teamer->getId(),
|
||||
'teamer_name' => (string) $teamer,
|
||||
'training_id' => $attendance->getTraining()->getId(),
|
||||
'training_name' => $attendance->getTraining()->getName(),
|
||||
]);
|
||||
|
||||
return $this->redirectToRoute('app_admin_teamer_skills', ['uuid' => $teamer->getUuid()]);
|
||||
|
||||
@@ -4,7 +4,9 @@ namespace App\Controller\Common;
|
||||
|
||||
use App\Entity\Upload;
|
||||
use App\Service\Upload\UploadHandler;
|
||||
use Psr\Log\LoggerInterface;
|
||||
use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
|
||||
use Symfony\Component\HttpFoundation\File\Exception\FileNotFoundException;
|
||||
use Symfony\Component\HttpFoundation\Request;
|
||||
use Symfony\Component\HttpFoundation\Response;
|
||||
use Symfony\Component\HttpFoundation\ResponseHeaderBag;
|
||||
@@ -13,11 +15,14 @@ use Symfony\Component\Security\Http\Attribute\IsGranted;
|
||||
|
||||
class DownloadController extends AbstractController
|
||||
{
|
||||
public function __construct(private readonly UploadHandler $uploadHandler)
|
||||
{
|
||||
public function __construct(
|
||||
private readonly UploadHandler $uploadHandler,
|
||||
private readonly LoggerInterface $logger
|
||||
) {
|
||||
}
|
||||
|
||||
#[Route('/download/{uuid}', name: 'app_common_download')]
|
||||
#[IsGranted('ROLE_USER')]
|
||||
#[IsGranted('DOWNLOAD', subject: 'upload')]
|
||||
public function index(Upload $upload, Request $request): Response
|
||||
{
|
||||
@@ -26,6 +31,17 @@ class DownloadController extends AbstractController
|
||||
$inline = (bool) $request->get('inline');
|
||||
$disposition = $inline ? ResponseHeaderBag::DISPOSITION_INLINE : ResponseHeaderBag::DISPOSITION_ATTACHMENT;
|
||||
|
||||
return $this->file($path, $originalFilename, $disposition);
|
||||
$this->logger->info('Download file', [
|
||||
'file_id' => $upload->getId(),
|
||||
'file_filename' => $upload->getOriginalFilename(),
|
||||
]);
|
||||
|
||||
try {
|
||||
$response = $this->file($path, $originalFilename, $disposition);
|
||||
} catch (FileNotFoundException $e) {
|
||||
throw $this->createNotFoundException('Die Datei wurde nicht gefunden');
|
||||
}
|
||||
|
||||
return $response;
|
||||
}
|
||||
}
|
||||
@@ -53,7 +53,7 @@ class PasswordResetController extends AbstractController
|
||||
|
||||
$this->addFlash('success', 'Passwort Reset wurde angefordert');
|
||||
|
||||
$this->logger->info('Password reset', [
|
||||
$this->logger->info('Initiate password reset', [
|
||||
'email' => $email,
|
||||
]);
|
||||
|
||||
|
||||
@@ -41,8 +41,11 @@ class CreateController extends AbstractController
|
||||
|
||||
$this->addFlash('success', 'Deine Bewerbung wurde entgegengenommen');
|
||||
$this->logger->info('Create application', [
|
||||
'teamer' => $teamer->getUuid(),
|
||||
'application' => $application->getUuid(),
|
||||
'teamer_id' => $teamer->getId(),
|
||||
'teamer_name' => (string) $teamer,
|
||||
'application_id' => $application->getId(),
|
||||
'assignment_id' => $assignment->getId(),
|
||||
'destination' => (string) $assignment->getDestination(),
|
||||
]);
|
||||
|
||||
return $this->redirectToRoute('app_teamer_index');
|
||||
|
||||
@@ -4,6 +4,7 @@ namespace App\Controller\Teamer\Application;
|
||||
|
||||
use App\Controller\Traits\ReturnUrlTrait;
|
||||
use App\Entity\Application;
|
||||
use App\Entity\User;
|
||||
use Doctrine\ORM\EntityManagerInterface;
|
||||
use Psr\Log\LoggerInterface;
|
||||
use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
|
||||
@@ -26,11 +27,20 @@ class DeleteController extends AbstractController
|
||||
#[IsGranted('DELETE', subject: 'application')]
|
||||
public function index(Application $application, Request $request): Response
|
||||
{
|
||||
/** @var User $user */
|
||||
$user = $this->getUser();
|
||||
$teamer = $user->getTeamer();
|
||||
$assignment = $application->getAssignment();
|
||||
|
||||
$this->entityManager->remove($application);
|
||||
$this->entityManager->flush();
|
||||
|
||||
$this->logger->info('Delete application', [
|
||||
'application' => $application->getUuid(),
|
||||
'teamer_id' => $teamer->getId(),
|
||||
'teamer_name' => (string) $teamer,
|
||||
'application_id' => $application->getId(),
|
||||
'assignment_id' => $assignment->getId(),
|
||||
'destination' => (string) $assignment->getDestination(),
|
||||
]);
|
||||
|
||||
$returnUrl = $this->getReturnUrl($request, 'app_teamer_index');
|
||||
|
||||
@@ -6,6 +6,7 @@ use App\Controller\Traits\ReturnUrlTrait;
|
||||
use App\Entity\Assignment;
|
||||
use App\Entity\User;
|
||||
use Doctrine\ORM\EntityManagerInterface;
|
||||
use Psr\Log\LoggerInterface;
|
||||
use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
|
||||
use Symfony\Component\HttpFoundation\Request;
|
||||
use Symfony\Component\HttpFoundation\Response;
|
||||
@@ -16,8 +17,11 @@ class ToggleController extends AbstractController
|
||||
{
|
||||
use ReturnUrlTrait;
|
||||
|
||||
public function __construct(private readonly EntityManagerInterface $entityManager)
|
||||
{}
|
||||
public function __construct(
|
||||
private readonly EntityManagerInterface $entityManager,
|
||||
private readonly LoggerInterface $logger
|
||||
) {
|
||||
}
|
||||
|
||||
#[Route('/teamer/bookmark/toggle/{uuid}', name: 'app_teamer_bookmark_toggle')]
|
||||
#[IsGranted('ROLE_TEAMER')]
|
||||
@@ -27,12 +31,21 @@ class ToggleController extends AbstractController
|
||||
$user = $this->getUser();
|
||||
$teamer = $user->getTeamer();
|
||||
|
||||
$loggerContext = [
|
||||
'assignment_id' => $assignment->getId(),
|
||||
'destination' => (string) $assignment->getDestination(),
|
||||
'teamer_id' => $teamer->getId(),
|
||||
'teamer_name' => (string) $teamer,
|
||||
];
|
||||
|
||||
if ($teamer->getBookmarks()->contains($assignment)) {
|
||||
$teamer->removeBookmark($assignment);
|
||||
$this->addFlash('success', 'Der Einsatz wurde von der Merkliste entfernt');
|
||||
$this->logger->info('Remove assignment bookmark', $loggerContext);
|
||||
} else {
|
||||
$teamer->addBookmark($assignment);
|
||||
$this->addFlash('success', 'Der Einsatz wurde auf die Merkliste gesetzt');
|
||||
$this->logger->info('Create assignment bookmark', $loggerContext);
|
||||
}
|
||||
|
||||
$this->entityManager->flush();
|
||||
|
||||
@@ -4,6 +4,7 @@ namespace App\Controller\Teamer\Disposition;
|
||||
|
||||
use App\Entity\Disposition;
|
||||
use App\Service\Pdf\ContractRenderer;
|
||||
use Psr\Log\LoggerInterface;
|
||||
use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
|
||||
use Symfony\Component\HttpFoundation\HeaderUtils;
|
||||
use Symfony\Component\HttpFoundation\Response;
|
||||
@@ -12,8 +13,11 @@ use Symfony\Component\Security\Http\Attribute\IsGranted;
|
||||
|
||||
class ContractPdfController extends AbstractController
|
||||
{
|
||||
public function __construct(private readonly ContractRenderer $renderer)
|
||||
{}
|
||||
public function __construct(
|
||||
private readonly ContractRenderer $renderer,
|
||||
private readonly LoggerInterface $logger
|
||||
) {
|
||||
}
|
||||
|
||||
#[Route('/teamer/disposition/contract/{uuid}', name: 'app_teamer_disposition_contractpdf')]
|
||||
#[IsGranted('ROLE_TEAMER')]
|
||||
@@ -23,8 +27,10 @@ class ContractPdfController extends AbstractController
|
||||
$pdf = $this->renderer->render($disposition);
|
||||
|
||||
$teamer = $disposition->getTeamer();
|
||||
$assignment = $disposition->getAssignment();
|
||||
$destination = $assignment->getDestination();
|
||||
|
||||
$filename = sprintf('Honorarvertrag_%s_%s.pdf', $teamer, $disposition->getAssignment()->getDestination());
|
||||
$filename = sprintf('Honorarvertrag_%s_%s.pdf', $teamer, $destination);
|
||||
$disposition = HeaderUtils::makeDisposition(HeaderUtils::DISPOSITION_ATTACHMENT, $filename, md5($filename));
|
||||
|
||||
$response = new Response($pdf->Output('S'));
|
||||
@@ -32,6 +38,13 @@ class ContractPdfController extends AbstractController
|
||||
$response->headers->set('Content-type', 'application/pdf');
|
||||
$response->headers->set('Content-Disposition', $disposition);
|
||||
|
||||
$this->logger->info('Create teamer contract', [
|
||||
'teamer_id' => $teamer->getId(),
|
||||
'teamer_name' => (string) $teamer,
|
||||
'assignment_id' => $assignment->getId(),
|
||||
'destination' => (string) $destination,
|
||||
]);
|
||||
|
||||
return $response;
|
||||
}
|
||||
}
|
||||
@@ -3,7 +3,9 @@
|
||||
namespace App\Controller\Teamer\Disposition;
|
||||
|
||||
use App\Entity\Disposition;
|
||||
use App\Entity\User;
|
||||
use App\Service\Common\IcsGenerator;
|
||||
use Psr\Log\LoggerInterface;
|
||||
use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
|
||||
use Symfony\Component\HttpFoundation\HeaderUtils;
|
||||
use Symfony\Component\HttpFoundation\Response;
|
||||
@@ -12,13 +14,21 @@ use Symfony\Component\Security\Http\Attribute\IsGranted;
|
||||
|
||||
class IcsController extends AbstractController
|
||||
{
|
||||
public function __construct(private readonly LoggerInterface $logger)
|
||||
{}
|
||||
|
||||
#[Route('/teamer/disposition/ics/{uuid}', name: 'app_teamer_disposition_ics')]
|
||||
#[IsGranted('ROLE_TEAMER')]
|
||||
#[IsGranted('VIEW', subject: 'disposition')]
|
||||
public function index(Disposition $disposition): Response
|
||||
{
|
||||
/** @var User $user */
|
||||
$user = $this->getUser();
|
||||
$teamer = $user->getTeamer();
|
||||
$assignment = $disposition->getAssignment();
|
||||
$destination = $assignment->getDestination();
|
||||
$jobProfile = $assignment->getJobProfile();
|
||||
|
||||
$ics = (new IcsGenerator($disposition))->generate();
|
||||
$filename = sprintf(
|
||||
'Einteilung_%s_%s-%s.ics',
|
||||
@@ -26,12 +36,19 @@ class IcsController extends AbstractController
|
||||
$assignment->getEffectivePeriod()->start->format('d.m.Y'),
|
||||
$assignment->getEffectivePeriod()->end->format('d.m.Y')
|
||||
);
|
||||
$disposition = HeaderUtils::makeDisposition(HeaderUtils::DISPOSITION_INLINE, $filename, md5($filename));
|
||||
$contentDisposition = HeaderUtils::makeDisposition(HeaderUtils::DISPOSITION_INLINE, $filename, md5($filename));
|
||||
|
||||
$response = new Response($ics);
|
||||
$response->setPrivate();
|
||||
$response->headers->set('Content-type', 'text/calendar');
|
||||
$response->headers->set('Content-Disposition', $disposition);
|
||||
$response->headers->set('Content-Disposition', $contentDisposition);
|
||||
|
||||
$this->logger->info('Create ICS file', [
|
||||
'assignment_id' => $assignment->getId(),
|
||||
'destination' => (string) $destination,
|
||||
'teamer_id' => $teamer->getId(),
|
||||
'teamer_name' => (string) $teamer,
|
||||
]);
|
||||
|
||||
return $response;
|
||||
}
|
||||
|
||||
@@ -4,6 +4,7 @@ namespace App\Controller\Teamer\Disposition;
|
||||
|
||||
use App\Entity\Disposition;
|
||||
use App\Service\Pdf\InvoiceRenderer;
|
||||
use Psr\Log\LoggerInterface;
|
||||
use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
|
||||
use Symfony\Component\HttpFoundation\HeaderUtils;
|
||||
use Symfony\Component\HttpFoundation\Response;
|
||||
@@ -12,8 +13,11 @@ use Symfony\Component\Security\Http\Attribute\IsGranted;
|
||||
|
||||
class InvoicePdfController extends AbstractController
|
||||
{
|
||||
public function __construct(private readonly InvoiceRenderer $renderer)
|
||||
{}
|
||||
public function __construct(
|
||||
private readonly InvoiceRenderer $renderer,
|
||||
private readonly LoggerInterface $logger
|
||||
) {
|
||||
}
|
||||
|
||||
#[Route('/teamer/disposition/invoice/{uuid}', name: 'app_teamer_disposition_invoicepdf')]
|
||||
#[IsGranted('ROLE_TEAMER')]
|
||||
@@ -22,15 +26,24 @@ class InvoicePdfController extends AbstractController
|
||||
{
|
||||
$pdf = $this->renderer->render($disposition);
|
||||
|
||||
$assignment = $disposition->getAssignment();
|
||||
$destination = $assignment->getDestination();
|
||||
$teamer = $disposition->getTeamer();
|
||||
|
||||
$filename = sprintf('Honorarnote_%s_%s.pdf', $teamer, $disposition->getAssignment()->getDestination());
|
||||
$disposition = HeaderUtils::makeDisposition(HeaderUtils::DISPOSITION_ATTACHMENT, $filename, md5($filename));
|
||||
$contentDisposition = HeaderUtils::makeDisposition(HeaderUtils::DISPOSITION_ATTACHMENT, $filename, md5($filename));
|
||||
|
||||
$response = new Response($pdf->Output('S'));
|
||||
$response->setPrivate();
|
||||
$response->headers->set('Content-type', 'application/pdf');
|
||||
$response->headers->set('Content-Disposition', $disposition);
|
||||
$response->headers->set('Content-Disposition', $contentDisposition);
|
||||
|
||||
$this->logger->info('Create teamer invoice', [
|
||||
'teamer_id' => $teamer->getId(),
|
||||
'teamer_name' => (string) $teamer,
|
||||
'assignment_id' => $assignment->getId(),
|
||||
'destination' => (string) $destination,
|
||||
]);
|
||||
|
||||
return $response;
|
||||
}
|
||||
|
||||
@@ -31,8 +31,9 @@ class AddController extends AbstractController
|
||||
$this->entityManager->flush();
|
||||
|
||||
$this->logger->info('Add availability', [
|
||||
'user' => $user->getUserIdentifier(),
|
||||
'availability' => $availability,
|
||||
'teamer_id' => $teamer->getId(),
|
||||
'teamer_name' => (string) $teamer,
|
||||
'availability' => (string) $availability,
|
||||
]);
|
||||
|
||||
return $this->redirectToRoute('app_teamer_profile_availability_index');
|
||||
|
||||
@@ -47,8 +47,10 @@ class CreateController extends AbstractController
|
||||
$this->entityManager->flush();
|
||||
|
||||
$this->addFlash('success', 'Der Zeitraum wurde hinzugefügt.');
|
||||
$this->logger->info('Add availability', [
|
||||
'availability' => $availability,
|
||||
$this->logger->info('Create availability', [
|
||||
'teamer_id' => $teamer->getId(),
|
||||
'teamer_name' => (string) $teamer,
|
||||
'availability' => (string) $availability,
|
||||
]);
|
||||
|
||||
$redirectUrl = $this->generateUrl('app_teamer_profile_availability_index');
|
||||
|
||||
@@ -37,7 +37,9 @@ class DeleteController extends AbstractController
|
||||
|
||||
$this->addFlash('success', 'Der Zeitraum wurde entfernt/gelöscht.');
|
||||
$this->logger->info('Delete availability', [
|
||||
'user' => $this->getUser()->getUserIdentifier(),
|
||||
'teamer_id' => $teamer->getId(),
|
||||
'teamer_name' => (string) $teamer,
|
||||
'availability' => (string) $availability,
|
||||
]);
|
||||
|
||||
return $this->redirectToRoute('app_teamer_profile_availability_index');
|
||||
|
||||
@@ -68,7 +68,8 @@ class IndexController extends AbstractController
|
||||
|
||||
$this->addFlash('success', 'Deine Daten wurden aktualisiert');
|
||||
$this->logger->info('Update teamer profile', [
|
||||
'user' => $user->getUserIdentifier(),
|
||||
'teamer_id' => $teamer->getId(),
|
||||
'teamer_name' => (string) $teamer,
|
||||
]);
|
||||
|
||||
return $this->redirectToRoute('app_teamer_profile_index');
|
||||
@@ -97,7 +98,8 @@ class IndexController extends AbstractController
|
||||
|
||||
$this->addFlash('success', 'Dein Profilbild wurde aktualisiert');
|
||||
$this->logger->info('Update teamer photo', [
|
||||
'user' => $user->getUserIdentifier(),
|
||||
'teamer_id' => $teamer->getId(),
|
||||
'teamer_name' => (string) $teamer,
|
||||
]);
|
||||
}
|
||||
}
|
||||
@@ -43,7 +43,15 @@ class AddController extends AbstractController
|
||||
$this->updateCertificate($user, $license, $uploadSession);
|
||||
}
|
||||
|
||||
$form = $this->createForm(LicenseType::class, $license, ['action' => $action, 'ajax_submit' => true, 'upload_session' => $uploadSession]);
|
||||
$form = $this->createForm(
|
||||
LicenseType::class,
|
||||
$license,
|
||||
[
|
||||
'action' => $action,
|
||||
'ajax_submit' => true,
|
||||
'upload_session' => $uploadSession,
|
||||
]
|
||||
);
|
||||
$form->handleRequest($request);
|
||||
|
||||
if ($form->isSubmitted() && $form->isValid()) {
|
||||
@@ -56,7 +64,9 @@ class AddController extends AbstractController
|
||||
|
||||
$this->addFlash('success', 'Die Lizenz wurde hinzugefügt.');
|
||||
$this->logger->info('Add license', [
|
||||
'user' => $user->getUserIdentifier(),
|
||||
'teamer_id' => $teamer->getId(),
|
||||
'teamer_name' => (string) $teamer,
|
||||
'license_type' => $license->getType(),
|
||||
]);
|
||||
|
||||
$redirectUrl = $this->generateUrl('app_teamer_profile_skills');
|
||||
|
||||
@@ -22,12 +22,16 @@ class DeleteController extends AbstractController
|
||||
#[IsGranted('DELETE', subject: 'license')]
|
||||
public function index(License $license): Response
|
||||
{
|
||||
$teamer = $license->getTeamer();
|
||||
|
||||
$this->entityManager->remove($license);
|
||||
$this->entityManager->flush();
|
||||
|
||||
$this->addFlash('success', 'Die Lizenz wurde gelöscht.');
|
||||
$this->logger->info('Delete license', [
|
||||
'user' => $this->getUser()->getUserIdentifier(),
|
||||
'teamer_id' => $teamer->getId(),
|
||||
'teamer_name' => (string) $teamer,
|
||||
'license_type' => $license->getType(),
|
||||
]);
|
||||
|
||||
return $this->redirectToRoute('app_teamer_profile_skills');
|
||||
|
||||
@@ -66,8 +66,9 @@ class SkillsController extends AbstractController
|
||||
$this->entityManager->flush();
|
||||
|
||||
$this->addFlash('success', 'Dein Profil wurde aktualisiert.');
|
||||
$this->logger->info('Update teamer profile', [
|
||||
'user' => $user->getUserIdentifier(),
|
||||
$this->logger->info('Update teamer skills', [
|
||||
'teamer_id' => $teamer->getId(),
|
||||
'teamer_name' => (string) $teamer,
|
||||
]);
|
||||
|
||||
return $this->redirectToRoute('app_teamer_profile_skills');
|
||||
|
||||
@@ -83,9 +83,7 @@ class BpnAuthenticator extends AbstractLoginFormAuthenticator implements Authent
|
||||
$user = $token->getUser();
|
||||
|
||||
$user->setLastLoginAt(new \DateTimeImmutable());
|
||||
$this->logger->info('Login', [
|
||||
'user' => $user->getUserIdentifier(),
|
||||
]);
|
||||
$this->logger->info('Login');
|
||||
|
||||
$this->entityManager->flush();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user