Code

Added new department sorting for div lists
authorhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Thu, 20 Apr 2006 13:30:47 +0000 (13:30 +0000)
committerhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Thu, 20 Apr 2006 13:30:47 +0000 (13:30 +0000)
git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@3076 594d385d-05f5-0310-b6e9-bd551577e9d8

plugins/admin/applications/class_applicationManagement.inc
plugins/admin/fai/class_faiManagement.inc
plugins/admin/groups/class_groupManagement.inc
plugins/admin/ogroups/class_ogroupManagement.inc
plugins/admin/systems/class_systemManagement.inc

index 8cd0d4d9e0d7c2d9665822e6435ec0e585498c08..e1a4dd820079df0e2cf30344eb15b6ea8d021db6 100644 (file)
@@ -624,26 +624,21 @@ class applicationManagement extends plugin
      * So we are able to navigate like in konquerer
      */
     $peopleOU = get_people_ou();
-
     $base2 = $_SESSION['CurrentMainBase'];
-    $res3= get_list("(&(|(ou=$regex)(description=$regex))(objectClass=gosaDepartment))", $this->ui->subtreeACL,
-                    $base2, array("ou", "description"), GL_SIZELIMIT | GL_CONVERT);
 
-    $this->departments= array();
-    $tmp = array();
-    foreach ($res3 as $value){
-      $tmp[strtolower($value['dn']).$value['dn']]=$value;
-    }
-    ksort($tmp);
-    foreach($tmp as $value){
-      if(isset($value["description"][0])){
+    /* Get all departments within this subtree */
+    $deps= get_list("(&(|(ou=$regex)(description=$regex))(objectClass=gosaDepartment))", $this->ui->subtreeACL,
+        $base2, array("ou", "description"), GL_SIZELIMIT | GL_CONVERT);
+
+    $this->departments = array();
+    foreach($deps as $value){
+      if(isset($value['description'][0])){
         $this->departments[$value['dn']]= get_sub_department($value['dn'])." - [".$value["description"][0]."]";
       }else{
-        $this->departments[$value['dn']]= get_sub_department($value['dn']);//$value["description"][0];
+        $this->departments[$value['dn']]= get_sub_department($value['dn']);
       }
     }
-
-
+    natcasesort($this->departments);
     /* END NEW LIST MANAGMENT
      */
 
index 2d3a7fc21172614816d8b9480722da35a2a5879d..6f3b0e30ed9c14cb69ea4bdd0be63c1e9e17c62b 100644 (file)
@@ -902,27 +902,22 @@ class faiManagement extends plugin
                 */
                $base2 = $_SESSION['CurrentMainBase'];
 
-    $res3= get_list("(&(|(ou=$regex)(description=$regex))(objectClass=gosaDepartment))",
-                    $this->ui->subtreeACL, $base2, array("ou", "description"), GL_SIZELIMIT | GL_CONVERT);
-
-               $this->departments= array();
-               $tmp = array();
-               foreach ($res3 as $value){
-                       $tmp[strtolower($value['dn']).$value['dn']]=$value;
-               }
-               ksort($tmp);
-               foreach($tmp as $value){
-                       if(isset($value["description"][0])){
-                               $this->departments[$value['dn']]= get_sub_department($value['dn'])." - [".$value["description"][0]."]";
-                       }else{
-                               $this->departments[$value['dn']]= get_sub_department($value['dn']);//$value["description"][0];
-                       }
-               }
-
-               /* END NEW LIST MANAGMENT
+    /* Get all departments within this subtree */
+    $deps= get_list("(&(|(ou=$regex)(description=$regex))(objectClass=gosaDepartment))", $this->ui->subtreeACL,
+        $base2, array("ou", "description"), GL_SIZELIMIT | GL_CONVERT);
+
+    $this->departments = array();
+    foreach($deps as $value){
+      if(isset($value['description'][0])){
+        $this->departments[$value['dn']]= get_sub_department($value['dn'])." - [".$value["description"][0]."]";
+      }else{
+        $this->departments[$value['dn']]= get_sub_department($value['dn']);
+      }
+    }
+    natcasesort($this->departments);
+               
+    /* END NEW LIST MANAGMENT
                 */
-
-       
     $res= get_list("(objectClass=organizationalUnit)", $this->ui->subtreeACL, $base,
                    array("cn","description","objectClass"), GL_SIZELIMIT);
 
index 047bb76aaafccf008b9a2b616e8ba21a47ca0e2b..4eedcbacbd07cc7cbfa96028ca4ff0cef6d49400 100644 (file)
@@ -679,21 +679,19 @@ class groupManagement extends plugin
      * So we are able to navigate like in konquerer
      */
 
-      $res3= get_list("(&(|(ou=$regex)(description=$regex))(objectClass=gosaDepartment))",
-                      $this->ui->subtreeACL, $base, array("ou", "description"), GL_SIZELIMIT | GL_CONVERT);
-      $this->departments= array();
-      $tmp = array();
-      foreach ($res3 as $value){
-        $tmp[strtolower($value['dn']).$value['dn']]=$value;
-      }
-      ksort($tmp);
-      foreach($tmp as $value){
-        if(isset($value["description"][0])){
-          $this->departments[$value['dn']]= get_sub_department($value['dn'])." - [".$value["description"][0]."]";
-        }else{
-          $this->departments[$value['dn']]= get_sub_department($value['dn']);//$value["description"][0];
-        }
+    /* Get all departments within this subtree */
+    $deps= get_list("(&(|(ou=$regex)(description=$regex))(objectClass=gosaDepartment))", $this->ui->subtreeACL,
+        $base, array("ou", "description"), GL_SIZELIMIT | GL_CONVERT);
+
+    $this->departments = array();
+    foreach($deps as $value){
+      if(isset($value['description'][0])){
+        $this->departments[$value['dn']]= get_sub_department($value['dn'])." - [".$value["description"][0]."]";
+      }else{
+        $this->departments[$value['dn']]= get_sub_department($value['dn']);
       }
+    }
+    natcasesort($this->departments);
     /*  Ende department generation
      */
 
index 4980494a06b82adb0109aaa5c35ddff3ceafda41..a626537cdc8cac74bd5e24ccf2e7b6d3fddb3e46 100644 (file)
@@ -706,24 +706,19 @@ name='dep_root' alt='"._("Root")."'>&nbsp;".
       $base2 = preg_replace("/".$peopleOU."/i","",$base);
     }
 
-    $res3= get_list("(&(|(ou=$regex)(description=$regex))(objectClass=gosaDepartment))",
-                    $this->ui->subtreeACL, $base2, array("ou", "description"), GL_SIZELIMIT | GL_CONVERT);
+    /* Get all departments within this subtree */
+    $deps= get_list("(&(|(ou=$regex)(description=$regex))(objectClass=gosaDepartment))", $this->ui->subtreeACL,
+        $base2, array("ou", "description"), GL_SIZELIMIT | GL_CONVERT);
 
-    $this->departments= array();
-    $tmp = array();
-    foreach ($res3 as $value){
-      $tmp[strtolower($value['dn']).$value['dn']]=$value;
-    }
-    ksort($tmp);
-    foreach($tmp as $value){
-      if(isset($value["description"][0])){
+    $this->departments = array();
+    foreach($deps as $value){
+      if(isset($value['description'][0])){
         $this->departments[$value['dn']]= get_sub_department($value['dn'])." - [".$value["description"][0]."]";
       }else{
-        $this->departments[$value['dn']]= get_sub_department($value['dn']);//$value["description"][0];
+        $this->departments[$value['dn']]= get_sub_department($value['dn']);
       }
     }
-    /* END NEW LIST MANAGMENT
-     */
+    natcasesort($this->departments);
 
     $tmp=array();
     foreach($this->ogrouplist as $tkey => $val ){
@@ -735,11 +730,7 @@ name='dep_root' alt='"._("Root")."'>&nbsp;".
       $this->ogrouplist[]=$val;
     }
     reset ($this->ogrouplist);
-
-
-
   }
-
 }
 
 // vim:tabstop=2:expandtab:shiftwidth=2:filetype=php:syntax:ruler:
index 6b022edd3d033e399197ef4214ddd979e60e4ba2..6d188a6997eb07a21a7b4a35e2c3794be66e2d3c 100644 (file)
@@ -1101,22 +1101,19 @@ class systems extends plugin
       $base2 = preg_replace("/".$peopleOU."/i","",$base);
     }
 
-    $res3= get_list("(&(|(ou=$regex)(description=$regex))(objectClass=gosaDepartment))", $this->ui->subtreeACL, 
-                    $base2, array("ou", "description"), GL_SIZELIMIT | GL_CONVERT);
+    /* Get all departments within this subtree */
+    $deps= get_list("(&(|(ou=$regex)(description=$regex))(objectClass=gosaDepartment))", $this->ui->subtreeACL,
+        $base2, array("ou", "description"), GL_SIZELIMIT | GL_CONVERT);
 
-    $this->departments= array();
-    $tmp = array();
-    foreach ($res3 as $value){
-      $tmp[strtolower($value['dn']).$value['dn']]=$value;
-    }
-    ksort($tmp);
-    foreach($tmp as $value){
-      if(isset($value["description"][0])){
+    $this->departments = array();
+    foreach($deps as $value){
+      if(isset($value['description'][0])){
         $this->departments[$value['dn']]= get_sub_department($value['dn'])." - [".$value["description"][0]."]";
       }else{
-        $this->departments[$value['dn']]= get_sub_department($value['dn']);//$value["description"][0];
+        $this->departments[$value['dn']]= get_sub_department($value['dn']);
       }
     }
+    natcasesort($this->departments);
 
     /* END NEW LIST MANAGMENT
      */