From c229c9964460537bb876c8ffdce318caf61750d9 Mon Sep 17 00:00:00 2001 From: hickert Date: Wed, 23 Sep 2009 13:26:00 +0000 Subject: [PATCH] Updated licenses git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@14333 594d385d-05f5-0310-b6e9-bd551577e9d8 --- .../opsiLicenses/class_licenseByProduct.inc | 2 +- .../opsiLicenses/class_licenseUsageByHost.inc | 19 +++++++++++++++---- .../opsiLicenses/class_opsiLicenseHandler.inc | 5 ----- .../admin/opsiLicenses/licenseUsageByHost.tpl | 6 ++++-- 4 files changed, 20 insertions(+), 12 deletions(-) diff --git a/gosa-plugins/opsi/admin/opsiLicenses/class_licenseByProduct.inc b/gosa-plugins/opsi/admin/opsiLicenses/class_licenseByProduct.inc index b7c2ce5f9..c159e32e5 100644 --- a/gosa-plugins/opsi/admin/opsiLicenses/class_licenseByProduct.inc +++ b/gosa-plugins/opsi/admin/opsiLicenses/class_licenseByProduct.inc @@ -29,7 +29,7 @@ class licenseByProduct extends plugin var $init_successfull = FALSE; - function __construct(&$config,$dn,$a,$b) + function __construct(&$config,$dn) { $this->config = $config; $this->dn = $this->orig_dn = $dn; diff --git a/gosa-plugins/opsi/admin/opsiLicenses/class_licenseUsageByHost.inc b/gosa-plugins/opsi/admin/opsiLicenses/class_licenseUsageByHost.inc index a6ba92f37..83054a7da 100644 --- a/gosa-plugins/opsi/admin/opsiLicenses/class_licenseUsageByHost.inc +++ b/gosa-plugins/opsi/admin/opsiLicenses/class_licenseUsageByHost.inc @@ -79,16 +79,26 @@ class licenseUsageByHost extends plugin // Create usage list $list = new divSelectBox("licenseUsage"); + $list->setHeight(150); foreach($this->licenseUses as $license){ - $f1 = array("string" => $license['hostId'][0]); $f2 = array("string" => $license['licenseKey'][0]); $f3 = array("string" => $license['licensePoolId'][0]); - $f4 = array("string" => $license['softwareLicenseId'][0], - "attach" => "style='border-right:0px;'"); + $f4 = array("string" => $license['softwareLicenseId'][0]); $list->addEntry(array($f1,$f2,$f3,$f4)); } + // Create reserved list + $list2 = new divSelectBox("reservedLicenses"); + $list2->setHeight(150); + foreach($this->licenseUses as $license){ + $f1 = array("string" => $license['hostId'][0]); + $f2 = array("string" => $license['licenseKey'][0]); + $f3 = array("string" => $license['licensePoolId'][0]); + $f4 = array("string" => $license['softwareLicenseId'][0]); + $list2->addEntry(array($f1,$f2,$f3,$f4)); + } + $smarty = get_smarty(); // Assign ACls @@ -101,9 +111,10 @@ class licenseUsageByHost extends plugin } $smarty->assign("licenseUses", $list->DrawList()); + $smarty->assign("licenseReserved", $list2->DrawList()); $smarty->assign("init_successfull", $this->init_successfull); $smarty->assign("initially_was_account", $this->initially_was_account); - return($smarty->fetch(get_template_path('licenseUsage.tpl',TRUE,dirname(__FILE__)))); + return($smarty->fetch(get_template_path('licenseUsageByHost.tpl',TRUE,dirname(__FILE__)))); } diff --git a/gosa-plugins/opsi/admin/opsiLicenses/class_opsiLicenseHandler.inc b/gosa-plugins/opsi/admin/opsiLicenses/class_opsiLicenseHandler.inc index 63e472935..032ade87c 100644 --- a/gosa-plugins/opsi/admin/opsiLicenses/class_opsiLicenseHandler.inc +++ b/gosa-plugins/opsi/admin/opsiLicenses/class_opsiLicenseHandler.inc @@ -303,11 +303,6 @@ class opsiLicenceHandler extends opsi { $data= array(); $data['productId'] = htmlentities($productId); $res = $this->send_data("gosa_opsi_getLicenseInformationForProduct",$this->target,$data,TRUE); - - if(isset($res['XML'][0]['ERROR_OPSI_GETLICENSEINFORMATIONFORPRODUCT'])){ -# $this->set_error($res['XML'][0]['ERROR_OPSI_GETLICENSEINFORMATIONFORPRODUCT']); - return(FALSE); - } if(isset($res['XML'][0]['ANSWER_OPSI_UNASSIGNALLSOFTWARELICENSESFROMHOST'])){ return($res['XML'][0]); } diff --git a/gosa-plugins/opsi/admin/opsiLicenses/licenseUsageByHost.tpl b/gosa-plugins/opsi/admin/opsiLicenses/licenseUsageByHost.tpl index 443d2f4f4..8305a8184 100644 --- a/gosa-plugins/opsi/admin/opsiLicenses/licenseUsageByHost.tpl +++ b/gosa-plugins/opsi/admin/opsiLicenses/licenseUsageByHost.tpl @@ -8,9 +8,11 @@ {else} -

{t}License usage{/t}

- +

{t}Licenses used{/t}

{$licenseUses} +

{t}Licenses reserved for this host{/t}

+{$licenseReserved} + {/if} -- 2.30.2