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.
21 * Saved Searches are used for saving frequently used queries
23 class CRM_Contact_Form_Task_HookSample
extends CRM_Contact_Form_Task
{
26 * Build all the data structures needed to build the form.
28 public function preProcess() {
31 // display name and email of all contact ids
32 $contactIDs = implode(',', $this->_contactIds
);;
34 SELECT c.id as contact_id, c.display_name as name,
35 c.contact_type as contact_type, e.email as email
36 FROM civicrm_contact c, civicrm_email e
37 WHERE e.contact_id = c.id
39 AND c.id IN ( $contactIDs )";
42 $dao = CRM_Core_DAO
::executeQuery($query);
43 while ($dao->fetch()) {
45 'id' => $dao->contact_id
,
47 'contact_type' => $dao->contact_type
,
48 'email' => $dao->email
,
52 $this->assign('rows', $rows);
56 * Build the form object.
58 public function buildQuickForm() {
59 $this->addDefaultButtons(ts('Back to Search'), 'done');
63 * Process the form after the input has been submitted and validated.
65 public function postProcess() {