Example #1
0
 public function init()
 {
     $formutil = new Agana_Form_Util($this->_action, $this->_model);
     $this->setName("project");
     $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' => 60));
     //$this->addElementStatus();
     $formutil->addElementProjectStatus($this);
     $formutil->addElementDescription($this, array('name' => 'abstract', 'label' => 'Abstract', 'maxlength' => 1200, 'rows' => 10, 'dimension' => 11, 'required' => true, 'modelfield' => 'abstract'));
     $formutil->addElementDate($this, array('name' => 'startdateexpected', 'label' => 'Start date expected', 'modelfield' => 'startdateexpected', 'default' => false));
     $formutil->addElementDate($this, array('name' => 'startdatereal', 'label' => 'Start date real', 'modelfield' => 'startdatereal', 'default' => false));
     $formutil->addElementDate($this, array('name' => 'finishdateexpected', 'label' => 'Finish date expected', 'modelfield' => 'finishdateexpected', 'default' => false));
     $formutil->addElementDate($this, array('name' => 'finishdatereal', 'label' => 'Finish date real', 'modelfield' => 'finishdatereal', 'default' => false));
     $formutil->addElementDescription($this, array('name' => 'fulldescription', 'label' => 'Full description', 'maxlength' => 0, 'dimension' => 11, 'rows' => 25, 'modelfield' => 'fulldescription', 'editor' => true));
     $formutil->addElementButtonSave($this);
     $formutil->addElementButtonCancel($this);
     $this->addDisplayGroup(array('name', 'status', 'abstract', 'startdateexpected', 'startdatereal', 'finishdateexpected', 'finishdatereal', 'fulldescription'), 'tasktypeform', array());
     $this->addDisplayGroup(array('save', 'cancel'), 'actions-end', array('disableLoadDefaultDecorators' => true, 'decorators' => array('Actions')));
 }
Example #2
0
 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')));
 }
Example #3
0
 public function init()
 {
     $formutil = new Agana_Form_Util($this->_action, $this->_model);
     $this->setName("jobfunction");
     $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' => 50));
     $formutil->addElementDescription($this);
     $formutil->addElementButtonSave($this);
     $formutil->addElementButtonCancel($this);
     $this->addDisplayGroup(array('name', 'description'), 'jobfunctionform', array());
     $this->addDisplayGroup(array('save', 'cancel'), 'actions-end', array('disableLoadDefaultDecorators' => true, 'decorators' => array('Actions')));
 }