From: hickert Date: Wed, 7 Apr 2010 16:06:31 +0000 (+0000) Subject: Replaced last 'old style' list in opsiLicenses X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=06fd60ccdfa1f960ece1310f9d74d6992261ffc0;p=gosa.git Replaced last 'old style' list in opsiLicenses git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@17533 594d385d-05f5-0310-b6e9-bd551577e9d8 --- diff --git a/gosa-plugins/opsi/admin/opsiLicenses/class_licenseByProduct.inc b/gosa-plugins/opsi/admin/opsiLicenses/class_licenseByProduct.inc index 4ed7a54e0..860d15a35 100644 --- a/gosa-plugins/opsi/admin/opsiLicenses/class_licenseByProduct.inc +++ b/gosa-plugins/opsi/admin/opsiLicenses/class_licenseByProduct.inc @@ -47,6 +47,15 @@ class licenseByProduct extends plugin } $this->init(); + + // Prepare lists + $this->usageList = new sortableListing(); + $this->usageList->setDeleteable(false); + $this->usageList->setEditable(false); + $this->usageList->setWidth("100%"); + $this->usageList->setHeight("300px"); + $this->usageList->setHeader(array(_("Host"),_("Key"),_("Pool"), _("License"))); + $this->usageList->setDefaultSortColumn(1); } @@ -87,21 +96,22 @@ class licenseByProduct extends plugin $ui = get_userinfo(); $readable = $ui->get_permissions($this->config->current['BASE'], "opsi/licenseByProduct",""); - if($readable) { - foreach($this->licenseUses as $license){ - $f1 = array("string" => $license['HOSTID'][0]['VALUE']); - $f2 = array("string" => $license['SOFTWARELICENSEID'][0]['VALUE']); - $f3 = array("string" => $license['LICENSEPOOLID'][0]['VALUE'], - "attach" => "style='border-right:0px;'"); - $list->addEntry(array($f1,$f2,$f3)); - } + $data = array(); + $this->usageList->setAcl($readable); + foreach($this->licenseUses as $license){ + $data[] = array('data'=> array($license['HOSTID'][0]['VALUE'], + $license['SOFTWARELICENSEID'][0]['VALUE'], + $license['LICENSEPOOLID'][0]['VALUE'])); } + $this->usageList->setListData($data,$data); + $this->usageList->update(); + $smarty = get_smarty(); // Assign ACls $plInfo = $this->plInfo(); - $smarty->assign("licenseUses", $list->DrawList()); + $smarty->assign("licenseUses", $this->usageList->render()); $smarty->assign("init_successfull", $this->init_successfull); $smarty->assign("initially_was_account", $this->initially_was_account); return($smarty->fetch(get_template_path('licenseByProduct.tpl',TRUE,dirname(__FILE__))));