3 +--------------------------------------------------------------------+
4 | Copyright CiviCRM LLC. All rights reserved. |
6 | This work is published under the GNU AGPLv3 license with some |
7 | permitted exceptions and without any warranty. For full license |
8 | and copyright information, see https://civicrm.org/licensing |
9 +--------------------------------------------------------------------+
15 * @copyright CiviCRM LLC https://civicrm.org/licensing
19 * This class provides the functionality to save a search
20 * Saved Searches are used for saving frequently used queries
22 class CRM_Contribute_Form_Task_SearchTaskHookSample
extends CRM_Contribute_Form_Task
{
25 * Build all the data structures needed to build the form.
27 public function preProcess() {
30 // display name and contribution details of all selected contacts
31 $contribIDs = implode(',', $this->_contributionIds
);
34 SELECT co.total_amount as amount,
35 co.receive_date as receive_date,
37 ct.display_name as display_name
38 FROM civicrm_contribution co
39 INNER JOIN civicrm_contact ct ON ( co.contact_id = ct.id )
40 WHERE co.id IN ( $contribIDs )";
42 $dao = CRM_Core_DAO
::executeQuery($query);
44 while ($dao->fetch()) {
46 'display_name' => $dao->display_name
,
47 'amount' => $dao->amount
,
48 'source' => $dao->source
,
49 'receive_date' => $dao->receive_date
,
52 $this->assign('rows', $rows);
56 * Build the form object.
58 public function buildQuickForm() {