summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 51e287c)
raw | patch | inline | side by side (parent: 51e287c)
author | hickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8> | |
Fri, 5 Sep 2008 08:38:26 +0000 (08:38 +0000) | ||
committer | hickert <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
git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@12367 594d385d-05f5-0310-b6e9-bd551577e9d8
gosa-plugins/opsi/admin/opsi/class_opsiware.inc | patch | blob | history | |
gosa-plugins/opsi/admin/opsi/opsiware.tpl | patch | blob | history |
diff --git a/gosa-plugins/opsi/admin/opsi/class_opsiware.inc b/gosa-plugins/opsi/admin/opsi/class_opsiware.inc
index 5e0caedd8f912918b9791e3344c5a327aec0e23e..75909c44116618699c7a1cc2b11f88eb02d19024 100644 (file)
<?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)
{
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){
$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)
<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'> {t}Hardware information{/t}</h2>
- <a href='{$plug}&type=0'>Software info</a>
{else}
<h2><img class='center' alt='' src='plugins/opsi/images/software_info.png'> {t}Software information{/t}</h2>
- <a href='{$plug}&type=1'>Hardware info</a>
{/if}
{foreach from=$info item=item key=key}