From b6e38815ac2ab623fa2fa83760e088d059e75841 Mon Sep 17 00:00:00 2001 From: Philipp Nowinski <philipp@sgalinski.de> Date: Mon, 20 Aug 2018 15:12:04 +0200 Subject: [PATCH] [FEAUTRE] add option to disallow unsolicited applications --- Classes/Controller/JoblistController.php | 8 ++++++++ Configuration/TypoScript/Frontend/constants.ts | 4 ++++ Configuration/TypoScript/Frontend/setup.ts | 2 ++ 3 files changed, 14 insertions(+) diff --git a/Classes/Controller/JoblistController.php b/Classes/Controller/JoblistController.php index 49557ecf..beb2c546 100644 --- a/Classes/Controller/JoblistController.php +++ b/Classes/Controller/JoblistController.php @@ -144,6 +144,14 @@ class JoblistController extends ActionController { $this->request->setArgument('error', NULL); } + if ($jobId === NULL && $this->settings['disallowUnsolicitedApplication']) { + $uriBuilder = $this->uriBuilder; + $uri = $uriBuilder + ->setTargetPageUid($this->settings['offersPage']) + ->build(); + $this->redirectToUri($uri, 0, 301); + } + $folderName = NULL; try { $folderName = $this->request->getArgument('folderName'); diff --git a/Configuration/TypoScript/Frontend/constants.ts b/Configuration/TypoScript/Frontend/constants.ts index 0e3a5249..e0f95ba9 100644 --- a/Configuration/TypoScript/Frontend/constants.ts +++ b/Configuration/TypoScript/Frontend/constants.ts @@ -21,6 +21,10 @@ plugin.tx_sgjobs { allowedMaxFileSize = 5000 # cat=plugin.tx_sgjobs/other; type=int+; label=Page id of the privacy policy page privacyPolicyPage = 42 + # cat=plugin.tx_sgjobs/other; type=int+; UID of the offers page – you need to set this if you set disallowUnsolicitedApplication=1 + offersPage = + # cat=plugin.tx_sgjobs/other; type=int+; If set to 1, the application-form page will redirect to the overview if no jobId is passed + disallowUnsolicitedApplication = 0 } pagebrowser.settings { diff --git a/Configuration/TypoScript/Frontend/setup.ts b/Configuration/TypoScript/Frontend/setup.ts index 10ecd141..a1929d9b 100644 --- a/Configuration/TypoScript/Frontend/setup.ts +++ b/Configuration/TypoScript/Frontend/setup.ts @@ -26,6 +26,8 @@ plugin.tx_sgjobs { allowedMimeTypes = {$plugin.tx_sgjobs.settings.allowedMimeTypes} allowedMaxFileSize = {$plugin.tx_sgjobs.settings.allowedMaxFileSize} privacyPolicyPage = {$plugin.tx_sgjobs.settings.privacyPolicyPage} + offersPage = {$plugin.tx_sgjobs.settings.offersPage} + disallowUnsolicitedApplication = {$plugin.tx_sgjobs.settings.disallowUnsolicitedApplication} } features { -- GitLab