mirror of
https://github.com/silverstripe/silverstripe-framework
synced 2024-10-22 14:05:37 +02:00
BUGFIX: Don't default to sorted descending if you already have a different column sorted ascending. (from r96061)
git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/branches/2.4@98134 467b73ca-7a2a-4603-9d3b-597d59a354a9
This commit is contained in:
parent
18e933f5a1
commit
ff1e605de9
@ -320,11 +320,13 @@ JS
|
||||
$sortLink = $this->Link();
|
||||
$sortLink = HTTP::setGetVar("ctf[{$this->Name()}][sort]", $fieldName, $sortLink);
|
||||
|
||||
// Apply sort direction
|
||||
$dir = isset($_REQUEST['ctf'][$this->Name()]['dir']) ? $_REQUEST['ctf'][$this->Name()]['dir'] : null;
|
||||
$dir = trim(strtolower($dir));
|
||||
$newDir = ($dir == 'desc') ? null : 'desc';
|
||||
$sortLink = HTTP::setGetVar("ctf[{$this->Name()}][dir]", Convert::raw2xml($newDir), $sortLink);
|
||||
// Apply sort direction to the current sort field
|
||||
if(!empty($_REQUEST['ctf'][$this->Name()]['sort']) && ($_REQUEST['ctf'][$this->Name()]['sort'] == $fieldName)) {
|
||||
$dir = isset($_REQUEST['ctf'][$this->Name()]['dir']) ? $_REQUEST['ctf'][$this->Name()]['dir'] : null;
|
||||
$dir = trim(strtolower($dir));
|
||||
$newDir = ($dir == 'desc') ? null : 'desc';
|
||||
$sortLink = HTTP::setGetVar("ctf[{$this->Name()}][dir]", Convert::raw2xml($newDir), $sortLink);
|
||||
}
|
||||
|
||||
if(isset($_REQUEST['ctf'][$this->Name()]['search']) && is_array($_REQUEST['ctf'][$this->Name()]['search'])) {
|
||||
foreach($_REQUEST['ctf'][$this->Name()]['search'] as $parameter => $value) {
|
||||
|
Loading…
Reference in New Issue
Block a user