diff --git a/Classes/Controller/JoblistController.php b/Classes/Controller/JoblistController.php index 362f5fa1e1c162e6a4e20bdbb7214fdc5d67349c..2d5bc52695d5c376efeeb35efa8641f429ac40dc 100644 --- a/Classes/Controller/JoblistController.php +++ b/Classes/Controller/JoblistController.php @@ -114,6 +114,18 @@ class JoblistController extends ActionController { $mailService->setToAddresses($this->settings['applicationEmail']); $mailService->sendEmail(); + + // redirect to the given page id from the flexform + $redirectPageId = (int) $this->configurationManager->getConfiguration( + ConfigurationManagerInterface::CONFIGURATION_TYPE_FRAMEWORK + )['settings']['redirectPage']; + + $uriBuilder = $this->uriBuilder; + $uri = $uriBuilder + ->setTargetPageUid($redirectPageId) + ->build(); + $this->redirectToUri($uri); + } catch (\Exception $exception) { // possible errors, because of wrong mails (maybe log that somewhere? Does this makes sense?) } diff --git a/Configuration/FlexForms/JobApplication.xml b/Configuration/FlexForms/JobApplication.xml new file mode 100644 index 0000000000000000000000000000000000000000..30cf107ff5d0bc9f2f445a7ccac6a8591d1e883e --- /dev/null +++ b/Configuration/FlexForms/JobApplication.xml @@ -0,0 +1,35 @@ +<?xml version="1.0" encoding="UTF-8"?> +<T3DataStructure> + <sheets> + <sDEF> + <ROOT> + <TCEforms> + <sheetTitle>LLL:EXT:sg_jobs/Resources/Private/Language/locallang_db.xlf:tx_sgjobs_domain_model_job.plugin_options</sheetTitle> + </TCEforms> + <type>array</type> + <el> + <settings.redirectPage> + <TCEforms> + <label>LLL:EXT:sg_jobs/Resources/Private/Language/locallang_db.xlf:tx_sgjobs.application_redirect_page</label> + <config> + <type>group</type> + <eval>required</eval> + <internal_type>db</internal_type> + <allowed>pages</allowed> + <size>1</size> + <maxitems>1</maxitems> + <minitems>0</minitems> + <show_thumbs>1</show_thumbs> + <wizards> + <suggest> + <type>suggest</type> + </suggest> + </wizards> + </config> + </TCEforms> + </settings.redirectPage> + </el> + </ROOT> + </sDEF> + </sheets> +</T3DataStructure> \ No newline at end of file diff --git a/Configuration/TCA/Overrides/tt_content.php b/Configuration/TCA/Overrides/tt_content.php index 920e1ac7435200833fde6b0c1ff292e335e2257d..f02a2d5d1d894a49677304100ded071be75d9311 100644 --- a/Configuration/TCA/Overrides/tt_content.php +++ b/Configuration/TCA/Overrides/tt_content.php @@ -1,11 +1,21 @@ <?php -call_user_func(function() { - $extensionName = strtolower(\TYPO3\CMS\Core\Utility\GeneralUtility::underscoredToUpperCamelCase('sg_jobs')); - $pluginSignature = $extensionName . '_' . strtolower('Joblist'); +call_user_func( + function () { + $extensionName = strtolower(\TYPO3\CMS\Core\Utility\GeneralUtility::underscoredToUpperCamelCase('sg_jobs')); + $pluginSignature = $extensionName . '_' . strtolower('Joblist'); - $GLOBALS['TCA']['tt_content']['types']['list']['subtypes_addlist'][$pluginSignature] = 'pi_flexform'; - \TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addPiFlexFormValue( - $pluginSignature, - 'FILE:EXT:sg_jobs/Configuration/FlexForms/Joblist.xml' - ); -}); + $GLOBALS['TCA']['tt_content']['types']['list']['subtypes_addlist'][$pluginSignature] = 'pi_flexform'; + \TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addPiFlexFormValue( + $pluginSignature, + 'FILE:EXT:sg_jobs/Configuration/FlexForms/Joblist.xml' + ); + + $pluginSignature = $extensionName . '_' . strtolower('JobApplication'); + + $GLOBALS['TCA']['tt_content']['types']['list']['subtypes_addlist'][$pluginSignature] = 'pi_flexform'; + \TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addPiFlexFormValue( + $pluginSignature, + 'FILE:EXT:sg_jobs/Configuration/FlexForms/JobApplication.xml' + ); + } +); diff --git a/Resources/Private/Language/de.locallang_db.xlf b/Resources/Private/Language/de.locallang_db.xlf index 6a8f614d1638cd6bd49a0b455e9b007986b6682c..0446a0f0dca9d4df7a4f9881ffc2a583b074bb7a 100644 --- a/Resources/Private/Language/de.locallang_db.xlf +++ b/Resources/Private/Language/de.locallang_db.xlf @@ -17,6 +17,10 @@ <source>Qualification & Tasks</source> <target>Qualifikation & Aufgaben</target> </trans-unit> + <trans-unit id="tx_sgjobs.application_redirect_page" approved="yes"> + <source>Redirect page after form submit</source> + <target>Weiterleitungsziel nach abschicken des Formulars</target> + </trans-unit> <trans-unit id="tx_sgjobs_domain_model_base" approved="yes"> <source>Base Table</source> <target>Basis-Tabelle</target> diff --git a/Resources/Private/Language/locallang_db.xlf b/Resources/Private/Language/locallang_db.xlf index d853bebb0d11001464e3b5aa4320169923968fec..a3ab19ba7d20305160325c11e1764ce0386b6121 100644 --- a/Resources/Private/Language/locallang_db.xlf +++ b/Resources/Private/Language/locallang_db.xlf @@ -15,6 +15,9 @@ <trans-unit id="tca.qualification_tab"> <source>Qualification & Tasks</source> </trans-unit> + <trans-unit id="tx_sgjobs.application_redirect_page"> + <source>Redirect page after form submit</source> + </trans-unit> <trans-unit id="tx_sgjobs_domain_model_base"> <source>Base Table</source> </trans-unit> diff --git a/Resources/Private/Templates/Joblist/ApplyForm.html b/Resources/Private/Templates/Joblist/ApplyForm.html index adcd614f66ab093a3df3d1301c6f943f8915a44f..5844051de336e09e67638dcb14174c248e2d676e 100644 --- a/Resources/Private/Templates/Joblist/ApplyForm.html +++ b/Resources/Private/Templates/Joblist/ApplyForm.html @@ -2,14 +2,14 @@ <f:section name="main"> <f:form action="apply" controller="Joblist" method="post" objectName="applyData" object="{applyData}" enctype="multipart/form-data"> - <f:form.hidden value="{job.uid}" property="jobId" /> - + <f:if condition="{job}"> + <f:form.hidden value="{job.job_id}" property="jobId" /> + <label for="apply-title"><f:translate key="frontend.apply.title" /></label> + <span id="apply-title">{job.title}</span> + <br /> + </f:if> <label for="apply-gender"><f:translate key="frontend.apply.gender" /></label> -<<<<<<< HEAD - <f:form.select property="gender" id="apply-gender" data="{}" class="" options="{Male: 'Male', Female: 'Female'}" /> -======= <f:form.select property="gender" id="apply-gender" class="" options="{None: '', Male: 'Male', Female: 'Female'}" /> ->>>>>>> ef0bad6dbd9fd1503cfce001734cb83f277d8404 <f:form.validationResults for="applyData.gender"> <f:for each="{validationResults.errors}" as="error"> <div class="sg-jobs-validation-error"> diff --git a/Resources/Public/JavaScript/sgjobs.js b/Resources/Public/JavaScript/sgjobs.js deleted file mode 100644 index 97d437c43f1b0ae1cd7ca68cdab627e08ad30f6c..0000000000000000000000000000000000000000 --- a/Resources/Public/JavaScript/sgjobs.js +++ /dev/null @@ -1,30 +0,0 @@ -module.exports = function() { - - 'use strict'; - - const $ = require('jquery'); - - let SgJobs = {}; - - SgJobs.init = function() { - $('body').delegate('.sgjobs-select', 'change', function() { - $.post( - '?eID=sgAjax&extensionName=SgJobs&controller=Ajax%5CJoblist&action=filter&format=html', - { - parameters: { - country: $('#filter-countries').val(), - location: $('#filter-locations').val(), - company: $('#filter-companies').val(), - area: $('#filter-areas').val(), - function: $('#filter-functions').val(), - } - } - ).done(function(result) { - // replace filter & job list with result from ajax controller - $('#sgjobs-joblist').html(result); - }); - }); - }; - - return SgJobs; -};