Ejemplo n.º 1
0
 /**
  * Function to build the form
  *
  * @return None
  * @access public
  */
 function buildQuickForm()
 {
     $this->applyFilter('__ALL__', 'trim');
     $this->add('text', 'name', ts('Name'), CRM_Core_DAO::getAttribute('CRM_Mailing_DAO_Component', 'name'), true);
     $this->addRule('name', ts('Name already exists in Database.'), 'objectExists', array('CRM_Mailing_DAO_Component', $this->_id));
     $this->add('select', 'component_type', ts('Component Type'), CRM_Core_SelectValues::mailingComponents());
     $this->add('text', 'subject', ts('Subject'), CRM_Core_DAO::getAttribute('CRM_Mailing_DAO_Component', 'subject'), true);
     $this->add('textarea', 'body_text', ts('Body in text format'), CRM_Core_DAO::getAttribute('CRM_Mailing_DAO_Component', 'body_text'), true);
     $this->add('textarea', 'body_html', ts('Body in html format'), CRM_Core_DAO::getAttribute('CRM_Mailing_DAO_Component', 'body_html'), true);
     $this->add('checkbox', 'is_default', ts('Default?'));
     $this->add('checkbox', 'is_active', ts('Enabled?'));
     $this->addButtons(array(array('type' => 'next', 'name' => ts('Save'), 'isDefault' => true), array('type' => 'cancel', 'name' => ts('Cancel'))));
 }
Ejemplo n.º 2
0
 /**
  * Build the form object.
  */
 public function buildQuickForm()
 {
     $this->applyFilter(array('name', 'subject', 'body_html'), 'trim');
     $this->add('text', 'name', ts('Name'), CRM_Core_DAO::getAttribute('CRM_Mailing_DAO_Component', 'name'), TRUE);
     $this->addRule('name', ts('Name already exists in Database.'), 'objectExists', array('CRM_Mailing_DAO_Component', $this->_id));
     $this->add('select', 'component_type', ts('Component Type'), CRM_Core_SelectValues::mailingComponents());
     $this->add('text', 'subject', ts('Subject'), CRM_Core_DAO::getAttribute('CRM_Mailing_DAO_Component', 'subject'), TRUE);
     $this->add('textarea', 'body_text', ts('Body - TEXT Format'), CRM_Core_DAO::getAttribute('CRM_Mailing_DAO_Component', 'body_text'), TRUE);
     $this->add('textarea', 'body_html', ts('Body - HTML Format'), CRM_Core_DAO::getAttribute('CRM_Mailing_DAO_Component', 'body_html'));
     $this->addYesNo('is_default', ts('Default?'));
     $this->addYesNo('is_active', ts('Enabled?'));
     $this->addFormRule(array('CRM_Mailing_Form_Component', 'dataRule'));
     $this->addButtons(array(array('type' => 'next', 'name' => ts('Save'), 'isDefault' => TRUE), array('type' => 'cancel', 'name' => ts('Cancel'))));
 }