From 5b34279b4fc78e0cbb2becabd8343f7be0ada545 Mon Sep 17 00:00:00 2001 From: Michael Neves Date: Thu, 26 Jan 2012 19:36:17 +0100 Subject: Bootiso download --- application/modules/user/controllers/BootisoController.php | 6 ++++++ application/modules/user/views/scripts/bootiso/index.phtml | 2 +- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/application/modules/user/controllers/BootisoController.php b/application/modules/user/controllers/BootisoController.php index cec9e8a..344de0e 100644 --- a/application/modules/user/controllers/BootisoController.php +++ b/application/modules/user/controllers/BootisoController.php @@ -85,14 +85,20 @@ class user_BootisoController extends Zend_Controller_Action { } } + $this->view->download = array(); $this->view->bootisolist = array_reverse($this->view->bootisolist); $preboottypeMapper = new Application_Model_PreBootTypeMapper(); + $prebootMapper = new Application_Model_PreBootMapper(); + foreach ($this->view->bootisolist as $bootiso) { $bootiso->setGroupID("[".$bootiso->getGroupID()."] ".$groupMapper->find($bootiso->getGroupID())->getTitle()); $bootiso->setPreBootTypeID($preboottypeMapper->find($bootiso->getPreBootTypeID())->getName()); $bootiso->setCreated(date(Zend_Registry::get('dateformat'), $bootiso->getCreated())); + if($prebootMapper->findBy(array("serialnumber" => $bootiso->getSerialnumber())) != null){ + $this->view->download[$bootiso->getID()] = true; + } if($bootiso->getExpires() == "") { $bootiso->setExpires(0); } diff --git a/application/modules/user/views/scripts/bootiso/index.phtml b/application/modules/user/views/scripts/bootiso/index.phtml index 2e71b18..c46c088 100644 --- a/application/modules/user/views/scripts/bootiso/index.phtml +++ b/application/modules/user/views/scripts/bootiso/index.phtml @@ -38,7 +38,7 @@