Merge pull request #22487 from mattwire/repeattransactiontemplatecontribution
[civicrm-core.git] / CRM / Batch / Page / Batch.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
18 /**
19 * Page for displaying list of current batches
20 */
21 class CRM_Batch_Page_Batch extends CRM_Core_Page_Basic {
22
23 /**
24 * The action links that we need to display for the browse screen.
25 *
26 * @var array
27 */
28 public static $_links = NULL;
29
30 /**
31 * Get BAO Name.
32 *
33 * @return string
34 * Classname of BAO.
35 */
36 public function getBAOName() {
37 return 'CRM_Batch_BAO_Batch';
38 }
39
40 /**
41 * Get action Links.
42 */
43 public function &links() {
44 }
45
46 /**
47 * Get name of edit form.
48 *
49 * @return string
50 * Classname of edit form.
51 */
52 public function editForm() {
53 return 'CRM_Batch_Form_Batch';
54 }
55
56 /**
57 * Get edit form name.
58 *
59 * @return string
60 * name of this page.
61 */
62 public function editName() {
63 return ts('Batch Processing');
64 }
65
66 /**
67 * Get user context.
68 *
69 * @param null $mode
70 *
71 * @return string
72 * user context.
73 */
74 public function userContext($mode = NULL) {
75 return CRM_Utils_System::currentPath();
76 }
77
78 /**
79 * Browse all entities.
80 */
81 public function browse() {
82 $status = CRM_Utils_Request::retrieve('status', 'Positive', CRM_Core_DAO::$_nullObject, FALSE, 1);
83 $this->assign('status', $status);
84 $this->search();
85 }
86
87 public function search() {
88 if ($this->_action & (CRM_Core_Action::ADD |
89 CRM_Core_Action::UPDATE |
90 CRM_Core_Action::DELETE
91 )
92 ) {
93 return;
94 }
95
96 $form = new CRM_Core_Controller_Simple('CRM_Batch_Form_Search', ts('Search Batches'), CRM_Core_Action::ADD);
97 $form->setEmbedded(TRUE);
98 $form->setParent($this);
99 $form->process();
100 $form->run();
101 }
102
103 }