From 92e1b1b371c5db9aac1aeda7b24f488fcc3091f6 Mon Sep 17 00:00:00 2001 From: hickert Date: Tue, 26 Aug 2008 12:29:49 +0000 Subject: [PATCH] Updated Opsi -Added remove client functionality. -Added some images. -Added action dropt down. Does not work currently. git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@12274 594d385d-05f5-0310-b6e9-bd551577e9d8 --- gosa-plugins/opsi/admin/opsi/class_opsi.inc | 48 ++++++++++++------- .../opsi/admin/opsi/class_opsigeneric.inc | 10 +++- gosa-plugins/opsi/admin/opsi/generic.tpl | 25 ++++++++-- 3 files changed, 61 insertions(+), 22 deletions(-) diff --git a/gosa-plugins/opsi/admin/opsi/class_opsi.inc b/gosa-plugins/opsi/admin/opsi/class_opsi.inc index b0f6bbb12..290f39157 100644 --- a/gosa-plugins/opsi/admin/opsi/class_opsi.inc +++ b/gosa-plugins/opsi/admin/opsi/class_opsi.inc @@ -65,7 +65,6 @@ class opsi extends gosaSupportDaemon function get_hosts_for_system_management() { $res = $this->list_clients(); - $data = array(); foreach($res as $entry){ if(!isset($entry['MAC'][0]['VALUE'])) $entry['MAC'][0]['VALUE'] = ""; @@ -382,15 +381,22 @@ class opsi extends gosaSupportDaemon @param @return */ - public function del_client() + public function del_client($hostId) { - /* -
gosa_opsi_del_client
- GOSA - 00:01:6c:9d:b9:fa - limux-cl-2.intranet.gonicus.de -
- */ + $data = array("hostId" => $hostId); + + /* Check parameter */ + if(empty($hostId)){ + trigger_error("No valid host id given, check parameter 1."); + return; + } + + /* Query SI server */ + $res = $this->send_data("gosa_opsi_del_client",$this->target,$data,TRUE); + if(isset($res['XML'][0]['ITEM'])){ + return($res['XML'][0]['ITEM']); + } + return(array()); } @@ -398,16 +404,22 @@ class opsi extends gosaSupportDaemon @param @return */ - public function job_opsi_install_client() + public function job_opsi_install_client($hostId) { - /* -
job_opsi_install_client
- GOSA - 00:01:6c:9d:b9:fa - limux-cl-2.intranet.gonicus.de - 00:11:25:4b:8c:e5 -
- */ + $data = array("hostId" => $hostId); + + /* Check parameter */ + if(empty($hostId)){ + trigger_error("No valid host id given, check parameter 1."); + return; + } + + /* Query SI server */ + $res = $this->send_data("job_opsi_install_client",$this->target,$data,TRUE); + if(isset($res['XML'][0]['ITEM'])){ + return($res['XML'][0]['ITEM']); + } + return(array()); } } // vim:tabstop=2:expandtab:shiftwidth=2:filetype=php:syntax:ruler: diff --git a/gosa-plugins/opsi/admin/opsi/class_opsigeneric.inc b/gosa-plugins/opsi/admin/opsi/class_opsigeneric.inc index 3b8a11656..98d4676fc 100644 --- a/gosa-plugins/opsi/admin/opsi/class_opsigeneric.inc +++ b/gosa-plugins/opsi/admin/opsi/class_opsigeneric.inc @@ -20,6 +20,7 @@ class opsigeneric extends plugin private $init_failed = FALSE; private $parent_mode = TRUE; + private $is_installed = FALSE; public $mac = ""; public $note = ""; @@ -144,6 +145,7 @@ class opsigeneric extends plugin } $smarty->assign("parent_mode", $this->parent_mode); + $smarty->assign("is_installed", $this->is_installed); $smarty->assign("init_failed",FALSE); $divSLP = new divSelectBox(); $divALP = new divSelectBox(); @@ -264,7 +266,13 @@ class opsigeneric extends plugin } public function remove_from_parent() - {} + { + $this->opsi->del_client($this->hostId); + if($this->opsi->is_error()){ + msg_dialog::display(_("Error"),msgPool::siError($this->opsi->get_error()),ERROR_DIALOG); + return; + } + } public function save_object() diff --git a/gosa-plugins/opsi/admin/opsi/generic.tpl b/gosa-plugins/opsi/admin/opsi/generic.tpl index 918c5f752..a62329a53 100644 --- a/gosa-plugins/opsi/admin/opsi/generic.tpl +++ b/gosa-plugins/opsi/admin/opsi/generic.tpl @@ -1,5 +1,5 @@ -

Opsi host

+

  {t}Opsi host{/t}

{if $init_failed} @@ -54,13 +54,32 @@ -

Installed products

+

  {t}Installed products{/t}

{$divSLP} -

Available products

+

{t}Available products{/t}

{$divALP} + + +

 


+ {if $parent_mode} +

 {t}Action{/t}

+ + + {/if} + + {/if} -- 2.30.2