Skip to content
Snippets Groups Projects
Commit f738b820 authored by Torsten Oppermann's avatar Torsten Oppermann
Browse files

[TASK] Fixing implementation

parent b753f775
No related branches found
No related tags found
No related merge requests found
...@@ -150,13 +150,6 @@ class JoblistController extends ActionController { ...@@ -150,13 +150,6 @@ class JoblistController extends ActionController {
$this->view->assign('job', $jobData); $this->view->assign('job', $jobData);
} }
// look for a configured default job, in case of unsolicited application
if ($jobData === NULL && $this->settings['defaultJobId']) {
/** @var Job $unsoliticedJob */
$unsoliticedJob = $this->jobRepository->findByUid($this->settings['defaultJobId']);
$this->view->assign('job', $unsoliticedJob);
}
// display country options // display country options
$countryRepository = $this->objectManager->get(CountryRepository::class); $countryRepository = $this->objectManager->get(CountryRepository::class);
$countries = $countryRepository->findAllOrderedBy('shortNameEn')->toArray(); $countries = $countryRepository->findAllOrderedBy('shortNameEn')->toArray();
...@@ -250,6 +243,15 @@ class JoblistController extends ActionController { ...@@ -250,6 +243,15 @@ class JoblistController extends ActionController {
try { try {
$applyData->setPid($GLOBALS['TSFE']->id); $applyData->setPid($GLOBALS['TSFE']->id);
/** @var Job $job */
$job = $applyData->getJob();
// look for a configured default job, in case of unsolicited application
if ($job === NULL && $this->settings['defaultJobId']) {
$unsoliticedJob = $this->settings['defaultJobId'];
$applyData->setJobId($unsoliticedJob);
}
if ($applyData->_isNew()) { if ($applyData->_isNew()) {
$this->jobApplicationRepository->add($applyData); $this->jobApplicationRepository->add($applyData);
} else { } else {
...@@ -266,8 +268,6 @@ class JoblistController extends ActionController { ...@@ -266,8 +268,6 @@ class JoblistController extends ActionController {
); );
// get email from the job contact, fallback is TS settings // get email from the job contact, fallback is TS settings
/** @var Job $job */
$job = $applyData->getJob();
if ($job !== NULL) { if ($job !== NULL) {
/** @var Contact $contact */ /** @var Contact $contact */
......
...@@ -25,7 +25,7 @@ plugin.tx_sgjobs { ...@@ -25,7 +25,7 @@ plugin.tx_sgjobs {
allowedFileExtensions = {$plugin.tx_sgjobs.settings.allowedFileExtensions} allowedFileExtensions = {$plugin.tx_sgjobs.settings.allowedFileExtensions}
allowedMimeTypes = {$plugin.tx_sgjobs.settings.allowedMimeTypes} allowedMimeTypes = {$plugin.tx_sgjobs.settings.allowedMimeTypes}
defaultContactId = 1 defaultContactId = 1
defaultJobId = defaultJobId = 28
} }
features { features {
......
...@@ -39,7 +39,7 @@ The Backend module is found in the **WEB** section under the name **Job Offers** ...@@ -39,7 +39,7 @@ The Backend module is found in the **WEB** section under the name **Job Offers**
You can create a new job offer by clicking on the **New Job Offer** button. You can create a new job offer by clicking on the **New Job Offer** button.
## Defining a default Job (unsoliticed Application) ## Defining a default Job (unsoliticed Application)
In your typoscript settings you can set a job offer, which will be used for all **unsoliticed Applications**. In your typoscript settings you can set a job id, which will be used for all **unsoliticed Applications**.
If nothing is set, unsolicited applications are not connected to any job offer. If nothing is set, unsolicited applications are not connected to any job offer.
``` ```
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment