From: hickert Date: Wed, 7 Apr 2010 15:42:34 +0000 (+0000) Subject: Replaced divlist X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=89d4d82b56478cd12fa127fc0176a76aea6e377f;p=gosa.git Replaced divlist git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@17530 594d385d-05f5-0310-b6e9-bd551577e9d8 --- diff --git a/gosa-plugins/opsi/admin/opsiLicenses/class_licenseUsage.inc b/gosa-plugins/opsi/admin/opsiLicenses/class_licenseUsage.inc index c7097fe14..83a283568 100644 --- a/gosa-plugins/opsi/admin/opsiLicenses/class_licenseUsage.inc +++ b/gosa-plugins/opsi/admin/opsiLicenses/class_licenseUsage.inc @@ -45,6 +45,15 @@ class licenseUsage extends plugin // Extract pool name out of the fake dn. $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); } @@ -71,6 +80,11 @@ class licenseUsage extends plugin function execute() { plugin::execute(); + + $ui = get_userinfo(); + $readable = $ui->get_permissions($this->config->current['BASE'], "opsi/licenseUsage",""); + $this->usageList->setAcl($readable); + // Handle initialization failures. if(isset($_POST['retry_init'])) $this->init(); if(!$this->init_successfull){ @@ -80,20 +94,17 @@ class licenseUsage extends plugin } // Create usage list - $list = new divSelectBox("licenseUsage"); - $ui = get_userinfo(); - $readable = $ui->get_permissions($this->config->current['BASE'], "opsi/licenseUsage",""); + $data = array(); if($readable) { 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;'"); - $list->addEntry(array($f1,$f2,$f3,$f4)); + $data[] = array('data'=>array( + $license['hostId'][0], + $license['licenseKey'][0], + $license['licensePoolId'][0], + $license['softwareLicenseId'][0])); } } - + $this->usageList->setListData($data,$data); $smarty = get_smarty(); // Assign ACls @@ -105,7 +116,7 @@ class licenseUsage extends plugin $smarty->assign($attr,$this->$attr); } - $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('licenseUsage.tpl',TRUE,dirname(__FILE__))));