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_Case_Form_Task_SearchTaskHookSample
extends CRM_Case_Form_Task
{
25 * Build all the data structures needed to build the form.
27 public function preProcess() {
30 // display name and email of all contact ids
31 $caseIDs = implode(',', $this->_entityIds
);
32 $statusId = CRM_Core_DAO
::getFieldValue('CRM_Core_DAO_OptionGroup', 'case_status', 'id', 'name');
34 SELECT ct.display_name as display_name,
35 cs.start_date as start_date,
39 INNER JOIN civicrm_case_contact cc ON ( cs.id = cc.case_id)
40 INNER JOIN civicrm_contact ct ON ( cc.contact_id = ct.id)
41 LEFT JOIN civicrm_option_value ov ON (cs.status_id = ov.value AND ov.option_group_id = {$statusId} )
42 WHERE cs.id IN ( {$caseIDs} )";
44 $dao = CRM_Core_DAO
::executeQuery($query);
45 while ($dao->fetch()) {
47 'display_name' => $dao->display_name
,
48 'start_date' => CRM_Utils_Date
::customFormat($dao->start_date
),
49 'status' => $dao->status
,
52 $this->assign('rows', $rows);
56 * Build the form object.
58 public function buildQuickForm() {