[BUGFIX] sys_action: Fix Record List page switching
authorThomas Maroschik <tmaroschik@dfau.de>
Sun, 21 Aug 2011 12:22:04 +0000 (14:22 +0200)
committerChristian Kuhn <lolli@schwarzbu.ch>
Sun, 21 Aug 2011 15:01:16 +0000 (17:01 +0200)
If a list-records-task lists more than 100 records, the singe table page turning
functionality is shown on top of the table. If you want to switch the page (or
enter a page number) nothing happens or you get elsewhere than you are supposed
to be.

This happens due to wrong link generation. The Listmodule has been refactored, but the
sys_actions Module stayed the same. Link generation was broken.

This patch fixes the issues with sys_actions and list link generation by subclassing
the localRecordList class and adopting the link generation to sys_actions needs.

Change-Id: Ie84ec59ce632dbe4a74df8236eab777b23f3bd53
Resolves: #23567
Reviewed-on: http://review.typo3.org/2992
Reviewed-by: Susanne Moog
Tested-by: Susanne Moog
Reviewed-by: Christian Kuhn
Tested-by: Christian Kuhn
typo3/sysext/sys_action/ext_autoload.php
typo3/sysext/sys_action/task/class.tx_sysaction_list.php [new file with mode: 0644]
typo3/sysext/sys_action/task/class.tx_sysaction_task.php

index e81605c..d5bc526 100644 (file)
@@ -5,6 +5,7 @@
  */
 $extensionPath = t3lib_extMgm::extPath('sys_action');
 return array(
+       'tx_sysaction_list' => $extensionPath . 'task/class.tx_sysaction_list.php',
        'tx_sysaction_task' => $extensionPath . 'task/class.tx_sysaction_task.php',
 );
 ?>
\ No newline at end of file
diff --git a/typo3/sysext/sys_action/task/class.tx_sysaction_list.php b/typo3/sysext/sys_action/task/class.tx_sysaction_list.php
new file mode 100644 (file)
index 0000000..24de21c
--- /dev/null
@@ -0,0 +1,97 @@
+<?php
+/*************************************************************
+*  Copyright notice
+*
+*  (c) 2011 Thomas Maroschik <tmaroschik@dfau.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 2 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.
+*  A copy is found in the textfile GPL.txt and important notices to the license
+*  from the author is found in LICENSE.txt distributed with these scripts.
+*
+*
+*  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!
+***************************************************************/
+/**
+ * Class for the list rendering of Web>Task Center module
+ *
+ * @author     Thomas Maroschik <tmaroschik@dfau.de>
+ * @package TYPO3
+ * @subpackage core
+ */
+class tx_sysaction_list extends localRecordList {
+
+       /**
+        * Creates the URL to this script, including all relevant GPvars
+        * Fixed GPvars are id, table, imagemode, returnUrl, search_field, search_levels and showLimit
+        * The GPvars "sortField" and "sortRev" are also included UNLESS they are found in the $exclList variable.
+        *
+        * @param string $altId Alternative id value. Enter blank string for the current id ($this->id)
+        * @param string $table Table name to display. Enter "-1" for the current table.
+        * @param string $exclList Comma separated list of fields NOT to include ("sortField" or "sortRev")
+        * @return string
+        */
+       function listURL($altId = '', $table = -1, $exclList = '') {
+               $urlParameters = array();
+               if (strcmp($altId, '')) {
+                       $urlParameters['id'] = $altId;
+               } else {
+                       $urlParameters['id'] = $this->id;
+               }
+               if ($table === -1) {
+                       $urlParameters['table'] = $this->table;
+               } else {
+                       $urlParameters['table'] = $table;
+               }
+               if ($this->thumbs) {
+                       $urlParameters['imagemode'] = $this->thumbs;
+               }
+               if ($this->returnUrl) {
+                       $urlParameters['returnUrl'] = $this->returnUrl;
+               }
+               if ($this->searchString) {
+                       $urlParameters['search_field'] = $this->searchString;
+               }
+               if ($this->searchLevels) {
+                       $urlParameters['search_levels'] = $this->searchLevels;
+               }
+               if ($this->showLimit) {
+                       $urlParameters['showLimit'] = $this->showLimit;
+               }
+               if ($this->firstElementNumber) {
+                       $urlParameters['pointer'] = $this->firstElementNumber;
+               }
+               if ((!$exclList || !t3lib_div::inList($exclList, 'sortField')) && $this->sortField) {
+                       $urlParameters['sortField'] = $this->sortField;
+               }
+               if ((!$exclList || !t3lib_div::inList($exclList, 'sortRev')) && $this->sortRev) {
+                       $urlParameters['sortRev'] = $this->sortRev;
+               }
+               if (t3lib_div::_GP('SET')) {
+                       $urlParameters['SET'] = t3lib_div::_GP('SET');
+               }
+               if (t3lib_div::_GP('show')) {
+                       $urlParameters['show'] = intval(t3lib_div::_GP('show'));
+               }
+
+               return t3lib_BEfunc::getModuleUrl('user_task', $urlParameters);
+       }
+}
+
+if (defined('TYPO3_MODE') && isset($GLOBALS['TYPO3_CONF_VARS'][TYPO3_MODE]['XCLASS']['ext/sys_action/task/class.tx_sysaction_list.php'])) {
+       include_once($GLOBALS['TYPO3_CONF_VARS'][TYPO3_MODE]['XCLASS']['ext/sys_action/task/class.tx_sysaction_list.php']);
+}
+
+?>
\ No newline at end of file
index 4040e80..9a72a41 100644 (file)
@@ -912,7 +912,7 @@ class tx_sysaction_task implements tx_taskcenter_Task {
                        // If there is access to the page, then render the list contents and set up the document template object:
                if ($access) {
                                // Initialize the dblist object:
-                       $dblist = t3lib_div::makeInstance('localRecordList');
+                       $dblist = t3lib_div::makeInstance('tx_sysaction_list');
                        $dblist->script = t3lib_div::getIndpEnv('REQUEST_URI');
                        $dblist->backPath = $GLOBALS['BACK_PATH'];
                        $dblist->calcPerms = $GLOBALS['BE_USER']->calcPerms($this->pageinfo);
@@ -929,7 +929,7 @@ class tx_sysaction_task implements tx_taskcenter_Task {
                        $dblist->dontShowClipControlPanels = $CLIENT['FORMSTYLE'] && !$this->taskObject->MOD_SETTINGS['bigControlPanel'] && $dblist->clipObj->current=='normal' && !$GLOBALS['BE_USER']->uc['disableCMlayers'] && !$this->modTSconfig['properties']['showClipControlPanelsDespiteOfCMlayers'];
 
                                // Initialize the listing object, dblist, for rendering the list:
-                       $this->pointer = t3lib_utility_Math::forceIntegerInRange($this->taskObject->pointer,0,100000);
+                       $this->pointer = t3lib_utility_Math::forceIntegerInRange(t3lib_div::_GP('pointer'), 0, 100000);
                        $dblist->start($this->id,$this->table,$this->pointer,$this->taskObject->search_field,$this->taskObject->search_levels,$this->taskObject->showLimit);
                        $dblist->setDispFields();