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