view->bootisolist = $bootisomapper->fetchAll(); foreach ($this->view->bootisolist as $bootiso){ $bootiso->setGroupID("[".$bootiso->getGroupID()."] ".$groupmapper->find($bootiso->getGroupID())->getTitle()); $bootiso->setMembershipID("[".$bootiso->getMembershipID()."] ".$personmapper->find($membershipmapper->find($bootiso->getMembershipID())->getPersonID())->getFirstname()); } } public function createbootisoAction() { $groupmapper = new Application_Model_GroupMapper(); if (!isset($_POST["createbootiso"])){ $createbootisoForm = new dev_Form_BootisoCreate(array('grouplist' => $groupmapper->fetchAll())); } else { $createbootisoForm = new dev_Form_BootisoCreate(array('grouplist' => $groupmapper->fetchAll()),$_POST); if ($createbootisoForm->isValid($_POST)) { $bootiso = new Application_Model_BootIso($_POST); $bootiso->setMembershipID('1'); $bootisomapper = new Application_Model_BootIsoMapper(); $bootiso->setCreated(time()); try { exec("wget --spider ".$bootiso->getPath_fbgui()." 2>&1 | grep 'Remote file exists.'", $exists_fbgui); if(!array_pop($exists_fbgui)){ $this->view->createbootisoForm = $createbootisoForm; return; } $bootisomapper->save($bootiso); $path_fbgui = "../resources/bootmedium/fbgui/"; exec("wget -P ".$path_fbgui." -N ".$bootiso->getPath_fbgui()); }catch(Zend_Exception $e) { echo "Caught exception: " . get_class($e) . "
"; echo "Message: " . $e->getMessage() . "
"; } $this->_redirect('/dev/bootiso'); } } $this->view->createbootisoForm = $createbootisoForm; } public function editbootisoAction() { $bootisoID = $this->_request->getParam('bootisoID'); $groupmapper = new Application_Model_GroupMapper(); if (!isset($_POST["editbootiso"])){ $bootisoID = $this->_request->getParam('bootisoID'); if (!isset($bootisoID) || !is_numeric($bootisoID)){ $this->_redirect('/dev/bootiso'); } else { $bootiso = new Application_Model_BootIso(); $bootisomapper = new Application_Model_BootIsoMapper(); $bootisomapper->find($bootisoID, $bootiso); $editbootisoForm = new dev_Form_BootisoEdit(array('grouplist' => $groupmapper->fetchAll())); $editbootisoForm->populate($bootiso->toArray()); } }else{ $editbootisoForm = new dev_Form_BootisoEdit(array('grouplist' => $groupmapper->fetchAll()),$_POST); if ($editbootisoForm->isValid($_POST)) { $bootiso = new Application_Model_BootIso($_POST); $bootiso->setMembershipID('1'); $bootisomapper = new Application_Model_BootIsoMapper(); $bootiso->setCreated(time()); $bootiso->setID($bootisoID); try { $bootisomapper->save($bootiso); }catch(Zend_Exception $e) { echo "Caught exception: " . get_class($e) . "
"; echo "Message: " . $e->getMessage() . "
"; } $this->_redirect('/dev/bootiso'); } } $this->view->editbootisoForm = $editbootisoForm; } public function deletebootisoAction() { $bootisoID = $this->_request->getParam('bootisoID'); if (!isset($bootisoID)){ $this->_redirect('/dev/bootiso'); } else { $bootiso = new Application_Model_BootIso(); $bootiso->setID($bootisoID); $bootisomapper = new Application_Model_BootIsoMapper(); $bootisomapper->delete($bootiso); } $this->_redirect('/dev/bootiso'); } }