From 1a680f160f335d3c4aff85283ed959e1ad95f585 Mon Sep 17 00:00:00 2001 From: Raphael Odini Date: Fri, 26 Apr 2024 11:27:10 +0200 Subject: [PATCH 1/6] Add missing HELLOASSO_CAMPAIGN_ID --- .env.dist | 1 + .env.oidc.test | 1 + .env.test | 1 + config/services.yaml | 5 +++-- 4 files changed, 6 insertions(+), 2 deletions(-) diff --git a/.env.dist b/.env.dist index d159f647a..3095d65ee 100644 --- a/.env.dist +++ b/.env.dist @@ -77,6 +77,7 @@ REGISTRATION_DURATION='1 year' REGISTRATION_EVERY_CIVIL_YEAR=false REGISTRATION_MANUAL_ENABLED=true HELLOASSO_REGISTRATION_CAMPAIGN_URL=https://www.helloasso.com/associations/my-local-coop/adhesions/re-adhesion +HELLOASSO_CAMPAIGN_ID= HELLOASSO_API_KEY= HELLOASSO_API_PASSWORD= HELLOASSO_API_BASE_URL=https://api.helloasso.com/v3/ diff --git a/.env.oidc.test b/.env.oidc.test index eca6fa359..b6bf9c0ea 100644 --- a/.env.oidc.test +++ b/.env.oidc.test @@ -80,6 +80,7 @@ REGISTRATION_DURATION='1 year' REGISTRATION_EVERY_CIVIL_YEAR=false REGISTRATION_MANUAL_ENABLED=true HELLOASSO_REGISTRATION_CAMPAIGN_URL=https://www.helloasso.com/associations/my-local-coop/adhesions/re-adhesion +HELLOASSO_CAMPAIGN_ID= HELLOASSO_API_KEY= HELLOASSO_API_PASSWORD= HELLOASSO_API_BASE_URL=https://api.helloasso.com/v3/ diff --git a/.env.test b/.env.test index 431f1d18d..7de265174 100644 --- a/.env.test +++ b/.env.test @@ -80,6 +80,7 @@ REGISTRATION_DURATION='1 year' REGISTRATION_EVERY_CIVIL_YEAR=false REGISTRATION_MANUAL_ENABLED=true HELLOASSO_REGISTRATION_CAMPAIGN_URL=https://www.helloasso.com/associations/my-local-coop/adhesions/re-adhesion +HELLOASSO_CAMPAIGN_ID= HELLOASSO_API_KEY= HELLOASSO_API_PASSWORD= HELLOASSO_API_BASE_URL=https://api.helloasso.com/v3/ diff --git a/config/services.yaml b/config/services.yaml index 29403f200..26e24af0a 100644 --- a/config/services.yaml +++ b/config/services.yaml @@ -54,10 +54,11 @@ parameters: forbid_shift_overlap_time: '%env(FORBID_SHIFT_OVERLAP_TIME)%' github_repo_url: 'elefan-grenoble/gestion-compte' github_current_release: 'v1.45.7' # x-release-please-version - helloasso_api_base_url: '%env(HELLOASSO_API_BASE_URL)%' + helloasso_registration_campaign_url: '%env(HELLOASSO_REGISTRATION_CAMPAIGN_URL)%' + helloasso_campaign_id: '%env(HELLOASSO_CAMPAIGN_ID)%' helloasso_api_key: '%env(HELLOASSO_API_KEY)%' helloasso_api_password: '%env(HELLOASSO_API_PASSWORD)%' - helloasso_registration_campaign_url: '%env(HELLOASSO_REGISTRATION_CAMPAIGN_URL)%' + helloasso_api_base_url: '%env(HELLOASSO_API_BASE_URL)%' images_tmp_dir: '%kernel.project_dir%/web/tmp' locale: fr_FR local_currency_name: '%env(LOCAL_CURRENCY_NAME)%' From 88a58e166702c5abfd52901780209160c9a14c3a Mon Sep 17 00:00:00 2001 From: Raphael Odini Date: Fri, 26 Apr 2024 11:55:11 +0200 Subject: [PATCH 2/6] Remove AppBundle in EmailTemplate --- src/Entity/EmailTemplate.php | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/Entity/EmailTemplate.php b/src/Entity/EmailTemplate.php index 6ac786fc2..1388dfb44 100644 --- a/src/Entity/EmailTemplate.php +++ b/src/Entity/EmailTemplate.php @@ -181,11 +181,11 @@ public function getCreatedAt() /** * Set createdBy * - * @param \AppBundle\Entity\User $user + * @param \App\Entity\User $user * * @return EmailTemplate */ - public function setCreatedBy(\AppBundle\Entity\User $user = null) + public function setCreatedBy(\App\Entity\User $user = null) { $this->createdBy = $user; @@ -195,7 +195,7 @@ public function setCreatedBy(\AppBundle\Entity\User $user = null) /** * Get createdBy * - * @return \AppBundle\Entity\User + * @return \App\Entity\User */ public function getCreatedBy() { @@ -215,11 +215,11 @@ public function getUpdatedAt() /** * Set updatedBy * - * @param \AppBundle\Entity\User $user + * @param \App\Entity\User $user * * @return EmailTemplate */ - public function setUpdatedBy(\AppBundle\Entity\User $user = null) + public function setUpdatedBy(\App\Entity\User $user = null) { $this->updatedBy = $user; @@ -229,7 +229,7 @@ public function setUpdatedBy(\AppBundle\Entity\User $user = null) /** * Get updatedBy * - * @return \AppBundle\Entity\User + * @return \App\Entity\User */ public function getUpdatedBy() { From e7f82436f0e9d4532a328a29a2884d58d7b73960 Mon Sep 17 00:00:00 2001 From: Raphael Odini Date: Fri, 26 Apr 2024 11:56:22 +0200 Subject: [PATCH 3/6] Add missing MAX_TIME_AT_END_OF_SHIFT --- config/services.yaml | 1 + 1 file changed, 1 insertion(+) diff --git a/config/services.yaml b/config/services.yaml index 26e24af0a..bc74a396d 100644 --- a/config/services.yaml +++ b/config/services.yaml @@ -52,6 +52,7 @@ parameters: forbid_own_shift_validate_admin: '%env(bool:FORBID_OWN_SHIFT_VALIDATE_ADMIN)%' forbid_own_timelog_new_admin: '%env(bool:FORBID_OWN_TIMELOG_NEW_ADMIN)%' forbid_shift_overlap_time: '%env(FORBID_SHIFT_OVERLAP_TIME)%' + max_time_at_end_of_shift: '%env(MAX_TIME_AT_END_OF_SHIFT)%' github_repo_url: 'elefan-grenoble/gestion-compte' github_current_release: 'v1.45.7' # x-release-please-version helloasso_registration_campaign_url: '%env(HELLOASSO_REGISTRATION_CAMPAIGN_URL)%' From b3aae900e09627baa5858016e6ec33b1d1fd521d Mon Sep 17 00:00:00 2001 From: Raphael Odini Date: Fri, 26 Apr 2024 11:58:16 +0200 Subject: [PATCH 4/6] Add missing USE_CARD_READER_TO_VALIDATE_SHIFTS --- config/services.yaml | 1 + 1 file changed, 1 insertion(+) diff --git a/config/services.yaml b/config/services.yaml index bc74a396d..aa5e588dd 100644 --- a/config/services.yaml +++ b/config/services.yaml @@ -135,6 +135,7 @@ parameters: site_name: '%env(SITE_NAME)%' super_admin.initial_password: '%env(SUPER_ADMIN_INITIAL_PASSWORD)%' super_admin.username: '%env(SUPER_ADMIN_USERNAME)%' + use_card_reader_to_validate_shifts: '%env(bool:USE_CARD_READER_TO_VALIDATE_SHIFTS)%' swipe_card_logging: '%env(bool:SWIPE_CARD_LOGGING)%' swipe_card_logging_anonymous: '%env(bool:SWIPE_CARD_LOGGING_ANONYMOUS)%' time_after_which_members_are_late_with_shifts: '%env(TIME_AFTER_WHICH_MEMBERS_ARE_LATE_WITH_SHIFTS)%' From 9059512fe10a9ffd45ca073ca3f952f9907894e5 Mon Sep 17 00:00:00 2001 From: Raphael Odini Date: Fri, 26 Apr 2024 12:01:18 +0200 Subject: [PATCH 5/6] Add missing RESERVE_NEW_SHIFT_TO_PRIOR_SHIFTER --- config/services.yaml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/config/services.yaml b/config/services.yaml index aa5e588dd..4c9fdd275 100644 --- a/config/services.yaml +++ b/config/services.yaml @@ -132,6 +132,8 @@ parameters: project_url_display: '%env(PROJECT_URL_DISPLAY)%' registration_duration: '%env(REGISTRATION_DURATION)%' registration_every_civil_year: '%env(bool:REGISTRATION_EVERY_CIVIL_YEAR)%' + reserve_new_shift_to_prior_shifter: '%env(bool:RESERVE_NEW_SHIFT_TO_PRIOR_SHIFTER)%' + reserve_new_shift_to_prior_shifter_delay: '%env(RESERVE_NEW_SHIFT_TO_PRIOR_SHIFTER_DELAY)%' site_name: '%env(SITE_NAME)%' super_admin.initial_password: '%env(SUPER_ADMIN_INITIAL_PASSWORD)%' super_admin.username: '%env(SUPER_ADMIN_USERNAME)%' From c195343104f5ccf6335f8179e70df849d08a2f16 Mon Sep 17 00:00:00 2001 From: Raphael Odini Date: Fri, 26 Apr 2024 12:06:56 +0200 Subject: [PATCH 6/6] form issubmitted & isvalid errors --- src/Controller/AdminClosingExceptionController.php | 3 ++- src/Controller/AdminController.php | 4 ++-- src/Controller/AdminEventController.php | 3 ++- src/Controller/AdminOpeningHourController.php | 3 ++- src/Controller/BeneficiaryController.php | 3 ++- src/Controller/JobController.php | 3 ++- src/Controller/MembershipController.php | 3 ++- src/Controller/ShiftController.php | 3 ++- 8 files changed, 16 insertions(+), 9 deletions(-) diff --git a/src/Controller/AdminClosingExceptionController.php b/src/Controller/AdminClosingExceptionController.php index 1392fefd5..828d36093 100644 --- a/src/Controller/AdminClosingExceptionController.php +++ b/src/Controller/AdminClosingExceptionController.php @@ -147,8 +147,9 @@ public function widgetGeneratorAction(Request $request) )) ->add('generate', SubmitType::class, array('label' => 'Générer')) ->getForm(); + $form->handleRequest($request); - if ($form->handleRequest($request)->isValid()) { + if ($form->isSubmitted() && $form->isValid()) { $data = $form->getData(); $widgetQueryString = 'title=' . ($data['title'] ? 1 : 0); diff --git a/src/Controller/AdminController.php b/src/Controller/AdminController.php index 24cd53674..e1696350a 100644 --- a/src/Controller/AdminController.php +++ b/src/Controller/AdminController.php @@ -245,9 +245,9 @@ public function csvImportAction(Request $request, KernelInterface $kernel) //->add('persist', CheckboxType::class, array('required' => false, 'label' => 'Sauver en base')) //->add('compute', SubmitType::class, array('label' => 'Importer les données')) ->getForm(); + $form->handleRequest($request); - if ($form->handleRequest($request)->isValid()) { - + if ($form->isSubmitted() && $form->isValid()) { // Get file $file = $form->get('submitFile'); $delimiter = ($form->get('delimiter')) ? $form->get('delimiter')->getData() : ','; diff --git a/src/Controller/AdminEventController.php b/src/Controller/AdminEventController.php index d8f2cf96b..417ccad9b 100644 --- a/src/Controller/AdminEventController.php +++ b/src/Controller/AdminEventController.php @@ -458,8 +458,9 @@ public function widgetGeneratorAction(Request $request) )) ->add('generate', SubmitType::class, array('label' => 'Générer')) ->getForm(); + $form->handleRequest($request); - if ($form->handleRequest($request)->isValid()) { + if ($form->isSubmitted() && $form->isValid()) { $data = $form->getData(); $widgetQueryString = 'event_kind_id=' . ($data['kind'] ? $data['kind']->getId() : '') . '&date_max=' . ($data['date_max'] ? $data['date_max'] : '') . '&limit=' . ($data['limit'] ? $data['limit'] : '') . '&title=' . ($data['title'] ? 1 : 0) . '&links=' . ($data['links'] ? 1 : 0); diff --git a/src/Controller/AdminOpeningHourController.php b/src/Controller/AdminOpeningHourController.php index 0ef195361..f4bef8c2e 100644 --- a/src/Controller/AdminOpeningHourController.php +++ b/src/Controller/AdminOpeningHourController.php @@ -174,8 +174,9 @@ public function widgetGeneratorAction(Request $request) )) ->add('generate', SubmitType::class, array('label' => 'Générer')) ->getForm(); + $form->handleRequest($request); - if ($form->handleRequest($request)->isValid()) { + if ($form->isSubmitted() && $form->isValid()) { $data = $form->getData(); $widgetQueryString = 'opening_hour_kind_id=' . ($data['kind'] ? $data['kind']->getId() : '') . '&title=' . ($data['title'] ? 1 : 0) . '&kind_title=' . ($data['kind_title'] ? 1 : 0) . '&align=' . $data['align']; diff --git a/src/Controller/BeneficiaryController.php b/src/Controller/BeneficiaryController.php index ce382f21b..798c4456f 100644 --- a/src/Controller/BeneficiaryController.php +++ b/src/Controller/BeneficiaryController.php @@ -236,8 +236,9 @@ public function findMemberNumberAction(Request $request): Response ->add('find', SubmitType::class, array('label' => 'Trouver mon numéro')) ->getForm(); } + $form->handleRequest($request); - if ($form->handleRequest($request)->isValid()) { + if ($form->isSubmitted() && $form->isValid()) { $firstname = $form->get('firstname')->getData(); $beneficiaries = $em->getRepository(Beneficiary::class)->findActiveFromFirstname($firstname); diff --git a/src/Controller/JobController.php b/src/Controller/JobController.php index ea25a6f3e..ac63dc443 100644 --- a/src/Controller/JobController.php +++ b/src/Controller/JobController.php @@ -193,8 +193,9 @@ public function widgetGeneratorAction(Request $request) ->add('title', CheckboxType::class, array('required' => false, 'data' => true, 'label' => 'Afficher le titre du widget ?')) ->add('generate', SubmitType::class, array('label' => 'Générer')) ->getForm(); + $form->handleRequest($request); - if ($form->handleRequest($request)->isValid()) { + if ($form->isSubmitted() && $form->isValid()) { $data = $form->getData(); $widgetQueryString = 'job_id='.$data['job']->getId().'&display_end='.($data['display_end'] ? 1 : 0).'&display_on_empty='.($data['display_on_empty'] ? 1 : 0).'&title='.($data['title'] ? 1 : 0); diff --git a/src/Controller/MembershipController.php b/src/Controller/MembershipController.php index 6bce2f188..f72cb3155 100644 --- a/src/Controller/MembershipController.php +++ b/src/Controller/MembershipController.php @@ -478,8 +478,9 @@ public function activeUserAccountAction(Request $request) ))) ->add('find', SubmitType::class, array('label' => 'Activer mon compte')) ->getForm(); + $form->handleRequest($request); - if ($form->handleRequest($request)->isValid()) { + if ($form->isSubmitted() && $form->isValid()) { $member_number = $form->get('member_number')->getData(); $em = $this->getDoctrine()->getManager(); $ms = $em->getRepository('App:Membership')->findOneBy(array('member_number' => $member_number)); diff --git a/src/Controller/ShiftController.php b/src/Controller/ShiftController.php index 6ff901ed1..4498c643c 100644 --- a/src/Controller/ShiftController.php +++ b/src/Controller/ShiftController.php @@ -630,8 +630,9 @@ public function contactFormAction(Request $request, Shift $shift, \Swift_Mailer $coShifters = $em->getRepository('App:Beneficiary')->findCoShifters($shift); $form = $this->createShiftContactForm($shift, $coShifters); + $form->handleRequest($request); - if ($form->handleRequest($request)->isValid()) { + if ($form->isSubmitted() && $form->isValid()) { $beneficiaries = $form->get('to')->getData(); $from = $form->get('from')->getData(); $from = $em->getRepository('App:Beneficiary')->findOneBy(array('id' => $from));