diff --git a/gosa-core/include/class_listingSortIterator.inc b/gosa-core/include/class_listingSortIterator.inc
index e656d98a9c1fcbee351d95eeb49abe8f1576ad69..14aef7630feb6b312578acae870cb0e2b0753222 100644 (file)
// Take a look at the several types
switch ($_sortType) {
case 'string':
// Take a look at the several types
switch ($_sortType) {
case 'string':
- return strnatcmp($a, $b);
+ return strcoll($a, $b);
+
+ case 'integer':
+ return $b - $a;
+
+ case 'date':
+ list($d, $m, $y)= split('\.', $a);
+ $a= (int)sprintf("%04d%02d%02d", $y, $m, $d);
+ list($d, $m, $y)= split('\.', $b);
+ $b= (int)sprintf("%04d%02d%02d", $y, $m, $d);
+ return $b-$a;
// Sort for string by default
default:
// Sort for string by default
default:
- return strnatcmp($a, $b);
+ return strcoll($a, $b);
}
}
// Sort for attribute
if ($attribute != "") {
}
}
// Sort for attribute
if ($attribute != "") {
- usort($data, "attrSort");
+ uasort($data, "attrSort");
}
// Invert if direction is set
if ($direction) {
}
// Invert if direction is set
if ($direction) {
- $this->data= array_reverse($data);
+ $this->data= array_reverse($data, true);
} else {
$this->data= $data;
}
} else {
$this->data= $data;
}