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 update a saved search.
21 class CRM_Contact_Form_Task_SaveSearch_Update
extends CRM_Contact_Form_Task_SaveSearch
{
24 * Build all the data structures needed to build the form.
26 public function preProcess() {
29 $this->_id
= $this->get('ssID');
31 // fetch the value from the group id gid
32 $gid = $this->get('gid');
34 $this->_id
= CRM_Core_DAO
::getFieldValue('CRM_Contact_DAO_Group', $gid, 'saved_search_id');
40 * Set default values for the form.
42 public function setDefaultValues() {
47 $params = ['saved_search_id' => $this->_id
];
48 CRM_Contact_BAO_Group
::retrieve($params, $defaults);
50 if (!empty($defaults['group_type'])) {
51 $types = explode(CRM_Core_DAO
::VALUE_SEPARATOR
,
52 substr($defaults['group_type'], 1, -1)
54 $defaults['group_type'] = array();
55 foreach ($types as $type) {
56 $defaults['group_type'][$type] = 1;