diff options
| author | Björn Geiger | 2011-03-23 19:31:03 +0100 |
|---|---|---|
| committer | Björn Geiger | 2011-03-23 19:31:03 +0100 |
| commit | f581446f90526dd3466becddd625d23bd1c26ed4 (patch) | |
| tree | 22b5708100e6c71e7cbd3a567527dcfc013fca91 /application/modules/dev/forms | |
| parent | seriel liegt jetzt im root/ (diff) | |
| download | pbs2-f581446f90526dd3466becddd625d23bd1c26ed4.tar.gz pbs2-f581446f90526dd3466becddd625d23bd1c26ed4.tar.xz pbs2-f581446f90526dd3466becddd625d23bd1c26ed4.zip | |
Rollenverwaltung in Dev Modul
Diffstat (limited to 'application/modules/dev/forms')
| -rw-r--r-- | application/modules/dev/forms/GroupAdd.php | 4 | ||||
| -rw-r--r-- | application/modules/dev/forms/GroupEdit.php | 6 | ||||
| -rw-r--r-- | application/modules/dev/forms/GroupLink.php | 2 | ||||
| -rw-r--r-- | application/modules/dev/forms/GroupSelect.php | 42 | ||||
| -rw-r--r-- | application/modules/dev/forms/LinkRight.php | 48 | ||||
| -rw-r--r-- | application/modules/dev/forms/PersonEdit.php | 4 | ||||
| -rw-r--r-- | application/modules/dev/forms/RoleAdd.php | 50 | ||||
| -rw-r--r-- | application/modules/dev/forms/RoleEdit.php | 51 |
8 files changed, 197 insertions, 10 deletions
diff --git a/application/modules/dev/forms/GroupAdd.php b/application/modules/dev/forms/GroupAdd.php index f7636e7..a235b56 100644 --- a/application/modules/dev/forms/GroupAdd.php +++ b/application/modules/dev/forms/GroupAdd.php @@ -37,7 +37,7 @@ class dev_Form_GroupAdd extends Zend_Form $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()); @@ -56,7 +56,7 @@ class dev_Form_GroupAdd extends Zend_Form 'required' => false, 'ignore' => true, 'label' => 'Cancel', - 'onclick' => 'location.href="/group/show"', + 'onclick' => 'location.href="/dev/group/"', )); } diff --git a/application/modules/dev/forms/GroupEdit.php b/application/modules/dev/forms/GroupEdit.php index fb1ed03..f2f51a4 100644 --- a/application/modules/dev/forms/GroupEdit.php +++ b/application/modules/dev/forms/GroupEdit.php @@ -29,10 +29,6 @@ class dev_Form_GroupEdit extends Zend_Form 'value' => $_POST['description'], )); - $this->addElement('hidden', 'groupID', array( - 'value' => $_POST['groupID'], - )); - $this->addElement('submit', 'save', array( 'required' => false, 'ignore' => true, @@ -43,7 +39,7 @@ class dev_Form_GroupEdit extends Zend_Form 'required' => false, 'ignore' => true, 'label' => 'Cancel', - 'onclick' => 'location.href="/group/show"', + 'onclick' => 'location.href="/dev/group/"', )); } diff --git a/application/modules/dev/forms/GroupLink.php b/application/modules/dev/forms/GroupLink.php index 05782c7..81c2dbe 100644 --- a/application/modules/dev/forms/GroupLink.php +++ b/application/modules/dev/forms/GroupLink.php @@ -46,7 +46,7 @@ class dev_Form_GroupLink extends Zend_Form 'required' => false, 'ignore' => true, 'label' => 'Cancel', - 'onclick' => 'location.href="/group/show"', + 'onclick' => 'location.href="/dev/group/"', )); } diff --git a/application/modules/dev/forms/GroupSelect.php b/application/modules/dev/forms/GroupSelect.php new file mode 100644 index 0000000..1eaf455 --- /dev/null +++ b/application/modules/dev/forms/GroupSelect.php @@ -0,0 +1,42 @@ +<?php + +class dev_Form_GroupSelect extends Zend_Form +{ + private $grouplist; + + public function setGrouplist($grouplist){ + $this->grouplist = $grouplist; + + } + + public function getGrouplist(){ + return $this->grouplist; + } + + public function init() + { + $this->setName("GroupSelect"); + $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', 'selectgroup', array( + 'required' => false, + 'ignore' => true, + 'label' => 'Select Group', + )); + } + + +} + diff --git a/application/modules/dev/forms/LinkRight.php b/application/modules/dev/forms/LinkRight.php new file mode 100644 index 0000000..8b9c3a9 --- /dev/null +++ b/application/modules/dev/forms/LinkRight.php @@ -0,0 +1,48 @@ +<?php + +class dev_Form_LinkRight extends Zend_Form +{ + private $rightlist; + private $roleID; + + public function setRightlist($rightlist){ + $this->rightlist = $rightlist; + } + + public function setRoleID($roleID){ + $this->roleID = $roleID; + } + + public function init() + { + $this->setName("LinkRight"); + $this->setMethod('post'); + + $rightfield = $this->createElement('select','rightID'); + $rightfield ->setLabel('Right:'); + + if(count($this->rightlist)>0){ + foreach($this->rightlist as $right => $r){ + $rightfield->addMultiOption($r->getID(), $r->getTitle()); + } + } + $rightfield->setRegisterInArrayValidator(false); + $this->addElement($rightfield); + + $this->addElement('submit', 'link', array( + 'required' => false, + 'ignore' => true, + 'label' => 'Add Right', + )); + + $this->addElement('button', 'cancel', array( + 'required' => false, + 'ignore' => true, + 'label' => 'Cancel', + 'onclick' => 'location.href="/dev/role/show/roleID/' . $this->roleID . '"', + )); + } + + +} + diff --git a/application/modules/dev/forms/PersonEdit.php b/application/modules/dev/forms/PersonEdit.php index 3baf4a6..aa39c34 100644 --- a/application/modules/dev/forms/PersonEdit.php +++ b/application/modules/dev/forms/PersonEdit.php @@ -7,7 +7,7 @@ class dev_Form_PersonEdit extends Zend_Form { $this->setName("PersonEdit"); $this->setMethod('post'); - + $this->addElement('text', 'title', array( 'filters' => array('StringTrim'), 'validators' => array( @@ -108,7 +108,7 @@ class dev_Form_PersonEdit extends Zend_Form 'required' => false, 'ignore' => true, 'label' => 'Cancel', - 'onclick' => 'location.href="/person/show"', + 'onclick' => 'location.href="/dev/person/"', )); } diff --git a/application/modules/dev/forms/RoleAdd.php b/application/modules/dev/forms/RoleAdd.php new file mode 100644 index 0000000..d773b17 --- /dev/null +++ b/application/modules/dev/forms/RoleAdd.php @@ -0,0 +1,50 @@ +<?php + +class dev_Form_RoleAdd extends Zend_Form +{ + private $rightlist; + + public function setRightlist($rightlist){ + $this->rightlist = $rightlist; + } + + public function init() + { + $this->setName("RoleAdd"); + $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:', + )); + + $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="/dev/role/"', + )); + } + + +} + diff --git a/application/modules/dev/forms/RoleEdit.php b/application/modules/dev/forms/RoleEdit.php new file mode 100644 index 0000000..2c79050 --- /dev/null +++ b/application/modules/dev/forms/RoleEdit.php @@ -0,0 +1,51 @@ +<?php + +class dev_Form_RoleEdit extends Zend_Form +{ + + public function init() + { + $this->setName("RoleEdit"); + $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="/dev/role/"', + )); + } + + +} + |
