set("context", $context); // assign vars to templates $id = CRM_Utils_Request::retrieve('id', 'Positive', $this, false, 0); $action = CRM_Utils_Request::retrieve('action', 'String', $this, false, 'browse'); // default to 'browse' // what action to take ? if ($action & (CRM_Core_Action::UPDATE | CRM_Core_Action::ADD | CRM_Core_Action::CLOSE | CRM_Core_Action::REOPEN | CRM_Core_Action::EXPORT)) { $this->edit($action, $id) ; } // parent run return parent::run(); } /** * Get name of edit form * * @return string classname of edit form. */ function editForm() { return 'CRM_Financial_Form_FinancialBatch'; } /** * Get edit form name * * @return string name of this page. */ function editName() { return 'Accounting Batch'; } /** * Get user context. * * Redirect to civicrm home page when clicked on cancel button * * @return string user context. */ function userContext($mode = null) { $context = $this->get("context"); if ($mode == CRM_Core_Action::UPDATE || ($mode = CRM_Core_Action::ADD & isset($context))) { return "civicrm/financial/financialbatches"; } return 'civicrm'; } function userContextParams($mode = NULL) { $context = $this->get("context"); if ($mode == CRM_Core_Action::UPDATE || ($mode = CRM_Core_Action::ADD & isset($context))) { return "reset=1&batchStatus={$context}"; } } }