/** * Build all the data structures needed to build the form. */ public function preProcess() { $id = CRM_Utils_Request::retrieve('id', 'Positive', $this, FALSE); if ($id) { $this->_contributionIds = array($id); $this->_componentClause = " civicrm_contribution.id IN ( {$id} ) "; $this->_single = TRUE; $this->assign('totalSelectedContributions', 1); } else { parent::preProcess(); } // check that all the contribution ids have pending status $query = "\nSELECT count(*)\nFROM civicrm_contribution\nWHERE contribution_status_id != 1\nAND {$this->_componentClause}"; $count = CRM_Core_DAO::singleValueQuery($query); if ($count != 0) { CRM_Core_Error::statusBounce("Please select only online contributions with Completed status."); } $this->assign('single', $this->_single); $qfKey = CRM_Utils_Request::retrieve('qfKey', 'String', $this); $urlParams = 'force=1'; if (CRM_Utils_Rule::qfKey($qfKey)) { $urlParams .= "&qfKey={$qfKey}"; } $url = CRM_Utils_System::url('civicrm/contribute/search', $urlParams); $breadCrumb = array(array('url' => $url, 'title' => ts('Search Results'))); CRM_Contact_Form_Task_EmailCommon::preProcessFromAddress($this, FALSE); // we have all the contribution ids, so now we get the contact ids parent::setContactIDs(); CRM_Utils_System::appendBreadCrumb($breadCrumb); CRM_Utils_System::setTitle(ts('Print Contribution Receipts')); }
/** * Test generating domain emails */ public function testDomainEmailGeneation() { $emails = CRM_Contact_Form_Task_EmailCommon::domainEmails(); $this->assertNotEmpty($emails); $optionValue = $this->callAPISuccess('OptionValue', 'Get', array('id' => $this->_optionValue['id'])); $this->assertTrue(array_key_exists('"Seamus Lee" <*****@*****.**>', $emails)); $this->assertEquals('"Seamus Lee" <*****@*****.**>', $optionValue['values'][$this->_optionValue['id']]['label']); }
/** * process the form after the input has been submitted and validated * * @access public * @return None */ public function postProcess() { CRM_Contact_Form_Task_EmailCommon::postProcess($this); }