Merge pull request #16001 from agileware/CIVICRM-1383
[civicrm-core.git] / CRM / Batch / Page / Batch.php
CommitLineData
6a488035
TO
1<?php
2/*
3 +--------------------------------------------------------------------+
bc77d7c0 4 | Copyright CiviCRM LLC. All rights reserved. |
6a488035 5 | |
bc77d7c0
TO
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 |
6a488035
TO
9 +--------------------------------------------------------------------+
10 */
11
12/**
13 *
14 * @package CRM
ca5cec67 15 * @copyright CiviCRM LLC https://civicrm.org/licensing
6a488035
TO
16 */
17
18/**
19 * Page for displaying list of current batches
20 */
21class CRM_Batch_Page_Batch extends CRM_Core_Page_Basic {
22
23 /**
eceb18cc 24 * The action links that we need to display for the browse screen.
6a488035
TO
25 *
26 * @var array
6a488035 27 */
62d3ee27 28 public static $_links = NULL;
6a488035
TO
29
30 /**
eceb18cc 31 * Get BAO Name.
6a488035 32 *
a6c01b45
CW
33 * @return string
34 * Classname of BAO.
6a488035 35 */
00be9182 36 public function getBAOName() {
6a488035
TO
37 return 'CRM_Batch_BAO_Batch';
38 }
39
40 /**
eceb18cc 41 * Get action Links.
6a488035 42 */
691df66d
TO
43 public function &links() {
44 }
6a488035
TO
45
46 /**
eceb18cc 47 * Get name of edit form.
6a488035 48 *
a6c01b45
CW
49 * @return string
50 * Classname of edit form.
6a488035 51 */
00be9182 52 public function editForm() {
6a488035
TO
53 return 'CRM_Batch_Form_Batch';
54 }
55
56 /**
eceb18cc 57 * Get edit form name.
6a488035 58 *
a6c01b45
CW
59 * @return string
60 * name of this page.
6a488035 61 */
00be9182 62 public function editName() {
6a488035
TO
63 return ts('Batch Processing');
64 }
65
66 /**
67 * Get user context.
68 *
77b97be7
EM
69 * @param null $mode
70 *
a6c01b45
CW
71 * @return string
72 * user context.
6a488035 73 */
00be9182 74 public function userContext($mode = NULL) {
6a488035
TO
75 return CRM_Utils_System::currentPath();
76 }
77
78 /**
100fef9d 79 * Browse all entities.
6a488035 80 */
00be9182 81 public function browse() {
6a488035
TO
82 $status = CRM_Utils_Request::retrieve('status', 'Positive', CRM_Core_DAO::$_nullObject, FALSE, 1);
83 $this->assign('status', $status);
84 $this->search();
85 }
86
00be9182 87 public function search() {
691df66d 88 if ($this->_action & (CRM_Core_Action::ADD |
6a488035
TO
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 }
96025800 102
6a488035 103}