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 {
$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
$countryRepository = $this->objectManager->get(CountryRepository::class);
$countries = $countryRepository->findAllOrderedBy('shortNameEn')->toArray();
......@@ -250,6 +243,15 @@ class JoblistController extends ActionController {
try {
$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()) {
$this->jobApplicationRepository->add($applyData);
} else {
......@@ -266,8 +268,6 @@ class JoblistController extends ActionController {
);
// get email from the job contact, fallback is TS settings
/** @var Job $job */
$job = $applyData->getJob();
if ($job !== NULL) {
/** @var Contact $contact */
......
......@@ -25,7 +25,7 @@ plugin.tx_sgjobs {
allowedFileExtensions = {$plugin.tx_sgjobs.settings.allowedFileExtensions}
allowedMimeTypes = {$plugin.tx_sgjobs.settings.allowedMimeTypes}
defaultContactId = 1
defaultJobId =
defaultJobId = 28
}
features {
......
......@@ -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.
## 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.
```
......
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