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

[TASK] ADding default / fallback job id for unsolicited application or missing job id

parent c0016e78
No related branches found
No related tags found
2 merge requests!5Feature 1 6,!4Feature 1 6
......@@ -272,9 +272,8 @@ class JoblistController extends ActionController {
$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 (($job === NULL || $applyData->getJobId() === NULL) && $applyData->getCompany() !== NULL) {
$applyData->setJobId($applyData->getCompany()->getJobId());
}
if ($applyData->_isNew()) {
......
......@@ -37,6 +37,11 @@ class Company extends AbstractEntity {
*/
protected $city = '';
/**
* @var string $jobId
*/
protected $jobId = '';
/**
* @var string $name
*/
......@@ -145,4 +150,18 @@ class Company extends AbstractEntity {
public function setContact(Contact $contact) {
$this->contact = $contact;
}
/**
* @return string
*/
public function getJobId() {
return $this->jobId;
}
/**
* @param string $jobId
*/
public function setJobId(string $jobId) {
$this->jobId = $jobId;
}
}
......@@ -8,7 +8,7 @@ return [
'crdate' => 'crdate',
'cruser_id' => 'cruser_id',
'dividers2tabs' => TRUE,
'searchFields' => 'city, country, description, name, street, contact',
'searchFields' => 'job_id, city, country, description, name, street, contact',
'versioningWS' => 2,
'versioning_followPages' => TRUE,
'origUid' => 't3_origuid',
......@@ -26,12 +26,12 @@ return [
'Resources/Public/Icons/tx_sgjobs_domain_model_company.svg'
],
'interface' => [
'showRecordFieldList' => 'sys_language_uid, l10n_parent, l10n_diffsource, hidden, pid, city, street name, country, description, contact',
'showRecordFieldList' => 'sys_language_uid, l10n_parent, l10n_diffsource, hidden, pid, job_id, city, street name, country, description, contact',
],
'types' => [
'1' => [
'showitem' => '--palette--;;sysLanguageAndHidden,
city, street,name, country, description, contact;;;richtext[*]:rte_transform[mode=ts],
job_id, city, street,name, country, description, contact;;;richtext[*]:rte_transform[mode=ts],
--div--;LLL:EXT:frontend/Resources/Private/Language/locallang_ttc.xlf:tabs.access, starttime, endtime',
],
],
......@@ -131,6 +131,15 @@ return [
'eval' => 'trim'
],
],
'job_id' => [
'exclude' => 0,
'label' => 'LLL:EXT:sg_jobs/Resources/Private/Language/locallang_db.xlf:tx_sgjobs_domain_model_company.job_id',
'config' => [
'type' => 'input',
'size' => 30,
'eval' => 'trim'
],
],
'name' => [
'exclude' => 0,
'label' => 'LLL:EXT:sg_jobs/Resources/Private/Language/locallang_db.xlf:tx_sgjobs_domain_model_company.name',
......
......@@ -69,6 +69,10 @@
<source>Description</source>
<target>Beschreibung</target>
</trans-unit>
<trans-unit id="tx_sgjobs_domain_model_company.job_id" approved="yes">
<source>Job ID</source>
<target>Job ID</target>
</trans-unit>
<trans-unit id="tx_sgjobs_domain_model_company.name" approved="yes">
<source>Name</source>
<target>Name</target>
......
......@@ -54,6 +54,9 @@
<trans-unit id="tx_sgjobs_domain_model_company.description">
<source>Description</source>
</trans-unit>
<trans-unit id="tx_sgjobs_domain_model_company.job_id">
<source>Job ID</source>
</trans-unit>
<trans-unit id="tx_sgjobs_domain_model_company.name">
<source>Name</source>
</trans-unit>
......
......@@ -59,6 +59,7 @@ CREATE TABLE tx_sgjobs_domain_model_company (
country varchar(255) DEFAULT '' NOT NULL,
description text DEFAULT '' NOT NULL,
contact int(11) unsigned DEFAULT '0' NOT NULL,
job_id text DEFAULT '' NOT NULL,
-- TYPO3 fields
sorting int(11) unsigned DEFAULT '0' NOT NULL,
......
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