From d127f3a03c802295921cedc1f8fb23ff13ed5205 Mon Sep 17 00:00:00 2001 From: Ivan Tcholakov Date: Sun, 21 Jun 2009 09:39:02 +0200 Subject: [PATCH] [svn r21542] FS#306 - Assesments (gradebook): A correction about sorting data by users. --- .../lib/flatview_data_generator.class.php | 15 +++------------ 1 file changed, 3 insertions(+), 12 deletions(-) diff --git a/main/gradebook/lib/flatview_data_generator.class.php b/main/gradebook/lib/flatview_data_generator.class.php index 26970928e8..99b060e84e 100644 --- a/main/gradebook/lib/flatview_data_generator.class.php +++ b/main/gradebook/lib/flatview_data_generator.class.php @@ -252,19 +252,10 @@ class FlatViewDataGenerator // Sort functions - used internally function sort_by_last_name($item1, $item2) { - if (api_strtolower($item1[1]) == api_strtolower($item2[1])) { - return 0; - } else { - return (api_strtolower($item1[1]) < api_strtolower($item2[1]) ? -1 : 1); - } + return api_strcmp($item1[1], $item2[1]); } - function sort_by_first_name($item1, $item2) - { - if (api_strtolower($item1[2]) == api_strtolower($item2[2])) { - return $this->sort_by_last_name($item1, $item2); - } else { - return (api_strtolower($item1[2]) < api_strtolower($item2[2]) ? -1 : 1); - } + function sort_by_first_name($item1, $item2) { + return api_strcmp($item1[2], $item2[2]); } }