diff --git a/Classes/Controller/JoblistController.php b/Classes/Controller/JoblistController.php index beb2c546ae01287c5f7c0284e664127e8de63719..623d3bfedde2ac84984fef284fdf7a83060bcad7 100644 --- a/Classes/Controller/JoblistController.php +++ b/Classes/Controller/JoblistController.php @@ -68,6 +68,12 @@ class JoblistController extends ActionController { */ private $jobApplicationRepository; + /** + * @var \SGalinski\SgJobs\Domain\Repository\DepartmentRepository + * @inject + */ + private $departmentRepository; + /** * Show all job offers and options to manage them * @@ -81,7 +87,7 @@ class JoblistController extends ActionController { $this->view->assign('selectedCountry', $filters['filterCountry']); $this->view->assign('selectedCompany', $filters['filterCompany']); $this->view->assign('selectedLocation', $filters['filterLocation']); - $this->view->assign('selectedArea', $filters['filterArea']); + $this->view->assign('selectedDepartment', $filters['filterDepartment']); $this->view->assign('selectedFunction', $filters['filterFunction']); } @@ -384,8 +390,8 @@ class JoblistController extends ActionController { $companies = $this->companyRepository->getAllCompanyNames($rootPageId); $this->view->assign('companies', $companies); - $areas = $this->jobRepository->getAllAreas($rootPageId); - $this->view->assign('areas', $areas); + $departments = $this->departmentRepository->findAll(); + $this->view->assign('departments', $departments); } /** diff --git a/Classes/Domain/Model/Department.php b/Classes/Domain/Model/Department.php new file mode 100644 index 0000000000000000000000000000000000000000..28dec87140a39fce71de38dd57101e0644116172 --- /dev/null +++ b/Classes/Domain/Model/Department.php @@ -0,0 +1,59 @@ +<?php + +namespace SGalinski\SgJobs\Domain\Model; + +/** + * Copyright notice + * + * (c) sgalinski Internet Services (https://www.sgalinski.de) + * + * All rights reserved + * + * This script is part of the TYPO3 project. The TYPO3 project is + * free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 3 of the License, or + * (at your option) any later version. + * + * The GNU General Public License can be found at + * http://www.gnu.org/copyleft/gpl.html. + * + * This script is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * This copyright notice MUST APPEAR in all copies of the script! + */ + +use TYPO3\CMS\Extbase\DomainObject\AbstractEntity; + +/** + * Class Department + * + * @package SGalinski\SgJobs\Domain\Model + * @author Kevin Ditscheid <kevin.ditscheid@sgalinski.de> + */ +class Department extends AbstractEntity { + /** + * The title of the department + * + * @var string + */ + protected $title; + + /** + * @return string + */ + public function getTitle(): string { + return $this->title; + } + + /** + * @param string $title + */ + public function setTitle(string $title) { + $this->title = $title; + } + +} diff --git a/Classes/Domain/Model/Job.php b/Classes/Domain/Model/Job.php index b2eb525d82ec99a07a49f21494c944b98f307b06..27d28208479312dd39753ad6bac15b420448e81f 100644 --- a/Classes/Domain/Model/Job.php +++ b/Classes/Domain/Model/Job.php @@ -53,9 +53,9 @@ class Job extends AbstractEntity { protected $qualification = ''; /** - * @var string $area + * @var \SGalinski\SgJobs\Domain\Model\Department */ - protected $area = ''; + protected $department; /** * @var bool @@ -210,17 +210,17 @@ class Job extends AbstractEntity { } /** - * @return string + * @return Department */ - public function getArea(): string { - return $this->area; + public function getDepartment(): Department { + return $this->department; } /** - * @param string $area + * @param Department $department */ - public function setArea(string $area) { - $this->area = $area; + public function setDepartment(Department $department) { + $this->department = $department; } /** diff --git a/Classes/Domain/Repository/DepartmentRepository.php b/Classes/Domain/Repository/DepartmentRepository.php new file mode 100644 index 0000000000000000000000000000000000000000..40591c7b48969f8d91ede409c9056979260c6aa0 --- /dev/null +++ b/Classes/Domain/Repository/DepartmentRepository.php @@ -0,0 +1,39 @@ +<?php + +namespace SGalinski\SgJobs\Domain\Repository; + +/** + * Copyright notice + * + * (c) sgalinski Internet Services (https://www.sgalinski.de) + * + * All rights reserved + * + * This script is part of the TYPO3 project. The TYPO3 project is + * free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 3 of the License, or + * (at your option) any later version. + * + * The GNU General Public License can be found at + * http://www.gnu.org/copyleft/gpl.html. + * + * This script is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * This copyright notice MUST APPEAR in all copies of the script! + */ + +use TYPO3\CMS\Extbase\Persistence\Repository; + +/** + * Class DepartmentRepository + * + * @package SGalinski\SgJobs\Domain\Repository + * @author Kevin Ditscheid <kevin.ditscheid@sgalinski.de> + */ +class DepartmentRepository extends Repository { + +} diff --git a/Classes/Domain/Repository/JobRepository.php b/Classes/Domain/Repository/JobRepository.php index afe4de0f31c1ae490d1e27b7459cc6c233351c3e..60efb5afee4b655e64f89dc4662471176944eb6f 100644 --- a/Classes/Domain/Repository/JobRepository.php +++ b/Classes/Domain/Repository/JobRepository.php @@ -127,37 +127,6 @@ class JobRepository extends Repository { return $this->findByJobIds($recordPageId, $result, $limit, $offset); } - /** - * Returns all areas filtered by page id - * - * @param int $pageUid - * @return mixed - * @throws \InvalidArgumentException - */ - public function getAllAreas($pageUid) { - /** @var QueryInterface $query */ - $query = $this->createQuery(); - $query->setOrderings( - [ - 'sorting' => QueryInterface::ORDER_ASCENDING, - ] - ); - - $companyConstraints[] = $query->equals('pid', $pageUid); - $query->matching($query->logicalAnd($companyConstraints)); - - $result = $query->execute()->toArray(); - - $areaArray = ['']; - /** @var Job $job */ - foreach ($result as $job) { - $areaName = $job->getArea(); - $areaArray[$areaName] = $areaName; - } - - return $areaArray; - } - /** * Returns a job filtered by company and page id * @@ -293,8 +262,8 @@ class JobRepository extends Repository { $constraints[] = $query->equals('company.name', $filters['filterLocation']); } - if ($filters['filterArea'] !== '0' && $filters['filterArea'] !== NULL) { - $constraints[] = $query->equals('area', $filters['filterArea']); + if ($filters['filterDepartment'] !== '0' && $filters['filterDepartment'] !== NULL) { + $constraints[] = $query->equals('department', $filters['filterDepartment']); } if (\count($constraints)) { diff --git a/Classes/Updates/DepartmentUpdateWizard.php b/Classes/Updates/DepartmentUpdateWizard.php new file mode 100644 index 0000000000000000000000000000000000000000..ae25b7db8ced741d386bc00f1bfd6d40916027df --- /dev/null +++ b/Classes/Updates/DepartmentUpdateWizard.php @@ -0,0 +1,202 @@ +<?php +/** + * Copyright notice + * + * (c) sgalinski Internet Services (https://www.sgalinski.de) + * + * All rights reserved + * + * This script is part of the TYPO3 project. The TYPO3 project is + * free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 3 of the License, or + * (at your option) any later version. + * + * The GNU General Public License can be found at + * http://www.gnu.org/copyleft/gpl.html. + * + * This script is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * This copyright notice MUST APPEAR in all copies of the script! + */ + +namespace SGalinski\SgJobs\Updates; + +use TYPO3\CMS\Core\Database\Connection; +use TYPO3\CMS\Core\Database\ConnectionPool; +use TYPO3\CMS\Core\Utility\GeneralUtility; +use TYPO3\CMS\Install\Updates\AbstractUpdate; + +/** + * Class DepartmentUpdateWizard + * + * @package SGalinski\SgJobs\Updates + * @author Kevin Ditscheid <kevin.ditscheid@sgalinski.de> + */ +class DepartmentUpdateWizard extends AbstractUpdate { + + /** + * @var string + */ + protected $title = 'Migrate old fulltext job areas to department records'; + + /** + * Checks whether updates are required. + * + * @param string &$description The description for the update + * @return bool Whether an update is required (TRUE) or not (FALSE) + */ + public function checkForUpdate(&$description): bool { + if ($this->isWizardDone()) { + return FALSE; + } + + if (!$this->checkIfTableExists('tx_sgjobs_domain_model_department')) { + return FALSE; + } + + if ( + $this->hasAreaField() || + $this->hasDeletedAreaField() + ) { + $description = 'Job areas can be migrated to the new department records'; + return TRUE; + } + + return FALSE; + } + + /** + * Performs the accordant updates. + * + * @param array &$dbQueries Queries done in this update + * @param string &$customMessage Custom message + * @return bool Whether everything went smoothly or not + */ + public function performUpdate(array &$dbQueries, &$customMessage): bool { + $customMessage = ''; + $connection = $this->getDatabaseConnection(); + $queryBuilder = $connection->createQueryBuilder(); + $field = $this->hasDeletedAreaField() ? 'zzz_deleted_area' : 'area'; + $queryBuilder->getRestrictions()->removeAll(); + $jobs = $queryBuilder->select('uid', 'pid', 'sys_language_uid', $field) + ->from('tx_sgjobs_domain_model_job') + ->execute() + ->fetchAll(); + + $dbQueries[] = $queryBuilder->getSQL(); + + $newDepartments = []; + if (\count($jobs) > 0) { + foreach ($jobs as $index => $job) { + if ($job[$field]) { + $identifier = $job[$field] . '-' . $job['pid'] . '-' . $job['sys_language_uid']; + $newDepartments[$identifier] = [ + 'title' => $job[$field], + 'pid' => $job['pid'], + 'sys_language_uid' => $job['sys_language_uid'] + ]; + } else { + $customMessage .= 'The Job with id ' . $job['uid'] . ' does not have an area set.' + . 'Please set a department manually later, because it is a required field now!' . \PHP_EOL; + unset($jobs[$index]); + } + } + + if (\count($jobs) > 0) { + \array_walk($newDepartments, function ($department) use (&$dbQueries, $connection) { + $queryBuilder = $connection->createQueryBuilder(); + $queryBuilder->insert('tx_sgjobs_domain_model_department')->values($department)->execute(); + $dbQueries[] = $queryBuilder->getSQL(); + }); + + $queryBuilder->resetQueryParts(); + $departments = $queryBuilder->select('uid', 'pid', 'sys_language_uid', 'title') + ->from('tx_sgjobs_domain_model_department') + ->execute() + ->fetchAll(); + + $identifiedDepartments = []; + foreach ($departments as $department) { + $identifier = $department['title'] . '-' . $department['pid'] . '-' . $department['sys_language_uid']; + $identifiedDepartments[$identifier] = $department; + } + + $dbQueries[] = $queryBuilder->getSQL(); + + foreach ($jobs as $index => $job) { + $identifier = $job[$field] . '-' . $job['pid'] . '-' . $job['sys_language_uid']; + if (isset($identifiedDepartments[$identifier])) { + $jobs[$index]['department'] = $identifiedDepartments[$identifier]['uid']; + unset($jobs[$index][$field]); + } else { + unset($jobs[$index]); + } + } + + if (\count($jobs) > 0) { + \array_walk($jobs, function ($job) use (&$dbQueries, $connection) { + $queryBuilder = $connection->createQueryBuilder(); + $queryBuilder->update('tx_sgjobs_domain_model_job') + ->set('department', (int) $job['department']) + ->where( + $queryBuilder->expr()->eq( + 'uid', + $queryBuilder->createNamedParameter($job['uid'], \PDO::PARAM_INT) + ) + )->execute(); + $dbQueries[] = $queryBuilder->getSQL(); + }); + } + } + } + $this->markWizardAsDone(); + return TRUE; + } + + /** + * Check if the job table has a deleted area field + * + * @return bool + */ + protected function hasDeletedAreaField() { + return $this->hasField('zzz_deleted_area'); + } + + /** + * Check if the job table has an area field + * + * @return bool + */ + protected function hasAreaField() { + return $this->hasField('area'); + } + + /** + * Check if the job database table has a field with the given name in it + * + * @param $fieldName + * @return bool + */ + protected function hasField($fieldName) { + $connection = $this->getDatabaseConnection(); + $tableColumns = $connection->getSchemaManager()->listTableColumns('tx_sgjobs_domain_model_job'); + if (\array_key_exists($fieldName, $tableColumns)) { + return TRUE; + } + return FALSE; + } + + /** + * Get the database query builder + * + * @return Connection + */ + protected function getDatabaseConnection(): Connection { + $connectionPool = GeneralUtility::makeInstance(ConnectionPool::class); + return $connectionPool->getConnectionForTable('tx_sgjobs_domain_model_job'); + } +} diff --git a/Configuration/TCA/tx_sgjobs_domain_model_department.php b/Configuration/TCA/tx_sgjobs_domain_model_department.php new file mode 100644 index 0000000000000000000000000000000000000000..f04328b219c2e9f63ef2e32cb3a9d6fa46d4c334 --- /dev/null +++ b/Configuration/TCA/tx_sgjobs_domain_model_department.php @@ -0,0 +1,164 @@ +<?php +/** + * Copyright notice + * + * (c) sgalinski Internet Services (https://www.sgalinski.de) + * + * All rights reserved + * + * This script is part of the TYPO3 project. The TYPO3 project is + * free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 3 of the License, or + * (at your option) any later version. + * + * The GNU General Public License can be found at + * http://www.gnu.org/copyleft/gpl.html. + * + * This script is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * This copyright notice MUST APPEAR in all copies of the script! + */ + +return [ + 'ctrl' => [ + 'title' => 'LLL:EXT:sg_jobs/Resources/Private/Language/locallang_db.xlf:tx_sgjobs_domain_model_department', + 'label' => 'title', + 'label_alt_force' => 1, + 'tstamp' => 'tstamp', + 'crdate' => 'crdate', + 'cruser_id' => 'cruser_id', + 'dividers2tabs' => TRUE, + 'searchFields' => 'title', + 'versioningWS' => 2, + 'versioning_followPages' => TRUE, + 'origUid' => 't3_origuid', + 'languageField' => 'sys_language_uid', + 'transOrigPointerField' => 'l10n_parent', + 'transOrigDiffSourceField' => 'l10n_diffsource', + 'delete' => 'deleted', + 'enablecolumns' => [ + 'disabled' => 'hidden', + 'starttime' => 'starttime', + 'endtime' => 'endtime', + ], + 'sortby' => 'sorting', + 'iconfile' => \TYPO3\CMS\Core\Utility\ExtensionManagementUtility::extRelPath('sg_jobs') . + 'Resources/Public/Icons/tx_sgjobs_domain_model_department.svg' + ], + 'interface' => [ + 'showRecordFieldList' => 'sys_language_uid, l10n_parent, l10n_diffsource, hidden, pid, title', + ], + 'types' => [ + '1' => [ + 'showitem' => '--palette--;;sysLanguageAndHidden, + title, + --div--;LLL:EXT:frontend/Resources/Private/Language/locallang_ttc.xlf:tabs.access, starttime, endtime', + ], + ], + 'palettes' => [ + 'sysLanguageAndHidden' => [ + 'showitem' => 'sys_language_uid;;;;1-1-1, l10n_diffsource, hidden;;1, ', + 'canNotCollapse' => 1, + ] + ], + 'columns' => [ + 'sys_language_uid' => [ + 'exclude' => 1, + 'label' => 'LLL:EXT:lang/Resources/Private/Language/locallang_general.xml:LGL.language', + 'config' => [ + 'type' => 'select', + 'foreign_table' => 'sys_language', + 'foreign_table_where' => 'ORDER BY sys_language.title', + 'items' => [ + ['LLL:EXT:lang/Resources/Private/Language/locallang_general.xml:LGL.allLanguages', -1], + ['LLL:EXT:lang/Resources/Private/Language/locallang_general.xml:LGL.default_value', 0] + ], + ], + ], + 'l10n_parent' => [ + 'displayCond' => 'FIELD:sys_language_uid:>:0', + 'exclude' => 1, + 'label' => 'LLL:EXT:lang/Resources/Private/Language/locallang_general.xml:LGL.l18n_parent', + 'config' => [ + 'type' => 'select', + 'items' => [ + ['', 0], + ], + 'foreign_table' => 'tx_sgjobs_domain_model_department', + 'foreign_table_where' => 'AND tx_sgjobs_domain_model_department.pid=###CURRENT_PID### AND tx_sgjobs_domain_model_department.sys_language_uid IN (-1,0)', + ], + ], + 'l10n_diffsource' => [ + 'config' => [ + 'type' => 'passthrough', + ], + ], + 't3ver_label' => [ + 'label' => 'LLL:EXT:lang/Resources/Private/Language/locallang_general.xml:LGL.versionLabel', + 'config' => [ + 'type' => 'input', + 'size' => 30, + 'max' => 255, + ] + ], + 'pid' => [ + 'exclude' => 0, + 'label' => 'PID', + 'config' => [ + 'type' => 'none', + ] + ], + 'hidden' => [ + 'exclude' => 1, + 'label' => 'LLL:EXT:lang/Resources/Private/Language/locallang_general.xml:LGL.hidden', + 'config' => [ + 'type' => 'check', + ], + ], + 'starttime' => [ + 'exclude' => 1, + 'l10n_mode' => 'mergeIfNotBlank', + 'label' => 'LLL:EXT:lang/Resources/Private/Language/locallang_general.xml:LGL.starttime', + 'config' => [ + 'type' => 'input', + 'size' => 13, + 'max' => 20, + 'eval' => 'datetime', + 'checkbox' => 0, + 'default' => 0, + 'range' => [ + 'lower' => mktime(0, 0, 0, date('m'), date('d'), date('Y')) + ], + ], + ], + 'endtime' => [ + 'exclude' => 1, + 'l10n_mode' => 'mergeIfNotBlank', + 'label' => 'LLL:EXT:lang/Resources/Private/Language/locallang_general.xml:LGL.endtime', + 'config' => [ + 'type' => 'input', + 'size' => 13, + 'max' => 20, + 'eval' => 'datetime', + 'checkbox' => 0, + 'default' => 0, + 'range' => [ + 'lower' => mktime(0, 0, 0, date('m'), date('d'), date('Y')) + ], + ], + ], + 'title' => [ + 'exclude' => 0, + 'label' => 'LLL:EXT:sg_jobs/Resources/Private/Language/locallang_db.xlf:tx_sgjobs_domain_model_department.title', + 'config' => [ + 'type' => 'input', + 'size' => 30, + 'eval' => 'trim,required' + ], + ] + ], +]; diff --git a/Configuration/TCA/tx_sgjobs_domain_model_job.php b/Configuration/TCA/tx_sgjobs_domain_model_job.php index 0b8dc7c0a4f12c2b694001f5ea8cba4f93adc2e7..82cd7ba74956ade041371369e071a832981f2212 100644 --- a/Configuration/TCA/tx_sgjobs_domain_model_job.php +++ b/Configuration/TCA/tx_sgjobs_domain_model_job.php @@ -8,7 +8,7 @@ return [ 'crdate' => 'crdate', 'cruser_id' => 'cruser_id', 'dividers2tabs' => TRUE, - 'searchFields' => 'title, job_id, start_date, alternative_start_date, company, contact, area', + 'searchFields' => 'title, job_id, start_date, alternative_start_date, company, contact, department', 'versioningWS' => 2, 'versioning_followPages' => TRUE, 'origUid' => 't3_origuid', @@ -26,12 +26,12 @@ return [ 'Resources/Public/Icons/tx_sgjobs_domain_model_job.svg' ], 'interface' => [ - 'showRecordFieldList' => 'sys_language_uid, l10n_parent, l10n_diffsource, hidden, pid, title, job_id, area, hide_apply_by_email, hide_apply_by_postal, featured_offer, start_date, alternative_start_date, + 'showRecordFieldList' => 'sys_language_uid, l10n_parent, l10n_diffsource, hidden, pid, title, job_id, department, hide_apply_by_email, hide_apply_by_postal, featured_offer, start_date, alternative_start_date, company, task, qualification, description, contact', ], 'types' => [ '1' => [ - 'showitem' => '--palette--;;sysLanguageAndHidden,title, job_id, --palette--;;palette_title_start,,--palette--;;palette_apply_function,,--palette--;;palette_area_function, + 'showitem' => '--palette--;;sysLanguageAndHidden,title, job_id, --palette--;;palette_title_start,,--palette--;;palette_apply_function,,--palette--;;palette_department_function, --palette--;;palette_location_contact, description, --div--; LLL:EXT:sg_jobs/Resources/Private/Language/locallang_db.xlf:tca.qualification_tab, task, qualification, div;;richtext[*]:rte_transform[mode=ts], --div--;LLL:EXT:frontend/Resources/Private/Language/locallang_ttc.xlf:tabs.access, starttime, endtime', ], @@ -43,7 +43,7 @@ return [ ], 'palette_title_start' => ['showitem' => 'start_date, alternative_start_date', 'canNotCollapse' => 1], 'palette_apply_function' => ['showitem' => 'hide_apply_by_email, hide_apply_by_postal', 'canNotCollapse' => 1], - 'palette_area_function' => ['showitem' => 'area, featured_offer', 'canNotCollapse' => 1], + 'palette_department_function' => ['showitem' => 'department, featured_offer', 'canNotCollapse' => 1], 'palette_location_contact' => ['showitem' => 'company, contact', 'canNotCollapse' => 1] ], 'columns' => [ @@ -145,13 +145,20 @@ return [ 'eval' => 'trim' ], ], - 'area' => [ + 'department' => [ 'exclude' => 0, - 'label' => 'LLL:EXT:sg_jobs/Resources/Private/Language/locallang_db.xlf:tx_sgjobs_domain_model_job.area', + 'label' => 'LLL:EXT:sg_jobs/Resources/Private/Language/locallang_db.xlf:tx_sgjobs_domain_model_job.department', 'config' => [ - 'type' => 'input', - 'size' => 30, - 'eval' => 'trim' + 'type' => 'select', + 'renderType' => 'selectSingle', + 'foreign_table' => 'tx_sgjobs_domain_model_department', + 'minitems' => 1, + 'items' => [ + [ + 'LLL:EXT:sg_jobs/Resources/Private/Language/locallang_db.xlf:tx_sgjobs_domain_model_job.department.none', + 0 + ] + ] ], ], 'featured_offer' => [ diff --git a/Configuration/TCA/tx_sgjobs_domain_model_job_application.php b/Configuration/TCA/tx_sgjobs_domain_model_job_application.php index 8a3b2f9bb9143090809441defd9cec3db1846462..2ea4696084c4c52b6135ea72fe87e8fc4c6af0e5 100644 --- a/Configuration/TCA/tx_sgjobs_domain_model_job_application.php +++ b/Configuration/TCA/tx_sgjobs_domain_model_job_application.php @@ -30,7 +30,7 @@ $tx_sgjobs_domain_model_job_application = [ 'Resources/Public/Icons/tx_sgjobs_domain_model_job.svg' ], 'interface' => [ - 'showRecordFieldList' => 'sys_language_uid, l10n_parent, l10n_diffsource, hidden, pid, job, job_id, job_title, company, area, start_date, alternative_start_date, + 'showRecordFieldList' => 'sys_language_uid, l10n_parent, l10n_diffsource, hidden, pid, job, job_id, job_title, company, department, start_date, alternative_start_date, company, task, qualification, description, contact, privacy_policy', ], 'types' => [ diff --git a/Resources/Private/Language/de.locallang.xlf b/Resources/Private/Language/de.locallang.xlf index 4708da0c25e99c5439336d4988a1406d01625126..8a23ecf81bafdb4c55ba82618e61dd92304549d4 100644 --- a/Resources/Private/Language/de.locallang.xlf +++ b/Resources/Private/Language/de.locallang.xlf @@ -290,8 +290,8 @@ <source><![CDATA[Apply by mail]]></source> <target><![CDATA[Bewerbung per Post]]></target> </trans-unit> - <trans-unit id="frontend.area" approved="yes"> - <source><![CDATA[Area]]></source> + <trans-unit id="frontend.department" approved="yes"> + <source><![CDATA[Department]]></source> <target><![CDATA[Bereich]]></target> </trans-unit> <trans-unit id="frontend.description" approved="yes"> @@ -314,8 +314,8 @@ <source><![CDATA[Entry date]]></source> <target><![CDATA[Eintrittsdatum]]></target> </trans-unit> - <trans-unit id="frontend.filter.areas" approved="yes"> - <source><![CDATA[Area]]></source> + <trans-unit id="frontend.filter.departments" approved="yes"> + <source><![CDATA[Department]]></source> <target><![CDATA[Bereich]]></target> </trans-unit> <trans-unit id="frontend.filter.companies" approved="yes"> @@ -372,4 +372,4 @@ </trans-unit> </body> </file> -</xliff> \ No newline at end of file +</xliff> diff --git a/Resources/Private/Language/de.locallang_db.xlf b/Resources/Private/Language/de.locallang_db.xlf index 85c245bb8afbf2fbb194a776626a9311bc0970d7..7e929be32bde9ae396dba9777c0c7decf819e31f 100644 --- a/Resources/Private/Language/de.locallang_db.xlf +++ b/Resources/Private/Language/de.locallang_db.xlf @@ -153,10 +153,14 @@ <source><![CDATA[Display apply by postal service section]]></source> <target><![CDATA[Bewerbung per Post einblenden]]></target> </trans-unit> - <trans-unit id="tx_sgjobs_domain_model_job.area" approved="yes"> + <trans-unit id="tx_sgjobs_domain_model_job.department" approved="yes"> <source><![CDATA[Department]]></source> <target><![CDATA[Bereich]]></target> </trans-unit> + <trans-unit id="tx_sgjobs_domain_model_job.department.none"> + <source><![CDATA[--Please choose--]]></source> + <target><![CDATA[--Bitte wählen--]]></target> + </trans-unit> <trans-unit id="tx_sgjobs_domain_model_job.company" approved="yes"> <source><![CDATA[Company]]></source> <target><![CDATA[Unternehmen]]></target> @@ -349,6 +353,14 @@ <source><![CDATA[Location]]></source> <target><![CDATA[Arbeitsort]]></target> </trans-unit> + <trans-unit id="tx_sgjobs_domain_model_department"> + <source><![CDATA[Department]]></source> + <target><![CDATA[Bereich]]></target> + </trans-unit> + <trans-unit id="tx_sgjobs_domain_model_department.title"> + <source><![CDATA[Title]]></source> + <target><![CDATA[Titel]]></target> + </trans-unit> </body> </file> -</xliff> \ No newline at end of file +</xliff> diff --git a/Resources/Private/Language/locallang.xlf b/Resources/Private/Language/locallang.xlf index 691cbb8a93d4a36fda1eb677488da7606c13fcfd..a3e270c24f365631cb0227f4965b4bd7e0b87ac9 100644 --- a/Resources/Private/Language/locallang.xlf +++ b/Resources/Private/Language/locallang.xlf @@ -219,8 +219,8 @@ <trans-unit id="frontend.apply_by_mail"> <source><![CDATA[Apply by mail]]></source> </trans-unit> - <trans-unit id="frontend.area"> - <source><![CDATA[Area]]></source> + <trans-unit id="frontend.department"> + <source><![CDATA[Department]]></source> </trans-unit> <trans-unit id="frontend.description"> <source><![CDATA[Description]]></source> @@ -237,8 +237,8 @@ <trans-unit id="frontend.entry_date"> <source><![CDATA[Entry date]]></source> </trans-unit> - <trans-unit id="frontend.filter.areas"> - <source><![CDATA[Area]]></source> + <trans-unit id="frontend.filter.departments"> + <source><![CDATA[Departments]]></source> </trans-unit> <trans-unit id="frontend.filter.companies"> <source><![CDATA[Company]]></source> @@ -281,4 +281,4 @@ </trans-unit> </body> </file> -</xliff> \ No newline at end of file +</xliff> diff --git a/Resources/Private/Language/locallang_db.xlf b/Resources/Private/Language/locallang_db.xlf index 49e9f0da5c62d4cc33cd7595f1c17f4b53bd7103..685739c2506b113c2fae79308b6afff1ec862e0c 100644 --- a/Resources/Private/Language/locallang_db.xlf +++ b/Resources/Private/Language/locallang_db.xlf @@ -120,9 +120,12 @@ <trans-unit id="tx_sgjobs_domain_model_job.applyByPostal"> <source><![CDATA[Display apply by postal service section]]></source> </trans-unit> - <trans-unit id="tx_sgjobs_domain_model_job.area"> + <trans-unit id="tx_sgjobs_domain_model_job.department"> <source><![CDATA[Department]]></source> </trans-unit> + <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.company"> <source><![CDATA[Company]]></source> </trans-unit> @@ -267,6 +270,12 @@ <trans-unit id="tx_sgjobs_domain_model_location.location"> <source><![CDATA[Location]]></source> </trans-unit> + <trans-unit id="tx_sgjobs_domain_model_department"> + <source><![CDATA[Department]]></source> + </trans-unit> + <trans-unit id="tx_sgjobs_domain_model_department.title"> + <source><![CDATA[Title]]></source> + </trans-unit> </body> </file> -</xliff> \ No newline at end of file +</xliff> diff --git a/Resources/Private/Language/zh.locallang.xlf b/Resources/Private/Language/zh.locallang.xlf index 4e18b1bbd5a39cf3b20c6544a1ea46725c42c5da..d8aaccc9cb9a78c916cac1c042d094b182bef519 100644 --- a/Resources/Private/Language/zh.locallang.xlf +++ b/Resources/Private/Language/zh.locallang.xlf @@ -193,8 +193,8 @@ <source><![CDATA[Entry date]]></source> <target><![CDATA[入境时间]]></target> </trans-unit> - <trans-unit id="frontend.filter.areas" approved="yes"> - <source><![CDATA[Area]]></source> + <trans-unit id="frontend.filter.departments" approved="yes"> + <source><![CDATA[Department]]></source> <target><![CDATA[行业]]></target> </trans-unit> <trans-unit id="frontend.filter.companies" approved="yes"> @@ -227,4 +227,4 @@ </trans-unit> </body> </file> -</xliff> \ No newline at end of file +</xliff> diff --git a/Resources/Private/Partials/Filter.html b/Resources/Private/Partials/Filter.html index d139f01a2051c2ad71ff6c52069711b13103824d..3a17c6ca48647833140e881b23f4d01abbf6c38d 100644 --- a/Resources/Private/Partials/Filter.html +++ b/Resources/Private/Partials/Filter.html @@ -29,11 +29,11 @@ id="filter-companies"/> </div> <div class="sgjobs-filter-bar-form-control"> - <label for="filter-areas"> - <f:translate key="frontend.filter.areas"/> + <label for="filter-departments"> + <f:translate key="frontend.filter.departments"/> </label> - <f:form.select class="sgjobs-select form-control" multiple="0" size="1" value="{selectedArea}" - property="filterArea" optionValueField="value" options="{areas}" id="filter-areas"/> + <f:form.select class="sgjobs-select form-control" multiple="0" size="1" value="{selectedDepartment}" + property="filterDepartment" optionValueField="value" options="{departments}" id="filter-departments"/> </div> </div> </f:form> diff --git a/Resources/Private/Partials/Job.html b/Resources/Private/Partials/Job.html index 1a57b540275f8dcf7017ac285cfed5363e2d9f64..ca6e0e05167c350ca2968328a1f65de696fc6f46 100644 --- a/Resources/Private/Partials/Job.html +++ b/Resources/Private/Partials/Job.html @@ -34,8 +34,8 @@ {job.company.country} - {job.company.zip} {job.company.city} </p> - <h3><f:translate key="frontend.area" /></h3> - <p>{job.area}</p> + <h3><f:translate key="frontend.department" /></h3> + <p>{job.department.title}</p> <h3><f:translate key="frontend.organisation" /></h3> <p>{job.company.name}</p> diff --git a/Resources/Private/Templates/Joblist/Index.html b/Resources/Private/Templates/Joblist/Index.html index b7f87fc92411def4f936e227644732cddf10a267..d1be8ab485ad89ef932cc9d2848a1f93da5c5efe 100644 --- a/Resources/Private/Templates/Joblist/Index.html +++ b/Resources/Private/Templates/Joblist/Index.html @@ -4,9 +4,9 @@ <div id="sgjobs-joblist"> <f:render partial="Filter" - arguments="{recordPageId: recordPageId, filters: filters, countries: countries, cities: cities, companies: companies, areas: areas, + arguments="{recordPageId: recordPageId, filters: filters, countries: countries, cities: cities, companies: companies, departments: departments, functions: functions, selectedCountry: selectedCountry, selectedCompany: selectedCompany, - selectedLocation: selectedLocation, selectedArea: selectedArea, selectedFunction: selectedFunction, limit: limit}" + selectedLocation: selectedLocation, selectedDepartment: selectedDepartment, selectedFunction: selectedFunction, limit: limit}" /> <div class="row default-content-element equal-height-columns stretch-first-child"> diff --git a/Resources/Public/Icons/tx_sgjobs_domain_model_department.svg b/Resources/Public/Icons/tx_sgjobs_domain_model_department.svg new file mode 100644 index 0000000000000000000000000000000000000000..5dede161565dbf3a3076ee6bba9e9fcc4bf63d3e --- /dev/null +++ b/Resources/Public/Icons/tx_sgjobs_domain_model_department.svg @@ -0,0 +1 @@ +<svg viewBox="0 0 64 64" xmlns="http://www.w3.org/2000/svg"><title>module-extensionmanager</title><g fill="none" fill-rule="evenodd"><path d="M0 0h64v64H0z" fill="#F08D34"/><path d="M33.018 27.928l10.897-3.8c.518-.194 1.094.068 1.288.585.194.517-.068 1.093-.585 1.287L34 29.703V42.93c0 .59-.448 1.066-1 1.066s-1-.477-1-1.066V29.687l-10.67-3.815c-.517-.194-.78-.77-.585-1.287.194-.518.77-.78 1.287-.586l10.986 3.928zm.454-12c-.26-.083-.687-.082-.944 0l-16.056 5.12c-.26.085-.472.366-.472.644v20.633c0 .27.215.56.472.642l16.056 5.122c.26.082.687.08.944 0l16.056-5.123c.26-.083.472-.364.472-.642V21.692c0-.272-.215-.56-.472-.643l-16.056-5.122z" fill="#FFF"/></g></svg> \ No newline at end of file diff --git a/ext_emconf.php b/ext_emconf.php index e668487074b81dddee143b69a4c24dbb2fbcbc1f..ab75beb7b67c18bf9f33a6185d5edede92d83faa 100644 --- a/ext_emconf.php +++ b/ext_emconf.php @@ -17,7 +17,7 @@ $EM_CONF[$_EXTKEY] = array ( 'depends' => array ( 'typo3' => '8.7.0-8.7.99', - 'php' => '5.6.0-7.2.99', + 'php' => '7.0.0-7.2.99', ), 'conflicts' => array ( diff --git a/ext_localconf.php b/ext_localconf.php index a801f268b230f80bef451339322d916becb072a5..180e49b386efe4cae4644e01ebe2bccde0784542 100644 --- a/ext_localconf.php +++ b/ext_localconf.php @@ -71,3 +71,7 @@ $signalSlotDispatcher->connect( \SGalinski\SgJobs\SignalSlot\SitemapSignalSlot::class, 'beforeSitemapGeneration' ); + +// Register the upgrade wizard +$GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['ext/install']['update'][\SGalinski\SgJobs\Updates\DepartmentUpdateWizard::class] + = \SGalinski\SgJobs\Updates\DepartmentUpdateWizard::class; diff --git a/ext_tables.php b/ext_tables.php index 41e39c501b069239f5e7865b737fe3fe9e5f3450..6234af8a04135544a9918749355ebd6c312d64c1 100644 --- a/ext_tables.php +++ b/ext_tables.php @@ -31,6 +31,7 @@ if (TYPO3_MODE === 'BE') { \TYPO3\CMS\Core\Utility\ExtensionManagementUtility::allowTableOnStandardPages('tx_sgjobs_domain_model_contact'); \TYPO3\CMS\Core\Utility\ExtensionManagementUtility::allowTableOnStandardPages('tx_sgjobs_domain_model_company'); \TYPO3\CMS\Core\Utility\ExtensionManagementUtility::allowTableOnStandardPages('tx_sgjobs_domain_model_job_application'); + \TYPO3\CMS\Core\Utility\ExtensionManagementUtility::allowTableOnStandardPages('tx_sgjobs_domain_model_department'); // Register backend modules \TYPO3\CMS\Extbase\Utility\ExtensionUtility::registerModule( diff --git a/ext_tables.sql b/ext_tables.sql index 51f2b6215dcd1cdc57fd9438f85b46faec27b6ad..3ed556704fa47085005a6d17389acd66c2bf0f18 100644 --- a/ext_tables.sql +++ b/ext_tables.sql @@ -11,7 +11,7 @@ CREATE TABLE tx_sgjobs_domain_model_job ( start_date int(11) unsigned DEFAULT '0' NOT NULL, company text DEFAULT '' NOT NULL, description text DEFAULT '' NOT NULL, - area text DEFAULT '' NOT NULL, + department int(11) DEFAULT '0' NOT NULL, contact int(11) unsigned DEFAULT '0' NOT NULL, featured_offer tinyint(4) unsigned DEFAULT '0' NOT NULL, hide_apply_by_email tinyint(4) unsigned DEFAULT '0' NOT NULL, @@ -50,6 +50,46 @@ CREATE TABLE tx_sgjobs_domain_model_job ( KEY language (l10n_parent,sys_language_uid) ); +CREATE TABLE tx_sgjobs_domain_model_department ( + uid int(11) NOT NULL auto_increment, + pid int(11) DEFAULT '0' NOT NULL, + + -- Custom fields + title text DEFAULT '' NOT NULL, + + -- TYPO3 fields + sorting int(11) unsigned DEFAULT '0' NOT NULL, + starttime int(11) unsigned DEFAULT '0' NOT NULL, + endtime int(11) unsigned DEFAULT '0' NOT NULL, + tstamp int(11) unsigned DEFAULT '0' NOT NULL, + crdate int(11) unsigned DEFAULT '0' NOT NULL, + cruser_id int(11) unsigned DEFAULT '0' NOT NULL, + deleted tinyint(4) unsigned DEFAULT '0' NOT NULL, + hidden tinyint(4) unsigned DEFAULT '0' NOT NULL, + + -- TYPO3 workspace fields + t3ver_oid int(11) DEFAULT '0' NOT NULL, + t3ver_id int(11) DEFAULT '0' NOT NULL, + t3ver_wsid int(11) DEFAULT '0' NOT NULL, + t3ver_label varchar(255) DEFAULT '' NOT NULL, + t3ver_state tinyint(4) DEFAULT '0' NOT NULL, + t3ver_stage int(11) DEFAULT '0' NOT NULL, + t3ver_count int(11) DEFAULT '0' NOT NULL, + t3ver_tstamp int(11) DEFAULT '0' NOT NULL, + t3ver_move_id int(11) DEFAULT '0' NOT NULL, + t3_origuid int(11) DEFAULT '0' NOT NULL, + + -- TYPO3 multi language fields + sys_language_uid int(11) DEFAULT '0' NOT NULL, + l10n_parent int(11) DEFAULT '0' NOT NULL, + l10n_diffsource mediumblob, + + PRIMARY KEY (uid), + KEY parent (pid), + KEY t3ver_oid (t3ver_oid,t3ver_wsid), + KEY language (l10n_parent,sys_language_uid) +); + CREATE TABLE tx_sgjobs_domain_model_company ( uid int(11) NOT NULL auto_increment, pid int(11) DEFAULT '0' NOT NULL,