diff --git a/Classes/Controller/BackendController.php b/Classes/Controller/BackendController.php index 8df684f8fe669a4c8e2e4d553bf7c607f9c8963d..44ca2b7f30f38413af85800212a3e7a65195d53f 100644 --- a/Classes/Controller/BackendController.php +++ b/Classes/Controller/BackendController.php @@ -121,34 +121,13 @@ class BackendController extends ActionController { $this->view->assign('pageUid', $pageUid); $this->view->assign('pages', BackendService::getPagesWithJobRecords()); - $sortingData = []; - if ($GLOBALS['TYPO3_CONF_VARS']['EXTENSIONS']['sg_jobs']['allowManualSorting'] && count($filters) <= 0) { - /** - * Somehow the pId is changed so data gets lost. - * - * - * $previousUid = 0; - * $sortingData = []; - * foreach ($jobs as $job) { - * if ($previousUid) { - * $sortingData['prev'][$job->getUid()] = $previousUid; - * $sortingData['next'][$previousUid] = $job->getUid(); - * } - * $previousUid = $job->getUid(); - * } - */ - $this->view->assign('manualSortingDestroysEverything', TRUE); - } - $this->view->assign('sortingData', $sortingData); - $jobs = $this->jobRepository->findBackendJobs($pageUid, $filters, $itemsPerPage); - $paginator = new QueryResultRawPaginator($jobs); + $paginator = new QueryResultRawPaginator($jobs, $currentPage, $itemsPerPage); $pagination = new SimplePagination($paginator); $this->view->assign('paginator', $paginator); $this->view->assign('pagination', $pagination); $totalJobCount = \count($jobs); $this->view->assign('totalJobCount', $totalJobCount); - $isManualSortingAllowed = $GLOBALS['TYPO3_CONF_VARS']['EXTENSIONS']['sg_jobs']['allowManualSorting']; // get all Locations /** @noinspection PhpUndefinedMethodInspection */ /** @var QueryResultInterface $companies */ @@ -156,7 +135,6 @@ class BackendController extends ActionController { $this->view->assign('locationOptions', $companies); $this->view->assign('isAdmin', $GLOBALS['BE_USER']->isAdmin()); - $this->view->assign('isManualSortingAllowed', $isManualSortingAllowed); $this->view->assign('filters', $filters); $this->view->assign('jobs', $jobs); if (!$totalJobCount && $pageUid) { diff --git a/Classes/Controller/JoblistController.php b/Classes/Controller/JoblistController.php index dd71a31e50db16e7675c6f3a5c68ef249881fa1e..3c1d064b8932d0d3d8b656d12e77ac004ceb6f5a 100644 --- a/Classes/Controller/JoblistController.php +++ b/Classes/Controller/JoblistController.php @@ -238,8 +238,6 @@ class JoblistController extends ActionController { ); $frontendPluginSettings = $frontendPluginSettings['settings']; - $isManualSortingAllowed = $GLOBALS['TYPO3_CONF_VARS']['EXTENSIONS']['sg_jobs']['allowManualSorting']; - // get all jobs for the current page $ordering = (int) $frontendPluginSettings['orderBy']; $experienceLevel = (int) $frontendPluginSettings['filterByExperienceLevel']; @@ -248,7 +246,6 @@ class JoblistController extends ActionController { $filters['filterExperienceLevel'] = $experienceLevel; } - $this->jobRepository->setAllowManualSorting((bool) $isManualSortingAllowed); $jobs = $this->jobRepository->findJobsByFilter($filters, $jobLimit, $offset, $ordering)->toArray(); // get all jobs for the current page diff --git a/Classes/Domain/Repository/JobRepository.php b/Classes/Domain/Repository/JobRepository.php index 5f5b0b8370cbe6ea0afc0c8829995b19b4d210e4..be8692bc66fcb19e1c645621f76dfec7ca76629e 100644 --- a/Classes/Domain/Repository/JobRepository.php +++ b/Classes/Domain/Repository/JobRepository.php @@ -45,11 +45,6 @@ class JobRepository extends Repository { public const ORDER_BY_CRDATE = 2; public const ORDER_BY_SORTING = 0; - /** - * @var bool $allowManualSorting - */ - protected $allowManualSorting = FALSE; - public function __construct(ObjectManagerInterface $objectManager) { parent::__construct($objectManager); $querySettings = $objectManager->get(Typo3QuerySettings::class); @@ -57,20 +52,6 @@ class JobRepository extends Repository { $this->setDefaultQuerySettings($querySettings); } - /** - * @return bool - */ - public function isAllowManualSorting(): bool { - return $this->allowManualSorting; - } - - /** - * @param bool $allowManualSorting - */ - public function setAllowManualSorting(bool $allowManualSorting): void { - $this->allowManualSorting = $allowManualSorting; - } - /** * Queries the job records based on filters (for the backend) * @@ -200,7 +181,7 @@ class JobRepository extends Repository { $query->getQuerySettings()->setRespectStoragePage(FALSE); } - if ($ordering === self::ORDER_BY_TITLE || (!$this->allowManualSorting && $ordering === self::ORDER_BY_SORTING)) { + if ($ordering === self::ORDER_BY_TITLE) { $query->setOrderings( [ 'title' => QueryInterface::ORDER_ASCENDING, @@ -216,7 +197,7 @@ class JobRepository extends Repository { ); } - if ($ordering === self::ORDER_BY_SORTING && $this->allowManualSorting) { + if ($ordering === self::ORDER_BY_SORTING) { $query->setOrderings( [ 'sorting' => QueryInterface::ORDER_ASCENDING diff --git a/Resources/Private/Language/de.locallang.xlf b/Resources/Private/Language/de.locallang.xlf index a2c5f67411e1dfd46163e22423f368d244ce7b36..8e004c0b51d8516f200b0665438dbfb310cd5b5a 100644 --- a/Resources/Private/Language/de.locallang.xlf +++ b/Resources/Private/Language/de.locallang.xlf @@ -122,10 +122,6 @@ <source><![CDATA[Item]]></source> <target><![CDATA[Eintrag]]></target> </trans-unit> - <trans-unit id="backend.manualSortingBug" approved="yes"> - <source><![CDATA[Manual sorting is currently not working. You can do that in the List module.]]></source> - <target><![CDATA[Die manuelle Sortierung ist derzeit leider fehlerbehaftet. Sie können die Reihenfolge in dem Listen-Modul ändern.]]></target> - </trans-unit> <trans-unit id="backend.message.error" approved="yes"> <source><![CDATA[Something went wrong. Please reload.]]></source> <target><![CDATA[Etwas ist schiefgelaufen. Bitte laden Sie die Seite neu.]]></target> diff --git a/UPGRADE.md b/UPGRADE.md index ed7b4341902d6b54672a65d6fca574f7698a0664..fed526361ed4e33584b2a8976baad7d1b083ca13 100644 --- a/UPGRADE.md +++ b/UPGRADE.md @@ -6,6 +6,7 @@ - Job location field is deprecated, use different Companies instead; job.location is unused in default templates/settings - Dropped support for sg_seo < 6.0 - Dropped support for sg_mail < 8.0 +- global manual sorting extension setting has been dropped ## Version 4 Breaking Changes diff --git a/ext_conf_template.txt b/ext_conf_template.txt index 692cda1f56b91d2f45b0204ffcff11910add1a44..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 100644 --- a/ext_conf_template.txt +++ b/ext_conf_template.txt @@ -1,2 +0,0 @@ -# cat=plugin.tx_sgjobs/other; type=boolean; label=Enable manual sorting -allowManualSorting = 0