Merge pull request #21940 from eileenmcnaughton/debug
[civicrm-core.git] / CRM / Batch / Form / Search.php
1 <?php
2 /*
3 +--------------------------------------------------------------------+
4 | Copyright CiviCRM LLC. All rights reserved. |
5 | |
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 +--------------------------------------------------------------------+
10 */
11
12 /**
13 *
14 * @package CRM
15 * @copyright CiviCRM LLC https://civicrm.org/licensing
16 */
17 class CRM_Batch_Form_Search extends CRM_Core_Form {
18
19 /**
20 * Set default values.
21 *
22 * @return array
23 */
24 public function setDefaultValues() {
25 $defaults = [];
26
27 $status = CRM_Utils_Request::retrieve('status', 'Positive', CRM_Core_DAO::$_nullObject, FALSE, 1);
28
29 $defaults['batch_status'] = $status;
30 return $defaults;
31 }
32
33 public function buildQuickForm() {
34 $this->add('text', 'title', ts('Find'),
35 CRM_Core_DAO::getAttribute('CRM_Batch_DAO_Batch', 'title')
36 );
37
38 $this->addButtons(
39 [
40 [
41 'type' => 'refresh',
42 'name' => ts('Search'),
43 'isDefault' => TRUE,
44 ],
45 ]
46 );
47
48 parent::buildQuickForm();
49 $this->assign('suppressForm', TRUE);
50 }
51
52 }