Code

Updated System Managenemt
authorhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Mon, 6 Oct 2008 06:35:03 +0000 (06:35 +0000)
committerhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Mon, 6 Oct 2008 06:35:03 +0000 (06:35 +0000)
-Added opsi filter checkbox.

git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@12596 594d385d-05f5-0310-b6e9-bd551577e9d8

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

index 1066c0bd292e3c32ad25838f3d8fbcc75e4e3751..bd339a3324d79e6064c72759164c9857376446b9 100644 (file)
@@ -39,6 +39,7 @@ class divListSystem extends MultiSelectWindow
   var $ShowPrinters;
   var $ShowDevices;
   var $ShowPhones;
+  var $ShowOpsiHosts;
 
   /* Subsearch checkbox */
   var $SubSearch;
@@ -131,6 +132,13 @@ class divListSystem extends MultiSelectWindow
           sprintf(_("Show %s"),   _("network devices")),  true);
     }
 
+    /* Add opsi checkboxes if opsi is enabled
+     */
+    if($this->parent->opsi instanceof opsi && $this->parent->opsi->enabled()){
+      $this->AddCheckBox("ShowOpsiHosts" , sprintf(_("Display objects of type '%s'."),
+            _("Opsi host")),_("Show opsi hosts")   ,true);
+    }
+
     /* Add SubSearch checkbox */
     $this->AddCheckBox(SEPERATOR);
     $this->AddCheckBox("SubSearch",  msgPool::selectToView("","subsearch"), msgPool::selectToView("","subsearch_small"), false);
@@ -199,7 +207,10 @@ class divListSystem extends MultiSelectWindow
       $s.= "...|<img src='plugins/systems/images/select_component.png' alt='' border='0' class='center'>".
         "&nbsp;"._("Component")."|"."newsystem_component|\n";
     }
-    if(class_available("opsiGeneric") && preg_match("/c/",$ui->get_permissions($this->selectedBase,"opsi/opsiGeneric"))){
+
+    if($this->parent->opsi instanceof opsi && 
+        $this->parent->opsi->enabled() &&  
+        preg_match("/c/",$ui->get_permissions($this->selectedBase,"opsi/opsiGeneric"))){
       $s.= "...|<img src='plugins/systems/images/select_winstation.png' alt='' border='0' class='center'>".
         "&nbsp;"._("Opsi")."|"."newsystem_opsi_client|\n";
     }
index 117847772083673a53e8f95b09364f4fb04d1116..4f1820dda0384a8e5fd4321cae8794430d8007b3 100644 (file)
@@ -62,9 +62,6 @@ class systems extends plugin
       $this->fai_activated = TRUE;
     }
 
-    /* Creat dialog object */
-    $this->DivListSystem = new divListSystem($this->config,$this);
-
     /* Copy & Paste enabled ?*/
     if ($this->config->get_cfg_value("copyPaste") == "true"){
       $this->CopyPasteHandler = new CopyPasteHandler($this->config);
@@ -87,6 +84,9 @@ class systems extends plugin
     if(class_available("opsi")){
       $this->opsi = new opsi($this->config);
     }
+
+    /* Creat dialog object */
+    $this->DivListSystem = new divListSystem($this->config,$this);
   }
 
 
@@ -1192,7 +1192,7 @@ class systems extends plugin
 
     /* Append opsi systems, the opsi extension have to installed.
      */
-    if($this->opsi != NULL && $this->opsi->enabled()){
+    if($this->opsi instanceof opsi && $this->opsi->enabled() && $this->DivListSystem->ShowOpsiHosts){
       $opsi_clients = $this->opsi->get_hosts_for_system_management();
       if($this->opsi->is_error()){
         msg_dialog::display(_("Error"),msgPool::siError($this->opsi->get_error()),ERROR_DIALOG);