diff --git a/Classes/Controller/JoblistController.php b/Classes/Controller/JoblistController.php index 71316519182691b2cb37b5640c430cfc7fe9f2d6..29dabb85151b84d02cdbfb7e98f3f4620f621305 100644 --- a/Classes/Controller/JoblistController.php +++ b/Classes/Controller/JoblistController.php @@ -179,6 +179,12 @@ class JoblistController extends ActionController { // get all jobs for the current page $ordering = (int) $frontendPluginSettings['orderBy']; + $experienceLevel = (int) $frontendPluginSettings['filterByExperienceLevel']; + + if ($experienceLevel !== 0) { + $filters['filterExperienceLevel'] = $experienceLevel; + } + $this->jobRepository->setAllowManualSorting((bool) $isManualSortingAllowed); $jobs = $this->jobRepository->findJobsByFilter($filters, $jobLimit, $offset, $ordering)->toArray(); diff --git a/Classes/Domain/Model/Contact.php b/Classes/Domain/Model/Contact.php index 0696ce7c30c82ebe3f99c757ab70a61c5d16d7be..31ee60fd8bed1821ab991d813b28a0f9d43a34e6 100644 --- a/Classes/Domain/Model/Contact.php +++ b/Classes/Domain/Model/Contact.php @@ -26,7 +26,9 @@ namespace SGalinski\SgJobs\Domain\Model; * This copyright notice MUST APPEAR in all copies of the script! ***************************************************************/ +use TYPO3\CMS\Extbase\Domain\Model\FileReference; use TYPO3\CMS\Extbase\DomainObject\AbstractEntity; +use TYPO3\CMS\Extbase\Persistence\Generic\LazyLoadingProxy; /** * The Contact model @@ -77,6 +79,12 @@ class Contact extends AbstractEntity { */ protected $hideInFrontend = FALSE; + /** + * @lazy + * @var \TYPO3\CMS\Extbase\Domain\Model\FileReference + */ + protected $image; + /** * @return string */ @@ -202,4 +210,22 @@ class Contact extends AbstractEntity { public function setStreet($street) { $this->street = $street; } + + /** + * @param FileReference $image + */ + public function setImage(FileReference $image): void { + $this->image = $image; + } + + /** + * @return FileReference + */ + public function getImage(): ?FileReference { + if ($this->image instanceof LazyLoadingProxy) { + $this->image->_loadRealInstance(); + } + + return $this->image; + } } diff --git a/Configuration/FlexForms/Joblist.xml b/Configuration/FlexForms/Joblist.xml index 8183ec1358dfd3c3ebe17d335175981cb08b0035..10fab10111dfe4f1ab1acf6e9cfc188b651ce5e8 100644 --- a/Configuration/FlexForms/Joblist.xml +++ b/Configuration/FlexForms/Joblist.xml @@ -60,6 +60,23 @@ </config> </TCEforms> </settings.orderBy> + <settings.filterByExperienceLevel> + <TCEforms> + <label>LLL:EXT:sg_jobs/Resources/Private/Language/locallang_db.xlf:tx_sgjobs_domain_model_job.experienceLevel</label> + <config> + <type>select</type> + <renderType>selectSingle</renderType> + <items type="array"> + <numIndex index="0"> + <numIndex index="0">LLL:EXT:sg_jobs/Resources/Private/Language/locallang_db.xlf:tx_sgjobs_domain_model_job.experienceLevel_all</numIndex> + <numIndex index="1">0</numIndex> + </numIndex> + </items> + <foreign_table>tx_sgjobs_domain_model_experience_level</foreign_table> + <foreign_table_where>AND tx_sgjobs_domain_model_experience_level.sys_language_uid IN (0,-1) ORDER BY tx_sgjobs_domain_model_experience_level.sorting ASC</foreign_table_where> + </config> + </TCEforms> + </settings.filterByExperienceLevel> </el> </ROOT> </sDEF> diff --git a/Configuration/TCA/tx_sgjobs_domain_model_contact.php b/Configuration/TCA/tx_sgjobs_domain_model_contact.php index f210321389f21185257b2c20cb2f6b59a755f10a..13b28747b78865c3029c574cb12c1004c7a62452 100644 --- a/Configuration/TCA/tx_sgjobs_domain_model_contact.php +++ b/Configuration/TCA/tx_sgjobs_domain_model_contact.php @@ -53,12 +53,12 @@ return call_user_func( 'iconfile' => 'EXT:' . $extKey . '/Resources/Public/Icons/' . $table . '.svg' ], 'interface' => [ - 'showRecordFieldList' => 'sys_language_uid, l10n_parent, l10n_diffsource, hidden, pid, title, first_name, last_name, street, city, zip, email, phone, hide_in_frontend', + 'showRecordFieldList' => 'sys_language_uid, l10n_parent, l10n_diffsource, hidden, pid, title, first_name, last_name, street, city, zip, email, phone, image, hide_in_frontend', ], 'types' => [ '1' => [ 'showitem' => '--palette--;;sysLanguageAndHidden, - hide_in_frontend, title, first_name, last_name, street, city, zip, email, phone;;;richtext[*]:rte_transform[mode=ts], + hide_in_frontend, title, first_name, last_name, image, street, city, zip, email, phone;;;richtext[*]:rte_transform[mode=ts], --div--;LLL:EXT:frontend/Resources/Private/Language/locallang_ttc.xlf:tabs.access, starttime, endtime', ], ], @@ -181,6 +181,19 @@ return call_user_func( 'eval' => 'trim, required' ], ], + 'image' => [ + 'exclude' => TRUE, + 'label' => 'LLL:EXT:' . $extKey . '/Resources/Private/Language/locallang_db.xlf:' . $table . '.image', + 'config' => \TYPO3\CMS\Core\Utility\ExtensionManagementUtility::getFileFieldTCAConfig( + 'image', [ + 'appearance' => [ + 'useSortable' => TRUE, + ], + 'minitems' => 0, + 'maxitems' => 1, + ] + ), + ], 'street' => [ 'exclude' => TRUE, 'label' => 'LLL:EXT:' . $extKey . '/Resources/Private/Language/locallang_db.xlf:' . $table . '.street', diff --git a/Resources/Private/Language/de.locallang.xlf b/Resources/Private/Language/de.locallang.xlf index 06c80cc0ff0782bac27ad57bfe35d31ae64449a8..b56f493bccd62ef55514701f2665a78053d00f8a 100644 --- a/Resources/Private/Language/de.locallang.xlf +++ b/Resources/Private/Language/de.locallang.xlf @@ -101,7 +101,7 @@ <source><![CDATA[Locations]]></source> <target><![CDATA[Arbeitsorte]]></target> </trans-unit> - <trans-unit id="backend.filters.locations.description" approved="yes" xml:space="preserve"> + <trans-unit id="backend.filters.locations.description" approved="yes"> <source><![CDATA[(Use the ctrl or cmd keys to deselect an option or to select multiple options) ]]></source> <target><![CDATA[Benutze die STRG oder CMD-Tasten, um eine Option abzuwählen oder mehrere anzuwählen ]]></target> @@ -174,6 +174,10 @@ <source><![CDATA[Location *]]></source> <target><![CDATA[Standort *]]></target> </trans-unit> + <trans-unit id="frontend.apply.contact" approved="yes"> + <source><![CDATA[Your contact]]></source> + <target><![CDATA[Dein Kontakt]]></target> + </trans-unit> <trans-unit id="frontend.apply.country" approved="yes"> <source><![CDATA[Country *]]></source> <target><![CDATA[Land *]]></target> @@ -258,6 +262,10 @@ <source><![CDATA[privacy policy]]></source> <target><![CDATA[Datenschutzinformationen]]></target> </trans-unit> + <trans-unit id="frontend.apply.recommend" approved="yes"> + <source><![CDATA[Recommend job]]></source> + <target><![CDATA[Stelle weiterempfehlen]]></target> + </trans-unit> <trans-unit id="frontend.apply.salutation" approved="yes"> <source><![CDATA[Salutation]]></source> <target><![CDATA[Anrede]]></target> @@ -302,10 +310,6 @@ <source><![CDATA[Department]]></source> <target><![CDATA[Bereich]]></target> </trans-unit> - <trans-unit id="frontend.experienceLevel" approved="yes"> - <source><![CDATA[Experience Level]]></source> - <target><![CDATA[Erfahrung]]></target> - </trans-unit> <trans-unit id="frontend.description" approved="yes"> <source><![CDATA[Description]]></source> <target><![CDATA[Beschreibung]]></target> @@ -322,10 +326,18 @@ <source><![CDATA[Apply by email]]></source> <target><![CDATA[Bewerbung per Mail]]></target> </trans-unit> + <trans-unit id="frontend.emailContact" approved="yes"> + <source><![CDATA[Email Contact]]></source> + <target><![CDATA[E-Mail-Kontakt]]></target> + </trans-unit> <trans-unit id="frontend.entry_date" approved="yes"> <source><![CDATA[Entry date]]></source> <target><![CDATA[Eintrittsdatum]]></target> </trans-unit> + <trans-unit id="frontend.experienceLevel" approved="yes"> + <source><![CDATA[Experience Level]]></source> + <target><![CDATA[Erfahrung]]></target> + </trans-unit> <trans-unit id="frontend.filter.companies" approved="yes"> <source><![CDATA[Company]]></source> <target><![CDATA[Unternehmen]]></target> @@ -390,10 +402,6 @@ <source><![CDATA[Vacancies worldwide]]></source> <target><![CDATA[Offene Stellen weltweit]]></target> </trans-unit> - <trans-unit id="frontend.emailContact"> - <source><![CDATA[Email Contact]]></source> - <target><![CDATA[E-Mail-Kontakt]]></target> - </trans-unit> </body> </file> </xliff> diff --git a/Resources/Private/Language/de.locallang_db.xlf b/Resources/Private/Language/de.locallang_db.xlf index 54e297249e84abf6e9fa1cab7d4419135af5d850..f49e2f68fcfc2a8c4e1b5c416fbd9be3dad05b94 100644 --- a/Resources/Private/Language/de.locallang_db.xlf +++ b/Resources/Private/Language/de.locallang_db.xlf @@ -77,10 +77,6 @@ <source><![CDATA[City]]></source> <target><![CDATA[Stadt]]></target> </trans-unit> - <trans-unit id="tx_sgjobs_domain_model_company.state" approved="yes"> - <source><![CDATA[State]]></source> - <target><![CDATA[Bundesland]]></target> - </trans-unit> <trans-unit id="tx_sgjobs_domain_model_company.country" approved="yes"> <source><![CDATA[Country]]></source> <target><![CDATA[Land]]></target> @@ -101,6 +97,10 @@ <source><![CDATA[Name]]></source> <target><![CDATA[Name]]></target> </trans-unit> + <trans-unit id="tx_sgjobs_domain_model_company.state" approved="yes"> + <source><![CDATA[State]]></source> + <target><![CDATA[Bundesland]]></target> + </trans-unit> <trans-unit id="tx_sgjobs_domain_model_company.street" approved="yes"> <source><![CDATA[Street]]></source> <target><![CDATA[Straße]]></target> @@ -129,6 +129,10 @@ <source><![CDATA[Hide contact information on the website -> obsolete, will be overwritten by Job settings]]></source> <target><![CDATA[Kontaktinformationen auf Website ausblenden -> obsolet, wird von Job settings überschrieben]]></target> </trans-unit> + <trans-unit id="tx_sgjobs_domain_model_contact.image" approved="yes"> + <source><![CDATA[Image]]></source> + <target><![CDATA[Bild]]></target> + </trans-unit> <trans-unit id="tx_sgjobs_domain_model_contact.last_name" approved="yes"> <source><![CDATA[Last name]]></source> <target><![CDATA[Nachname]]></target> @@ -153,14 +157,14 @@ <source><![CDATA[Department]]></source> <target><![CDATA[Bereich]]></target> </trans-unit> - <trans-unit id="tx_sgjobs_domain_model_experience_level" approved="yes"> - <source><![CDATA[Experience Level]]></source> - <target><![CDATA[Erfahrung]]></target> - </trans-unit> <trans-unit id="tx_sgjobs_domain_model_department.title" approved="yes"> <source><![CDATA[Title]]></source> <target><![CDATA[Titel]]></target> </trans-unit> + <trans-unit id="tx_sgjobs_domain_model_experience_level" approved="yes"> + <source><![CDATA[Experience Level]]></source> + <target><![CDATA[Erfahrung]]></target> + </trans-unit> <trans-unit id="tx_sgjobs_domain_model_experience_level.title" approved="yes"> <source><![CDATA[Title]]></source> <target><![CDATA[Titel]]></target> @@ -213,14 +217,6 @@ <source><![CDATA[--Please choose--]]></source> <target><![CDATA[--Bitte wählen--]]></target> </trans-unit> - <trans-unit id="tx_sgjobs_domain_model_job.experience_level" approved="yes"> - <source><![CDATA[Experience Level]]></source> - <target><![CDATA[Erfahrung]]></target> - </trans-unit> - <trans-unit id="tx_sgjobs_domain_model_job.experience_level.none" approved="yes"> - <source><![CDATA[--Please choose--]]></source> - <target><![CDATA[--Bitte wählen--]]></target> - </trans-unit> <trans-unit id="tx_sgjobs_domain_model_job.description" approved="yes"> <source><![CDATA[Job description]]></source> <target><![CDATA[Beschreibung]]></target> @@ -261,6 +257,22 @@ <source><![CDATA[Volunteer]]></source> <target><![CDATA[Freiwillig]]></target> </trans-unit> + <trans-unit id="tx_sgjobs_domain_model_job.experienceLevel" approved="yes"> + <source><![CDATA[Experience Level Filter]]></source> + <target><![CDATA[Filter nach Berufserfahrung]]></target> + </trans-unit> + <trans-unit id="tx_sgjobs_domain_model_job.experienceLevel_all" approved="yes"> + <source><![CDATA[All]]></source> + <target><![CDATA[Alle]]></target> + </trans-unit> + <trans-unit id="tx_sgjobs_domain_model_job.experience_level" approved="yes"> + <source><![CDATA[Experience Level]]></source> + <target><![CDATA[Erfahrung]]></target> + </trans-unit> + <trans-unit id="tx_sgjobs_domain_model_job.experience_level.none" approved="yes"> + <source><![CDATA[--Please choose--]]></source> + <target><![CDATA[--Bitte wählen--]]></target> + </trans-unit> <trans-unit id="tx_sgjobs_domain_model_job.featuredOffer" approved="yes"> <source><![CDATA[Featured Offer (will always show up in the job offer teaser)]]></source> <target><![CDATA[Diese Stellenausschreibung in jedem Job-Teaser anzeigen]]></target> diff --git a/Resources/Private/Language/locallang.xlf b/Resources/Private/Language/locallang.xlf index 157149f3aada9b5ce392f804f00a8040f0727c59..22309a35a1ee8f4e57d05606422713bc430f8e8f 100644 --- a/Resources/Private/Language/locallang.xlf +++ b/Resources/Private/Language/locallang.xlf @@ -132,6 +132,9 @@ <trans-unit id="frontend.apply.company"> <source><![CDATA[Location *]]></source> </trans-unit> + <trans-unit id="frontend.apply.contact"> + <source><![CDATA[Your contact]]></source> + </trans-unit> <trans-unit id="frontend.apply.country"> <source><![CDATA[Country *]]></source> </trans-unit> @@ -195,6 +198,9 @@ <trans-unit id="frontend.apply.privacyPolicy.link"> <source><![CDATA[privacy policy]]></source> </trans-unit> + <trans-unit id="frontend.apply.recommend"> + <source><![CDATA[Recommend job]]></source> + </trans-unit> <trans-unit id="frontend.apply.salutation"> <source><![CDATA[Salutation]]></source> </trans-unit> @@ -228,9 +234,6 @@ <trans-unit id="frontend.department"> <source><![CDATA[Department]]></source> </trans-unit> - <trans-unit id="frontend.experienceLevel"> - <source><![CDATA[Experience Level]]></source> - </trans-unit> <trans-unit id="frontend.description"> <source><![CDATA[Description]]></source> </trans-unit> @@ -243,9 +246,15 @@ <trans-unit id="frontend.email"> <source><![CDATA[Apply by email]]></source> </trans-unit> + <trans-unit id="frontend.emailContact"> + <source><![CDATA[Email Contact]]></source> + </trans-unit> <trans-unit id="frontend.entry_date"> <source><![CDATA[Entry date]]></source> </trans-unit> + <trans-unit id="frontend.experienceLevel"> + <source><![CDATA[Experience Level]]></source> + </trans-unit> <trans-unit id="frontend.filter.companies"> <source><![CDATA[Company]]></source> </trans-unit> @@ -294,9 +303,6 @@ <trans-unit id="frontend.teaserHeadline"> <source><![CDATA[Vacancies worldwide]]></source> </trans-unit> - <trans-unit id="frontend.emailContact"> - <source><![CDATA[Email Contact]]></source> - </trans-unit> </body> </file> </xliff> diff --git a/Resources/Private/Language/locallang_db.xlf b/Resources/Private/Language/locallang_db.xlf index 88c08a4a9ee70727abd90d0dde0fbe3dc405c588..2af164ab1b05e0e6e04fab40413bb380e73f3185 100644 --- a/Resources/Private/Language/locallang_db.xlf +++ b/Resources/Private/Language/locallang_db.xlf @@ -60,9 +60,6 @@ <trans-unit id="tx_sgjobs_domain_model_company.city"> <source><![CDATA[City]]></source> </trans-unit> - <trans-unit id="tx_sgjobs_domain_model_company.state"> - <source><![CDATA[State]]></source> - </trans-unit> <trans-unit id="tx_sgjobs_domain_model_company.country"> <source><![CDATA[Country]]></source> </trans-unit> @@ -78,6 +75,9 @@ <trans-unit id="tx_sgjobs_domain_model_company.name"> <source><![CDATA[Name]]></source> </trans-unit> + <trans-unit id="tx_sgjobs_domain_model_company.state"> + <source><![CDATA[State]]></source> + </trans-unit> <trans-unit id="tx_sgjobs_domain_model_company.street"> <source><![CDATA[Street]]></source> </trans-unit> @@ -102,6 +102,9 @@ <trans-unit id="tx_sgjobs_domain_model_contact.hide_in_frontend"> <source><![CDATA[Hide contact information on the website -> obsolete, will be overwritten by Job settings]]></source> </trans-unit> + <trans-unit id="tx_sgjobs_domain_model_contact.image"> + <source><![CDATA[Image]]></source> + </trans-unit> <trans-unit id="tx_sgjobs_domain_model_contact.last_name"> <source><![CDATA[Last name]]></source> </trans-unit> @@ -165,12 +168,6 @@ <trans-unit id="tx_sgjobs_domain_model_job.department.none"> <source><![CDATA[--Please choose--]]></source> </trans-unit> - <trans-unit id="tx_sgjobs_domain_model_job.experience_level"> - <source><![CDATA[Experience Level]]></source> - </trans-unit> - <trans-unit id="tx_sgjobs_domain_model_job.experience_level.none"> - <source><![CDATA[--Please choose--]]></source> - </trans-unit> <trans-unit id="tx_sgjobs_domain_model_job.description"> <source><![CDATA[Job description]]></source> </trans-unit> @@ -201,6 +198,18 @@ <trans-unit id="tx_sgjobs_domain_model_job.employment_types.volunteer"> <source><![CDATA[Volunteer]]></source> </trans-unit> + <trans-unit id="tx_sgjobs_domain_model_job.experienceLevel"> + <source><![CDATA[Experience Level Filter]]></source> + </trans-unit> + <trans-unit id="tx_sgjobs_domain_model_job.experienceLevel_all"> + <source><![CDATA[All]]></source> + </trans-unit> + <trans-unit id="tx_sgjobs_domain_model_job.experience_level"> + <source><![CDATA[Experience Level]]></source> + </trans-unit> + <trans-unit id="tx_sgjobs_domain_model_job.experience_level.none"> + <source><![CDATA[--Please choose--]]></source> + </trans-unit> <trans-unit id="tx_sgjobs_domain_model_job.featuredOffer"> <source><![CDATA[Featured Offer (will always show up in the job offer teaser)]]></source> </trans-unit> diff --git a/Resources/Private/Templates/Joblist/ApplyForm.html b/Resources/Private/Templates/Joblist/ApplyForm.html index f17c633e9d9a3739c0cab38c3a5acd68adbc61d3..bab90cecf0ad4b06700dac39d7e8a3f0003f45be 100644 --- a/Resources/Private/Templates/Joblist/ApplyForm.html +++ b/Resources/Private/Templates/Joblist/ApplyForm.html @@ -1,4 +1,5 @@ {namespace h=SGalinski\SgJobs\ViewHelpers} +{namespace base=SGalinski\ProjectBase\ViewHelpers} <f:layout name="Default" /> <f:section name="main"> @@ -75,9 +76,29 @@ </a> </div> </div> - </div> - <f:if condition="{job.attachment}"> - <div class="col-md-4 col-sm-6 col-xs-12"> + <f:if condition="{job.contact}"> + <div class="highlight-box bg-card sgjobs-meta-box"> + <div class="default-content-element sg-jobs-contact-box"> + <div class="sg-jobs-contact-box__text"> + <p class="h4"><f:translate key="frontend.apply.contact" /></p> + {job.contact.firstName} {job.contact.lastName} + {job.contact.phone} + {job.contact.email} + </div> + <f:if condition="{job.contact.image}"> + <div class="sg-jobs-contact-box__image"> + <f:image image="{job.contact.image}" /> + </div> + </f:if> + </div> + <hr> + <div class="default-content-element sgjobs-social-sharer"> + <p class="h4"><f:translate key="frontend.apply.recommend" /></p> + <base:sharer /> + </div> + </div> + </f:if> + <f:if condition="{job.attachment}"> <div class="highlight-box bg-card sgjobs-meta-box"> <div class="default-content-element downloads"> <f:link.typolink target="_blank" parameter="{job.attachment.0.originalResource.publicUrl}" class="download-link"> @@ -90,8 +111,8 @@ </f:link.typolink> </div> </div> - </div> - </f:if> + </f:if> + </div> </div> </div> </div> diff --git a/ext_tables.sql b/ext_tables.sql index 89be1ae9a564fa22dd89f55d958175ff3ce84ae4..8f2b716e3a2b9b90713635eeefccd9e15302d119 100644 --- a/ext_tables.sql +++ b/ext_tables.sql @@ -205,6 +205,7 @@ CREATE TABLE tx_sgjobs_domain_model_contact ( zip varchar(255) DEFAULT '' NOT NULL, email varchar(255) DEFAULT '' NOT NULL, phone varchar(255) DEFAULT '' NOT NULL, + image int(11) unsigned DEFAULT '0', hide_in_frontend tinyint(4) unsigned DEFAULT '0' NOT NULL, -- TYPO3 fields