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
20 * Page for displaying list of financial batches
22 class CRM_Financial_Page_BatchTransaction
extends CRM_Core_Page_Basic
{
24 * The action links that we need to display for the browse screen.
28 public static $_links = NULL;
29 public static $_entityID;
31 public static $_columnHeader = NULL;
32 public static $_returnvalues = NULL;
40 public function getBAOName() {
41 return 'CRM_Batch_BAO_Batch';
48 * While this function only references static self::$_links, we can't make
49 * the function static because we need to match CRM_Core_Page_Basic. Possibly
50 * the intent was caching, but there's nothing very time-consuming in here
51 * that needs it so do we even need $_links? The variable is public - a quick
52 * look doesn't seem like it's used on its own, but it's hard to fully check
56 * (reference) of action links
58 public function &links() {
59 if (!(self
::$_links)) {
63 'url' => 'civicrm/contact/view/contribution',
64 'qs' => 'reset=1&id=%%contid%%&cid=%%cid%%&action=view&context=contribution&selectedChild=contribute',
65 'title' => ts('View Contribution'),
68 'name' => ts('Remove'),
69 'title' => ts('Remove Transaction'),
70 'extra' => 'onclick = "assignRemove( %%id%%,\'' . 'remove' . '\' );"',
80 * This method is called after the page is created. It checks for the
81 * type of action and executes that action.
82 * Finally it calls the parent's run method.
84 public function run() {
85 // get the requested action
86 // default to 'browse'
87 $action = CRM_Utils_Request
::retrieve('action', 'String', $this, FALSE, 'browse');
89 // assign vars to templates
90 $this->assign('action', $action);
92 self
::$_entityID = CRM_Utils_Request
::retrieve('bid', 'Positive');
94 if (isset(self
::$_entityID)) {
95 $statusID = CRM_Core_DAO
::getFieldValue('CRM_Batch_BAO_Batch', self
::$_entityID, 'status_id');
100 'title' => ts('Accounting Batches'),
101 'url' => CRM_Utils_System
::url('civicrm/financial/financialbatches',
102 "reset=1&batchStatus=$statusID"),
106 CRM_Utils_System
::appendBreadCrumb($breadCrumb);
107 $this->edit($action, self
::$_entityID);
108 return parent
::run();
112 * Get name of edit form.
115 * Classname of edit form.
117 public function editForm() {
118 return 'CRM_Financial_Form_BatchTransaction';
122 * Get edit form name.
127 public function editName() {
139 public function userContext($mode = NULL) {
140 return 'civicrm/batchtransaction';