From: hickert Date: Wed, 19 Dec 2007 12:33:03 +0000 (+0000) Subject: Fixed sorting of management plugin. X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=5dd6252ce96f194b7c65e7be098fb4fe44232dd1;p=gosa.git Fixed sorting of management plugin. -sorting is now natural. git-svn-id: https://oss.gonicus.de/repositories/gosa/branches/2.5@8146 594d385d-05f5-0310-b6e9-bd551577e9d8 --- diff --git a/plugins/admin/applications/class_applicationManagement.inc b/plugins/admin/applications/class_applicationManagement.inc index 7959e6f6d..b496a6b43 100644 --- a/plugins/admin/applications/class_applicationManagement.inc +++ b/plugins/admin/applications/class_applicationManagement.inc @@ -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); } diff --git a/plugins/admin/mimetypes/class_mimetypeManagement.inc b/plugins/admin/mimetypes/class_mimetypeManagement.inc index 349c61c65..61146ec0d 100755 --- a/plugins/admin/mimetypes/class_mimetypeManagement.inc +++ b/plugins/admin/mimetypes/class_mimetypeManagement.inc @@ -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); } diff --git a/plugins/admin/ogroups/class_ogroupManagement.inc b/plugins/admin/ogroups/class_ogroupManagement.inc index 728c79c51..0bc09b7d6 100644 --- a/plugins/admin/ogroups/class_ogroupManagement.inc +++ b/plugins/admin/ogroups/class_ogroupManagement.inc @@ -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); } diff --git a/plugins/admin/users/class_userManagement.inc b/plugins/admin/users/class_userManagement.inc index 8b3acec2e..bcf05f4ac 100644 --- a/plugins/admin/users/class_userManagement.inc +++ b/plugins/admin/users/class_userManagement.inc @@ -789,7 +789,7 @@ class userManagement extends plugin $SortTemp[$display] = $display; } } - sort($SortTemp); + natcasesort($SortTemp); reset($SortTemp); $this->list = array();