public function init() { parent::init(); $this->setAction('/core/user/edit'); $this->addElement('hidden', 'user_id', array('validators' => array(array('Int')), 'required' => true, 'decorators' => $this->_hiddenElementDecorator)); $this->removeElement('password'); $this->removeElement('passwordCheck'); $this->removeElement('invite'); // @todo: no longer needed $this->removeElement('role_id'); // @todo: no longer needed $this->getElement('email')->setDescription(null); $this->getElement('organisation')->setRequired(true); }
public function init() { parent::init(); $uuid = new uuid(); $invite = new Zend_Form_Element_Hidden('invite'); $invite->setValue($uuid->get())->setRequired(true)->addValidator(new TA_Form_Validator_Uuid())->setDecorators(array('Composite')); $userModel = new Core_Model_User(); $roles = new Zend_Form_Element_Select('role_id'); $roles->setAttrib('class', 'small')->setLabel('Role')->setOrder(4)->addFilter('Null')->setMultiOptions($userModel->getRolesForSelect('---'))->setDecorators(array('Composite')); $this->addElements(array($roles, $invite)); }