Code

Fixed sorting iof entries.
authorhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Wed, 19 Dec 2007 12:28:22 +0000 (12:28 +0000)
committerhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Wed, 19 Dec 2007 12:28:22 +0000 (12:28 +0000)
-Natural sorting

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

gosa-core/plugins/admin/applications/class_applicationManagement.inc
gosa-core/plugins/admin/devices/class_deviceManagement.inc
gosa-core/plugins/admin/mimetypes/class_mimetypeManagement.inc
gosa-core/plugins/admin/ogroups/class_ogroupManagement.inc
gosa-core/plugins/admin/users/class_userManagement.inc

index 69a4c0f4845f9d92c0f3fc7a51fcbc505058066b..7736f1963c3ab76b8f278409c6afc46173a0eb63 100644 (file)
@@ -521,14 +521,16 @@ class applicationManagement extends plugin
     }
    
     $res= get_list($Filter, "application", $use_base, array("cn","description","dn","objectClass"), $Flags);
+    $tmp2 = array();
     foreach ($res as $val){
       $tmp[strtolower($val['cn'][0]).$val['cn'][0].$val['dn']]=$val;
+      $tmp2[strtolower($val['cn'][0]).$val['cn'][0].$val['dn']] = strtolower($val['cn'][0]).$val['cn'][0].$val['dn'];
     }
 
-    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 dbdfc0fb476f769dd8401c6c30a5559bf9978ef7..59e702ff481eb9bb3f66f89168f12fc32168f24c 100644 (file)
@@ -512,15 +512,17 @@ class deviceManagement extends plugin
 
     /* Get results and create index */
     $res= get_list($Filter, "devices", $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);
+    natcasesort($tmp2);
     $this->devices=array();
-    foreach($tmp as $val){
-      $this->devices[]=$val;
+    foreach($tmp2 as $val){
+      $this->devices[]=$tmp[$val];
     }
     reset ($this->devices);
   }
index 5cd9c15b330af24bdc34ada6466e1f3ca9135176..6511103600da18e892c4a054d999ba7c22aa4515 100755 (executable)
@@ -527,15 +527,17 @@ class mimetypeManagement extends plugin
   
     /* Get results and create index */ 
     $res= get_list($Filter, "mimetypes", $use_base, array("cn","description","dn","objectClass"), $Flags);
+    $tmp2 = array();
     foreach ($res as $val){
       $tmp[strtolower($val['cn'][0]).$val['cn'][0].$val['dn']]=$val;
+      $tmp2[strtolower($val['cn'][0]).$val['cn'][0].$val['dn']] = strtolower($val['cn'][0]).$val['cn'][0].$val['dn'];
     }
 
     /* sort entries */
-    ksort($tmp);
+    natcasesort($tmp2);
     $this->mimetypes=array();
-    foreach($tmp as $val){
-      $this->mimetypes[]=$val;
+    foreach($tmp2 as $val){
+      $this->mimetypes[]=$tmp[$val];
     }
     reset ($this->mimetypes);
   }
index 5740877402040ba9736e3be50994c5d5dd4044e9..1e66866da642e4d1102580ea81cc25852a1a3537 100644 (file)
@@ -532,13 +532,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 a031e89d9f783a2cbb19272ea867938b1bde2c65..977a26f6b1db3fdaa98c823b6004bf540be707b9 100644 (file)
@@ -990,7 +990,7 @@ class userManagement extends plugin
         $SortTemp[$display] = $display;
       }
     }
-    sort($SortTemp);
+    natcasesort($SortTemp);
     reset($SortTemp);
 
     $this->list = array();