diff --git a/module/Activity/src/Controller/ActivityController.php b/module/Activity/src/Controller/ActivityController.php index 223911d69f..ec12e5a59a 100644 --- a/module/Activity/src/Controller/ActivityController.php +++ b/module/Activity/src/Controller/ActivityController.php @@ -158,11 +158,9 @@ public function viewSignupListAction(): ViewModel $view->setTemplate('activity/activity/view.phtml'); // Retrieve and clear the request status from the session, if it exists. - if (isset($activitySession->success)) { - $view->setVariable('success', $activitySession->success); - unset($activitySession->success); - $view->setVariable('message', $activitySession->message); - unset($activitySession->message); + if (isset($activitySession->reopen)) { + $view->setVariable('reopen', $activitySession->reopen); + unset($activitySession->reopen); } return $view; @@ -219,6 +217,8 @@ public function signupAction(): Response|ViewModel /** @var Request $request */ $request = $this->getRequest(); + $activityRequestSession = new SessionContainer('activityRequest'); + $activityRequestSession->reopen = false; if ($request->isPost()) { $form = $this->signupService->getForm($signupList); @@ -229,7 +229,7 @@ public function signupAction(): Response|ViewModel // Check if the form is valid if (!$form->isValid()) { $error = $this->translator->translate('Invalid form'); - $activityRequestSession = new SessionContainer('activityRequest'); + $activityRequestSession->reopen = true; $activityRequestSession->signupData = $postData->toArray(); return $this->redirectActivityRequest($activityId, $signupListId, false, $error); @@ -268,6 +268,7 @@ public function signupAction(): Response|ViewModel } $error = $this->translator->translate('Use the form to subscribe'); + $activityRequestSession->reopen = true; return $this->redirectActivityRequest($activityId, $signupListId, false, $error); } @@ -312,6 +313,8 @@ public function externalSignupAction(): Response|ViewModel /** @var Request $request */ $request = $this->getRequest(); + $activityRequestSession = new SessionContainer('activityRequest'); + $activityRequestSession->reopen = false; if ($request->isPost()) { $form = $this->signupService->getExternalForm($signupList); @@ -322,7 +325,7 @@ public function externalSignupAction(): Response|ViewModel // Check if the form is valid if (!$form->isValid()) { $error = $this->translator->translate('Invalid form'); - $activityRequestSession = new SessionContainer('activityRequest'); + $activityRequestSession->reopen = true; $activityRequestSession->signupData = $postData->toArray(); return $this->redirectActivityRequest($activityId, $signupListId, false, $error); @@ -357,6 +360,7 @@ public function externalSignupAction(): Response|ViewModel } $error = $this->translator->translate('Use the form to subscribe'); + $activityRequestSession->reopen = true; return $this->redirectActivityRequest($activityId, $signupListId, false, $error); } diff --git a/module/Activity/src/Controller/AdminController.php b/module/Activity/src/Controller/AdminController.php index 9fec2a8b6f..9535ac7a55 100644 --- a/module/Activity/src/Controller/AdminController.php +++ b/module/Activity/src/Controller/AdminController.php @@ -281,11 +281,9 @@ public function participantsAction(): ViewModel $result['signupLists'] = $signupLists; // Retrieve and clear the request status from the session, if it exists. - if (isset($activityAdminSession->success)) { - $result['success'] = $activityAdminSession->success; - unset($activityAdminSession->success); - $result['message'] = $activityAdminSession->message; - unset($activityAdminSession->message); + if (isset($activityAdminSession->reopen)) { + $result['reopen'] = $activityAdminSession->reopen; + unset($activityAdminSession->reopen); } $result['canSeeTimeOfSignup'] = $this->aclService->isAllowed('viewParticipantDetails', 'activity'); @@ -309,6 +307,8 @@ public function externalSignupAction(): Response|ViewModel /** @var Request $request */ $request = $this->getRequest(); + $activityAdminSession = new SessionContainer('activityAdminRequest'); + $activityAdminSession->reopen = false; if ($request->isPost()) { $form = $this->signupService->getExternalAdminForm($signupList); @@ -318,7 +318,7 @@ public function externalSignupAction(): Response|ViewModel // Check if the form is valid if (!$form->isValid()) { - $activityAdminSession = new SessionContainer('activityAdminRequest'); + $activityAdminSession->reopen = true; $activityAdminSession->signupData = $postData->toArray(); return $this->redirectActivityAdminRequest( @@ -345,6 +345,8 @@ public function externalSignupAction(): Response|ViewModel ); } + $activityAdminSession->reopen = true; + return $this->redirectActivityAdminRequest( $activityId, $signupListId, diff --git a/module/Activity/view/activity/activity/view.phtml b/module/Activity/view/activity/activity/view.phtml index 18d48c8509..98b19062c3 100644 --- a/module/Activity/view/activity/activity/view.phtml +++ b/module/Activity/view/activity/activity/view.phtml @@ -187,78 +187,108 @@ $this->headTitle($this->translate('Activities'));
- + + + + + + - - - -
-
-
- -

translate('Unsubscribe yourself') ?>

- -
- translate('You are not allowed to unsubscribe after the deadline!') ?> -
- -
- setAttribute('action', $this->url('activity/signoff', ['id' => $activity->getId(), 'signupList' => $signupList->getId()])); - $signoffForm->prepare(); - echo $this->form()->openTag($signoffForm); - echo $this->formElement($signoffForm->get('security')); - $submit = $signoffForm->get('submit'); - $submit->setAttribute('class', 'btn btn-default'); - echo $this->formSubmit($submit); - echo $this->form()->closeTag(); - ?> -
- - - -

- translate('Subscribe yourself') ?> -

- - translate('Login to subscribe') ?> + getOnlyGEWIS()): ?> + + translate('Log in to subscribe') ?> - getOnlyGEWIS() && null !== $form): ?> -
- translate('Or subscribe without a GEWIS membership: ') ?> - partial('partial/signupForm', [ - 'form' => $form, - 'signupList' => $signupList, - ]) - ?> - - - -

- translate('Subscribe yourself') ?> -

+ getOnlyGEWIS()): ?> + + partial('partial/signupForm', [ + 'form' => $form, + 'signupList' => $signupList, + ]) + ?> + + partial('partial/signupForm', [ 'form' => $form, 'signupList' => $signupList, ]) ?> -
+ + + +
+ +
+

translate('Current subscriptions') ?>

diff --git a/module/Activity/view/activity/admin/participants.phtml b/module/Activity/view/activity/admin/participants.phtml index 88d775ddee..fa2ab3d1ca 100644 --- a/module/Activity/view/activity/admin/participants.phtml +++ b/module/Activity/view/activity/admin/participants.phtml @@ -77,12 +77,23 @@ $this->breadcrumbs()
+ partial('partial/signupForm', [ 'form' => $externalSignupForm, 'activity' => $activity, 'signupList' => $signupList, ]) ?> + + +
diff --git a/module/Activity/view/partial/signupForm.phtml b/module/Activity/view/partial/signupForm.phtml index e0d048e065..3e7c93338e 100644 --- a/module/Activity/view/partial/signupForm.phtml +++ b/module/Activity/view/partial/signupForm.phtml @@ -76,49 +76,89 @@ function formElementRender( ?> -setAttribute('action', $submitUrl); -$form->setAttribute('class', 'form-signup'); -$form->prepare(); -echo $this->form()->openTag($form); -?> - - get('fullName'), $this->translate('Full name'), 'fullName', false, $this) ?> - get('email'), $this->translate('E-mail Address'), 'email', true, $this) ?> - - - - get('captcha'), $this->translate('CAPTCHA'), 'captcha', false, $this) ?> - - -getFields() as $field): ?> - get(strval($field->getId())), - $this->escapeHtml($this->localiseText($field->getName())), - $field->getId(), - $field->isSensitive(), - $this, - ) ?> - - -

- - translate('Activity Policy') ?> translate('and') ?> - - translate('Alcohol Policy') ?>. -

- -

- - translate('Fields that are marked with an \'¹\' will only be shared with the board and the organiser of the activity.') ?> - -

- -get('submit'); -$submit->setAttribute('class', 'btn btn-primary'); -$submit->setAttribute('value', $submitText); -echo $this->formElement($form->get('security')); -echo $this->formSubmit($submit); -echo $this->form()->closeTag(); -?> + diff --git a/module/Application/language/en.po b/module/Application/language/en.po index dd08c16f94..9702626a8b 100644 --- a/module/Application/language/en.po +++ b/module/Application/language/en.po @@ -8,8 +8,8 @@ msgid "" msgstr "" "Project-Id-Version: GEWISweb 0.1.0-dev\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-11-16 10:18+0100\n" -"PO-Revision-Date: 2023-11-16 10:19+0100\n" +"POT-Creation-Date: 2023-11-19 16:08+0100\n" +"PO-Revision-Date: 2023-11-19 16:09+0100\n" "Last-Translator: Tom Udding \n" "Language-Team: English \n" "Language: en\n" @@ -285,9 +285,6 @@ msgstr "All Activities" msgid "All rights reserved." msgstr "All rights reserved." -msgid "Already subscribed" -msgstr "Already subscribed" - msgid "Already voted!" msgstr "Already voted!" @@ -453,6 +450,9 @@ msgstr "" msgid "Are you sure you want to delete this poll?" msgstr "Are you sure you want to delete this poll?" +msgid "Are you sure you want to unsubscribe?" +msgstr "Are you sure you want to unsubscribe?" + msgid "Are you sure you would like to authorize" msgstr "Are you sure you would like to authorize" @@ -953,6 +953,10 @@ msgstr "Display GEWIS member count" msgid "Display number of subscribed members" msgstr "Display number of subscribed members" +#, php-format +msgid "Do you have a GEWIS account? Log in to subscribe." +msgstr "Do you have a GEWIS account? Log in to subscribe." + #, php-format msgid "" "Do you have a complaint or suggestion concerning the education at the TU/e? " @@ -1690,12 +1694,12 @@ msgstr "Log in as company" msgid "Log in as member" msgstr "Log in as member" +msgid "Log in to subscribe" +msgstr "Log in to subscribe" + msgid "Login" msgstr "Login" -msgid "Login to subscribe" -msgstr "Login to subscribe" - msgid "Login to view more information" msgstr "Login to view more information" @@ -2671,14 +2675,15 @@ msgstr "Subscribe an external participant" msgid "Subscribe as external participant" msgstr "Subscribe as external participant" -msgid "Subscribe now" -msgstr "Subscribe now" +msgid "Subscribe external participant" +msgstr "Subscribe external participant" -msgid "Subscribe yourself" -msgstr "Subscribe yourself" +#, php-format +msgid "Subscribe to '%s'" +msgstr "Subscribe to '%s'" -msgid "Subscription closed" -msgstr "Subscription closed" +msgid "Subscription period closed" +msgstr "Subscription period closed" msgid "Successfully added course!" msgstr "Successfully added course!" @@ -3203,8 +3208,15 @@ msgstr "Unfortunately, there aren't any %s at the moment." msgid "Unknown" msgstr "Unknown" -msgid "Unsubscribe yourself" -msgstr "Unsubscribe yourself" +msgid "Unsubscribe" +msgstr "Unsubscribe" + +#, php-format +msgid "Unsubscribe from '%s'" +msgstr "Unsubscribe from '%s'" + +msgid "Unsubscription period closed" +msgstr "Unsubscription period closed" msgid "Until" msgstr "Until" @@ -3818,9 +3830,6 @@ msgstr "You are not allowed to subscribe to this sign-up list" msgid "You are not allowed to transfer jobs" msgstr "You are not allowed to transfer jobs" -msgid "You are not allowed to unsubscribe after the deadline!" -msgstr "You are not allowed to unsubscribe after the deadline!" - msgid "You are not allowed to update this activity" msgstr "You are not allowed to update this activity" diff --git a/module/Application/language/gewisweb.pot b/module/Application/language/gewisweb.pot index a25d9bb867..0001bcc673 100644 --- a/module/Application/language/gewisweb.pot +++ b/module/Application/language/gewisweb.pot @@ -6,9 +6,9 @@ #, fuzzy msgid "" msgstr "" -"Project-Id-Version: GEWISweb v2.8.6-563-g229793789-dirty\n" +"Project-Id-Version: GEWISweb v2.8.6-570-g8364f44e3-dirty\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-11-16 10:29+0100\n" +"POT-Creation-Date: 2023-11-19 16:08+0100\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -276,9 +276,6 @@ msgstr "" msgid "All rights reserved." msgstr "" -msgid "Already subscribed" -msgstr "" - msgid "Already voted!" msgstr "" @@ -426,6 +423,9 @@ msgstr "" msgid "Are you sure you want to delete this poll?" msgstr "" +msgid "Are you sure you want to unsubscribe?" +msgstr "" + msgid "Are you sure you would like to authorize" msgstr "" @@ -909,6 +909,10 @@ msgstr "" msgid "Display number of subscribed members" msgstr "" +#, php-format +msgid "Do you have a GEWIS account? Log in to subscribe." +msgstr "" + #, php-format msgid "" "Do you have a complaint or suggestion concerning the education at the TU/e? " @@ -1595,10 +1599,10 @@ msgstr "" msgid "Log in as member" msgstr "" -msgid "Login" +msgid "Log in to subscribe" msgstr "" -msgid "Login to subscribe" +msgid "Login" msgstr "" msgid "Login to view more information" @@ -2526,13 +2530,14 @@ msgstr "" msgid "Subscribe as external participant" msgstr "" -msgid "Subscribe now" +msgid "Subscribe external participant" msgstr "" -msgid "Subscribe yourself" +#, php-format +msgid "Subscribe to '%s'" msgstr "" -msgid "Subscription closed" +msgid "Subscription period closed" msgstr "" msgid "Successfully added course!" @@ -3008,7 +3013,14 @@ msgstr "" msgid "Unknown" msgstr "" -msgid "Unsubscribe yourself" +msgid "Unsubscribe" +msgstr "" + +#, php-format +msgid "Unsubscribe from '%s'" +msgstr "" + +msgid "Unsubscription period closed" msgstr "" msgid "Until" @@ -3586,9 +3598,6 @@ msgstr "" msgid "You are not allowed to transfer jobs" msgstr "" -msgid "You are not allowed to unsubscribe after the deadline!" -msgstr "" - msgid "You are not allowed to update this activity" msgstr "" diff --git a/module/Application/language/nl.po b/module/Application/language/nl.po index 60877d8e10..fea07ca4cf 100644 --- a/module/Application/language/nl.po +++ b/module/Application/language/nl.po @@ -8,8 +8,8 @@ msgid "" msgstr "" "Project-Id-Version: GEWISweb 0.1.0-dev\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-11-16 10:29+0100\n" -"PO-Revision-Date: 2023-11-16 10:29+0100\n" +"POT-Creation-Date: 2023-11-19 16:08+0100\n" +"PO-Revision-Date: 2023-11-19 16:12+0100\n" "Last-Translator: Tom Udding \n" "Language-Team: English \n" "Language: nl\n" @@ -286,9 +286,6 @@ msgstr "Alle Activiteiten" msgid "All rights reserved." msgstr "Alle rechten voorbehouden." -msgid "Already subscribed" -msgstr "Je bent al ingeschreven" - msgid "Already voted!" msgstr "Je hebt al gestemd!" @@ -454,6 +451,9 @@ msgstr "" msgid "Are you sure you want to delete this poll?" msgstr "Weet je zeker dat je deze poll wilt verwijderen?" +msgid "Are you sure you want to unsubscribe?" +msgstr "Weet je zeker dat je je wilt uitschrijven?" + msgid "Are you sure you would like to authorize" msgstr "Weet je zeker dat je wilt machtigen" @@ -960,6 +960,11 @@ msgstr "Toon aantal GEWIS leden" msgid "Display number of subscribed members" msgstr "Toon aantal deelnemers" +#, php-format +msgid "Do you have a GEWIS account? Log in to subscribe." +msgstr "" +"Heb je een GEWIS-account? Log in om je in te schrijven." + #, php-format msgid "" "Do you have a complaint or suggestion concerning the education at the TU/e? " @@ -1712,12 +1717,12 @@ msgstr "Inloggen als bedrijf" msgid "Log in as member" msgstr "Inloggen als lid" +msgid "Log in to subscribe" +msgstr "Log in om in te schrijven" + msgid "Login" msgstr "Login" -msgid "Login to subscribe" -msgstr "Login om in te schrijven" - msgid "Login to view more information" msgstr "Log in om meer informatie te zien" @@ -2694,14 +2699,15 @@ msgstr "Inschrijven zonder GEWIS lidmaatschap" msgid "Subscribe as external participant" msgstr "Inschrijven zonder GEWIS lidmaatschap" -msgid "Subscribe now" -msgstr "Schrijf je in" +msgid "Subscribe external participant" +msgstr "Inschrijven externe deelnemer" -msgid "Subscribe yourself" -msgstr "Inschrijven" +#, php-format +msgid "Subscribe to '%s'" +msgstr "Inschrijven voor '%s'" -msgid "Subscription closed" -msgstr "Inschrijving gesloten" +msgid "Subscription period closed" +msgstr "Inschrijvingsperiode gesloten" msgid "Successfully added course!" msgstr "Vak succesvol toegevoegd!" @@ -3241,9 +3247,16 @@ msgstr "Helaas zijn er momenteel geen %s." msgid "Unknown" msgstr "Onbekend" -msgid "Unsubscribe yourself" +msgid "Unsubscribe" msgstr "Uitschrijven" +#, php-format +msgid "Unsubscribe from '%s'" +msgstr "Uitschrijven van '%s'" + +msgid "Unsubscription period closed" +msgstr "Uitschrijvingsperiode gesloten" + msgid "Until" msgstr "Tot" @@ -3869,9 +3882,6 @@ msgstr "" msgid "You are not allowed to transfer jobs" msgstr "Je hebt niet de rechten om vacatures te verplaatsen" -msgid "You are not allowed to unsubscribe after the deadline!" -msgstr "Uitschrijven na de uitschrijfdeadline is niet toegestaan!" - msgid "You are not allowed to update this activity" msgstr "Je hebt niet de rechten om deze activiteit te wijzigen"