Code

Hide php errors
[gosa.git] / plugins / admin / applications / class_applicationManagement.inc
index fb4d3f98d939e1233926c77a08caceab1682ebb4..3be16fae584810def87323b9137a938d1b53f213 100644 (file)
@@ -60,7 +60,6 @@ class applicationManagement extends plugin
             $s_action="open";
             $s_entry = base64_decode($_GET['dep_id']);
             $appfilter['depselect']= "".$this->config->departments[trim($s_entry)];
-            $this->reload();
     }
 
     /* Test Posts */
@@ -95,19 +94,16 @@ class applicationManagement extends plugin
     /* Department changed? */
     if(isset($_POST['depselect']) && $_POST['depselect']){
       $appfilter['depselect']= $_POST['depselect'];
-      $this->reload();
     }
 
     /* Homebutton is posted */
     if($s_action=="home"){
       $appfilter['depselect']=(preg_replace("/^[^,]+,/","",$this->ui->dn));
       $appfilter['depselect']=(preg_replace("/^[^,]+,/","",$appfilter['depselect']));
-      $this->reload();
     }
 
     if($s_action=="root"){
       $appfilter['depselect']=($this->config->current['BASE']);
-      $this->reload();
     }
 
     /* If Backbutton is Posted */
@@ -120,7 +116,6 @@ class applicationManagement extends plugin
       }else{
         $appfilter['depselect']= $this->config->departments["/"];
       }
-      $this->reload();
     }
 
     if (isset($_POST['regex'])){
@@ -136,12 +131,7 @@ class applicationManagement extends plugin
     register_global("appfilter", $appfilter);
 
     /* Check sorting variable */
-    if (!isset($this->apptabs) &&
-        !isset($_POST['new_app']) &&
-        !isset($_POST['delete_app']) &&
-        !isset($_POST['select_app'])){
-      $this->reload();
-    }
+    $this->reload();
     $smarty= get_smarty();
 
     /* Check for exeeded sizelimit */
@@ -358,7 +348,7 @@ class applicationManagement extends plugin
         $empty    = "<img src='images/empty.png' style='width:16px;height:16px;' alt=''>";
 
 
-        $divlist = new divlist();
+        $divlist = new divlist("applicationtabs");
         $divlist->SetHeader(array(
               array("string" => ""),
               array("string" => _("Application name")." / "._("Department")),
@@ -371,7 +361,19 @@ class applicationManagement extends plugin
 
         foreach($this->departments as $key=> $val){
 
-          $field1 = array("string" => "<img src='images/folder.png' alt='department'>");
+          if(!isset($this->config->departments[trim($key)])){
+            $this->config->departments[trim($key)]="";
+          }
+
+          $non_empty="";
+          $keys= str_replace("/","\/",$key);
+          foreach($this->config->departments as $keyd=>$vald ){
+            if(preg_match("/".$keys."\/.*/",$keyd)){
+              $non_empty="full";
+            }
+          }
+
+          $field1 = array("string" => "<img src='images/".$non_empty."folder.png' alt='department'>");
           $field2 = array("string" => sprintf($linkopen,base64_encode($key),$val));
           $field3 = array("string" => "&nbsp;","attach"=>"style='text-align:right;border:none'");
 
@@ -425,9 +427,9 @@ class applicationManagement extends plugin
         } else {
                 $regex= "*";
         }
-
+      
         /* Generate application list */
-        $res= get_list($this->ui->subtreeACL, "(&(cn=$regex)(objectClass=gosaApplication))", TRUE, $base, array("*"), TRUE);
+        $res= get_list($this->ui->subtreeACL, "(&(cn=$regex)(objectClass=gosaApplication))", FALSE, "ou=apps,".$base, array("*"), TRUE);
         $this->applications= array();
         foreach ($res as $value){
           $this->applications[]= $value;