public function init() { $formutil = new Agana_Form_Util($this->_action, $this->_model); $this->setName("person"); $this->setMethod('post'); $this->_addClassNames('well'); $this->addAttribs(array('load-in' => 'content-container')); if ($this->_action == self::ACTION_EDIT) { $this->addElement($this->_getIdElement()); } //$this->_addElementName(); $formutil->addElementName($this, array('maxlength' => 120, 'dimension' => 7)); $formutil->addElementGender($this); $formutil->addElementDate($this, array('name' => 'birthdate', 'label' => 'Birthdate', 'modelfield' => 'birthdate')); $formutil->addElementMaritalStatus($this, array('dimension' => 3)); $formutil->addElementPhone($this, array('class' => 'float-left')); $formutil->addElementPhone($this, array('name' => 'mobilephone', 'label' => 'Mobile phone', 'modelfield' => 'mobilephone')); $formutil->addElementEmail($this); $formutil->addElementAddress($this); $formutil->addElementAddressNumber($this); $formutil->addElementAddressDetails($this); $formutil->addElementPostalCode($this); $formutil->addElementCityId($this, array('required' => true)); $formutil->addElementCityRegionId($this, array('showcity' => true)); $formutil->addElementWebsite($this); $formutil->addElementButtonSave($this); $formutil->addElementButtonCancel($this); $this->addDisplayGroup(array('name', 'gender', 'birthdate', 'marital_status', 'phone', 'mobilephone', 'email', 'address', 'addressnumber', 'addressdetails', 'postalcode', 'city_id', 'city_region_id', 'website'), 'personform', array('legend' => '')); // $phonesForm = new Twitter_Bootstrap_Form_Inline(); // $formutil->addElementPhone($phonesForm); // $formutil->addElementPhone($phonesForm, array( // 'name' => 'mobilephone', // 'label'=> 'Mobile Phone', // 'modelfield' => 'mobilephone' // )); // // $phonesForm->addDisplayGroup(array( // 'phone', 'mobilephone', // ), 'personformphone', // array( // 'legend' => 'Phones', // ) // ); // // $this->addSubForm($phonesForm, 'phonesform'); // $this->addDisplayGroup(array('save', 'cancel'), 'actions-end', array('disableLoadDefaultDecorators' => true, 'decorators' => array('Actions'))); }
public function init() { $this->translate = Zend_Registry::get("Zend_Translate"); $formutil = new Agana_Form_Util($this->_action, $this->_model); $this->setName("personhelped"); $this->setMethod('post'); $this->_addClassNames('well'); $this->addAttribs(array('load-in' => 'content-container')); $this->addElement($this->_getIdElement()); //$this->_addElementName(); $this->_addElementPerson(); $formutil->addElementDate($this, array('name' => 'first_help_date', 'modelfield' => 'first_help_date', 'label' => 'First help date', 'description' => 'When the first help was made for this person', 'required' => false, 'default' => 'today')); $this->_addElementReligion(); $formutil->addElementStateId($this, array('name' => 'born_state_id', 'modelfield' => 'born_state_id', 'required' => true)); $formutil->addElementCityId($this, array('name' => 'born_city_id', 'modelfield' => 'born_city_id', 'required' => true)); $this->_addElementProfessionalOccupation(); $formutil->addElementDescription($this, array('label' => 'Professional experience', 'name' => 'professional_experience', 'modelfield' => 'professional_experience')); $this->addElement('checkbox', 'live_with_family', array('label' => 'Live with family', 'value' => $this->_model ? $this->_model->getLive_with_family() : '', 'description' => 'Check this field if this person live with his/her family')); $this->_addElementHomeSituation(); $this->_addElementRentValue(); $this->_addElementHomeArea(); $this->_addElementHomeType(); $formutil->addElementDate($this, array('name' => 'home_since', 'modelfield' => 'home_since', 'label' => 'Living since', 'description' => 'Since that date lives in this house', 'required' => true, 'default' => 'false')); $this->addElement('text', 'home_pieces_number', array('label' => 'Home pieces', 'value' => $this->_model ? $this->_model->getHome_pieces_number() : '', 'type' => 'number', 'required' => true, 'class' => 'mask-input', 'data-mask' => '{"mask": "9", "repeat": 2, "greedy":false}')); $formutil->addElementButtonSave($this); $formutil->addElementButtonCancel($this); $this->addDisplayGroup(array('id', 'first_help_date', 'religion'), 'personhelpedform', array()); $this->addDisplayGroup(array('born_state_id', 'born_city_id'), 'personhelpedbornform', array('legend' => 'Birth data')); $this->addDisplayGroup(array('professional_occupation_choice', 'professional_occupation', 'professional_experience'), 'personhelpedprofessionalform', array('legend' => 'Professional data')); $this->addDisplayGroup(array('live_with_family', 'home_since', 'home_situation_choice', 'home_situation', 'rent_value', 'home_area_choice', 'home_area', 'home_type_choice', 'home_type', 'home_pieces_number'), 'personhelpedhomeform', array('legend' => 'Home data')); $this->addDisplayGroup(array('save', 'cancel'), 'actions-end', array('disableLoadDefaultDecorators' => true, 'decorators' => array('Actions'))); }