<?php
/*
* Copyright (c) 2011 - OpenSLX GmbH, RZ Uni Freiburg
* This program is free software distributed under the GPL version 2.
* See http://gpl.openslx.org/
*
* If you have any feedback please consult http://feedback.openslx.org/ and
* send your suggestions, praise, or complaints to feedback@openslx.org
*
* General information about OpenSLX can be found at http://openslx.org/
*/
class user_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)),array('EmailAddress', "deep" => true, "mx" => true),
),
'required' => true,
'label' => 'Email:',
'value' => $this->getView()->person->getEmail(),
));
$this->addElement('password', 'newpassword', array(
'filters' => array('StringTrim'),
'validators' => array(
array('StringLength', false, array(5, 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="javascript:history.back();"',
));
}
}