diff options
Diffstat (limited to 'application/modules/user/forms')
-rw-r--r-- | application/modules/user/forms/ConfirmDeleteAccount.php | 27 | ||||
-rw-r--r-- | application/modules/user/forms/GroupAdd.php | 65 | ||||
-rw-r--r-- | application/modules/user/forms/GroupEdit.php | 50 | ||||
-rw-r--r-- | application/modules/user/forms/GroupLink.php | 55 | ||||
-rw-r--r-- | application/modules/user/forms/GroupRequest.php | 4 | ||||
-rw-r--r-- | application/modules/user/forms/LinkRight.php | 4 | ||||
-rw-r--r-- | application/modules/user/forms/MembershipSelect.php | 2 | ||||
-rw-r--r-- | application/modules/user/forms/PersonEdit.php | 2 | ||||
-rw-r--r-- | application/modules/user/forms/RecoverPassword.php | 2 | ||||
-rw-r--r-- | application/modules/user/forms/RoleAdd.php | 6 | ||||
-rw-r--r-- | application/modules/user/forms/RoleEdit.php | 26 |
11 files changed, 223 insertions, 20 deletions
diff --git a/application/modules/user/forms/ConfirmDeleteAccount.php b/application/modules/user/forms/ConfirmDeleteAccount.php new file mode 100644 index 0000000..7bf5a32 --- /dev/null +++ b/application/modules/user/forms/ConfirmDeleteAccount.php @@ -0,0 +1,27 @@ +<?php + +class user_Form_ConfirmDeleteAccount extends Zend_Form +{ + + public function init() + { + $this->setName("ConfirmDeleteAccount"); + $this->setMethod('post'); + + $this->addElement('submit', 'confirmdelete', array( + 'required' => false, + 'ignore' => true, + 'label' => 'Confirm', + )); + + $this->addElement('button', 'cancel', array( + 'required' => false, + 'ignore' => true, + 'label' => 'Cancel', + 'onclick' => 'location.href="' . $_SERVER['HTTP_REFERER'] . '"', + )); + } + + +} + diff --git a/application/modules/user/forms/GroupAdd.php b/application/modules/user/forms/GroupAdd.php new file mode 100644 index 0000000..ff2b97a --- /dev/null +++ b/application/modules/user/forms/GroupAdd.php @@ -0,0 +1,65 @@ +<?php + +class user_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="' . $_SERVER['HTTP_REFERER'] . '"', + )); + } + + +} + diff --git a/application/modules/user/forms/GroupEdit.php b/application/modules/user/forms/GroupEdit.php new file mode 100644 index 0000000..4f0d7fc --- /dev/null +++ b/application/modules/user/forms/GroupEdit.php @@ -0,0 +1,50 @@ +<?php + +class user_Form_GroupEdit extends Zend_Form +{ + private $groupID; + + public function setGroupID($groupID){ + $this->groupID = $groupID; + + } + + 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('submit', 'save', array( + 'required' => false, + 'ignore' => true, + 'label' => 'Save', + )); + + $this->addElement('button', 'cancel', array( + 'required' => false, + 'ignore' => true, + 'label' => 'Cancel', + 'onclick' => 'location.href="' . $_SERVER['HTTP_REFERER'] . '"', + )); + } +}
\ No newline at end of file diff --git a/application/modules/user/forms/GroupLink.php b/application/modules/user/forms/GroupLink.php new file mode 100644 index 0000000..9db7ce4 --- /dev/null +++ b/application/modules/user/forms/GroupLink.php @@ -0,0 +1,55 @@ +<?php + +class user_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="' . $_SERVER['HTTP_REFERER'] . '"', + )); + } + + +} + diff --git a/application/modules/user/forms/GroupRequest.php b/application/modules/user/forms/GroupRequest.php index 2cdada0..c9ba273 100644 --- a/application/modules/user/forms/GroupRequest.php +++ b/application/modules/user/forms/GroupRequest.php @@ -33,14 +33,14 @@ class user_Form_GroupRequest extends Zend_Form $this->addElement('submit', 'request', array( 'required' => false, 'ignore' => true, - 'label' => 'Request Membership', + 'label' => 'Request', )); $this->addElement('button', 'cancel', array( 'required' => false, 'ignore' => true, 'label' => 'Cancel', - 'onclick' => 'location.href="/user/person/"', + 'onclick' => 'location.href="' . $_SERVER['HTTP_REFERER'] . '"', )); } diff --git a/application/modules/user/forms/LinkRight.php b/application/modules/user/forms/LinkRight.php index 139aee4..a7b28b1 100644 --- a/application/modules/user/forms/LinkRight.php +++ b/application/modules/user/forms/LinkRight.php @@ -32,14 +32,14 @@ class user_Form_LinkRight extends Zend_Form $this->addElement('submit', 'link', array( 'required' => false, 'ignore' => true, - 'label' => 'Add Right', + 'label' => 'Add', )); $this->addElement('button', 'cancel', array( 'required' => false, 'ignore' => true, 'label' => 'Cancel', - 'onclick' => 'location.href="/user/role/show/roleID/' . $this->roleID . '"', + 'onclick' => 'location.href="' . $_SERVER['HTTP_REFERER'] . '"', )); } diff --git a/application/modules/user/forms/MembershipSelect.php b/application/modules/user/forms/MembershipSelect.php index fbf8b8a..b4b54c4 100644 --- a/application/modules/user/forms/MembershipSelect.php +++ b/application/modules/user/forms/MembershipSelect.php @@ -33,7 +33,7 @@ class user_Form_MembershipSelect extends Zend_Form $this->addElement('submit', 'selectmembership', array( 'required' => false, 'ignore' => true, - 'label' => 'Select Group', + 'label' => 'Select', )); } diff --git a/application/modules/user/forms/PersonEdit.php b/application/modules/user/forms/PersonEdit.php index d6c68e7..a6bd123 100644 --- a/application/modules/user/forms/PersonEdit.php +++ b/application/modules/user/forms/PersonEdit.php @@ -108,7 +108,7 @@ class user_Form_PersonEdit extends Zend_Form 'required' => false, 'ignore' => true, 'label' => 'Cancel', - 'onclick' => 'location.href="/user/person/"', + 'onclick' => 'location.href="' . $_SERVER['HTTP_REFERER'] . '"', )); } diff --git a/application/modules/user/forms/RecoverPassword.php b/application/modules/user/forms/RecoverPassword.php index 90feb87..22a775f 100644 --- a/application/modules/user/forms/RecoverPassword.php +++ b/application/modules/user/forms/RecoverPassword.php @@ -19,7 +19,7 @@ class user_Form_RecoverPassword extends Zend_Form $this->addElement('submit', 'recoverPassword', array( 'required' => false, 'ignore' => true, - 'label' => 'Recover Password', + 'label' => 'Recover', )); } diff --git a/application/modules/user/forms/RoleAdd.php b/application/modules/user/forms/RoleAdd.php index 3b5200b..e8e99a5 100644 --- a/application/modules/user/forms/RoleAdd.php +++ b/application/modules/user/forms/RoleAdd.php @@ -31,6 +31,10 @@ class user_Form_RoleAdd extends Zend_Form 'label' => 'Description:', )); + $this->addElement('checkbox', 'inheritance', array( + 'label' => 'Inheritance:', + )); + $this->addElement('submit', 'add', array( 'required' => false, 'ignore' => true, @@ -41,7 +45,7 @@ class user_Form_RoleAdd extends Zend_Form 'required' => false, 'ignore' => true, 'label' => 'Cancel', - 'onclick' => 'location.href="/user/role/"', + 'onclick' => 'location.href="' . $_SERVER['HTTP_REFERER'] . '"', )); } diff --git a/application/modules/user/forms/RoleEdit.php b/application/modules/user/forms/RoleEdit.php index 170a2f9..0bdc977 100644 --- a/application/modules/user/forms/RoleEdit.php +++ b/application/modules/user/forms/RoleEdit.php @@ -33,6 +33,17 @@ class user_Form_RoleEdit extends Zend_Form 'value' => $_POST['description'], )); + if($_POST['inheritance'] == 1) { + $this->addElement('checkbox', 'inheritance', array( + 'label' => 'Inheritance:', + 'checked' => 'checked', + )); + } else { + $this->addElement('checkbox', 'inheritance', array( + 'label' => 'Inheritance:', + )); + } + $this->addElement('hidden', 'groupID', array( 'value' => $_POST['groupID'], )); @@ -43,21 +54,12 @@ class user_Form_RoleEdit extends Zend_Form 'label' => 'Save', )); - if(strpos($_SERVER['HTTP_REFERER'], '/user/role/show/roleID')) { - $this->addElement('button', 'cancel', array( + $this->addElement('button', 'cancel', array( 'required' => false, 'ignore' => true, 'label' => 'Cancel', - 'onclick' => 'location.href="/user/role/show/roleID/' . $this->roleID . '"', - )); - } else { - $this->addElement('button', 'cancel', array( - 'required' => false, - 'ignore' => true, - 'label' => 'Cancel', - 'onclick' => 'location.href="/user/role/"', - )); - } + 'onclick' => 'location.href="' . $_SERVER['HTTP_REFERER'] . '"', + )); } |