/** * Build the form object. * * @return void */ public function buildQuickForm() { $this->add('text', 'pcp_title', ts('Title'), NULL, TRUE); $this->add('textarea', 'pcp_intro_text', ts('Welcome'), NULL, TRUE); $this->add('text', 'goal_amount', ts('Your Goal'), NULL, TRUE); $this->addRule('goal_amount', ts('Goal Amount should be a numeric value'), 'money'); $attributes = array(); if ($this->_component == 'event') { if ($this->get('action') & CRM_Core_Action::ADD) { $attributes = array('value' => ts('Join Us'), 'onClick' => 'select();'); } $this->add('text', 'donate_link_text', ts('Sign up Button'), $attributes); } else { if ($this->get('action') & CRM_Core_Action::ADD) { $attributes = array('value' => ts('Donate Now'), 'onClick' => 'select();'); } $this->add('text', 'donate_link_text', ts('Donation Button'), $attributes); } $attrib = array('rows' => 8, 'cols' => 60); $this->add('textarea', 'page_text', ts('Your Message'), NULL, FALSE); $maxAttachments = 1; CRM_Core_BAO_File::buildAttachment($this, 'civicrm_pcp', $this->_pageId, $maxAttachments); $this->addElement('checkbox', 'is_thermometer', ts('Progress Bar')); $this->addElement('checkbox', 'is_honor_roll', ts('Honor Roll'), NULL); if ($this->_pageId) { $params = array('id' => $this->_pageId); CRM_Core_DAO::commonRetrieve('CRM_PCP_DAO_PCP', $params, $pcpInfo); $owner_notification_option = CRM_Core_DAO::getFieldValue('CRM_PCP_DAO_PCPBlock', $pcpInfo['pcp_block_id'], 'owner_notify_id'); } else { $owner_notification_option = CRM_PCP_BAO_PCP::getOwnerNotificationId($this->controller->get('component_page_id'), $this->_component ? $this->_component : 'contribute'); } if ($owner_notification_option == CRM_Core_OptionGroup::getValue('pcp_owner_notify', 'owner_chooses', 'name')) { $this->assign('owner_notification_option', TRUE); $this->addElement('checkbox', 'is_notify', ts('Notify me via email when someone donates to my page'), NULL); } $this->addElement('checkbox', 'is_active', ts('Active')); if ($this->_context == 'dashboard') { CRM_Core_Session::singleton()->pushUserContext(CRM_Utils_System::url('civicrm/admin/pcp', 'reset=1')); } $this->addButtons(array(array('type' => 'upload', 'name' => ts('Save'), 'isDefault' => TRUE), array('type' => 'cancel', 'name' => ts('Cancel')))); $this->addFormRule(array('CRM_PCP_Form_Campaign', 'formRule'), $this); }