Code

Added release col to system management. Sorting does now work currently.
authorhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Mon, 19 May 2008 07:39:06 +0000 (07:39 +0000)
committerhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Mon, 19 May 2008 07:39:06 +0000 (07:39 +0000)
git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@10945 594d385d-05f5-0310-b6e9-bd551577e9d8

gosa-plugins/systems/admin/systems/class_divListSystem.inc
gosa-plugins/systems/admin/systems/class_systemManagement.inc

index 0bba4f6d576ceb9a5245945ba6f7eb4384e4ccf0..9b4f5f00a05af37210fa7bbadd00fa816b2edd9f 100644 (file)
@@ -85,6 +85,12 @@ class divListSystem extends MultiSelectWindow
     $this->AddHeader(array("string"=> $chk,          "attach"=>"style='width:20px;'"));
     $this->AddHeader(array("string"=>"&nbsp;","attach"=>"style='width:20px;'"));
     $this->AddHeader(array("string"=>_("Systems")." / "._("Department")));
+
+    /* Add header for selected FAI release, if fai is active */
+    if($this->parent->fai_activated){
+      $this->AddHeader(array("string"=>_("Release"),"attach"=>"style='width:100px;'"));
+    }
+
     $this->AddHeader(array("string"=>_("Actions"),"attach"=>"style='width:".$action_col_size."px;border-right:0px;'"));
 
     /*                  Text        ,Value    ,Name         ,Is selected */
@@ -444,15 +450,28 @@ class divListSystem extends MultiSelectWindow
       }
       $cnts[$type] ++;
 
-
       /* Create each field */
       $field0 = array("string" => "<input type='checkbox' id='item_selected_".$key."' name='item_selected_".$key."'>" ,
-                      "attach" => "style='width:20px;'");
+          "attach" => "style='width:20px;'");
+      $field1 = array("string" => sprintf($img['img'],$val['dn']),
+          "attach" => "style='text-align:center;width:20px;'");
+      $field2 = array("string" => sprintf($editlink,$key,$display),
+          "attach" => "style='' title='".preg_replace('/ /', '&nbsp;', @LDAP::fix($val['dn']))."'");
+      $field3 = array("string" => preg_replace("/%KEY%/", "$key", $action2.$action),
+          "attach" => "style='width:".$action_col_size."px;border-right:0px;text-align:right;'");
+
+      if($this->parent->fai_activated){
+
+        $release ="&nbsp;";
+        if(isset($val['FAIclass'][0]) && preg_match("/:/",$val['FAIclass'][0])){
+          $release = preg_replace("/^.*:/","",$val['FAIclass'][0]);
+        }
 
-      $field1 = array("string" => sprintf($img['img'],$val['dn']), "attach" => "style='text-align:center;width:20px;'");
-      $field2 = array("string" => sprintf($editlink,$key,$display), "attach" => "style='' title='".preg_replace('/ /', '&nbsp;', @LDAP::fix($val['dn']))."'");
-      $field3 = array("string" => preg_replace("/%KEY%/", "$key", $action2.$action), "attach" => "style='width:".$action_col_size."px;border-right:0px;text-align:right;'");
-      $this->AddElement( array($field0,$field1,$field2,$field3));
+        $field2a = array("string" => $release,"attach"=>"style='width:100px;'");
+        $this->AddElement( array($field0,$field1,$field2,$field2a,$field3));
+      }else{
+        $this->AddElement( array($field0,$field1,$field2,$field3));
+      }
     }
 
     /* Create summary string for list footer */
index c30b3aa8b62f1e41af81e8d13cc1a5d0df5f3234..7bb89b751e7faafd685b3211736f886d89ae3147 100644 (file)
@@ -42,6 +42,7 @@ class systems extends plugin
   var $dns = array();
 
   var $system_activation_object = ""; // The object to activate (NewDevice)
+  var $fai_activated  = FALSE;
 
   function systems (&$config, $ui)
   {
@@ -49,6 +50,12 @@ class systems extends plugin
     $this->config= $config;
     $this->ui= $ui;
 
+    /* Add FAIstate to attributes if FAI is activated */
+    $tmp = $this->config->search("faiManagement", "CLASS",array('menu','tabs'));
+    if(!empty($tmp)){
+      $this->fai_activated = TRUE;
+    }
+
     /* Creat dialog object */
     $this->DivListSystem = new divListSystem($this->config,$this);
 
@@ -61,7 +68,6 @@ class systems extends plugin
     if($this->config->search("ArpNewDevice","CLASS",array('tabs')) != ""){
       $this->arp_handling_active = TRUE;
     }
-
   }
 
 
@@ -1140,7 +1146,13 @@ class systems extends plugin
 
     /* Add departments if subsearch is disabled */
     if(!$this->DivListSystem->SubSearch){
-      $this->DivListSystem->AddDepartments($this->DivListSystem->selectedBase,3,1);
+
+      /* Add FAIstate to attributes if FAI is activated */
+      if($this->fai_activated){
+        $this->DivListSystem->AddDepartments($this->DivListSystem->selectedBase,4,1);
+      }else{
+        $this->DivListSystem->AddDepartments($this->DivListSystem->selectedBase,3,1);
+      }
     }
     $this->reload();
     $this->DivListSystem->setEntries($this->terminals);
@@ -1250,7 +1262,7 @@ class systems extends plugin
     }
 
     /* Attributes to fetch */
-    $sys_attrs        = array("cn", "description", "macAddress", "objectClass", "sambaDomainName","gotoMode");
+    $sys_attrs        = array("cn", "description", "macAddress", "objectClass", "sambaDomainName","gotoMode","FAIclass");
     $sys_categories   = array("terminal", "workstation", "server", "phone" ,"printer","incoming");
 
     /* Add FAIstate to attributes if FAI is activated */