Code

Added Sorting
authorhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Thu, 28 Jul 2005 10:54:23 +0000 (10:54 +0000)
committerhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Thu, 28 Jul 2005 10:54:23 +0000 (10:54 +0000)
git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@1030 594d385d-05f5-0310-b6e9-bd551577e9d8

plugins/admin/applications/class_applicationManagement.inc
plugins/admin/groups/class_groupManagement.inc
plugins/admin/ogroups/class_ogroupManagement.inc
plugins/admin/users/class_userManagement.inc
plugins/gofax/blocklists/class_blocklistManagement.inc
plugins/gofon/macro/class_gofonMacroManagement.inc

index 90df8771ec6017281a28bfa00545f8bc98f56823..fb4d3f98d939e1233926c77a08caceab1682ebb4 100644 (file)
@@ -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);
+
 
   }
 
index db439b5702aba1f490849bc13f5e2f5690fbc58f..17115474d0a5f7c5b517aeea710a8a59d5a190d4 100644 (file)
@@ -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);
   }
 
index 80c1b5412d3adbcb056b624521233c9cb7a08fc1..4d01afdbaff0dc570c80df138c68035aad687822 100644 (file)
@@ -579,18 +579,34 @@ name='dep_root' alt='"._("Root")."'>&nbsp;".
     $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);
 
 
 
index eecf3d17ce3dc1e6cdc2a2a0a48e75f570d59b8d..7c87e833002d167849e25125a7662471024fc821 100644 (file)
@@ -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 
      */
   
index f9a4533ae82c704f51e97d64beb8dc7720b4741d..10a682e84a06b6228d2a9b35c4ffdae270099b4c 100644 (file)
@@ -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);
   }
 
index 53281d0c52557c9ef27e7c34719db2d748cca24d..1190f7ba5fe830c16f36cbc5437740990b5d7654 100755 (executable)
@@ -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);
   }