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'))); }
public function init() { $formutil = new Agana_Form_Util(null); $this->setName("report-persons-by-project"); $this->setMethod('post'); //$this->addAttribs(array('load-in' => 'content-container')); $this->addProjects(); $el = $formutil->addElementProjectStatus($this, array('label' => $this->getTranslator()->_('Filter by') . ' status', 'first-options' => array(array('value' => null, 'label' => 'Any status')))); $el = $formutil->addElementDate($this, array('name' => 'date_from', 'label' => 'À partir da data', 'default' => false, 'addDescriptionFormat' => false)); $el = $formutil->addElementDate($this, array('name' => 'date_to', 'label' => 'Até a data', 'default' => false, 'addDescriptionFormat' => false)); $this->addElement('checkbox', 'summarized', array('label' => 'Resumido', 'description' => 'Check this field to print this report in a summarized format')); //$formutil->addElementButtonPrint($this, array('type'=>'link')); $this->addDisplayGroup(array('id', 'project_id', 'status', 'date_from', 'date_to', 'summarized'), 'project', array()); }