From 317f1e4c9f590ddfacb40f5d8f7f92283c92e1ba Mon Sep 17 00:00:00 2001 From: hickert Date: Thu, 28 Jul 2005 10:54:23 +0000 Subject: [PATCH] Added Sorting git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@1030 594d385d-05f5-0310-b6e9-bd551577e9d8 --- .../class_applicationManagement.inc | 21 ++++++++++++++++++- .../admin/groups/class_groupManagement.inc | 18 +++++++++++++++- .../admin/ogroups/class_ogroupManagement.inc | 20 ++++++++++++++++-- plugins/admin/users/class_userManagement.inc | 9 ++++++-- .../blocklists/class_blocklistManagement.inc | 17 +++++++++++++-- .../macro/class_gofonMacroManagement.inc | 16 +++++++++++++- 6 files changed, 92 insertions(+), 9 deletions(-) diff --git a/plugins/admin/applications/class_applicationManagement.inc b/plugins/admin/applications/class_applicationManagement.inc index 90df8771e..fb4d3f98d 100644 --- a/plugins/admin/applications/class_applicationManagement.inc +++ b/plugins/admin/applications/class_applicationManagement.inc @@ -445,18 +445,37 @@ class applicationManagement extends plugin $res3 = get_list2($this->ui->subtreeACL, "(&(|(ou=$regex)(description=$regex))(objectClass=gosaDepartment))", TRUE, $base2, array("ou", "description"), TRUE); + + $this->departments= array(); + $tmp = array(); foreach ($res3 as $value){ + $tmp[strtolower($value['dn']).$value['dn']]=$value; + } + ksort($tmp); + foreach($tmp as $value){ if($value["description"][0]!=".."){ - $this->departments[$value['dn']]= convert_department_dn2($value['dn'])." - [".$value["description"][0]."]"; + $this->departments[$value['dn']]=convert_department_dn2($value['dn'])." - [".$value["description"][0]."]"; }else{ $this->departments[$value['dn']]=$value["description"][0]; } } + /* END NEW LIST MANAGMENT */ + $tmp=array(); + foreach($this->applications as $tkey => $val ){ + $tmp[strtolower($val['cn'][0]).$val['cn'][0]]=$val; + } + ksort($tmp); + $this->applications=array(); + foreach($tmp as $val){ + $this->applications[]=$val; + } + reset ($this->applications); + } diff --git a/plugins/admin/groups/class_groupManagement.inc b/plugins/admin/groups/class_groupManagement.inc index db439b570..17115474d 100644 --- a/plugins/admin/groups/class_groupManagement.inc +++ b/plugins/admin/groups/class_groupManagement.inc @@ -542,9 +542,14 @@ class groupManagement extends plugin TRUE, $base2, array("ou", "description"), TRUE); $this->departments= array(); + $tmp = array(); foreach ($res3 as $value){ + $tmp[strtolower($value['dn']).$value['dn']]=$value; + } + ksort($tmp); + foreach($tmp as $value){ if($value["description"][0]!=".."){ - $this->departments[$value['dn']]= convert_department_dn2($value['dn'])." - [".$value["description"][0]."]"; + $this->departments[$value['dn']]=convert_department_dn2($value['dn'])." - [".$value["description"][0]."]"; }else{ $this->departments[$value['dn']]=$value["description"][0]; } @@ -578,6 +583,17 @@ class groupManagement extends plugin $this->grouplist[$value['gidNumber'][0]]= $value; } + + + $tmp=array(); + foreach($this->grouplist as $tkey => $val ){ + $tmp[strtolower($val['cn'][0]).$val['cn'][0]]=$val; + } + ksort($tmp); + $this->grouplist=array(); + foreach($tmp as $val){ + $this->grouplist[]=$val; + } reset ($this->grouplist); } diff --git a/plugins/admin/ogroups/class_ogroupManagement.inc b/plugins/admin/ogroups/class_ogroupManagement.inc index 80c1b5412..4d01afdba 100644 --- a/plugins/admin/ogroups/class_ogroupManagement.inc +++ b/plugins/admin/ogroups/class_ogroupManagement.inc @@ -579,18 +579,34 @@ name='dep_root' alt='"._("Root")."'> ". $res3 = get_list2($this->ui->subtreeACL, "(&(|(ou=$regex)(description=$regex))(objectClass=gosaDepartment))", TRUE, $base2, array("ou", "description"), TRUE); + + $this->departments= array(); + $tmp = array(); foreach ($res3 as $value){ + $tmp[strtolower($value['dn']).$value['dn']]=$value; + } + ksort($tmp); + foreach($tmp as $value){ if($value["description"][0]!=".."){ - $this->departments[$value['dn']]= convert_department_dn2($value['dn'])." - [".$value["description"][0]."]"; + $this->departments[$value['dn']]=convert_department_dn2($value['dn'])." - [".$value["description"][0]."]"; }else{ $this->departments[$value['dn']]=$value["description"][0]; } } - /* END NEW LIST MANAGMENT */ + $tmp=array(); + foreach($this->ogrouplist as $tkey => $val ){ + $tmp[strtolower($val['cn'][0]).$val['cn'][0]]=$val; + } + ksort($tmp); + $this->ogrouplist=array(); + foreach($tmp as $val){ + $this->ogrouplist[]=$val; + } + reset ($this->ogrouplist); diff --git a/plugins/admin/users/class_userManagement.inc b/plugins/admin/users/class_userManagement.inc index eecf3d17c..7c87e8330 100644 --- a/plugins/admin/users/class_userManagement.inc +++ b/plugins/admin/users/class_userManagement.inc @@ -826,14 +826,19 @@ class userManagement extends plugin TRUE, $base2, array("ou", "description"), TRUE); $this->departments= array(); + + $tmp = array(); foreach ($res3 as $value){ + $tmp[strtolower($value['dn']).$value['dn']]=$value; + } + ksort($tmp); + foreach($tmp as $value){ if($value["description"][0]!=".."){ - $this->departments[$value['dn']]= convert_department_dn2($value['dn'])." - [".$value["description"][0]."]"; + $this->departments[$value['dn']]=convert_department_dn2($value['dn'])." - [".$value["description"][0]."]"; }else{ $this->departments[$value['dn']]=$value["description"][0]; } } - /* END NEW LIST MANAGMENT */ diff --git a/plugins/gofax/blocklists/class_blocklistManagement.inc b/plugins/gofax/blocklists/class_blocklistManagement.inc index f9a4533ae..10a682e84 100644 --- a/plugins/gofax/blocklists/class_blocklistManagement.inc +++ b/plugins/gofax/blocklists/class_blocklistManagement.inc @@ -441,9 +441,14 @@ class blocklist extends plugin TRUE, $base2, array("ou", "description"), TRUE); $this->departments= array(); + $tmp = array(); foreach ($res3 as $value){ + $tmp[strtolower($value['dn']).$value['dn']]=$value; + } + ksort($tmp); + foreach($tmp as $value){ if($value["description"][0]!=".."){ - $this->departments[$value['dn']]= convert_department_dn2($value['dn'])." - [".$value["description"][0]."]"; + $this->departments[$value['dn']]=convert_department_dn2($value['dn'])." - [".$value["description"][0]."]"; }else{ $this->departments[$value['dn']]=$value["description"][0]; } @@ -451,7 +456,15 @@ class blocklist extends plugin /* END NEW LIST MANAGMENT */ - + $tmp=array(); + foreach($this->blocklists as $tkey => $val ){ + $tmp[strtolower($val['cn'][0]).$val['cn'][0]]=$val; + } + ksort($tmp); + $this->blocklists=array(); + foreach($tmp as $val){ + $this->blocklists[]=$val; + } reset ($this->blocklists); } diff --git a/plugins/gofon/macro/class_gofonMacroManagement.inc b/plugins/gofon/macro/class_gofonMacroManagement.inc index 53281d0c5..1190f7ba5 100755 --- a/plugins/gofon/macro/class_gofonMacroManagement.inc +++ b/plugins/gofon/macro/class_gofonMacroManagement.inc @@ -439,9 +439,14 @@ class gofonMacro extends plugin TRUE, $base2, array("ou", "description"), TRUE); $this->departments= array(); + $tmp = array(); foreach ($res3 as $value){ + $tmp[strtolower($value['dn']).$value['dn']]=$value; + } + ksort($tmp); + foreach($tmp as $value){ if($value["description"][0]!=".."){ - $this->departments[$value['dn']]= convert_department_dn2($value['dn'])." - [".$value["description"][0]."]"; + $this->departments[$value['dn']]=convert_department_dn2($value['dn'])." - [".$value["description"][0]."]"; }else{ $this->departments[$value['dn']]=$value["description"][0]; } @@ -450,6 +455,15 @@ class gofonMacro extends plugin /* END NEW LIST MANAGMENT */ + $tmp=array(); + foreach($this->macros as $tkey => $val ){ + $tmp[strtolower($val['cn'][0]).$val['cn'][0]]=$val; + } + ksort($tmp); + $this->macros=array(); + foreach($tmp as $val){ + $this->macros[]=$val; + } reset ($this->macros); } -- 2.30.2