diff options
author | Simon | 2011-03-09 12:20:55 +0100 |
---|---|---|
committer | Simon | 2011-03-09 12:20:55 +0100 |
commit | 1ac1db9336fdfa2f32e775e390a3d9fdaa605c79 (patch) | |
tree | bcb7fc97937b9db314b74903ffed61a1d75506ea | |
parent | oberfläche verändert (diff) | |
parent | ACHTUNG: Habe in einigen Mappern die find() Methode geändert, sie liefern je... (diff) | |
download | pbs2-1ac1db9336fdfa2f32e775e390a3d9fdaa605c79.tar.gz pbs2-1ac1db9336fdfa2f32e775e390a3d9fdaa605c79.tar.xz pbs2-1ac1db9336fdfa2f32e775e390a3d9fdaa605c79.zip |
Merge gefixxt
23 files changed, 351 insertions, 147 deletions
diff --git a/application/controllers/BootisoController.php b/application/controllers/BootisoController.php index 771a48d..c49cdf3 100644 --- a/application/controllers/BootisoController.php +++ b/application/controllers/BootisoController.php @@ -11,13 +11,25 @@ class BootisoController extends Zend_Controller_Action public function indexAction() { $bootisomapper = new Application_Model_BootIsoMapper(); + $groupmapper = new Application_Model_GroupMapper(); + $membershipmapper = new Application_Model_MembershipMapper(); + $personmapper = new Application_Model_PersonMapper(); + $this->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 Application_Form_BootisoCreate(); + $createbootisoForm = new Application_Form_BootisoCreate(array('grouplist' => $groupmapper->fetchAll())); } else { $createbootisoForm = new Application_Form_BootisoCreate($_POST); @@ -47,6 +59,7 @@ class BootisoController extends Zend_Controller_Action public function editbootisoAction() { $bootisoID = $this->_request->getParam('bootisoID'); + $groupmapper = new Application_Model_GroupMapper(); if (!isset($_POST["editbootiso"])){ $bootisoID = $this->_request->getParam('bootisoID'); @@ -57,7 +70,7 @@ class BootisoController extends Zend_Controller_Action $bootisomapper = new Application_Model_BootIsoMapper(); $bootisomapper->find($bootisoID, $bootiso); - $editbootisoForm = new Application_Form_BootisoEdit(); + $editbootisoForm = new Application_Form_BootisoEdit(array('grouplist' => $groupmapper->fetchAll())); $editbootisoForm->populate($bootiso->toArray()); } }else{ diff --git a/application/controllers/BootmenuController.php b/application/controllers/BootmenuController.php index 41cee9d..239aa4f 100644 --- a/application/controllers/BootmenuController.php +++ b/application/controllers/BootmenuController.php @@ -13,13 +13,20 @@ class BootmenuController extends Zend_Controller_Action $bootmenumapper = new Application_Model_BootMenuMapper(); $bootmenuentriesmapper = new Application_Model_BootMenuEntriesMapper(); $bootosmapper = new Application_Model_BootOsMapper(); + $configmapper = new Application_Model_ConfigMapper(); + $membershipmapper = new Application_Model_MembershipMapper(); + $groupmapper = new Application_Model_GroupMapper(); + $personmapper = new Application_Model_PersonMapper(); $this->view->bootosmapper = $bootosmapper; + $this->view->configmapper = $configmapper; $this->view->bootmenulist = $bootmenumapper->fetchAll(); $bootmenuentries = array(); foreach ($this->view->bootmenulist as $bootmenu){ $bootmenuentries[$bootmenu->getID()] = $bootmenuentriesmapper->findBy('bootmenuID',$bootmenu->getID()); + $bootmenu->setGroupID("[".$bootmenu->getGroupID()."] ".$groupmapper->find($bootmenu->getGroupID())->getTitle()); + $bootmenu->setMembershipID("[".$bootmenu->getMembershipID()."] ".$personmapper->find($membershipmapper->find($bootmenu->getMembershipID())->getPersonID())->getFirstname()); } $this->view->bootmenuentrylist = $bootmenuentries; @@ -29,12 +36,13 @@ class BootmenuController extends Zend_Controller_Action { $bootmenuID = $this->_request->getParam('bootmenuID'); $bootosmapper = new Application_Model_BootOsMapper(); + $configmapper = new Application_Model_ConfigMapper(); // $bootmenuentriesmapper = new Application_Model_BootMenuEntriesMapper(); // // $bootoslist = $this->arrayDiff($bootosmapper->fetchAll(), $bootmenuentriesmapper->findBy('bootmenuID',$bootmenuID)); if (!isset($_POST["addbootmenuentry"])){ - $addbootmenuentryForm = new Application_Form_BootmenuEntriesAdd(array('bootoslist'=>$bootosmapper->fetchAll(), 'maxorder'=> $this->_request->getParam('maxorder'))); + $addbootmenuentryForm = new Application_Form_BootmenuEntriesAdd(array('bootoslist'=>$bootosmapper->fetchAll(), 'maxorder'=> $this->_request->getParam('maxorder'), 'configlist'=>$configmapper->fetchAll())); $addbootmenuentryForm->populate(array('order' => $this->_request->getParam('maxorder'))); } else { @@ -69,8 +77,10 @@ class BootmenuController extends Zend_Controller_Action public function createbootmenuAction() { + $groupmapper = new Application_Model_GroupMapper(); + if (!isset($_POST["createbootmenu"])){ - $createbootmenuForm = new Application_Form_BootmenuCreate(); + $createbootmenuForm = new Application_Form_BootmenuCreate(array('grouplist' => $groupmapper->fetchAll())); } else { $createbootmenuForm = new Application_Form_BootmenuCreate($_POST); @@ -100,6 +110,8 @@ class BootmenuController extends Zend_Controller_Action public function editbootmenuAction() { $bootmenuID = $this->_request->getParam('bootmenuID'); + $groupmapper = new Application_Model_GroupMapper(); + if (!isset($_POST["editbootmenu"])){ $bootmenuID = $this->_request->getParam('bootmenuID'); if (!isset($bootmenuID) || !is_numeric($bootmenuID)){ @@ -109,7 +121,7 @@ class BootmenuController extends Zend_Controller_Action $bootmenumapper = new Application_Model_BootMenuMapper(); $bootmenumapper->find($bootmenuID, $bootmenu); - $editbootmenuForm = new Application_Form_BootmenuEdit(); + $editbootmenuForm = new Application_Form_BootmenuEdit(array('grouplist' => $groupmapper->fetchAll())); $editbootmenuForm->populate($bootmenu->toArray()); } }else{ @@ -145,6 +157,7 @@ class BootmenuController extends Zend_Controller_Action $bootmenuentryID = $this->_request->getParam('bootmenuentryID'); $bootmenuID = $this->_request->getParam('bootmenuID'); $bootosmapper = new Application_Model_BootOsMapper(); + $configmapper = new Application_Model_ConfigMapper(); $bootmenuentry = new Application_Model_BootMenuEntries(); $bootmenuentrymapper = new Application_Model_BootMenuEntriesMapper(); @@ -156,7 +169,7 @@ class BootmenuController extends Zend_Controller_Action $bootmenuentrymapper->find($bootmenuentryID, $bootmenuentry); - $editbootmenuentryForm = new Application_Form_BootmenuEntriesEdit(array('bootoslist'=>$bootosmapper->fetchAll(), 'maxorder' => $this->_request->getParam('maxorder'))); + $editbootmenuentryForm = new Application_Form_BootmenuEntriesEdit(array('bootoslist'=>$bootosmapper->fetchAll(), 'maxorder' => $this->_request->getParam('maxorder'), 'configlist'=>$configmapper->fetchAll())); $editbootmenuentryForm->populate($bootmenuentry->toArray()); } }else{ diff --git a/application/controllers/BootosController.php b/application/controllers/BootosController.php index a644a5c..d052503 100644 --- a/application/controllers/BootosController.php +++ b/application/controllers/BootosController.php @@ -11,13 +11,30 @@ class BootosController extends Zend_Controller_Action public function indexAction() { $bootosmapper = new Application_Model_BootOsMapper(); + + $groupmapper = new Application_Model_GroupMapper(); + $membershipmapper = new Application_Model_MembershipMapper(); + $personmapper = new Application_Model_PersonMapper(); + $configmapper = new Application_Model_ConfigMapper(); + $this->view->bootoslist = $bootosmapper->fetchAll(); + + foreach ($this->view->bootoslist as $bootos){ + $bootos->setGroupID("[".$bootos->getGroupID()."] ".$groupmapper->find($bootos->getGroupID())->getTitle()); + $bootos->setMembershipID("[".$bootos->getMembershipID()."] ".$personmapper->find($membershipmapper->find($bootos->getMembershipID())->getPersonID())->getFirstname()); + $bootos->setConfigID("[".$bootos->getConfigID()."] ".$configmapper->find($bootos->getConfigID())->getTitle()); + + } + } public function createbootosAction() { + $groupmapper = new Application_Model_GroupMapper(); + $configmapper = new Application_Model_ConfigMapper(); + if (!isset($_POST["createbootos"])){ - $createbootosForm = new Application_Form_BootosCreate(); + $createbootosForm = new Application_Form_BootosCreate(array('grouplist' => $groupmapper->fetchAll() ,'configlist'=>$configmapper->fetchAll())); } else { $createbootosForm = new Application_Form_BootosCreate($_POST); @@ -49,6 +66,8 @@ class BootosController extends Zend_Controller_Action public function editbootosAction() { $bootosID = $this->_request->getParam('bootosID'); + $groupmapper = new Application_Model_GroupMapper(); + $configmapper = new Application_Model_ConfigMapper(); if (!isset($_POST["editbootos"])){ $bootosID = $this->_request->getParam('bootosID'); @@ -59,7 +78,7 @@ class BootosController extends Zend_Controller_Action $bootosmapper = new Application_Model_BootOsMapper(); $bootos = $bootosmapper->find($bootosID); - $editbootosForm = new Application_Form_BootosEdit(); + $editbootosForm = new Application_Form_BootosEdit(array('grouplist' => $groupmapper->fetchAll() ,'configlist'=>$configmapper->fetchAll())); $editbootosForm->populate($bootos->toArray()); } }else{ diff --git a/application/controllers/ConfigController.php b/application/controllers/ConfigController.php index 461c288..ae2a520 100644 --- a/application/controllers/ConfigController.php +++ b/application/controllers/ConfigController.php @@ -11,13 +11,25 @@ class ConfigController extends Zend_Controller_Action public function indexAction() { $configmapper = new Application_Model_ConfigMapper(); - $this->view->configlist = $configmapper->fetchAll(); + + $groupmapper = new Application_Model_GroupMapper(); + $membershipmapper = new Application_Model_MembershipMapper(); + $personmapper = new Application_Model_PersonMapper(); + + $this->view->configlist = $configmapper->fetchAll(); + + foreach ($this->view->configlist as $config){ + $config->setGroupID("[".$config->getGroupID()."] ".$groupmapper->find($config->getGroupID())->getTitle()); + $config->setMembershipID("[".$config->getMembershipID()."] ".$personmapper->find($membershipmapper->find($config->getMembershipID())->getPersonID())->getFirstname()); + } + } public function createconfigAction() { + $groupmapper = new Application_Model_GroupMapper(); if (!isset($_POST["createconfig"])){ - $createconfigForm = new Application_Form_ConfigCreate(); + $createconfigForm = new Application_Form_ConfigCreate(array('grouplist' => $groupmapper->fetchAll())); } else { $createconfigForm = new Application_Form_ConfigCreate($_POST); @@ -48,7 +60,8 @@ class ConfigController extends Zend_Controller_Action public function editconfigAction() { $configID = $this->_request->getParam('configID'); - + $groupmapper = new Application_Model_GroupMapper(); + if (!isset($_POST["editconfig"])){ $configID = $this->_request->getParam('configID'); if (!isset($configID) || !is_numeric($configID)){ @@ -56,9 +69,9 @@ class ConfigController extends Zend_Controller_Action } else { $config = new Application_Model_Config(); $configmapper = new Application_Model_ConfigMapper(); - $configmapper->find($configID, $config); + $config = $configmapper->find($configID); - $editconfigForm = new Application_Form_ConfigEdit(); + $editconfigForm = new Application_Form_ConfigEdit(array('grouplist' => $groupmapper->fetchAll())); $editconfigForm->populate($config->toArray()); } }else{ diff --git a/application/controllers/FilterController.php b/application/controllers/FilterController.php index 1ebb35e..54bcb19 100644 --- a/application/controllers/FilterController.php +++ b/application/controllers/FilterController.php @@ -7,10 +7,11 @@ class FilterController extends Zend_Controller_Action private $db; public function init() { - try{ - $this->_filtermapper = new Application_Model_FilterMapper(); + try{ + + $this->_filtermapper = new Application_Model_FilterMapper(); }catch (Zend_Exception $e) { - echo "Error message 1: " . $e->getMessage() . "\n"; + echo "Error message 1: " . $e->getMessage() . "\n"; } $this->db = Zend_Db_Table::getDefaultAdapter(); } diff --git a/application/forms/BootisoCreate.php b/application/forms/BootisoCreate.php index 035205d..3d04124 100644 --- a/application/forms/BootisoCreate.php +++ b/application/forms/BootisoCreate.php @@ -3,6 +3,13 @@ class Application_Form_BootisoCreate extends Zend_Form { + private $grouplist; + + public function setGrouplist($grouplist){ + $this->grouplist = $grouplist; + + } + public function init() { $this->setName("BootIsoCreate"); @@ -17,15 +24,16 @@ class Application_Form_BootisoCreate extends Zend_Form 'label' => 'Title:', )); - $this->addElement('text', 'groupID', array( - 'filters' => array('StringTrim'), - 'validators' => array( - array('StringLength', false, array(0, 50)), - ), - 'required' => true, - 'label' => 'GroupID:', - 'value' => '1', - )); + $groupfield = $this->createElement('select','groupID'); + $groupfield ->setLabel('Group:'); + + if(count($this->grouplist)>0){ + foreach($this->grouplist as $group => $g){ + $groupfield->addMultiOption($g->getID(), $g->getTitle()); + } + } + $groupfield->setRegisterInArrayValidator(false); + $this->addElement($groupfield); $this->addElement('text', 'path', array( 'filters' => array('StringTrim'), diff --git a/application/forms/BootisoEdit.php b/application/forms/BootisoEdit.php index 7418a17..174f109 100644 --- a/application/forms/BootisoEdit.php +++ b/application/forms/BootisoEdit.php @@ -2,6 +2,14 @@ class Application_Form_BootisoEdit extends Zend_Form { + + private $grouplist; + + public function setGrouplist($grouplist){ + $this->grouplist = $grouplist; + + } + public function init() { $this->setName("BootIsoEdit"); @@ -16,15 +24,17 @@ class Application_Form_BootisoEdit extends Zend_Form 'label' => 'Title:', )); - $this->addElement('text', 'groupID', array( - 'filters' => array('StringTrim'), - 'validators' => array( - array('StringLength', false, array(0, 50)), - ), - 'required' => true, - 'label' => 'GroupID:', - 'value' => '1', - )); + $groupfield = $this->createElement('select','groupID'); + $groupfield ->setLabel('Group:'); + + if(count($this->grouplist)>0){ + foreach($this->grouplist as $group => $g){ + $groupfield->addMultiOption($g->getID(), $g->getTitle()); + } + } + + $groupfield->setRegisterInArrayValidator(false); + $this->addElement($groupfield); $this->addElement('text', 'path', array( 'filters' => array('StringTrim'), diff --git a/application/forms/BootmenuCreate.php b/application/forms/BootmenuCreate.php index 5b284f5..a6b4272 100644 --- a/application/forms/BootmenuCreate.php +++ b/application/forms/BootmenuCreate.php @@ -2,7 +2,13 @@ class Application_Form_BootmenuCreate extends Zend_Form { - + private $grouplist; + + public function setGrouplist($grouplist){ + $this->grouplist = $grouplist; + + } + public function init() { $this->setName("BootMenuCreate"); @@ -17,15 +23,16 @@ class Application_Form_BootmenuCreate extends Zend_Form 'label' => 'Title:', )); - $this->addElement('text', 'groupID', array( - 'filters' => array('StringTrim'), - 'validators' => array( - array('StringLength', false, array(0, 50)), - ), - 'required' => true, - 'label' => 'GroupID:', - 'value' => '1', - )); + $groupfield = $this->createElement('select','groupID'); + $groupfield ->setLabel('Group:'); + + if(count($this->grouplist)>0){ + foreach($this->grouplist as $group => $g){ + $groupfield->addMultiOption($g->getID(), $g->getTitle()); + } + } + $groupfield->setRegisterInArrayValidator(false); + $this->addElement($groupfield); $this->addElement('submit', 'createbootmenu', array( 'required' => false, diff --git a/application/forms/BootmenuEdit.php b/application/forms/BootmenuEdit.php index a3733bf..0b33643 100644 --- a/application/forms/BootmenuEdit.php +++ b/application/forms/BootmenuEdit.php @@ -3,6 +3,13 @@ class Application_Form_BootmenuEdit extends Zend_Form { + private $grouplist; + + public function setGrouplist($grouplist){ + $this->grouplist = $grouplist; + + } + public function init() { $this->setName("BootMenuEdit"); @@ -17,15 +24,16 @@ class Application_Form_BootmenuEdit extends Zend_Form 'label' => 'Title:', )); - $this->addElement('text', 'groupID', array( - 'filters' => array('StringTrim'), - 'validators' => array( - array('StringLength', false, array(0, 50)), - ), - 'required' => true, - 'label' => 'GroupID:', - 'value' => '1', - )); + $groupfield = $this->createElement('select','groupID'); + $groupfield ->setLabel('Group:'); + + if(count($this->grouplist)>0){ + foreach($this->grouplist as $group => $g){ + $groupfield->addMultiOption($g->getID(), $g->getTitle()); + } + } + $groupfield->setRegisterInArrayValidator(false); + $this->addElement($groupfield); $this->addElement('submit', 'editbootmenu', array( 'required' => false, diff --git a/application/forms/BootmenuEntriesAdd.php b/application/forms/BootmenuEntriesAdd.php index 9caa90f..0f2109e 100644 --- a/application/forms/BootmenuEntriesAdd.php +++ b/application/forms/BootmenuEntriesAdd.php @@ -3,8 +3,25 @@ class Application_Form_BootmenuEntriesAdd extends Zend_Form { private $bootoslist; + private $configlist; private $maxorder; + public function setBootoslist($bootoslist){ + $this->bootoslist = $bootoslist; + + } + + public function setMaxorder($maxorder){ + $this->maxorder = $maxorder; + + } + + public function setConfiglist($configlist){ + $this->configlist = $configlist; + + } + + public function init() { $this->setName("BootMenuEntryAdd"); @@ -30,24 +47,28 @@ class Application_Form_BootmenuEntriesAdd extends Zend_Form $bootosfield->setRegisterInArrayValidator(false); $this->addElement($bootosfield); - $this->addElement('text', 'kcl', array( + $this->addElement('textarea', 'kcl', array( 'filters' => array('StringTrim'), 'validators' => array( array('StringLength', false, array(0, 50)), ), 'required' => true, + 'cols' => 50, + 'rows' => 5, 'label' => 'KCL:', + )); - $this->addElement('text', 'configID', array( - 'filters' => array('StringTrim'), - 'validators' => array( - array('StringLength', false, array(0, 50)), - ), - 'required' => true, - 'label' => 'ConfigID:', - 'value' => '1', - )); + $configfield = $this->createElement('select','configID'); + $configfield ->setLabel('Config:'); + + if(count($this->configlist)>0){ + foreach($this->configlist as $config => $c){ + $configfield->addMultiOption($c->getID(), $c->getTitle()); + } + } + $configfield->setRegisterInArrayValidator(false); + $this->addElement($configfield); $orderfield = $this->createElement('select','order'); $orderfield ->setLabel('Position:'); @@ -70,15 +91,6 @@ class Application_Form_BootmenuEntriesAdd extends Zend_Form } - public function setBootoslist($bootoslist){ - $this->bootoslist = $bootoslist; - - } - - public function setMaxorder($maxorder){ - $this->maxorder = $maxorder; - - } diff --git a/application/forms/BootmenuEntriesEdit.php b/application/forms/BootmenuEntriesEdit.php index 0aa2cdc..7fd97fe 100644 --- a/application/forms/BootmenuEntriesEdit.php +++ b/application/forms/BootmenuEntriesEdit.php @@ -4,6 +4,7 @@ class Application_Form_BootmenuEntriesEdit extends Zend_Form { private $bootoslist; + private $configlist; private $maxorder; public function setBootoslist($bootoslist){ @@ -15,6 +16,11 @@ class Application_Form_BootmenuEntriesEdit extends Zend_Form $this->maxorder = $maxorder; } + + public function setConfiglist($configlist){ + $this->configlist = $configlist; + + } public function init() { @@ -41,24 +47,27 @@ class Application_Form_BootmenuEntriesEdit extends Zend_Form $bootosfield->setRegisterInArrayValidator(false); $this->addElement($bootosfield); - $this->addElement('text', 'kcl', array( + $this->addElement('textarea', 'kcl', array( 'filters' => array('StringTrim'), 'validators' => array( array('StringLength', false, array(0, 50)), ), 'required' => true, + 'cols' => 50, + 'rows' => 5, 'label' => 'KCL:', )); - $this->addElement('text', 'configID', array( - 'filters' => array('StringTrim'), - 'validators' => array( - array('StringLength', false, array(0, 50)), - ), - 'required' => true, - 'label' => 'ConfigID:', - 'value' => '1', - )); + $configfield = $this->createElement('select','configID'); + $configfield ->setLabel('Config:'); + + if(count($this->configlist)>0){ + foreach($this->configlist as $config => $c){ + $configfield->addMultiOption($c->getID(), $c->getTitle()); + } + } + $configfield->setRegisterInArrayValidator(false); + $this->addElement($configfield); $orderfield = $this->createElement('select','order'); $orderfield ->setLabel('Position:'); diff --git a/application/forms/BootosCreate.php b/application/forms/BootosCreate.php index a9648e4..a6d74c6 100644 --- a/application/forms/BootosCreate.php +++ b/application/forms/BootosCreate.php @@ -3,6 +3,19 @@ class Application_Form_BootosCreate extends Zend_Form { + private $grouplist; + private $configlist; + + public function setGrouplist($grouplist){ + $this->grouplist = $grouplist; + + } + + public function setConfiglist($configlist){ + $this->configlist = $configlist; + + } + public function init() { $this->setName("BootOsCreate"); @@ -18,24 +31,27 @@ class Application_Form_BootosCreate extends Zend_Form )); - $this->addElement('text', 'configID', array( - 'filters' => array('StringTrim'), - 'validators' => array( - array('StringLength', false, array(0, 50)), - ), - 'required' => false, - 'label' => 'ConfigID:', - )); + $configfield = $this->createElement('select','configID'); + $configfield ->setLabel('Config:'); + + if(count($this->configlist)>0){ + foreach($this->configlist as $config => $c){ + $configfield->addMultiOption($c->getID(), $c->getTitle()); + } + } + $configfield->setRegisterInArrayValidator(false); + $this->addElement($configfield); - $this->addElement('text', 'groupID', array( - 'filters' => array('StringTrim'), - 'validators' => array( - array('StringLength', false, array(0, 50)), - ), - 'required' => true, - 'label' => 'GroupID:', - 'value' => '1', - )); + $groupfield = $this->createElement('select','groupID'); + $groupfield ->setLabel('Group:'); + + if(count($this->grouplist)>0){ + foreach($this->grouplist as $group => $g){ + $groupfield->addMultiOption($g->getID(), $g->getTitle()); + } + } + $groupfield->setRegisterInArrayValidator(false); + $this->addElement($groupfield); $this->addElement('text', 'path_init', array( 'filters' => array('StringTrim'), @@ -43,6 +59,7 @@ class Application_Form_BootosCreate extends Zend_Form array('StringLength', false, array(0, 50)), ), 'required' => true, + 'size' => 50, 'label' => 'Init-Path:', )); @@ -52,15 +69,18 @@ class Application_Form_BootosCreate extends Zend_Form array('StringLength', false, array(0, 50)), ), 'required' => true, + 'size' => 50, 'label' => 'Kernel-Path:', )); - $this->addElement('text', 'defaultkcl', array( + $this->addElement('textarea', 'defaultkcl', array( 'filters' => array('StringTrim'), 'validators' => array( array('StringLength', false, array(0, 50)), ), 'required' => true, + 'rows' => 5, + 'cols' => 50, 'label' => 'Default-KCL:', )); @@ -70,6 +90,8 @@ class Application_Form_BootosCreate extends Zend_Form array('StringLength', false, array(0, 50)), ), 'required' => false, + 'rows' => 5, + 'cols' => 50, 'label' => 'Description:', )); @@ -93,6 +115,7 @@ class Application_Form_BootosCreate extends Zend_Form ), 'required' => true, 'label' => 'Public-Level:', + 'value' => '0', )); $this->addElement('submit', 'createbootos', array( diff --git a/application/forms/BootosEdit.php b/application/forms/BootosEdit.php index 89edf79..572e712 100644 --- a/application/forms/BootosEdit.php +++ b/application/forms/BootosEdit.php @@ -3,6 +3,19 @@ class Application_Form_BootosEdit extends Zend_Form { + private $grouplist; + private $configlist; + + public function setGrouplist($grouplist){ + $this->grouplist = $grouplist; + + } + + public function setConfiglist($configlist){ + $this->configlist = $configlist; + + } + public function init() { $this->setName("BootOsEdit"); @@ -26,24 +39,27 @@ class Application_Form_BootosEdit extends Zend_Form 'label' => 'Title:', )); - $this->addElement('text', 'configID', array( - 'filters' => array('StringTrim'), - 'validators' => array( - array('StringLength', false, array(0, 50)), - ), - 'required' => false, - 'label' => 'ConfigID:', - )); + $configfield = $this->createElement('select','configID'); + $configfield ->setLabel('Config:'); + + if(count($this->configlist)>0){ + foreach($this->configlist as $config => $c){ + $configfield->addMultiOption($c->getID(), $c->getTitle()); + } + } + $configfield->setRegisterInArrayValidator(false); + $this->addElement($configfield); - $this->addElement('text', 'groupID', array( - 'filters' => array('StringTrim'), - 'validators' => array( - array('StringLength', false, array(0, 50)), - ), - 'required' => true, - 'label' => 'GroupID:', - 'value' => '1', - )); + $groupfield = $this->createElement('select','groupID'); + $groupfield ->setLabel('Group:'); + + if(count($this->grouplist)>0){ + foreach($this->grouplist as $group => $g){ + $groupfield->addMultiOption($g->getID(), $g->getTitle()); + } + } + $groupfield->setRegisterInArrayValidator(false); + $this->addElement($groupfield); $this->addElement('text', 'path_init', array( 'filters' => array('StringTrim'), @@ -51,6 +67,7 @@ class Application_Form_BootosEdit extends Zend_Form array('StringLength', false, array(0, 50)), ), 'required' => true, + 'size' => 50, 'label' => 'Init-Path:', )); @@ -60,15 +77,18 @@ class Application_Form_BootosEdit extends Zend_Form array('StringLength', false, array(0, 50)), ), 'required' => true, + 'size' => 50, 'label' => 'Kernel-Path:', )); - $this->addElement('text', 'defaultkcl', array( + $this->addElement('textarea', 'defaultkcl', array( 'filters' => array('StringTrim'), 'validators' => array( array('StringLength', false, array(0, 50)), ), 'required' => true, + 'rows' => 5, + 'cols' => 50, 'label' => 'Default-KCL:', )); @@ -78,6 +98,8 @@ class Application_Form_BootosEdit extends Zend_Form array('StringLength', false, array(0, 50)), ), 'required' => false, + 'rows' => 5, + 'cols' => 50, 'label' => 'Description:', )); @@ -101,6 +123,7 @@ class Application_Form_BootosEdit extends Zend_Form ), 'required' => true, 'label' => 'Public-Level:', + 'value' => '0', )); $this->addElement('submit', 'editbootos', array( diff --git a/application/forms/ConfigCreate.php b/application/forms/ConfigCreate.php index 705fd62..3aa142c 100644 --- a/application/forms/ConfigCreate.php +++ b/application/forms/ConfigCreate.php @@ -3,6 +3,13 @@ class Application_Form_ConfigCreate extends Zend_Form { + private $grouplist; + + public function setGrouplist($grouplist){ + $this->grouplist = $grouplist; + + } + public function init() { $this->setName("ConfigCreate"); @@ -17,15 +24,17 @@ class Application_Form_ConfigCreate extends Zend_Form 'label' => 'Title:', )); - $this->addElement('text', 'groupID', array( - 'filters' => array('StringTrim'), - 'validators' => array( - array('StringLength', false, array(0, 50)), - ), - 'required' => true, - 'label' => 'GroupID:', - 'value' => '1', - )); + $groupfield = $this->createElement('select','groupID'); + $groupfield ->setLabel('Group:'); + + if(count($this->grouplist)>0){ + foreach($this->grouplist as $group => $g){ + $groupfield->addMultiOption($g->getID(), $g->getTitle()); + } + } + + $groupfield->setRegisterInArrayValidator(false); + $this->addElement($groupfield); $this->addElement('textarea', 'shellscript', array( 'filters' => array('StringTrim'), @@ -33,6 +42,8 @@ class Application_Form_ConfigCreate extends Zend_Form array('StringLength', false, array(0, 50)), ), 'required' => true, + 'rows' => 10, + 'cols' => 70, 'label' => 'Shellscript:', )); diff --git a/application/forms/ConfigEdit.php b/application/forms/ConfigEdit.php index 3883595..53219d9 100644 --- a/application/forms/ConfigEdit.php +++ b/application/forms/ConfigEdit.php @@ -2,6 +2,12 @@ class Application_Form_ConfigEdit extends Zend_Form { + private $grouplist; + + public function setGrouplist($grouplist){ + $this->grouplist = $grouplist; + + } public function init() { @@ -17,15 +23,17 @@ class Application_Form_ConfigEdit extends Zend_Form 'label' => 'Title:', )); - $this->addElement('text', 'groupID', array( - 'filters' => array('StringTrim'), - 'validators' => array( - array('StringLength', false, array(0, 50)), - ), - 'required' => true, - 'label' => 'GroupID:', - 'value' => '1', - )); + $groupfield = $this->createElement('select','groupID'); + $groupfield ->setLabel('Group:'); + + if(count($this->grouplist)>0){ + foreach($this->grouplist as $group => $g){ + $groupfield->addMultiOption($g->getID(), $g->getTitle()); + } + } + + $groupfield->setRegisterInArrayValidator(false); + $this->addElement($groupfield); $this->addElement('textarea', 'shellscript', array( 'filters' => array('StringTrim'), @@ -33,6 +41,8 @@ class Application_Form_ConfigEdit extends Zend_Form array('StringLength', false, array(0, 50)), ), 'required' => true, + 'rows' => 10, + 'cols' => 70, 'label' => 'Shellscript:', )); diff --git a/application/models/ConfigMapper.php b/application/models/ConfigMapper.php index dc2a524..da7a073 100644 --- a/application/models/ConfigMapper.php +++ b/application/models/ConfigMapper.php @@ -66,8 +66,9 @@ class Application_Model_ConfigMapper } } - public function find($id, Application_Model_Config $config) + public function find($id) { + $config = new Application_Model_Config(); $result = $this->getDbTable()->find($id); if (0 == count($result)) { return; @@ -76,6 +77,7 @@ class Application_Model_ConfigMapper $row = $result->current(); $config->setID($row->configID)->setGroupID($row->groupID)->setMembershipID($row->membershipID)->setCreated($row->created)->setShellscript($row->shellscript)->setTitle($row->title); + return $config; } public function fetchAll() diff --git a/application/models/GroupMapper.php b/application/models/GroupMapper.php index f48fc5f..d43b3f1 100644 --- a/application/models/GroupMapper.php +++ b/application/models/GroupMapper.php @@ -66,8 +66,9 @@ class Application_Model_GroupMapper } } - public function find($id, Application_Model_Group $group) + public function find($id) { + $group = new Application_Model_Group(); $result = $this->getDbTable()->find($id); if (0 == count($result)) { return; @@ -76,6 +77,7 @@ class Application_Model_GroupMapper $row = $result->current(); $group->setID($row->groupID)->setTitle($row->title)->setDescription($row->description); + return $group; } public function fetchAll() diff --git a/application/models/MembershipMapper.php b/application/models/MembershipMapper.php index 58fa9d5..2a6e57d 100644 --- a/application/models/MembershipMapper.php +++ b/application/models/MembershipMapper.php @@ -66,8 +66,9 @@ class Application_Model_MembershipMapper } } - public function find($id, Application_Model_Membership $membership) + public function find($id) { + $membership = new Application_Model_Membership(); $result = $this->getDbTable()->find($id); if (0 == count($result)) { return; @@ -76,6 +77,7 @@ class Application_Model_MembershipMapper $row = $result->current(); $membership->setID($row->membershipID)->setGroupID($row->groupID)->setRoleID($row->roleID)->setPersonID($row->personID); + return $membership; } public function fetchAll() diff --git a/application/models/PersonMapper.php b/application/models/PersonMapper.php index 74f7250..038670d 100644 --- a/application/models/PersonMapper.php +++ b/application/models/PersonMapper.php @@ -66,8 +66,9 @@ class Application_Model_PersonMapper } } - public function find($id, Application_Model_Person $person) + public function find($id) { + $person = new Application_Model_Person(); $result = $this->getDbTable()->find($id); if (0 == count($result)) { return; @@ -76,6 +77,7 @@ class Application_Model_PersonMapper $row = $result->current(); $person->setID($row->personID)->setTitle($row->title)->setName($row->name)->setFirstname($row->firstname)->setStreet($row->street)->setHousenumber($row->housenumber)->setCity($row->city)->setPostalcode($row->postalcode)->setLogindate($row->logindate)->setRegisterdate($row->registerdate)->setEmail($row->email)->setLogin($row->login)->setPassword($row->password)->setPasswordSalt($row->password_salt); + return $person; } public function fetchAll() diff --git a/application/views/scripts/bootiso/index.phtml b/application/views/scripts/bootiso/index.phtml index 5b766a6..20de6a1 100644 --- a/application/views/scripts/bootiso/index.phtml +++ b/application/views/scripts/bootiso/index.phtml @@ -15,6 +15,8 @@ <th>Public</th> <th colspan=2>Actions</th> </tr> + <?php if(count($this->bootisolist)==0) + echo "</table> There are no BootISO's entries for the Bootmenuto display." ?> <?php foreach ($this->bootisolist as $bootiso): ?> <tr class=entry> <td><?php echo $this->escape($bootiso->getID()); ?></td> diff --git a/application/views/scripts/bootmenu/index.phtml b/application/views/scripts/bootmenu/index.phtml index 7e3a92e..f54f085 100644 --- a/application/views/scripts/bootmenu/index.phtml +++ b/application/views/scripts/bootmenu/index.phtml @@ -13,6 +13,8 @@ <th>Changed</th> <th colspan=3>Actions</th> </tr> + <?php if(count($this->bootmenulist)==0) + echo "</table> There are no BootMenus to display." ?> <?php foreach ($this->bootmenulist as $bootmenu): ?> <tr class=entry> <td><?php echo $this->escape($bootmenu->getID()); ?></td> @@ -46,29 +48,36 @@ 'default', true) ?>">Add Entry</a></td> </tr> +<<<<<<< HEAD <?php if(count($this->bootmenuentrylist[$bootmenu->getID()]) > 0):?> <tr class=detail> <td></td> <td colspan=7> <table> - <tr> + <tr> + <th></th> + <th>ID</th> <th>Title</th> <!-- <th>BootmenuID</th>--> - <th>BootOSID</th> + <th>BootOS</th> <th>kcl</th> - <th>ConfigID</th> - <th>order</th> + + <th>Config</th> + <th>Position</th> <th colspan=2>Actions</th> + </tr> <?php foreach ($this->bootmenuentrylist[$bootmenu->getID()] as $bootmenuentry): ?> - <tr> + <?php $bootos = $this->bootosmapper->find($bootmenuentry->getBootosID());?> + <?php $config = $this->configmapper->find($bootmenuentry->getConfigID());?> + <tr><td></td> <td><?php echo $this->escape($bootmenuentry->getID()); ?></td> <td><?php echo $this->escape($bootmenuentry->getTitle()); ?></td> <!--<td><?php echo $this->escape($bootmenuentry->getBootmenuID()); ?></td> - --><td><?php echo "[".$this->escape($bootmenuentry->getBootosID()."] ". $this->bootosmapper->find($bootmenuentry->getBootosID())->getTitle()); ?></td> + --><td><?php echo "[".$this->escape($bootmenuentry->getBootosID()."] ". $bootos->getTitle()); ?></td> <td><?php echo $this->escape($bootmenuentry->getkcl()); ?></td> - <td><?php echo $this->escape($bootmenuentry->getConfigID()); ?></td> + <td><?php echo "[".$this->escape($bootmenuentry->getConfigID()."] ". $config->getTitle()); ?></td> <td><?php echo $this->escape($bootmenuentry->getOrder() + 1); ?></td> <td><a href="<?php echo $this->url( array( @@ -100,6 +109,7 @@ + diff --git a/application/views/scripts/bootos/index.phtml b/application/views/scripts/bootos/index.phtml index fd3e8cb..df4f072 100644 --- a/application/views/scripts/bootos/index.phtml +++ b/application/views/scripts/bootos/index.phtml @@ -19,6 +19,8 @@ <th>Public</th> <th colspan=2>Actions</th> </tr> + <?php if(count($this->bootoslist)==0) + echo "</table> There are no BootOs's to display." ?> <?php foreach ($this->bootoslist as $bootos): ?> <tr class=entry> <td><?php echo $this->escape($bootos->getID()); ?></td> diff --git a/application/views/scripts/config/index.phtml b/application/views/scripts/config/index.phtml index 3e220a0..6457d8f 100644 --- a/application/views/scripts/config/index.phtml +++ b/application/views/scripts/config/index.phtml @@ -13,6 +13,8 @@ <th>Changed</th> <th colspan=2>Actions</th> </tr> + <?php if(count($this->configlist)==0) + echo "</table> There are no Config's to display." ?> <?php foreach ($this->configlist as $config): ?> <tr class=entry> <td><?php echo $this->escape($config->getID()); ?></td> |