Code

Fixed sorting of management plugin.
authorhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Wed, 19 Dec 2007 12:33:03 +0000 (12:33 +0000)
committerhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Wed, 19 Dec 2007 12:33:03 +0000 (12:33 +0000)
-sorting is now natural.

git-svn-id: https://oss.gonicus.de/repositories/gosa/branches/2.5@8146 594d385d-05f5-0310-b6e9-bd551577e9d8

plugins/admin/applications/class_applicationManagement.inc
plugins/admin/mimetypes/class_mimetypeManagement.inc
plugins/admin/ogroups/class_ogroupManagement.inc
plugins/admin/users/class_userManagement.inc

index 7959e6f6db42b3b12582af949382f2c5d8cbb668..b496a6b43dab2c606adadc93e92960b3f8fc9f91 100644 (file)
@@ -409,14 +409,16 @@ class applicationManagement extends plugin
     }
    
     $res= get_list($Filter, $this->ui->subtreeACL,$use_base, array("cn","description","dn","objectClass","FAIstate"), $Flags);
+    $tmp2 = array();
     foreach ($res as $val){
       $tmp[strtolower($val['cn'][0]).$val['cn'][0]]=$val;
+      $tmp2[strtolower($val['cn'][0]).$val['cn'][0]]=strtolower($val['cn'][0]).$val['cn'][0];
     }
 
-    ksort($tmp);
+    natcasesort($tmp2);
     $this->applications=array();
-    foreach($tmp as $val){
-      $this->applications[]=$val;
+    foreach($tmp2 as $val){
+      $this->applications[]=$tmp[$val];
     }
     reset ($this->applications);
   }
index 349c61c657df3905aab7ab5cc581b62007586fa9..61146ec0d028fc0d8cd2c9f3b7d5ca521a4484ad 100755 (executable)
@@ -474,15 +474,17 @@ class mimetypeManagement extends plugin
   
     /* Get results and create index */ 
     $res= get_list($Filter, $this->ui->subtreeACL, $use_base, array("cn","description","dn","objectClass"), $Flags);
+    $tmp2 = array();
     foreach ($res as $val){
+      $tmp2[strtolower($val['cn'][0]).$val['cn'][0].$val['dn']] = strtolower($val['cn'][0]).$val['cn'][0].$val['dn'];
       $tmp[strtolower($val['cn'][0]).$val['cn'][0].$val['dn']]=$val;
     }
 
     /* sort entries */
-    ksort($tmp);
+    ksort($tmp2);
     $this->mimetypes=array();
-    foreach($tmp as $val){
-      $this->mimetypes[]=$val;
+    foreach($tmp2 as $val){
+      $this->mimetypes[]=$tmp[$val];
     }
     reset ($this->mimetypes);
   }
index 728c79c510c3d24edba264b06760859c6d3a46c1..0bc09b7d61fae318a5fc7868c7d8f465b2e9ebc7 100644 (file)
@@ -440,13 +440,15 @@ class ogroupManagement extends plugin
     ksort ($this->ogrouplist);
     reset ($this->ogrouplist);
     $tmp=array();
+    $tmp2 = array();
     foreach($this->ogrouplist as $tkey => $val ){
       $tmp[strtolower($val['cn'][0]).$val['cn'][0]]=$val;
+      $tmp2[strtolower($val['cn'][0]).$val['cn'][0]] = strtolower($val['cn'][0]).$val['cn'][0];
     }
-    ksort($tmp);
+    natcasesort($tmp2);
     $this->ogrouplist=array();
-    foreach($tmp as $val){
-      $this->ogrouplist[]=$val;
+    foreach($tmp2 as $val){
+      $this->ogrouplist[]=$tmp[$val];
     }
     reset ($this->ogrouplist);
   }
index 8b3acec2e18eb9c600de5599433229e236f3a025..bcf05f4aca6a44941124b866700c68d61f579041 100644 (file)
@@ -789,7 +789,7 @@ class userManagement extends plugin
         $SortTemp[$display] = $display;
       }
     }
-    sort($SortTemp);
+    natcasesort($SortTemp);
     reset($SortTemp);
 
     $this->list = array();