diff --git a/Classes/Domain/Repository/TimelineEventRepository.php b/Classes/Domain/Repository/TimelineEventRepository.php index f6ebe95..acb4abd 100644 --- a/Classes/Domain/Repository/TimelineEventRepository.php +++ b/Classes/Domain/Repository/TimelineEventRepository.php @@ -7,24 +7,25 @@ class TimelineEventRepository extends Repository { - /** - * @param int $uid - * @return \TYPO3\CMS\Extbase\Persistence\QueryResultInterface - */ + /** + * @param int $uid + * @param $order + * @return \TYPO3\CMS\Extbase\Persistence\QueryResultInterface + */ public function getContentElementEntries($uid, $order) { $query = $this->createQuery(); $ordering = null; switch ($order) { - case "none": - $ordering = []; - break; case "asc": $ordering = ['start_date' => Query::ORDER_ASCENDING]; break; case "desc": $ordering = ['start_date' => Query::ORDER_DESCENDING]; break; + default: + $ordering = ['sorting' => Query::ORDER_ASCENDING]; + break; } $query->getQuerySettings()->setRespectStoragePage(false); diff --git a/Configuration/TCA/Overrides/tt_content.php b/Configuration/TCA/Overrides/tt_content.php index 4766e9a..6ee6622 100644 --- a/Configuration/TCA/Overrides/tt_content.php +++ b/Configuration/TCA/Overrides/tt_content.php @@ -16,14 +16,25 @@ 'foreign_table' => 'tx_timeline_domain_model_timelineevent', 'foreign_field' => 'timetable_id', 'foreign_label' => 'title', + 'foreign_sortby' => 'sorting', 'maxitems' => '100', 'appearance' => array( #'collapseAll' => 0, 'expandSingle' => true, + 'useSortable' => true, 'newRecordLinkAddTitle' => 1, 'newRecordLinkPosition' => 'both', 'showAllLocalizationLink' => true, 'showPossibleLocalizationRecords' => true, + 'enabledControls' => [ + 'info' => true, + 'new' => true, + 'dragdrop' => true, + 'sort' => true, + 'hide' => true, + 'delete' => true, + 'localize' => true, + ], ), 'behaviour' => array( 'localizationMode' => 'select',