summaryrefslogtreecommitdiffstats
path: root/application/forms
diff options
context:
space:
mode:
authorBjörn Geiger2011-06-29 17:47:26 +0200
committerBjörn Geiger2011-06-29 17:47:26 +0200
commit67701f80256723b179f6a73b8990cfcc22a3a8c8 (patch)
treeaff9211600fab3b20b2dcfb5b001d153ca21a03c /application/forms
parentFehler in eventcategory korrigiert (diff)
downloadpoolctrl-67701f80256723b179f6a73b8990cfcc22a3a8c8.tar.gz
poolctrl-67701f80256723b179f6a73b8990cfcc22a3a8c8.tar.xz
poolctrl-67701f80256723b179f6a73b8990cfcc22a3a8c8.zip
Add und Edit Formular korrgieirt
Diffstat (limited to 'application/forms')
-rw-r--r--application/forms/EventAdd.php187
-rw-r--r--application/forms/EventEdit.php192
2 files changed, 292 insertions, 87 deletions
diff --git a/application/forms/EventAdd.php b/application/forms/EventAdd.php
index 47ef86c..7710ea6 100644
--- a/application/forms/EventAdd.php
+++ b/application/forms/EventAdd.php
@@ -1,8 +1,11 @@
<?php
class Application_Form_EventAdd extends Zend_Form
-{
+{
private $membershiplist;
+ private $bootoslist;
+ private $poollist;
+ private $eventcategorylist;
public function setMembershiplist($membershiplist){
$this->membershiplist = $membershiplist;
@@ -12,137 +15,155 @@ class Application_Form_EventAdd extends Zend_Form
public function getMembershiplist(){
return $this->membershiplist;
}
-
+
+ public function setBootoslist($bootoslist){
+ $this->bootoslist = $bootoslist;
+
+ }
+
+ public function getBootoslist(){
+ return $this->bootoslist;
+ }
+
+ public function setPoollist($poollist){
+ $this->poollist = $poollist;
+
+ }
+
+ public function getPoollist(){
+ return $this->poollist;
+ }
+
+ public function getEventcategorylist()
+ {
+ return $this->eventcategorylist;
+ }
+
+ public function setEventcategorylist($eventcategorylist)
+ {
+ $this->eventcategorylist = $eventcategorylist;
+ }
+
public function init()
- {
+ {
$this->addElement('text', 'title', array(
'filters' => array('StringTrim'),
'validators' => array(
- array('StringLength', false, array(0, 50)),
- ),
+ array('StringLength', false, array(0, 50)),
+ ),
'required' => true,
'label' => 'Title:',
));
-
+
$this->addElement('checkbox', 'immediate', array(
'required' => false,
'label' => 'Immediate Event',
'value'=>array(0,1),
));
-
+
$this->addElement('text', 'start', array(
'filters' => array('StringTrim'),
'validators' => array(
- array('StringLength', false, array(0, 50)),
- ),
+ array('StringLength', false, array(0, 50)),
+ ),
'required' => true,
'label' => 'Start:',
));
-
+
$this->addElement('text', 'end', array(
'filters' => array('StringTrim'),
'validators' => array(
- array('StringLength', false, array(0, 50)),
- ),
+ array('StringLength', false, array(0, 50)),
+ ),
'required' => true,
'label' => 'End:',
));
-
+
$this->addElement('checkbox', 'repeat', array(
'required' => false,
'label' => 'Repeat:',
'value'=>array(0,1),
));
-
+
$this->addElement('text', 'participants', array(
'filters' => array('StringTrim'),
'validators' => array(
- array('StringLength', false, array(0, 140)),
- ),
+ array('StringLength', false, array(0, 140)),
+ ),
'required' => false,
'label' => 'Participants:',
- ));
-
- $this->addElement('select', 'category', array(
- 'required' => false,
- 'label' => 'Category:',
- 'multioptions' => array(
- 'le' => 'Lecture',
- 'pr' => 'Private',
- 'pu' => 'Public',
- 'ma' => 'Maintenance',
- ),
- ));
+ ));
+
+ $eventcategoryfield = $this->createElement('select','category');
+ $eventcategoryfield ->setLabel('Category:');
+
+ if(count($this->eventcategorylist)>0){
+ foreach($this->eventcategorylist as $category => $c){
+ $eventcategoryfield->addMultiOption($c->getID(), $c->getTitle());
+ }
+ }
+ $eventcategoryfield->setRegisterInArrayValidator(false);
+ $this->addElement($eventcategoryfield);
+
$this->addElement('text', 'note', array(
'filters' => array('StringTrim'),
'validators' => array(
- array('StringLength', false, array(0, 140)),
- ),
+ array('StringLength', false, array(0, 140)),
+ ),
'required' => false,
'label' => 'Note:',
));
-
- $this->addElement('select', 'pbs_poolID', array(
- 'required' => true,
- 'label' => 'PoolID:',
- 'multioptions' => array(
- '1',
- '2',
- '3',
- ),
- ));
-
- $this->addElement('select', 'pbs_membershipID', array(
- 'required' => true,
- 'label' => 'MembershipID:',
- 'multioptions' => array(
- '1',
- '2',
- '3',
- ),
- ));
-// $this->setName("MembershipSelect");
-// $this->setMethod('post');
-//
-// $membershipfield = $this->createElement('select','pbs_membershipID');
-// $membershipfield ->setLabel('Membership:');
-//
-// if(count($this->membershiplist)>0){
-// foreach($this->membershiplist as $membership => $m){
-// $membershipfield->addMultiOption($m['pbs_membershipID'], $m['pbs_group'] . ' - ' . $m['pbs_role']);
-// }
-// }
-//
-// $membershipfield->setRegisterInArrayValidator(false);
-// $this->addElement($membershipfield);
-
- $this->addElement('select', 'pbs_bootosID', array(
- 'required' => true,
- 'label' => 'BootosID:',
- 'multioptions' => array(
- '1',
- '2',
- '3',
- ),
- ));
-
+ $poolfield = $this->createElement('select','pbs_poolID');
+ $poolfield ->setLabel('Pool:');
+
+ if(count($this->poollist)>0){
+ foreach($this->poollist as $pool => $p){
+ $poolfield->addMultiOption($p['poolID'], $p['title']);
+ }
+ }
+
+ $poolfield->setRegisterInArrayValidator(false);
+ $this->addElement($poolfield);
+
+ // $membershipfield = $this->createElement('select','pbs_membershipID');
+ // $membershipfield ->setLabel('Membership:');
+ //
+ // if(count($this->membershiplist)>0){
+ // foreach($this->membershiplist as $membership => $m){
+ // $membershipfield->addMultiOption($m['membershipID'], $m['person']);
+ // }
+ // }
+ //
+ // $membershipfield->setRegisterInArrayValidator(false);
+ // $this->addElement($membershipfield);
+
+ $bootosfield = $this->createElement('select','pbs_bootosID');
+ $bootosfield ->setLabel('BootOS:');
+
+ if(count($this->bootoslist)>0){
+ foreach($this->bootoslist as $bootos => $b){
+ $bootosfield->addMultiOption($b['bootosID'], $b['title']);
+ }
+ }
+
+ $bootosfield->setRegisterInArrayValidator(false);
+ $this->addElement($bootosfield);
+
$this->addElement('submit', 'add', array(
'required' => false,
'ignore' => true,
'label' => 'Create Event'
- ));
-
- $this->addElement('button', 'cancel', array(
+ ));
+
+ $this->addElement('button', 'cancel', array(
'required' => false,
'ignore' => true,
'label' => 'Cancel',
'onclick' => 'location.href="javascript:history.back();"',
- ));
-
- }
-
-
+ ));
+
+ }
}
diff --git a/application/forms/EventEdit.php b/application/forms/EventEdit.php
index a34161d..f2ad783 100644
--- a/application/forms/EventEdit.php
+++ b/application/forms/EventEdit.php
@@ -2,11 +2,195 @@
class Application_Form_EventEdit extends Zend_Form
{
+ private $membershiplist;
+ private $bootoslist;
+ private $poollist;
+ private $eventcategorylist;
- public function init()
- {
- /* Form Elements & Other Definitions Here ... */
- }
+ public function setMembershiplist($membershiplist){
+ $this->membershiplist = $membershiplist;
+
+ }
+
+ public function getMembershiplist(){
+ return $this->membershiplist;
+ }
+
+ public function setBootoslist($bootoslist){
+ $this->bootoslist = $bootoslist;
+
+ }
+
+ public function getBootoslist(){
+ return $this->bootoslist;
+ }
+
+ public function setPoollist($poollist){
+ $this->poollist = $poollist;
+
+ }
+
+ public function getPoollist(){
+ return $this->poollist;
+ }
+
+ public function getEventcategorylist()
+ {
+ return $this->eventcategorylist;
+ }
+
+ public function setEventcategorylist($eventcategorylist)
+ {
+ $this->eventcategorylist = $eventcategorylist;
+ }
+
+ public function init()
+ {
+ $this->addElement('text', 'title', array(
+ 'filters' => array('StringTrim'),
+ 'validators' => array(
+ array('StringLength', false, array(0, 50)),
+ ),
+ 'required' => true,
+ 'label' => 'Title:',
+ 'value' => $_POST['title'],
+ ));
+
+ if($_POST['immediate'] == 1) {
+ $this->addElement('checkbox', 'immediate', array(
+ 'required' => false,
+ 'label' => 'Immediate Event',
+ 'value'=>array(0,1),
+ 'checked' => 'checked',
+ ));
+ } else {
+ $this->addElement('checkbox', 'immediate', array(
+ 'required' => false,
+ 'label' => 'Immediate Event',
+ 'value'=>array(0,1),
+ ));
+ }
+
+ $this->addElement('text', 'start', array(
+ 'filters' => array('StringTrim'),
+ 'validators' => array(
+ array('StringLength', false, array(0, 50)),
+ ),
+ 'required' => true,
+ 'label' => 'Start:',
+ 'value' => $_POST['start'],
+ ));
+
+ $this->addElement('text', 'end', array(
+ 'filters' => array('StringTrim'),
+ 'validators' => array(
+ array('StringLength', false, array(0, 50)),
+ ),
+ 'required' => true,
+ 'label' => 'End:',
+ 'value' => $_POST['end'],
+ ));
+
+ if($_POST['repeat'] == 1) {
+ $this->addElement('checkbox', 'repeat', array(
+ 'required' => false,
+ 'label' => 'Repeat:',
+ 'value'=>array(0,1),
+ 'checked' => 'checked',
+ ));
+ } else {
+ $this->addElement('checkbox', 'repeat', array(
+ 'required' => false,
+ 'label' => 'Repeat:',
+ 'value'=>array(0,1),
+ ));
+ }
+
+ $this->addElement('text', 'participants', array(
+ 'filters' => array('StringTrim'),
+ 'validators' => array(
+ array('StringLength', false, array(0, 140)),
+ ),
+ 'required' => false,
+ 'label' => 'Participants:',
+ 'value' => $_POST['participants'],
+ ));
+
+ $eventcategoryfield = new Zend_Form_Element_Select('category');
+ $eventcategoryfield ->setLabel('Category:');
+
+ if(count($this->eventcategorylist)>0){
+ foreach($this->eventcategorylist as $category => $c){
+ $eventcategoryfield->addMultiOption($c->getID(), $c->getTitle());
+ }
+ }
+
+ $eventcategoryfield->setRegisterInArrayValidator(false);
+ $eventcategoryfield->setValue($_POST['category']);
+ $this->addElement($eventcategoryfield);
+
+ $this->addElement('text', 'note', array(
+ 'filters' => array('StringTrim'),
+ 'validators' => array(
+ array('StringLength', false, array(0, 140)),
+ ),
+ 'required' => false,
+ 'label' => 'Note:',
+ 'value' => $_POST['note'],
+ ));
+
+ $poolfield = $this->createElement('select','pbs_poolID');
+ $poolfield ->setLabel('Pool:');
+
+ if(count($this->poollist)>0){
+ foreach($this->poollist as $pool => $p){
+ $poolfield->addMultiOption($p['poolID'], $p['title']);
+ }
+ }
+
+ $poolfield->setRegisterInArrayValidator(false);
+ $poolfield->setValue($_POST['pbs_poolID']);
+ $this->addElement($poolfield);
+
+ // $membershipfield = $this->createElement('select','pbs_membershipID');
+ // $membershipfield ->setLabel('Membership:');
+ //
+ // if(count($this->membershiplist)>0){
+ // foreach($this->membershiplist as $membership => $m){
+ // $membershipfield->addMultiOption($m['membershipID'], $m['person']);
+ // }
+ // }
+ //
+ // $membershipfield->setRegisterInArrayValidator(false);
+ // $this->addElement($membershipfield);
+
+ $bootosfield = $this->createElement('select','pbs_bootosID');
+ $bootosfield ->setLabel('BootOS:');
+
+ if(count($this->bootoslist)>0){
+ foreach($this->bootoslist as $bootos => $b){
+ $bootosfield->addMultiOption($b['bootosID'], $b['title']);
+ }
+ }
+
+ $bootosfield->setRegisterInArrayValidator(false);
+ $bootosfield->setValue($_POST['pbs_bootosID']);
+ $this->addElement($bootosfield);
+
+ $this->addElement('submit', 'add', array(
+ 'required' => false,
+ 'ignore' => true,
+ 'label' => 'Create Event'
+ ));
+
+ $this->addElement('button', 'cancel', array(
+ 'required' => false,
+ 'ignore' => true,
+ 'label' => 'Cancel',
+ 'onclick' => 'location.href="javascript:history.back();"',
+ ));
+
+ }
}