[FEATURE] Add file links sorting by date and sorting direction 67/53667/3
authorWolfgang Klinger <wolfgang@wazum.com>
Wed, 9 Aug 2017 15:22:09 +0000 (17:22 +0200)
committerSusanne Moog <susanne.moog@typo3.org>
Mon, 14 Aug 2017 08:46:22 +0000 (10:46 +0200)
Adds ‘Sort by creation date’ and ‘Sort by modification date’ options
and a new option to set a sorting direction in the file links
content element.
Corrects the sorting option labels in English.

Resolves: #65403
Resolves: #63509
Releases: master
Change-Id: I0e0b474ee49e2be5e4111b6841a36f27d35f3b71
Reviewed-on: https://review.typo3.org/53667
Tested-by: TYPO3com <no-reply@typo3.com>
Reviewed-by: Henning Liebe <h.liebe@neusta.de>
Tested-by: Henning Liebe <h.liebe@neusta.de>
Reviewed-by: Susanne Moog <susanne.moog@typo3.org>
Tested-by: Susanne Moog <susanne.moog@typo3.org>
typo3/sysext/core/Documentation/Changelog/master/Feature-63509-FileLinksSortingByDateAndSortingDirection.rst [new file with mode: 0644]
typo3/sysext/fluid_styled_content/Configuration/TypoScript/ContentElement/Uploads.txt
typo3/sysext/frontend/Configuration/TCA/tt_content.php
typo3/sysext/frontend/Resources/Private/Language/locallang_ttc.xlf
typo3/sysext/frontend/ext_tables.sql

diff --git a/typo3/sysext/core/Documentation/Changelog/master/Feature-63509-FileLinksSortingByDateAndSortingDirection.rst b/typo3/sysext/core/Documentation/Changelog/master/Feature-63509-FileLinksSortingByDateAndSortingDirection.rst
new file mode 100644 (file)
index 0000000..c4e82e7
--- /dev/null
@@ -0,0 +1,24 @@
+.. include:: ../../Includes.txt
+
+======================================================================
+Feature: #65403 - Add file links sorting by date and sorting direction
+======================================================================
+
+See :issue:`63509`
+See :issue:`65403`
+
+Description
+===========
+
+Adds "Sort by creation date" and "Sort by modification date" options
+and a new option to set a sorting direction in the file links
+content element.
+
+
+Impact
+======
+
+New options in the "Sort by" dropdown and a new dropdown
+to set a sorting direction.
+
+.. index:: Backend
index 78d84e8..262a175 100644 (file)
@@ -12,6 +12,7 @@ tt_content.uploads {
             references.fieldName = media
             collections.field = file_collections
             sorting.field = filelink_sorting
+            sorting.direction.field = filelink_sorting_direction
         }
     }
     stdWrap {
index 369642f..b9763e8 100644 (file)
@@ -996,7 +996,21 @@ return [
                     ['LLL:EXT:frontend/Resources/Private/Language/locallang_ttc.xlf:filelink_sorting.extension', 'extension'],
                     ['LLL:EXT:frontend/Resources/Private/Language/locallang_ttc.xlf:filelink_sorting.name', 'name'],
                     ['LLL:EXT:frontend/Resources/Private/Language/locallang_ttc.xlf:filelink_sorting.type', 'type'],
-                    ['LLL:EXT:frontend/Resources/Private/Language/locallang_ttc.xlf:filelink_sorting.size', 'size']
+                    ['LLL:EXT:frontend/Resources/Private/Language/locallang_ttc.xlf:filelink_sorting.size', 'size'],
+                    ['LLL:EXT:frontend/Resources/Private/Language/locallang_ttc.xlf:filelink_sorting.creation_date', 'creation_date'],
+                    ['LLL:EXT:frontend/Resources/Private/Language/locallang_ttc.xlf:filelink_sorting.modification_date', 'modification_date']
+                ]
+            ]
+        ],
+        'filelink_sorting_direction' => [
+            'label' => 'LLL:EXT:frontend/Resources/Private/Language/locallang_ttc.xlf:filelink_sorting_direction',
+            'config' => [
+                'type' => 'select',
+                'renderType' => 'selectSingle',
+                'items' => [
+                    ['', ''],
+                    ['LLL:EXT:frontend/Resources/Private/Language/locallang_ttc.xlf:filelink_sorting_direction.ascending', 'asc'],
+                    ['LLL:EXT:frontend/Resources/Private/Language/locallang_ttc.xlf:filelink_sorting_direction.descending', 'desc'],
                 ]
             ]
         ],
@@ -1903,6 +1917,7 @@ return [
                 file_collections;LLL:EXT:frontend/Resources/Private/Language/locallang_ttc.xlf:file_collections.ALT.uploads_formlabel,
                 --linebreak--,
                 filelink_sorting,
+                filelink_sorting_direction,
                 target
             ',
         ],
index 74567d9..7769124 100644 (file)
                                <source>Show File Size:</source>
                        </trans-unit>
                        <trans-unit id="filelink_sorting">
-                               <source>Sort Filelist:</source>
+                               <source>Sort file list:</source>
                        </trans-unit>
                        <trans-unit id="filelink_sorting.none">
-                                       <source>none</source>
+                                       <source>no sorting</source>
                        </trans-unit>
                        <trans-unit id="filelink_sorting.extension">
-                                       <source>by Fileextension</source>
+                                       <source>by file extension</source>
                        </trans-unit>
                        <trans-unit id="filelink_sorting.name">
-                                       <source>by Filename</source>
+                                       <source>by filename</source>
                        </trans-unit>
                        <trans-unit id="filelink_sorting.type">
-                                       <source>by Filetype</source>
+                                       <source>by file type</source>
                        </trans-unit>
                        <trans-unit id="filelink_sorting.size">
-                                       <source>by Filesize</source>
+                                       <source>by file size</source>
+                       </trans-unit>
+                       <trans-unit id="filelink_sorting.creation_date">
+                                       <source>by file creation date</source>
+                       </trans-unit>
+                       <trans-unit id="filelink_sorting.modification_date">
+                                       <source>by file modification date</source>
+                       </trans-unit>
+                       <trans-unit id="filelink_sorting_direction">
+                               <source>Sorting direction:</source>
+                       </trans-unit>
+                       <trans-unit id="filelink_sorting_direction.ascending">
+                                       <source>Ascending (default)</source>
+                       </trans-unit>
+                       <trans-unit id="filelink_sorting_direction.descending">
+                                       <source>Descending</source>
                        </trans-unit>
                        <trans-unit id="filelink_size_formlabel">
                                <source>Display File Size Information</source>
index 36cfa88..1178bae 100644 (file)
@@ -276,7 +276,8 @@ CREATE TABLE tt_content (
        linkToTop tinyint(3) unsigned DEFAULT '0' NOT NULL,
        file_collections text,
        filelink_size tinyint(3) unsigned DEFAULT '0' NOT NULL,
-       filelink_sorting varchar(10) DEFAULT '' NOT NULL,
+       filelink_sorting varchar(17) DEFAULT '' NOT NULL,
+       filelink_sorting_direction varchar(4) DEFAULT '' NOT NULL,
        target varchar(30) DEFAULT '' NOT NULL,
        date int(10) unsigned DEFAULT '0' NOT NULL,
        recursive tinyint(3) unsigned DEFAULT '0' NOT NULL,