diff options
| author | Simon | 2011-03-14 16:09:03 +0100 |
|---|---|---|
| committer | Simon | 2011-03-14 16:09:03 +0100 |
| commit | b5cbdd6b400aa1ec77c9846e9cc8d4257f437e3c (patch) | |
| tree | fcef50ad1ddf831f457d6aecd83e7fdc63297a1c /application/modules/dev/forms | |
| parent | footer bleibt am fensterbottom (diff) | |
| download | pbs2-b5cbdd6b400aa1ec77c9846e9cc8d4257f437e3c.tar.gz pbs2-b5cbdd6b400aa1ec77c9846e9cc8d4257f437e3c.tar.xz pbs2-b5cbdd6b400aa1ec77c9846e9cc8d4257f437e3c.zip | |
Application in 3 Modules gesplittet, Dev = unsere entwicklungsumgebung, user = die weboberfläche fr anwender mit acl etc, fbgui = für die fbgui truppe - links in dev müssen noch angepasst werden
Diffstat (limited to 'application/modules/dev/forms')
26 files changed, 2049 insertions, 0 deletions
diff --git a/application/modules/dev/forms/AuthDelete.php b/application/modules/dev/forms/AuthDelete.php new file mode 100644 index 0000000..4e9c92d --- /dev/null +++ b/application/modules/dev/forms/AuthDelete.php @@ -0,0 +1,28 @@ +<?php + +class Application_Form_AuthDelete extends Zend_Form +{ + + public function init() + { + $this->setName("Delete"); + $this->setMethod('post'); + + $this->addElement('text', 'ID', array( + 'filters' => array('StringTrim'), + 'validators' => array( + array('StringLength', false, array(0, 50)), + ), + 'required' => true, + 'label' => 'ID:', + )); + $this->addElement('submit', 'delete', array( + 'required' => false, + 'ignore' => true, + 'label' => 'Delete', + )); + } + + +} + diff --git a/application/modules/dev/forms/AuthLogin.php b/application/modules/dev/forms/AuthLogin.php new file mode 100644 index 0000000..adffa29 --- /dev/null +++ b/application/modules/dev/forms/AuthLogin.php @@ -0,0 +1,38 @@ +<?php + +class Application_Form_AuthLogin extends Zend_Form +{ + + public function init() + { + $this->setName("Login"); + $this->setMethod('post'); + + $this->addElement('text', 'email', array( + 'filters' => array('StringTrim', 'StringToLower'), + 'validators' => array( + array('StringLength', false, array(0, 50)), + ), + 'required' => true, + 'label' => 'E-Mail:', + )); + + $this->addElement('password', 'password', array( + 'filters' => array('StringTrim'), + 'validators' => array( + array('StringLength', false, array(0, 50)), + ), + 'required' => true, + 'label' => 'Password:', + )); + + $this->addElement('submit', 'login', array( + 'required' => false, + 'ignore' => true, + 'label' => 'Login', + )); + } + + +} + diff --git a/application/modules/dev/forms/AuthRecoverPassword.php b/application/modules/dev/forms/AuthRecoverPassword.php new file mode 100644 index 0000000..fc9478b --- /dev/null +++ b/application/modules/dev/forms/AuthRecoverPassword.php @@ -0,0 +1,28 @@ +<?php + +class Application_Form_AuthRecoverPassword extends Zend_Form +{ + + public function init() + { + $this->setName("RecoverPassword"); + $this->setMethod('post'); + + $this->addElement('text', 'email', array( + 'filters' => array('StringTrim'), + 'validators' => array( + array('StringLength', false, array(0, 30)), + ), + 'required' => true, + 'label' => 'Email:', + )); + $this->addElement('submit', 'recoverPassword', array( + 'required' => false, + 'ignore' => true, + 'label' => 'Recover Password', + )); + } + + +} + diff --git a/application/modules/dev/forms/AuthRegister.php b/application/modules/dev/forms/AuthRegister.php new file mode 100644 index 0000000..ae6e766 --- /dev/null +++ b/application/modules/dev/forms/AuthRegister.php @@ -0,0 +1,105 @@ +<?php + +class Application_Form_AuthRegister extends Zend_Form +{ + + public function init() + { + $this->setName("Register"); + $this->setMethod('post'); + + $this->addElement('text', 'title', array( + 'filters' => array('StringTrim'), + 'validators' => array( + array('StringLength', false, array(0, 50)), + ), + 'required' => true, + 'label' => 'Title:', + )); + + + $this->addElement('text', 'name', array( + 'filters' => array('StringTrim'), + 'validators' => array( + array('StringLength', false, array(0, 50)), + ), + 'required' => true, + 'label' => 'Name:', + )); + + $this->addElement('text', 'firstname', array( + 'filters' => array('StringTrim'), + 'validators' => array( + array('StringLength', false, array(0, 50)), + ), + 'required' => true, + 'label' => 'Firstname:', + )); + + $this->addElement('text', 'street', array( + 'filters' => array('StringTrim'), + 'validators' => array( + array('StringLength', false, array(0, 50)), + ), + 'required' => true, + 'label' => 'Street:', + )); + + $this->addElement('text', 'housenumber', array( + 'filters' => array('StringTrim'), + 'validators' => array( + array('StringLength', false, array(0, 50)), + ), + 'required' => true, + 'label' => 'Housenumber:', + )); + + $this->addElement('text', 'city', array( + 'filters' => array('StringTrim'), + 'validators' => array( + array('StringLength', false, array(0, 50)), + ), + 'required' => true, + 'label' => 'City:', + )); + + $this->addElement('text', 'postalcode', array( + 'filters' => array('StringTrim'), + 'validators' => array( + array('StringLength', false, array(0, 50)), + ), + 'required' => true, + 'label' => 'Postalcode:', + )); + + $this->addElement('text', 'email', array( + 'filters' => array('StringTrim', 'StringToLower'), + 'validators' => array( + array('StringLength', false, array(0, 50)), + ), + 'required' => true, + 'label' => 'Email:', + )); + + $this->addElement('password', 'password', array( + 'filters' => array('StringTrim'), + 'validators' => array( + array('StringLength', false, array(0, 50)), + ), + 'required' => true, + 'label' => 'Password:', + )); + + $this->addElement('submit', 'register', array( + 'required' => false, + 'ignore' => true, + 'label' => 'Register', + )); + + + } + + + +} + diff --git a/application/modules/dev/forms/BootisoCreate.php b/application/modules/dev/forms/BootisoCreate.php new file mode 100644 index 0000000..6efb0c2 --- /dev/null +++ b/application/modules/dev/forms/BootisoCreate.php @@ -0,0 +1,94 @@ +<?php + +class Application_Form_BootisoCreate extends Zend_Form +{ + + private $grouplist; + + public function setGrouplist($grouplist){ + $this->grouplist = $grouplist; + + } + + public function init() + { + $this->setName("BootIsoCreate"); + $this->setMethod('post'); + + $this->addElement('text', 'title', array( + 'filters' => array('StringTrim'), + 'validators' => array( + array('StringLength', false, array(0, 50)), + ), + 'required' => true, + 'label' => 'Title:', + )); + + $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'), + 'validators' => array( + array('StringLength', false, array(0, 50)), + ), + 'required' => true, + 'size' => 50, + 'label' => 'Path:', + )); + + $this->addElement('text', 'serialnumber', array( + 'filters' => array('StringTrim'), + 'validators' => array( + array('StringLength', false, array(0, 50)), + ), + 'required' => true, + 'size' => 50, + 'label' => 'Serialnumber:', + )); + + $date = new DateTime(); + $date->add(new DateInterval('P1Y')); + $this->addElement('text', 'expires', array( + 'filters' => array('StringTrim'), + 'validators' => array( + array('StringLength', false, array(0, 50)), + ), + 'required' => false, + 'label' => 'Expires:', + 'value' => $date->format('Y-m-d'), + )); + + $this->addElement('text', 'public', array( + 'filters' => array('StringTrim'), + 'validators' => array( + array('StringLength', false, array(0, 50)), + ), + 'required' => true, + 'label' => 'Public-Level:', + 'value' => '0' + )); + + $this->addElement('submit', 'createbootiso', array( + 'required' => false, + 'ignore' => true, + 'label' => 'Create BootISO', + )); + + $this->addElement('button', 'Cancel', array( + 'onclick' => 'self.location="/bootiso"' + )); + + } + + +} + diff --git a/application/modules/dev/forms/BootisoEdit.php b/application/modules/dev/forms/BootisoEdit.php new file mode 100644 index 0000000..17c87d6 --- /dev/null +++ b/application/modules/dev/forms/BootisoEdit.php @@ -0,0 +1,92 @@ +<?php + +class Application_Form_BootisoEdit extends Zend_Form +{ + + private $grouplist; + + public function setGrouplist($grouplist){ + $this->grouplist = $grouplist; + + } + + public function init() + { + $this->setName("BootIsoEdit"); + $this->setMethod('post'); + + $this->addElement('text', 'title', array( + 'filters' => array('StringTrim'), + 'validators' => array( + array('StringLength', false, array(0, 50)), + ), + 'required' => true, + 'label' => 'Title:', + )); + + $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'), + 'validators' => array( + array('StringLength', false, array(0, 50)), + ), + 'required' => true, + 'size' => 50, + 'label' => 'Path:', + )); + + $this->addElement('text', 'serialnumber', array( + 'filters' => array('StringTrim'), + 'validators' => array( + array('StringLength', false, array(0, 50)), + ), + 'required' => true, + 'size' => 50, + 'label' => 'Serialnumber:', + )); + + $date = new DateTime(); + $date->add(new DateInterval('P1Y')); + $this->addElement('text', 'expires', array( + 'filters' => array('StringTrim'), + 'validators' => array( + array('StringLength', false, array(0, 50)), + ), + 'required' => false, + 'label' => 'Expires:', + 'value' => $date->format('Y-m-d'), + )); + + $this->addElement('text', 'public', array( + 'filters' => array('StringTrim'), + 'validators' => array( + array('StringLength', false, array(0, 50)), + ), + 'required' => true, + 'label' => 'Public-Level:', + )); + + $this->addElement('submit', 'editbootiso', array( + 'required' => false, + 'ignore' => true, + 'label' => 'Edit BootISO', + )); + + $this->addElement('button', 'Cancel', array( + 'onclick' => 'self.location="/bootiso"' + )); + + } +} + diff --git a/application/modules/dev/forms/BootmenuCreate.php b/application/modules/dev/forms/BootmenuCreate.php new file mode 100644 index 0000000..a6b4272 --- /dev/null +++ b/application/modules/dev/forms/BootmenuCreate.php @@ -0,0 +1,51 @@ +<?php + +class Application_Form_BootmenuCreate extends Zend_Form +{ + private $grouplist; + + public function setGrouplist($grouplist){ + $this->grouplist = $grouplist; + + } + + public function init() + { + $this->setName("BootMenuCreate"); + $this->setMethod('post'); + + $this->addElement('text', 'title', array( + 'filters' => array('StringTrim'), + 'validators' => array( + array('StringLength', false, array(0, 50)), + ), + 'required' => true, + 'label' => 'Title:', + )); + + $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, + 'ignore' => true, + 'label' => 'Create Bootmenu', + )); + + $this->addElement('button', 'Cancel', array( + 'onclick' => 'self.location="/bootmenu"' + )); + + } + + +} + diff --git a/application/modules/dev/forms/BootmenuEdit.php b/application/modules/dev/forms/BootmenuEdit.php new file mode 100644 index 0000000..0b33643 --- /dev/null +++ b/application/modules/dev/forms/BootmenuEdit.php @@ -0,0 +1,51 @@ +<?php + +class Application_Form_BootmenuEdit extends Zend_Form +{ + + private $grouplist; + + public function setGrouplist($grouplist){ + $this->grouplist = $grouplist; + + } + + public function init() + { + $this->setName("BootMenuEdit"); + $this->setMethod('post'); + + $this->addElement('text', 'title', array( + 'filters' => array('StringTrim'), + 'validators' => array( + array('StringLength', false, array(0, 50)), + ), + 'required' => true, + 'label' => 'Title:', + )); + + $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, + 'ignore' => true, + 'label' => 'Edit BootMenu', + )); + + $this->addElement('button', 'Cancel', array( + 'onclick' => 'self.location="/bootmenu"' + )); + + } + +} + diff --git a/application/modules/dev/forms/BootmenuEntriesAdd.php b/application/modules/dev/forms/BootmenuEntriesAdd.php new file mode 100644 index 0000000..6981619 --- /dev/null +++ b/application/modules/dev/forms/BootmenuEntriesAdd.php @@ -0,0 +1,110 @@ +<?php + +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() + { + + if(!isset($_POST['bootosID'])){ + $firstbootos = array_slice($this->bootoslist,0,1); + $_POST['bootosID'] = $firstbootos[0]->getID(); + } + + $this->setName("BootMenuEntryAdd"); + $this->setMethod('post'); + + $this->addElement('text', 'title', array( + 'filters' => array('StringTrim'), + 'validators' => array( + array('StringLength', false, array(0, 50)), + ), + 'required' => true, + 'label' => 'Title:', + )); + + $bootosfield = $this->createElement('select','bootosID'); + $bootosfield ->setLabel('BootOs:'); + $bootosfield->setAttrib('onChange', "document.getElementById('BootMenuEntryAdd').submit();"); + + if(count($this->bootoslist)>0){ + foreach($this->bootoslist as $bootos => $b){ + $bootosfield->addMultiOption($b->getID(), $b->getTitle()); + } + } + $bootosfield->setRegisterInArrayValidator(false); + + $this->addElement($bootosfield); + + $this->addElement('textarea', 'kcl', array( + 'filters' => array('StringTrim'), + 'validators' => array( + array('StringLength', false, array(0, 50)), + ), + 'required' => false, + 'cols' => 50, + 'rows' => 5, + 'label' => 'KCL:', + 'value' => $this->bootoslist[$_POST['bootosID']]->getDefaultkcl() + + )); + + $defaultconfigid = $this->bootoslist[$_POST['bootosID']]->getConfigID(); + $configfield = $this->createElement('select','configID'); + $configfield->setLabel('Config:'); + $configfield->addMultiOption($defaultconfigid, 'default'); + + if(count($this->configlist)>0){ + foreach($this->configlist as $config => $c){ + if($c->getID() != $defaultconfigid) + $configfield->addMultiOption($c->getID(), $c->getTitle()); + } + } + + $configfield->setRegisterInArrayValidator(false); + $this->addElement($configfield); + + $orderfield = $this->createElement('select','order'); + $orderfield ->setLabel('Position:'); + + for ($i = 0; $i <= $this->maxorder; $i++) { + $orderfield->addMultiOption($i, $i+1); + } + $orderfield->setRegisterInArrayValidator(false); + $this->addElement($orderfield); + + $this->addElement('submit', 'addbootmenuentry', array( + 'required' => false, + 'ignore' => true, + 'label' => 'Add Bootmenuentry', + )); + + $this->addElement('button', 'Cancel', array( + 'onclick' => 'self.location="/bootmenu"' + )); + + } + + + + +} + diff --git a/application/modules/dev/forms/BootmenuEntriesEdit.php b/application/modules/dev/forms/BootmenuEntriesEdit.php new file mode 100644 index 0000000..6dc1aab --- /dev/null +++ b/application/modules/dev/forms/BootmenuEntriesEdit.php @@ -0,0 +1,108 @@ +<?php + +class Application_Form_BootmenuEntriesEdit 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() + { + + if(!isset($_POST['bootosID'])){ + $firstbootos = array_slice($this->bootoslist,0,1); + $_POST['bootosID'] = $firstbootos[0]->getID(); + } + + $this->setName("BootMenuEntryAdd"); + $this->setMethod('post'); + + $this->addElement('text', 'title', array( + 'filters' => array('StringTrim'), + 'validators' => array( + array('StringLength', false, array(0, 50)), + ), + 'required' => true, + 'label' => 'Title:', + )); + + $bootosfield = $this->createElement('select','bootosID'); + $bootosfield->setLabel('BootOs:'); + $bootosfield->setAttrib('onChange', "document.getElementById('BootMenuEntryAdd').submit();"); + + + if(count($this->bootoslist)>0){ + foreach($this->bootoslist as $bootos => $b){ + $bootosfield->addMultiOption($b->getID(), $b->getTitle()); + } + } + $bootosfield->setRegisterInArrayValidator(false); + $this->addElement($bootosfield); + + $this->addElement('textarea', 'kcl', array( + 'filters' => array('StringTrim'), + 'validators' => array( + array('StringLength', false, array(0, 50)), + ), + 'required' => false, + 'cols' => 50, + 'rows' => 5, + 'label' => 'KCL:', + 'value' => $this->bootoslist[$_POST['bootosID']]->getDefaultkcl() + )); + + $defaultconfigid = $this->bootoslist[$_POST['bootosID']]->getConfigID(); + $configfield = $this->createElement('select','configID'); + $configfield->setLabel('Config:'); + $configfield->addMultiOption($defaultconfigid, 'default'); + + + if(count($this->configlist)>0){ + foreach($this->configlist as $config => $c){ + if($c->getID() != $defaultconfigid) + $configfield->addMultiOption($c->getID(), $c->getTitle()); + } + } + $configfield->setRegisterInArrayValidator(false); + $this->addElement($configfield); + + $orderfield = $this->createElement('select','order'); + $orderfield ->setLabel('Position:'); + + for ($i = 0; $i < $this->maxorder; $i++) { + $orderfield->addMultiOption($i, $i+1); + } + $orderfield->setRegisterInArrayValidator(false); + $this->addElement($orderfield); + + $this->addElement('submit', 'editbootmenuentry', array( + 'required' => false, + 'ignore' => true, + 'label' => 'Edit Bootmenuentry', + )); + + $this->addElement('button', 'Cancel', array( + 'onclick' => 'self.location="/bootmenu"' + )); + + } + + +} + diff --git a/application/modules/dev/forms/BootosCreate.php b/application/modules/dev/forms/BootosCreate.php new file mode 100644 index 0000000..0377197 --- /dev/null +++ b/application/modules/dev/forms/BootosCreate.php @@ -0,0 +1,135 @@ +<?php + +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"); + $this->setMethod('post'); + + $this->addElement('text', 'title', array( + 'filters' => array('StringTrim'), + 'validators' => array( + array('StringLength', false, array(0, 50)), + ), + 'required' => true, + 'label' => 'Title:', + )); + + + $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); + + $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'), + 'validators' => array( + array('StringLength', false, array(0, 250)), + ), + 'required' => true, + 'size' => 50, + 'label' => 'Init-Path:', + )); + + $this->addElement('text', 'path_kernel', array( + 'filters' => array('StringTrim'), + 'validators' => array( + array('StringLength', false, array(0, 250)), + ), + 'required' => true, + 'size' => 50, + 'label' => 'Kernel-Path:', + )); + + $this->addElement('textarea', 'defaultkcl', array( + 'filters' => array('StringTrim'), + 'validators' => array( + array('StringLength', false, array(0, 50)), + ), + 'required' => false, + 'rows' => 5, + 'cols' => 50, + 'label' => 'Default-KCL:', + )); + + $this->addElement('textarea', 'description', array( + 'filters' => array('StringTrim'), + 'validators' => array( + array('StringLength', false, array(0, 50)), + ), + 'required' => false, + 'rows' => 5, + 'cols' => 50, + 'label' => 'Description:', + )); + + $date = new DateTime(); + $date->add(new DateInterval('P1Y')); + $this->addElement('text', 'expires', array( + 'filters' => array('StringTrim'), + 'validators' => array( + array('StringLength', false, array(0, 50)), + ), + 'required' => false, + 'label' => 'Expires:', + 'value' => $date->format('Y-m-d'), + )); + + + $this->addElement('text', 'public', array( + 'filters' => array('StringTrim'), + 'validators' => array( + array('StringLength', false, array(0, 50)), + ), + 'required' => true, + 'label' => 'Public-Level:', + 'value' => '0', + )); + + $this->addElement('submit', 'createbootos', array( + 'required' => false, + 'ignore' => true, + 'label' => 'Create BootOS', + )); + + $this->addElement('button', 'Cancel', array( + 'onclick' => 'self.location="/bootos"' + )); + + } + + +} + diff --git a/application/modules/dev/forms/BootosEdit.php b/application/modules/dev/forms/BootosEdit.php new file mode 100644 index 0000000..641429d --- /dev/null +++ b/application/modules/dev/forms/BootosEdit.php @@ -0,0 +1,145 @@ +<?php + +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"); + $this->setMethod('post'); + + $this->addElement('text', 'title', array( + 'filters' => array('StringTrim'), + 'validators' => array( + array('StringLength', false, array(0, 50)), + ), + 'required' => true, + 'label' => 'Title:', + )); + + $this->addElement('text', 'title', array( + 'filters' => array('StringTrim'), + 'validators' => array( + array('StringLength', false, array(0, 50)), + ), + 'required' => true, + 'label' => 'Title:', + )); + + $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); + + $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'), + 'validators' => array( + array('StringLength', false, array(0, 50)), + ), + 'required' => true, + 'size' => 50, + 'label' => 'Init-Path:', + )); + + $this->addElement('text', 'path_kernel', array( + 'filters' => array('StringTrim'), + 'validators' => array( + array('StringLength', false, array(0, 50)), + ), + 'required' => true, + 'size' => 50, + 'label' => 'Kernel-Path:', + )); + + $this->addElement('textarea', 'defaultkcl', array( + 'filters' => array('StringTrim'), + 'validators' => array( + array('StringLength', false, array(0, 50)), + ), + 'required' => false, + 'rows' => 5, + 'cols' => 50, + 'label' => 'Default-KCL:', + )); + + $this->addElement('textarea', 'description', array( + 'filters' => array('StringTrim'), + 'validators' => array( + array('StringLength', false, array(0, 50)), + ), + 'required' => false, + 'rows' => 5, + 'cols' => 50, + 'label' => 'Description:', + )); + + $date = new DateTime(); + $date->add(new DateInterval('P1Y')); + $this->addElement('text', 'expires', array( + 'filters' => array('StringTrim'), + 'validators' => array( + array('StringLength', false, array(0, 50)), + ), + 'required' => false, + 'label' => 'Expires:', + 'value' => $date->format('Y-m-d'), + )); + + + $this->addElement('text', 'public', array( + 'filters' => array('StringTrim'), + 'validators' => array( + array('StringLength', false, array(0, 50)), + ), + 'required' => true, + 'label' => 'Public-Level:', + 'value' => '0', + )); + + $this->addElement('submit', 'editbootos', array( + 'required' => false, + 'ignore' => true, + 'label' => 'Edit BootOS', + )); + + $this->addElement('button', 'Cancel', array( + 'onclick' => 'self.location="/bootos"' + )); + + } + + +} + + + diff --git a/application/modules/dev/forms/Client.php b/application/modules/dev/forms/Client.php new file mode 100644 index 0000000..83df97e --- /dev/null +++ b/application/modules/dev/forms/Client.php @@ -0,0 +1,45 @@ +<?php + +class Application_Form_Client extends Zend_Form +{ + + public function init() + { + $this->setName("pool"); + $this->setMethod('post'); + + $this->addElement('text', 'macadress', array( + 'filters' => array('StringTrim'), + 'validators' => array( + array('StringLength', false, array(0, 50)), + ), + 'required' => true, + 'label' => 'MacAdress:', + )); + $this->addElement('text', 'hardwarehash', array( + 'filters' => array('StringTrim'), + 'validators' => array( + array('StringLength', false, array(0, 50)), + ), + 'required' => true, + 'label' => 'Hardwarehash:', + )); + + $this->addElement('submit', 'add', array( + 'required' => false, + 'ignore' => true, + 'label' => $this->buttontext, + )); + + $this->addElement('button', 'Cancel', array( + 'onclick' => 'self.location="/client"' + )); + } + private $buttontext = 'Save'; + function setButtontext($v){ + $this->buttontext = $v; + } + + +} + diff --git a/application/modules/dev/forms/ConfigCreate.php b/application/modules/dev/forms/ConfigCreate.php new file mode 100644 index 0000000..3aa142c --- /dev/null +++ b/application/modules/dev/forms/ConfigCreate.php @@ -0,0 +1,63 @@ +<?php + +class Application_Form_ConfigCreate extends Zend_Form +{ + + private $grouplist; + + public function setGrouplist($grouplist){ + $this->grouplist = $grouplist; + + } + + public function init() + { + $this->setName("ConfigCreate"); + $this->setMethod('post'); + + $this->addElement('text', 'title', array( + 'filters' => array('StringTrim'), + 'validators' => array( + array('StringLength', false, array(0, 50)), + ), + 'required' => true, + 'label' => 'Title:', + )); + + $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'), + 'validators' => array( + array('StringLength', false, array(0, 50)), + ), + 'required' => true, + 'rows' => 10, + 'cols' => 70, + 'label' => 'Shellscript:', + )); + + $this->addElement('submit', 'createconfig', array( + 'required' => false, + 'ignore' => true, + 'label' => 'Create Config', + )); + + $this->addElement('button', 'Cancel', array( + 'onclick' => 'self.location="/config"' + )); + + } + +} + diff --git a/application/modules/dev/forms/ConfigEdit.php b/application/modules/dev/forms/ConfigEdit.php new file mode 100644 index 0000000..53219d9 --- /dev/null +++ b/application/modules/dev/forms/ConfigEdit.php @@ -0,0 +1,62 @@ +<?php + +class Application_Form_ConfigEdit extends Zend_Form +{ + private $grouplist; + + public function setGrouplist($grouplist){ + $this->grouplist = $grouplist; + + } + + public function init() + { + $this->setName("ConfigEdit"); + $this->setMethod('post'); + + $this->addElement('text', 'title', array( + 'filters' => array('StringTrim'), + 'validators' => array( + array('StringLength', false, array(0, 50)), + ), + 'required' => true, + 'label' => 'Title:', + )); + + $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'), + 'validators' => array( + array('StringLength', false, array(0, 50)), + ), + 'required' => true, + 'rows' => 10, + 'cols' => 70, + 'label' => 'Shellscript:', + )); + + $this->addElement('submit', 'editconfig', array( + 'required' => false, + 'ignore' => true, + 'label' => 'Edit Config', + )); + + $this->addElement('button', 'Cancel', array( + 'onclick' => 'self.location="/config"' + )); + + } + +} + diff --git a/application/modules/dev/forms/FilterAdd.php b/application/modules/dev/forms/FilterAdd.php new file mode 100644 index 0000000..b720089 --- /dev/null +++ b/application/modules/dev/forms/FilterAdd.php @@ -0,0 +1,65 @@ +<?php + +class Application_Form_FilterAdd extends Zend_Form +{ + private $bootmenus; + + public function init() + { + $this->setName("Add Filter"); + $this->setMethod('post'); + + $this->addElement('text', 'title', array( + 'filters' => array('StringTrim'), + 'validators' => array( + array('StringLength', false, array(0, 50)), + ), + 'required' => true, + 'label' => 'Title:', + )); + $this->addElement('textarea', 'description', array( + 'filters' => array('StringTrim'), + 'required' => false, + 'label' => 'Description:', + )); + + $bootmenufield = $this->createElement('select','bootmenuID'); + $bootmenufield ->setLabel('Bootmenu:'); + + if(count($this->bootmenus)>0){ + foreach($this->bootmenus as $id => $g){ + $bootmenufield->addMultiOption($g->getID(), $g->getTitle()); + } + } + $bootmenufield->setRegisterInArrayValidator(false); + $this->addElement($bootmenufield); + + $this->addElement('text', 'priority', array( + 'filters' => array('StringTrim'), + 'validators' => array( + array('StringLength', false, array(0, 50)), + ), + 'required' => true, + 'label' => 'Priority:', + )); + $this->addElement('submit', 'add', array( + 'required' => false, + 'ignore' => true, + 'label' => $this->buttontext, + )); + + $this->addElement('button', 'Cancel', array( + 'onclick' => 'self.location="/filter"' + )); + } + function setBootmenus($val){ + $this->bootmenus = $val; + return; + } + private $buttontext = 'Save'; + function setButtontext($v){ + $this->buttontext = $v; + } + +} + diff --git a/application/modules/dev/forms/FilterEntriesAdd.php b/application/modules/dev/forms/FilterEntriesAdd.php new file mode 100644 index 0000000..9f9c642 --- /dev/null +++ b/application/modules/dev/forms/FilterEntriesAdd.php @@ -0,0 +1,145 @@ +<?php + +class Application_Form_FilterEntriesAdd extends Zend_Form +{ + private $filterID = 0; + + public function init() + { + $this->setName("Add Filterentry"); + $this->setMethod('post'); + $this->setAttrib('id','filterentryform'); + #print_a($this->data); + + try{ + $filtertypemapper = new Application_Model_FilterTypeMapper(); + $filtertype = $filtertypemapper->fetchAll(); + + $filtertypes = $this->createElement('select','filtertypeID'); + $filtertypes ->setLabel('Type:'); + $filtertypes ->setAttrib('id','filtertype'); + $filtertypes->addMultiOption('',''); + foreach($filtertype as $f){ + $filtertypes->addMultiOption($f->getID(),$f->getFiltertypename()); + } + $filterentry = $filtertypes->getMultiOption($this->data['filtertypeID']); + $filterentryID = $this->data['filtertypeID']; + }catch (Zend_Exception $e) { + echo "Error message 1: " . $e->getMessage() . "\n"; + } + switch($filterentryID){ + default: + $desc = "Select the filtertype"; + $label1 = 'Value 1:'; + $label2 = 'Value 2:'; + break; + case "1": + $desc = "You can set one IP or an IP-Range"; + $label1 = 'Start:'; + $label2 = 'End:'; + break; + case "2": + $desc = "You can set one Mac-Adress or an Mac-Range"; + $label1 = 'Start:'; + $label2 = 'End:'; + break; + case "3": + $desc = "Select your Pool"; + $label1 = 'PoolID:'; + break; + case "4": + $desc = "Select your BootIso"; + $label1 = 'BootIsoID:'; + break; + case "5": + $desc = "Select a Membership"; + $label1 = 'Membership:'; + break; + case "6": + $desc = "Select a Group"; + $label1 = 'Group:'; + break; + case "7": + $desc = "Specify a time-range"; + $label1 = 'Start:'; + $label2 = 'End:'; + break; + case "8": + $desc = "Select a Client"; + $label1 = 'Client:'; + break; + case "9": + $desc = "Define a Hardwarehash"; + $label1 = 'Hardwarehash:'; + break; + case "10": + $desc = "Specify the Weekday (Monday:1, Tuesday:2 ... Sunday:7) or a range"; + $label1 = 'Start Day:'; + $label2 = 'End Day:'; + break; + case "11": + $desc = "Specify the date or a day range of the filter"; + $label1 = 'Start Date:'; + $label2 = 'End Date:'; + break; + } + $filtertypes->setDescription($desc); + $this->addElement($filtertypes); + + $this->addElement('text', 'filtervalue', array( + 'label' => $label1, + 'id' => 'val1' + )); + + if(!in_array($filterentryID,array(3,4,5,6,8,9))){ + $this->addElement('text', 'filtervalue2', array( + 'label' => $label2, + 'id' => 'val2' + )); + } + + $this->addElement('submit', 'add', array( + 'required' => false, + 'ignore' => true, + 'label' => $this->buttontext, + )); + + $this->addElement('button', 'Cancel', array( + 'onclick' => 'self.location="/filter"' + )); + + $this->addElement('hidden', 'filterID', array( + 'value' => $this->filterID + )); + + + } + + private $buttontext = 'Save'; + function setButtontext($v){ + $this->buttontext = $v; + } + private $data ; + function setData($v){ + $this->data = $v; + } + function setFilterID($v){ + $this->filterID = $v; + } +} + +?> +<script> + $('#filtertype').change(function(){ + //alert($("#filtertype option:selected").val()); + $('#filterentryform').submit(); + }); + $('#val1').focusout(function(){ + if($("#filtertype option:selected").val() == 1 && $('#val2').val() == ""){ + $('#val2').val($('#val1').val()); + } + if($("#filtertype option:selected").val() == 2 && $('#val2').val() == ""){ + $('#val2').val($('#val1').val()); + } + }); +</script> diff --git a/application/modules/dev/forms/FilterEvaluate.php b/application/modules/dev/forms/FilterEvaluate.php new file mode 100644 index 0000000..b7c2b51 --- /dev/null +++ b/application/modules/dev/forms/FilterEvaluate.php @@ -0,0 +1,130 @@ +<?php + +class Application_Form_FilterEvaluate extends Zend_Form +{ + private $pools; + private $bootisos; + private $memberships; + private $groups; + private $clients; + + public function init() + { + $this->setName("Test Filter"); + $this->setMethod('post'); + $this->setAction('/filter/evaluate'); + + $this->addElement('text', 'ip', array( + 'filters' => array('StringTrim'), + 'validators' => array( + array('StringLength', false, array(0, 50)), + ), + 'required' => false, + 'label' => 'IP:', + )); + ###################################### + $this->addElement('text', 'mac', array( + 'filters' => array('StringTrim'), + 'validators' => array( + array('StringLength', false, array(0, 50)), + ), + 'required' => false, + 'label' => 'Mac:', + )); + ###################################### + $poolfield = $this->createElement('select','poolID'); + $poolfield ->setLabel('Pool:'); + $poolfield->addMultiOption('',''); + if(count($this->pools)>0){ + foreach($this->pools as $id => $g){ + $poolfield->addMultiOption($g->getID(), $g->getTitle()); + } + } + $poolfield->setRegisterInArrayValidator(false); + $this->addElement($poolfield); + ###################################### + $bootisofield = $this->createElement('select','bootisoID'); + $bootisofield ->setLabel('BootIso:'); + $bootisofield->addMultiOption('',''); + if(count($this->bootisos)>0){ + foreach($this->bootisos as $id => $g){ + $bootisofield->addMultiOption($g->getID(), $g->getTitle()); + } + } + $bootisofield->setRegisterInArrayValidator(false); + $this->addElement($bootisofield); + ###################################### + $membershipfield = $this->createElement('select','membershipID'); + $membershipfield ->setLabel('Membership:'); + $membershipfield->addMultiOption('',''); + if(count($this->memberships)>0){ + foreach($this->memberships as $id => $g){ + $membershipfield->addMultiOption($g->getID(), $g->getPersonID()); + } + } + $membershipfield->setRegisterInArrayValidator(false); + $this->addElement($membershipfield); + ###################################### + $groupfield = $this->createElement('select','groupID'); + $groupfield ->setLabel('Group:'); + $groupfield->addMultiOption('',''); + if(count($this->groups)>0){ + foreach($this->groups as $id => $g){ + $groupfield->addMultiOption($g->getID(), $g->getTitle()); + } + } + $groupfield->setRegisterInArrayValidator(false); + $this->addElement($groupfield); + ###################################### + $this->addElement('text', 'time', array( + 'filters' => array('StringTrim'), + 'validators' => array( + array('StringLength', false, array(0, 50)), + ), + 'required' => false, + 'label' => 'Time:', + )); + ###################################### + $clientfield = $this->createElement('select','clientID'); + $clientfield ->setLabel('Client:'); + $clientfield->addMultiOption('',''); + if(count($this->clients)>0){ + foreach($this->clients as $id => $g){ + $clientfield->addMultiOption($g->getID(), $g->getID() . " - " . $g->getMacadress()); + } + } + $clientfield->setRegisterInArrayValidator(false); + $this->addElement($clientfield); + ###################################### + $this->addElement('text', 'hardwarehash', array( + 'filters' => array('StringTrim'), + 'validators' => array( + array('StringLength', false, array(0, 50)), + ), + 'required' => false, + 'label' => 'Hardwarehash:', + )); + + $this->addElement('submit', 'submit', array( + 'required' => false, + 'ignore' => true, + 'label' => 'Get It On!', + )); + } + function setPools($v){ + $this->pools = $v; + } + function setBootisos($v){ + $this->bootisos = $v; + } + function setMemberships($v){ + $this->memberships = $v; + } + function setGroups($v){ + $this->groups = $v; + } + function setClients($v){ + $this->clients = $v; + } +} + diff --git a/application/modules/dev/forms/GroupAdd.php b/application/modules/dev/forms/GroupAdd.php new file mode 100644 index 0000000..7df3af5 --- /dev/null +++ b/application/modules/dev/forms/GroupAdd.php @@ -0,0 +1,65 @@ +<?php + +class Application_Form_GroupAdd extends Zend_Form +{ + private $grouplist; + + public function setGrouplist($grouplist){ + $this->grouplist = $grouplist; + + } + + + public function init() + { + $this->setName("GroupAdd"); + $this->setMethod('post'); + + $this->addElement('text', 'title', array( + 'filters' => array('StringTrim'), + 'validators' => array( + array('StringLength', false, array(0, 50)), + ), + 'required' => true, + 'label' => 'Title:', + )); + + $this->addElement('text', 'description', array( + 'filters' => array('StringTrim'), + 'validators' => array( + array('StringLength', false, array(0, 140)), + ), + 'required' => false, + 'label' => 'Description:', + )); + + $groupfield = $this->createElement('select','superordinatedGroupID'); + $groupfield ->setLabel('superordinated Group:'); + + $groupfield->addMultiOption('-1', '---- none ----'); + + 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', 'add', array( + 'required' => false, + 'ignore' => true, + 'label' => 'Add', + )); + + $this->addElement('button', 'cancel', array( + 'required' => false, + 'ignore' => true, + 'label' => 'Cancel', + 'onclick' => 'location.href="/group/show"', + )); + } + + +} + diff --git a/application/modules/dev/forms/GroupEdit.php b/application/modules/dev/forms/GroupEdit.php new file mode 100644 index 0000000..ef38d83 --- /dev/null +++ b/application/modules/dev/forms/GroupEdit.php @@ -0,0 +1,52 @@ +<?php + +class Application_Form_GroupEdit extends Zend_Form +{ + + + public function init() + { + $this->setName("GroupEdit"); + $this->setMethod('post'); + + $this->addElement('text', 'title', array( + 'filters' => array('StringTrim'), + 'validators' => array( + array('StringLength', false, array(0, 50)), + ), + 'required' => true, + 'label' => 'Title:', + 'value' => $_POST['title'], + )); + + $this->addElement('text', 'description', array( + 'filters' => array('StringTrim'), + 'validators' => array( + array('StringLength', false, array(0, 140)), + ), + 'required' => false, + 'label' => 'Description:', + 'value' => $_POST['description'], + )); + + $this->addElement('hidden', 'groupID', array( + 'value' => $_POST['groupID'], + )); + + $this->addElement('submit', 'save', array( + 'required' => false, + 'ignore' => true, + 'label' => 'Save', + )); + + $this->addElement('button', 'cancel', array( + 'required' => false, + 'ignore' => true, + 'label' => 'Cancel', + 'onclick' => 'location.href="/group/show"', + )); + } + + +} + diff --git a/application/modules/dev/forms/GroupLink.php b/application/modules/dev/forms/GroupLink.php new file mode 100644 index 0000000..231c4a7 --- /dev/null +++ b/application/modules/dev/forms/GroupLink.php @@ -0,0 +1,55 @@ +<?php + +class Application_Form_GroupLink extends Zend_Form +{ + private $grouplist; + + public function setGrouplist($grouplist){ + $this->grouplist = $grouplist; + + } + + public function init() + { + $this->setName("GroupLink"); + $this->setMethod('post'); + + $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); + + $groupfield1 = $this->createElement('select','superordinatedGroupID'); + $groupfield1 ->setLabel('superordinated Group:'); + + if(count($this->grouplist)>0){ + foreach($this->grouplist as $group => $g){ + $groupfield1->addMultiOption($g->getID(), $g->getTitle()); + } + } + $groupfield1->setRegisterInArrayValidator(false); + $this->addElement($groupfield1); + + $this->addElement('submit', 'link', array( + 'required' => false, + 'ignore' => true, + 'label' => 'Link', + )); + + $this->addElement('button', 'cancel', array( + 'required' => false, + 'ignore' => true, + 'label' => 'Cancel', + 'onclick' => 'location.href="/group/show"', + )); + } + + +} + diff --git a/application/modules/dev/forms/GroupRequest.php b/application/modules/dev/forms/GroupRequest.php new file mode 100644 index 0000000..ec717de --- /dev/null +++ b/application/modules/dev/forms/GroupRequest.php @@ -0,0 +1,42 @@ +<?php + +class Application_Form_GroupRequest extends Zend_Form +{ + private $grouplist; + + public function setGrouplist($grouplist){ + $this->grouplist = $grouplist; + + } + + public function getGrouplist(){ + return $this->grouplist; + } + + public function init() + { + $this->setName("GroupRequest"); + $this->setMethod('post'); + + $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', 'request', array( + 'required' => false, + 'ignore' => true, + 'label' => 'Request Membership', + )); + + } + +} + diff --git a/application/modules/dev/forms/PersonEdit.php b/application/modules/dev/forms/PersonEdit.php new file mode 100644 index 0000000..664daac --- /dev/null +++ b/application/modules/dev/forms/PersonEdit.php @@ -0,0 +1,117 @@ +<?php + +class Application_Form_PersonEdit extends Zend_Form +{ + + public function init() + { + $this->setName("PersonEdit"); + $this->setMethod('post'); + + $this->addElement('text', 'title', array( + 'filters' => array('StringTrim'), + 'validators' => array( + array('StringLength', false, array(0, 50)), + ), + 'required' => true, + 'label' => 'Title:', + 'value' => $this->getView()->person->getTitle(), + )); + + + $this->addElement('text', 'name', array( + 'filters' => array('StringTrim'), + 'validators' => array( + array('StringLength', false, array(0, 50)), + ), + 'required' => true, + 'label' => 'Name:', + 'value' => $this->getView()->person->getName(), + )); + + $this->addElement('text', 'firstname', array( + 'filters' => array('StringTrim'), + 'validators' => array( + array('StringLength', false, array(0, 50)), + ), + 'required' => true, + 'label' => 'Firstname:', + 'value' => $this->getView()->person->getFirstname(), + )); + + $this->addElement('text', 'street', array( + 'filters' => array('StringTrim'), + 'validators' => array( + array('StringLength', false, array(0, 50)), + ), + 'required' => true, + 'label' => 'Street:', + 'value' => $this->getView()->person->getStreet(), + )); + + $this->addElement('text', 'housenumber', array( + 'filters' => array('StringTrim'), + 'validators' => array( + array('StringLength', false, array(0, 50)), + ), + 'required' => true, + 'label' => 'Housenumber:', + 'value' => $this->getView()->person->getHousenumber(), + )); + + $this->addElement('text', 'city', array( + 'filters' => array('StringTrim'), + 'validators' => array( + array('StringLength', false, array(0, 50)), + ), + 'required' => true, + 'label' => 'City:', + 'value' => $this->getView()->person->getCity(), + )); + + $this->addElement('text', 'postalcode', array( + 'filters' => array('StringTrim'), + 'validators' => array( + array('StringLength', false, array(0, 50)), + ), + 'required' => true, + 'label' => 'Postalcode:', + 'value' => $this->getView()->person->getPostalcode(), + )); + + $this->addElement('text', 'email', array( + 'filters' => array('StringTrim', 'StringToLower'), + 'validators' => array( + array('StringLength', false, array(0, 50)), + ), + 'required' => true, + 'label' => 'Email:', + 'value' => $this->getView()->person->getEmail(), + )); + + $this->addElement('password', 'newpassword', array( + 'filters' => array('StringTrim'), + 'validators' => array( + array('StringLength', false, array(0, 50)), + ), + 'required' => false, + 'label' => 'Neues Password:', + )); + + $this->addElement('submit', 'save', array( + 'required' => false, + 'ignore' => true, + 'label' => 'Save', + )); + + $this->addElement('button', 'cancel', array( + 'required' => false, + 'ignore' => true, + 'label' => 'Cancel', + 'onclick' => 'location.href="/person/show"', + )); + } + + +} + diff --git a/application/modules/dev/forms/Pool.php b/application/modules/dev/forms/Pool.php new file mode 100644 index 0000000..be30444 --- /dev/null +++ b/application/modules/dev/forms/Pool.php @@ -0,0 +1,52 @@ +<?php + +class Application_Form_Pool extends Zend_Form +{ + + public function init() + { + $this->setName("pool"); + $this->setMethod('post'); + + $this->addElement('text', 'title', array( + 'filters' => array('StringTrim'), + 'validators' => array( + array('StringLength', false, array(0, 50)), + ), + 'required' => true, + 'label' => 'Title:', + )); + $this->addElement('textarea', 'description', array( + 'filters' => array('StringTrim'), + 'required' => false, + 'label' => 'Description:', + )); + // TODO: Add target of Filter + + $this->addElement('text', 'location', array( + 'filters' => array('StringTrim'), + 'validators' => array( + array('StringLength', false, array(0, 50)), + ), + 'required' => true, + 'label' => 'Location:', + )); + + $this->addElement('submit', 'add', array( + 'required' => false, + 'ignore' => true, + 'label' => $this->buttontext, + )); + + $this->addElement('button', 'Cancel', array( + 'onclick' => 'self.location="/pool"' + )); + } + private $buttontext = 'Save'; + function setButtontext($v){ + $this->buttontext = $v; + } + + +} + diff --git a/application/modules/dev/forms/PoolClient.php b/application/modules/dev/forms/PoolClient.php new file mode 100644 index 0000000..0c4ef6a --- /dev/null +++ b/application/modules/dev/forms/PoolClient.php @@ -0,0 +1,32 @@ +<?php + +class Application_Form_PoolClient extends Zend_Form +{ + private $clients; + + public function init() + { + $this->setName("addClientToPool"); + $this->setMethod('post'); + + $clientfield = $this->createElement('select','clientID'); + $clientfield ->setLabel('Client:'); + print_a($this->clients); + foreach($this->clients as $c){ + $clientfield->addMultiOption($c['clientID'],$c['macadress']." - ".$c['hardwarehash']); + } + $this->addElement($clientfield); + + $this->addElement('submit', 'add', array( + 'required' => false, + 'ignore' => true, + 'label' => 'Save', + )); + } + public function setClients($clients){ + $this->clients = $clients; + return $this; + } + +} + diff --git a/application/modules/dev/forms/Session.php b/application/modules/dev/forms/Session.php new file mode 100644 index 0000000..8603f75 --- /dev/null +++ b/application/modules/dev/forms/Session.php @@ -0,0 +1,139 @@ +<?php + +class Application_Form_Session extends Zend_Form +{ + + private $clients; + private $bootos; + private $bootisos; + private $bootmenuentries; + private $memberships; + + public function init() + { + $this->setName("session"); + $this->setMethod('post'); + + $this->addElement('text', 'alphasessionID', array( + 'filters' => array('StringTrim'), + 'validators' => array( + array('StringLength', false, array(0, 16)), + ), + 'required' => false, + 'label' => 'alphasessionID:', + )); + + $clientfield = $this->createElement('select','clientID'); + $clientfield ->setLabel('Client:'); + $clientfield->addMultiOption('',''); + if(count($this->clients)>0){ + foreach($this->clients as $id => $g){ + $clientfield->addMultiOption($g->getID(), $g->getMacadress()); + } + } + $clientfield->setRegisterInArrayValidator(false); + $this->addElement($clientfield); + + + $bootmenuentrieyfield = $this->createElement('select','bootmenuentryID'); + $bootmenuentrieyfield->setLabel('BootmenuentryID:'); + $bootmenuentrieyfield->addMultiOption('',''); + if(count($this->bootmenuentries)>0){ + foreach($this->bootmenuentries as $id => $g){ + $bootmenuentrieyfield->addMultiOption($g->getID(), $g->getTitle()); + } + } + $bootmenuentrieyfield->setRegisterInArrayValidator(false); + $this->addElement($bootmenuentrieyfield); + + + $bootosfield = $this->createElement('select','bootosID'); + $bootosfield ->setLabel('BootOs:'); + $bootosfield->addMultiOption('',''); + if(count($this->bootos)>0){ + foreach($this->bootos as $id => $g){ + $bootosfield->addMultiOption($g->getID(), $g->getTitle()); + } + } + $bootosfield->setRegisterInArrayValidator(false); + $this->addElement($bootosfield); + + $bootisofield = $this->createElement('select','bootisoID'); + $bootisofield ->setLabel('BootIso:'); + if(count($this->bootisos)>0){ + foreach($this->bootisos as $id => $g){ + $bootisofield->addMultiOption($g->getID(), $g->getTitle()); + } + } + $bootisofield->setRegisterInArrayValidator(false); + $this->addElement($bootisofield); + + $membershipfield = $this->createElement('select','membershipID'); + $membershipfield ->setLabel('Membership:'); + $membershipfield ->addMultiOption('',''); + if(count($this->memberships)>0){ + foreach($this->memberships as $id => $g){ + $membershipfield->addMultiOption($g->getID(), $g->getPersonID()); + } + } + $membershipfield->setRegisterInArrayValidator(false); + $this->addElement($membershipfield); + +$this->addElement('text', 'time', array( + 'filters' => array('StringTrim'), + 'validators' => array( + array('StringLength', false, array(0, 50)), + ), + 'required' => true, + 'label' => 'time:', + )); +$this->addElement('text', 'ip', array( + 'filters' => array('StringTrim'), + 'validators' => array( + array('StringLength', false, array(0, 50)), + ), + 'required' => false, + 'label' => 'ip:', + )); +$this->addElement('text', 'ip6', array( + 'filters' => array('StringTrim'), + 'validators' => array( + array('StringLength', false, array(0, 50)), + ), + 'required' => false, + 'label' => 'ip6:', + )); + + $this->addElement('submit', 'add', array( + 'required' => false, + 'ignore' => true, + 'label' => $this->buttontext, + )); + + $this->addElement('button', 'Cancel', array( + 'onclick' => 'self.location="/session"' + )); + } + function setClients($v){ + $this->clients = $v; + } + function setBootos($v){ + $this->bootos = $v; + } + function setBootisos($v){ + $this->bootisos = $v; + } + function setBootmenuentries($v){ + $this->bootmenuentries = $v; + } + function setMemberships($v){ + $this->memberships = $v; + } + private $buttontext = 'Save'; + function setButtontext($v){ + $this->buttontext = $v; + } + + +} + |
