summaryrefslogtreecommitdiffstats
path: root/application/forms
diff options
context:
space:
mode:
Diffstat (limited to 'application/forms')
-rw-r--r--application/forms/AuthRecoverPassword.php28
-rw-r--r--application/forms/AuthRegister.php2
-rw-r--r--application/forms/GroupAdd.php65
-rw-r--r--application/forms/GroupEdit.php52
-rw-r--r--application/forms/GroupLink.php55
-rw-r--r--application/forms/GroupRequest.php42
-rw-r--r--application/forms/PersonEdit.php117
7 files changed, 360 insertions, 1 deletions
diff --git a/application/forms/AuthRecoverPassword.php b/application/forms/AuthRecoverPassword.php
new file mode 100644
index 0000000..fc9478b
--- /dev/null
+++ b/application/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/forms/AuthRegister.php b/application/forms/AuthRegister.php
index 773f020..ae6e766 100644
--- a/application/forms/AuthRegister.php
+++ b/application/forms/AuthRegister.php
@@ -93,7 +93,7 @@ class Application_Form_AuthRegister extends Zend_Form
$this->addElement('submit', 'register', array(
'required' => false,
'ignore' => true,
- 'label' => 'Login',
+ 'label' => 'Register',
));
diff --git a/application/forms/GroupAdd.php b/application/forms/GroupAdd.php
new file mode 100644
index 0000000..7df3af5
--- /dev/null
+++ b/application/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/forms/GroupEdit.php b/application/forms/GroupEdit.php
new file mode 100644
index 0000000..ef38d83
--- /dev/null
+++ b/application/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/forms/GroupLink.php b/application/forms/GroupLink.php
new file mode 100644
index 0000000..231c4a7
--- /dev/null
+++ b/application/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/forms/GroupRequest.php b/application/forms/GroupRequest.php
new file mode 100644
index 0000000..ec717de
--- /dev/null
+++ b/application/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/forms/PersonEdit.php b/application/forms/PersonEdit.php
new file mode 100644
index 0000000..664daac
--- /dev/null
+++ b/application/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"',
+ ));
+ }
+
+
+}
+