/** * Build the form object. */ public function buildQuickForm() { parent::buildQuickForm(); if ($this->_action & CRM_Core_Action::DELETE) { return; } $this->applyFilter('__ALL__', 'trim'); $attributes = CRM_Core_DAO::getAttribute('CRM_Batch_DAO_Batch'); $this->add('text', 'title', ts('Batch Name'), $attributes['name'], TRUE); $batchTypes = CRM_Batch_BAO_Batch::buildOptions('type_id'); $type = $this->add('select', 'type_id', ts('Type'), $batchTypes); if ($this->_action & CRM_Core_Action::UPDATE) { $type->freeze(); } $this->add('textarea', 'description', ts('Description'), $attributes['description']); $this->add('text', 'item_count', ts('Number of Items'), $attributes['item_count'], TRUE); $this->add('text', 'total', ts('Total Amount'), $attributes['total'], TRUE); }