Code

Updated opsi
authorhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Fri, 5 Sep 2008 08:38:26 +0000 (08:38 +0000)
committerhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Fri, 5 Sep 2008 08:38:26 +0000 (08:38 +0000)
-Updated opsi hard && software tabs.

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

gosa-plugins/opsi/admin/opsi/class_opsiware.inc
gosa-plugins/opsi/admin/opsi/opsiware.tpl

index 5e0caedd8f912918b9791e3344c5a327aec0e23e..75909c44116618699c7a1cc2b11f88eb02d19024 100644 (file)
@@ -1,13 +1,23 @@
 <?php
 
+class opsiSoftware extends opsiWare
+{
+  protected $type = 0;
+}
+
+class opsiHardware extends opsiWare
+{
+  protected $type = 1;
+}
+
+
 class opsiWare extends plugin
 {
   private $opsi;
-  private $SW_info;
-  private $HW_info;
   private $hostId;
-  private $type = 0;
   private $init_failed = FALSE;
+  private $info;
+  protected $type = 0;
 
   public function __construct($config,$hostId)
   {
@@ -19,25 +29,22 @@ class opsiWare extends plugin
 
   private function init()
   {
-    $err = FALSE;
-    if(!$err){
-      $this->HW_info = $this->opsi->get_client_hardware($this->hostId);
-      $err |= $this->opsi->is_error(); 
-    }
-    if(!$err){
-      $this->SW_info = $this->opsi->get_client_software($this->hostId);
-      $err |= $this->opsi->is_error(); 
+    if($this->type == 0){
+      $this->info = $this->opsi->get_client_hardware($this->hostId);
+      $err = $this->opsi->is_error(); 
+    }else{
+      $this->info = $this->opsi->get_client_software($this->hostId);
+      $err = $this->opsi->is_error(); 
     }
     $this->init_failed = $err;
   }
 
+
   public function execute()
   {
     if(isset($_POST['reinit']) && $this->init_failed){
       $this->init();
     }
-    if(isset($_GET['type'])) $this->type = $_GET['type'];
-
     $smarty = get_smarty();
     $smarty->assign("init_failed",$this->init_failed);
     if($this->init_failed){
@@ -45,14 +52,8 @@ class opsiWare extends plugin
       $smarty->assign("message",$this->opsi->get_error());
       return($smarty->fetch(get_template_path("opsiware.tpl",TRUE,dirname(__FILE__))));
     }  
-
     $smarty->assign("type", $this->type);
-
-    if($this->type == 1){
-      $smarty->assign("info", $this->HW_info);
-    }else{
-      $smarty->assign("info", $this->SW_info);
-    }
+    $smarty->assign("info", $this->info);
     return($smarty->fetch(get_template_path("opsiware.tpl",TRUE,dirname(__FILE__))));
   }
 }
index cdb809a684f4aaa95a7b5e0d9e72f51ca8f5d825..9e57fd1eb055529cf7dc8c422e0135ccdf51a539 100644 (file)
@@ -3,12 +3,10 @@
        <font style='color: #FF0000;'>{msgPool type=siError p=$message}</font>
        <input type='submit' name='reinit' value="{t}Retry{/t}">
 {else}
-       {if $type == 1}
+       {if $type == 0}
                <h2><img class='center' alt='' src='plugins/opsi/images/hardware_info.png'>&nbsp;{t}Hardware information{/t}</h2>
-               <a href='{$plug}&amp;type=0'>Software info</a>
        {else}
                <h2><img class='center' alt='' src='plugins/opsi/images/software_info.png'>&nbsp;{t}Software information{/t}</h2>
-               <a href='{$plug}&amp;type=1'>Hardware info</a>
        {/if}
 
        {foreach from=$info item=item key=key}