diff --git a/Classes/Controller/JoblistController.php b/Classes/Controller/JoblistController.php index d5aa5d3607da5a3fdc28b1a251c13684c20a4135..fa20f93bd62a4b4e418ce69f55e7fb18191ba1d5 100644 --- a/Classes/Controller/JoblistController.php +++ b/Classes/Controller/JoblistController.php @@ -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()) { @@ -403,8 +402,14 @@ class JoblistController extends ActionController { * @return array */ private function getApplicationMailMarkers($applyData): array { + $location = ''; + if ($applyData->getCompany() !== NULL) { + $location = $applyData->getCompany()->getCity(); + } + return [ 'salutation' => $applyData->getGender(), + 'location' => $location, 'firstname' => $applyData->getFirstName(), 'lastname' => $applyData->getLastName(), 'street' => $applyData->getStreet(), diff --git a/Classes/Domain/Model/Company.php b/Classes/Domain/Model/Company.php index bdc6193f0673f5479c4a38e1fa37af1c82985196..e425e13d42f4178c6cc6df410b984c9312e16dfc 100644 --- a/Classes/Domain/Model/Company.php +++ b/Classes/Domain/Model/Company.php @@ -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; + } } diff --git a/Configuration/MailTemplates/ApplicationMail.php b/Configuration/MailTemplates/ApplicationMail.php index ff4c1c6a70bd53c985b2bae33c5cc358965f5bd9..dd90f09d331ff7d6bf0165c2e4cbaf9a32d0c39a 100644 --- a/Configuration/MailTemplates/ApplicationMail.php +++ b/Configuration/MailTemplates/ApplicationMail.php @@ -12,6 +12,12 @@ return [ 'value' => 'Webdeveloper', 'description' => 'LLL:EXT:sg_jobs/Resources/Private/Language/locallang.xlf:application_mail.marker.jobtitle' ], + [ + 'marker' => 'application.company.location', + 'type' => \SGalinski\SgMail\Service\MailTemplateService::MARKER_TYPE_STRING, + 'value' => 'München', + 'description' => 'LLL:EXT:sg_jobs/Resources/Private/Language/locallang.xlf:application_mail.marker.location' + ], [ 'marker' => 'application.gender', 'type' => \SGalinski\SgMail\Service\MailTemplateService::MARKER_TYPE_STRING, diff --git a/Configuration/TCA/tx_sgjobs_domain_model_company.php b/Configuration/TCA/tx_sgjobs_domain_model_company.php index 5946e0721ee99c0835cd67f255923e125a2be992..e304cf3349194cdf245f8252c2912073095a3685 100644 --- a/Configuration/TCA/tx_sgjobs_domain_model_company.php +++ b/Configuration/TCA/tx_sgjobs_domain_model_company.php @@ -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', diff --git a/Resources/Private/Language/de.locallang.xlf b/Resources/Private/Language/de.locallang.xlf index fa45ad81a2df3a0fafed5cddbedb5a10339d3a0c..3634116a7680d3f7be85d62b487001a8ad6fe8c8 100644 --- a/Resources/Private/Language/de.locallang.xlf +++ b/Resources/Private/Language/de.locallang.xlf @@ -45,6 +45,10 @@ <source>Last name</source> <target>Nachname</target> </trans-unit> + <trans-unit id="application_mail.marker.location" approved="yes"> + <source>The location regarding the unsolicited application</source> + <target>Der Standort für die Initiativbewerbung</target> + </trans-unit> <trans-unit id="application_mail.marker.message" approved="yes"> <source>Message</source> <target>Bemerkungen</target> diff --git a/Resources/Private/Language/de.locallang_db.xlf b/Resources/Private/Language/de.locallang_db.xlf index c4765479dc333b614025f4f1f39f051ee38275f2..700f73a1a9d145e89f4122938ba3fafcde7e02d8 100644 --- a/Resources/Private/Language/de.locallang_db.xlf +++ b/Resources/Private/Language/de.locallang_db.xlf @@ -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> diff --git a/Resources/Private/Language/locallang.xlf b/Resources/Private/Language/locallang.xlf index 604c0c0a59fede6c0cf0e4bc466d4d0a4f507110..d94719fd55d8aa1e7d41e9eb1f426465190637a6 100644 --- a/Resources/Private/Language/locallang.xlf +++ b/Resources/Private/Language/locallang.xlf @@ -36,6 +36,9 @@ <trans-unit id="application_mail.marker.lastname"> <source>Last name</source> </trans-unit> + <trans-unit id="application_mail.marker.location"> + <source>The location regarding the unsolicited application</source> + </trans-unit> <trans-unit id="application_mail.marker.message"> <source>Message</source> </trans-unit> diff --git a/Resources/Private/Language/locallang_db.xlf b/Resources/Private/Language/locallang_db.xlf index 019e0a6269e0577cff2a46d74eb6c44acdc16295..12c26c5544ca5fb8e709504b6d484f41a7c744a3 100644 --- a/Resources/Private/Language/locallang_db.xlf +++ b/Resources/Private/Language/locallang_db.xlf @@ -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> diff --git a/Resources/Private/Templates/SgMail/ApplicationMail/template.html b/Resources/Private/Templates/SgMail/ApplicationMail/template.html index cdc389b3964b573f5cbd1445eec436ac55635885..8e0ee9927f156c9a7d1af02856b35f1543681bc9 100644 --- a/Resources/Private/Templates/SgMail/ApplicationMail/template.html +++ b/Resources/Private/Templates/SgMail/ApplicationMail/template.html @@ -1,4 +1,5 @@ -Eine neue {f:if(condition: '{application.jobTitle}', then: 'Bewerbung als <b>{application.jobTitle}</b>.', else: 'Initiativbewerbung.')} + +Eine neue {f:if(condition: '{application.jobTitle}', then: 'Bewerbung als <b>{application.jobTitle}</b> für den Standort <b>{application.company.city}</b>.', else: 'Initiativbewerbung für den Standort <b>{application.company.city}</b>.')} Geschlecht: {f:if(condition: '{application.gender} == \'0\'', then: 'weiblich', else: 'männlich')} diff --git a/composer.json b/composer.json index 8bd52d1449da1b5a2993835e1cf3978a599aedbc..44b24c3399d05b13132926f4488c6344fb9a83b7 100644 --- a/composer.json +++ b/composer.json @@ -6,7 +6,7 @@ "license": [ "GPL-2.0+" ], - "version": "1.5.2", + "version": "1.6.0", "support": { "issues": "https://gitlab.sgalinski.de/typo3/sg_jobs" }, diff --git a/ext_emconf.php b/ext_emconf.php index a64717c09282db593395d2b517550905f1aeefe5..03b483fd46e76075dfc6b4ec9d359e737729b003 100644 --- a/ext_emconf.php +++ b/ext_emconf.php @@ -4,7 +4,7 @@ $EM_CONF[$_EXTKEY] = array ( 'title' => 'Jobs', 'description' => 'Manage and display your Job offers.', 'category' => 'plugin', - 'version' => '1.5.2', + 'version' => '1.6.0', 'state' => 'stable', 'uploadfolder' => FALSE, 'createDirs' => '', diff --git a/ext_tables.sql b/ext_tables.sql index fcd79cc4e0834b3ed3b57fd115e024a7fd2b8c8d..2fdaf6489c711ae6f7065ed536b4562e7ee1d625 100644 --- a/ext_tables.sql +++ b/ext_tables.sql @@ -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,