4 +--------------------------------------------------------------------+
5 | CiviCRM version 4.3 |
6 +--------------------------------------------------------------------+
7 | Copyright CiviCRM LLC (c) 2004-2013 |
8 +--------------------------------------------------------------------+
9 | This file is a part of CiviCRM. |
11 | CiviCRM is free software; you can copy, modify, and distribute it |
12 | under the terms of the GNU Affero General Public License |
13 | Version 3, 19 November 2007 and the CiviCRM Licensing Exception. |
15 | CiviCRM is distributed in the hope that it will be useful, but |
16 | WITHOUT ANY WARRANTY; without even the implied warranty of |
17 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. |
18 | See the GNU Affero General Public License for more details. |
20 | You should have received a copy of the GNU Affero General Public |
21 | License and the CiviCRM Licensing Exception along |
22 | with this program; if not, contact CiviCRM LLC |
23 | at info[AT]civicrm[DOT]org. If you have questions about the |
24 | GNU Affero General Public License or the licensing of CiviCRM, |
25 | see the CiviCRM license FAQ at http://civicrm.org/licensing |
26 +--------------------------------------------------------------------+
32 * @copyright CiviCRM LLC (c) 2004-2013
38 * Page for displaying list of financial types
40 class CRM_Financial_Page_FinancialBatch
extends CRM_Core_Page_Basic
{
43 * The action links that we need to display for the browse screen
48 static $_links = null;
53 * @return string classname of BAO.
55 function getBAOName() {
56 return 'CRM_Batch_BAO_Batch';
62 * @return array (reference) of action links
65 if (!(self
::$_links)) {
66 self
::$_links = array();
74 * This method is called after the page is created. It checks for the
75 * type of action and executes that action.
76 * Finally it calls the parent's run method.
83 $context = CRM_Utils_Request
::retrieve('context', 'String', $this);
84 $this->set("context", $context);
85 // assign vars to templates
86 $id = CRM_Utils_Request
::retrieve('id', 'Positive', $this, false, 0);
87 $action = CRM_Utils_Request
::retrieve('action', 'String', $this, false, 'browse'); // default to 'browse'
89 // what action to take ?
91 (CRM_Core_Action
::UPDATE |
92 CRM_Core_Action
::ADD |
93 CRM_Core_Action
::CLOSE |
94 CRM_Core_Action
::REOPEN |
95 CRM_Core_Action
::EXPORT
)) {
96 $this->edit($action, $id) ;
104 * Get name of edit form
106 * @return string classname of edit form.
108 function editForm() {
109 return 'CRM_Financial_Form_FinancialBatch';
115 * @return string name of this page.
117 function editName() {
118 return 'Accounting Batch';
124 * Redirect to civicrm home page when clicked on cancel button
126 * @return string user context.
128 function userContext($mode = null) {
129 $context = $this->get("context");
130 if ($mode == CRM_Core_Action
::UPDATE ||
($mode = CRM_Core_Action
::ADD
& isset($context))) {
131 return "civicrm/financial/financialbatches";
136 function userContextParams($mode = NULL) {
137 $context = $this->get("context");
138 if ($mode == CRM_Core_Action
::UPDATE ||
($mode = CRM_Core_Action
::ADD
& isset($context))) {
139 return "reset=1&batchStatus={$context}";