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
21 * This class provides the functionality to save a search
22 * Saved Searches are used for saving frequently used queries
24 class CRM_Member_Form_Task_SearchTaskHookSample
extends CRM_Member_Form_Task
{
27 * Build all the data structures needed to build the form.
31 public function preProcess() {
34 // display name and membership details of all selected contacts
35 $memberIDs = implode(',', $this->_memberIds
);
38 SELECT mem.start_date as start_date,
39 mem.end_date as end_date,
41 ct.display_name as display_name
42 FROM civicrm_membership mem
43 INNER JOIN civicrm_contact ct ON ( mem.contact_id = ct.id )
44 WHERE mem.id IN ( $memberIDs )";
46 $dao = CRM_Core_DAO
::executeQuery($query);
47 while ($dao->fetch()) {
49 'display_name' => $dao->display_name
,
50 'start_date' => CRM_Utils_Date
::customFormat($dao->start_date
),
51 'end_date' => CRM_Utils_Date
::customFormat($dao->end_date
),
52 'source' => $dao->source
,
55 $this->assign('rows', $rows);
59 * Build the form object.
63 public function buildQuickForm() {