Skip to content
Snippets Groups Projects
Commit a5c0d796 authored by Kevin Ditscheid's avatar Kevin Ditscheid
Browse files

[TASK] Add a new sorting possibility to the list plugin

parent 17316e93
No related branches found
No related tags found
1 merge request!10Feature departments
......@@ -42,6 +42,7 @@ use TYPO3\CMS\Extbase\Persistence\Repository;
class JobRepository extends Repository {
const TABLENAME = 'tx_sgjobs_domain_model_job';
const ORDER_BY_TITLE = 1;
const ORDER_BY_CRDATE = 2;
/**
* initializes the object
......@@ -252,6 +253,14 @@ class JobRepository extends Repository {
);
}
if ($ordering === self::ORDER_BY_CRDATE) {
$query->setOrderings(
[
'crDate' => QueryInterface::ORDER_DESCENDING
]
);
}
$constraints = [];
if ($filters['filterCountry'] !== '0' && $filters['filterCountry'] !== NULL) {
......
......@@ -52,6 +52,10 @@
<numIndex index="0">LLL:EXT:sg_jobs/Resources/Private/Language/locallang_db.xlf:tx_sgjobs_domain_model_job.orderBy_2</numIndex>
<numIndex index="1">1</numIndex>
</numIndex>
<numIndex index="2" type="array">
<numIndex index="0">LLL:EXT:sg_jobs/Resources/Private/Language/locallang_db.xlf:tx_sgjobs_domain_model_job.orderBy_3</numIndex>
<numIndex index="1">2</numIndex>
</numIndex>
</items>
</config>
</TCEforms>
......
......@@ -47,6 +47,12 @@ return [
'palette_location_contact' => ['showitem' => 'company, contact', 'canNotCollapse' => 1]
],
'columns' => [
'crdate' => [
'exclude' => FALSE,
'config' => [
'type' => 'passthrough'
]
],
'sys_language_uid' => [
'exclude' => TRUE,
'label' => 'LLL:EXT:lang/Resources/Private/Language/locallang_general.xml:LGL.language',
......
......@@ -213,6 +213,10 @@
<source><![CDATA[By title]]></source>
<target><![CDATA[Nach Jobtitel]]></target>
</trans-unit>
<trans-unit id="tx_sgjobs_domain_model_job.orderBy_3">
<source><![CDATA[By creation date]]></source>
<target><![CDATA[Nach Erstellungsdatum]]></target>
</trans-unit>
<trans-unit id="tx_sgjobs_domain_model_job.plugin_options" approved="yes">
<source><![CDATA[Joblist plugin options]]></source>
<target><![CDATA[Joblist Plugin-Optionen]]></target>
......
......@@ -165,6 +165,9 @@
<trans-unit id="tx_sgjobs_domain_model_job.orderBy_2">
<source><![CDATA[By title]]></source>
</trans-unit>
<trans-unit id="tx_sgjobs_domain_model_job.orderBy_3">
<source><![CDATA[By creation date]]></source>
</trans-unit>
<trans-unit id="tx_sgjobs_domain_model_job.plugin_options">
<source><![CDATA[Joblist plugin options]]></source>
</trans-unit>
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment