public function init() { //////////////////////////////////////////////// // Create and configure elements //////////////////////////////////////////////// // let's capture the user's name and add them to the contact table also $name = $this->createElement('text', 'name'); $name->addValidator('stringLength', false, array(2, 64, 'UTF-8'))->setRequired(true)->setAttrib('size', 50)->setAttrib('class', 'span3')->setLabel('Name')->addFilter('StringTrim')->addFilter('StripTags')->addFilter(new OSS_Filter_StripSlashes()); $this->addElement($name); $username = OSS_Form_Auth::createUsernameElement(); $username->addValidator('stringLength', false, array(2, 30, 'UTF-8'))->addValidator('regex', true, array('/^[a-zA-Z0-9\\-_\\.]+$/')); $this->addElement($username); $password = $this->createElement('text', 'password'); $password->addValidator('stringLength', false, array(8, 30, 'UTF-8'))->setRequired(true)->setAttrib('class', 'span3')->setLabel('Password')->addFilter('StringTrim')->addFilter(new OSS_Filter_StripSlashes()); $this->addElement($password); $privileges = $this->createElement('select', 'privs'); $privileges->setMultiOptions(\Entities\User::$PRIVILEGES_TEXT)->setRegisterInArrayValidator(true)->setLabel('Privileges')->setAttrib('class', 'span3 chzn-select')->setErrorMessages(array('Please select the users privilege level')); $this->addElement($privileges); $this->addElement(OSS_Form_User::createEmailElement()); $this->addElement(self::createMobileElement('authorisedMobile')); $this->addElement(IXP_Form_Customer::getPopulatedSelect('custid')); $disabled = $this->createElement('checkbox', 'disabled'); $disabled->setLabel('Disabled?')->setCheckedValue('1'); $this->addElement($disabled); $this->addElement(self::createSubmitElement('submit', _('Add'))); $this->addElement($this->createCancelElement()); }
public function init() { $this->setAttrib('id', 'auth_lost_username')->setAttrib('name', 'auth_lost_username'); $this->addElement(OSS_Form_User::createEmailElement()); $this->addElement(OSS_Form::createSubmitElement('submit', _('Find Username(s)'))); $this->addElement(OSS_Form_Auth::createReturnToLoginElement()); }
public function init() { $this->setDecorators([['ViewScript', ['viewScript' => 'contact/forms/edit.phtml']]]); $name = $this->createElement('text', 'name'); $name->addValidator('stringLength', false, array(1, 255, 'UTF-8'))->setRequired(true)->setLabel('Name')->addFilter('StringTrim')->addFilter('StripTags')->addFilter(new OSS_Filter_StripSlashes()); $this->addElement($name); $position = $this->createElement('text', 'position'); $position->addValidator('stringLength', false, array(1, 50, 'UTF-8'))->setRequired(false)->setLabel('Position')->addFilter('StringTrim')->addFilter('StripTags')->addFilter(new OSS_Filter_StripSlashes()); $this->addElement($position); $this->addElement(IXP_Form_Customer::getPopulatedSelect('custid')); $this->getElement('custid')->setAttrib('class', "chzn-select"); $this->addElement(OSS_Form_User::createEmailElement('email')); $this->getElement('email')->setRequired(false)->setAttrib('class', ""); $phone = $this->createElement('text', 'phone'); $phone->addValidator('stringLength', false, array(1, 32, 'UTF-8'))->setLabel(_('Phone'))->addFilter('StringTrim')->addFilter('StripTags')->addFilter(new OSS_Filter_StripSlashes()); $this->addElement($phone); $mobile = $this->createElement('text', 'mobile'); $mobile->addValidator('stringLength', false, array(1, 32, 'UTF-8'))->setLabel(_('Mobile'))->addFilter('StringTrim')->addFilter('StripTags')->addFilter(new OSS_Filter_StripSlashes()); $this->addElement($mobile); $notes = $this->createElement('textarea', 'notes'); $notes->setLabel('Notes')->setRequired(false)->setAttrib('style', 'width: 80%;')->addFilter(new OSS_Filter_StripSlashes())->addFilter('StripTags')->setAttrib('cols', 60)->setAttrib('rows', 5); $this->addElement($notes); $facilityaccess = $this->createElement('checkbox', 'facilityaccess'); $facilityaccess->setLabel('Facility Access')->addValidator('InArray', false, array(array(0, 1)))->addFilter('Int')->setValue(1); $this->addElement($facilityaccess); $mayauthorize = $this->createElement('checkbox', 'mayauthorize'); $mayauthorize->setLabel('May Authorize')->addValidator('InArray', false, array(array(0, 1)))->addFilter('Int')->setValue(1); $this->addElement($mayauthorize); $this->addElement(self::createSubmitElement('submit', _('Add'))); $this->addElement($this->createCancelElement()); $role = $this->createElement('hidden', 'role'); $role->setRequired(false); $this->addElement($role); $group = $this->createElement('hidden', 'group'); $group->setRequired(false); $this->addElement($group); $login = $this->createElement('checkbox', 'login'); $login->setLabel('can login to portal')->addValidator('InArray', false, array(array(0, 1)))->addFilter('Int'); $this->addElement($login); $username = OSS_Form_Auth::createUsernameElement(); $username->addValidator('stringLength', false, array(2, 30, 'UTF-8'))->addValidator('regex', true, array('/^[a-zA-Z0-9\\-_\\.]+$/'))->setRequired(false)->setAttrib('class', ''); $this->addElement($username); $password = $this->createElement('text', 'password'); $password->addValidator('stringLength', false, array(8, 30, 'UTF-8'))->setRequired(false)->setLabel('Password')->addFilter('StringTrim')->addFilter(new OSS_Filter_StripSlashes()); $this->addElement($password); $privileges = $this->createElement('select', 'privs'); $privileges->setMultiOptions(\Entities\User::$PRIVILEGES_TEXT)->setRegisterInArrayValidator(true)->setRequired(false)->setLabel('Privileges')->setAttrib('class', 'chzn-select')->setAttrib('chzn-fix-width', '1')->setErrorMessages(array('Please select the users privilege level')); $this->addElement($privileges); $disabled = $this->createElement('checkbox', 'disabled'); $disabled->setLabel('Disabled?')->addValidator('InArray', false, array(array(0, 1)))->addFilter('Int'); $this->addElement($disabled); }
public function init() { $this->setDecorators([['ViewScript', ['viewScript' => 'profile/forms/profile.phtml']]]); $this->setAttrib('id', 'profile')->setAttrib('name', 'profile')->setAction(OSS_Utils::genUrl('profile', 'change-profile')); $name = $this->createElement('text', 'name'); $name->addValidator('stringLength', false, array(1, 255, 'UTF-8'))->setRequired(true)->setLabel('Name')->setAttrib('class', 'span6')->addFilter('StringTrim')->addFilter('StripTags')->addFilter(new OSS_Filter_StripSlashes()); $this->addElement($name); $position = $this->createElement('text', 'position'); $position->addValidator('stringLength', false, array(1, 50, 'UTF-8'))->setRequired(true)->setLabel('Position')->setAttrib('class', 'span6')->addFilter('StripTags')->addFilter('StringTrim')->addFilter(new OSS_Filter_StripSlashes()); $this->addElement($position); $email = OSS_Form_User::createEmailElement(); $email->setAttrib('class', 'span9'); $this->addElement($email); $mobile = IXP_Form_User::createMobileElement()->setAttrib('class', 'span6'); $this->addElement($mobile); $phone = $this->createElement('text', 'phone'); $phone->addValidator('stringLength', false, array(1, 32, 'UTF-8'))->setLabel(_('Phone'))->setAttrib('class', 'span6')->addFilter('StringTrim')->addFilter('StripTags')->addFilter(new OSS_Filter_StripSlashes()); $this->addElement($phone); $this->addElement(OSS_Form_Auth::createPasswordElement('current_password')->setLabel(_('Current Password'))->setAttrib('class', 'span6')); $this->addElement(self::createSubmitElement('submit', _('Update'))); }