Documentation

Mage_Adminhtml_Report_SalesController extends Mage_Adminhtml_Controller_Report_Abstract
in package

Allows dispatching before and after events for each controller action

Table of Contents

Constants

ADMIN_RESOURCE  : mixed = 'admin'
ACL resource
FLAG_IS_URLS_CHECKED  : mixed = 'check_url_settings'
Name of "is URLs checked" flag
FLAG_NO_CHECK_INSTALLATION  : mixed = 'no-install-check'
FLAG_NO_DISPATCH  : mixed = 'no-dispatch'
FLAG_NO_DISPATCH_BLOCK_EVENT  : mixed = 'no-beforeGenerateLayoutBlocksDispatch'
FLAG_NO_POST_DISPATCH  : mixed = 'no-postDispatch'
FLAG_NO_PRE_DISPATCH  : mixed = 'no-preDispatch'
FLAG_NO_START_SESSION  : mixed = 'no-startSession'
PARAM_NAME_BASE64_URL  : mixed = 'r64'
PARAM_NAME_ERROR_URL  : mixed = 'error_url'
PARAM_NAME_REFERER_URL  : mixed = 'referer_url'
PARAM_NAME_SUCCESS_URL  : mixed = 'success_url'
PARAM_NAME_URL_ENCODED  : mixed = 'uenc'
PROFILER_KEY  : mixed = 'dispatch.controller.action'
SESSION_MAX_LIFETIME  : mixed = 60 * 60 * 24 * 400
SESSION_MIN_LIFETIME  : mixed = 60
SESSION_NAMESPACE  : mixed = 'maho_admin_session'
Session constants to refer in other places

Properties

$_adminSession  : null|Mage_Admin_Model_Session
Admin session model
$_currentArea  : string
Currently used area
$_flags  : array<string|int, mixed>
Action flags
$_isLayoutLoaded  : bool
Whether layout is loaded
$_publicActions  : array<string|int, mixed>
Array of actions which can be processed without secret key validation
$_realModuleName  : string
Real module name (like 'Mage_Module')
$_removeDefaultTitle  : bool
Whether the default title should be removed
$_request  : Mage_Core_Controller_Request_Http
Request object
$_response  : Mage_Core_Controller_Response_Http
Response object
$_sessionNamespace  : string
Namespace for session.
$_titles  : array<string|int, mixed>
Title parts to be rendered in the page head title
$_usedModuleName  : mixed
Used module name in current adminhtml controller

Methods

__()  : string
Translate a phrase
__construct()  : mixed
_initAction()  : $this
Add report/sales breadcrumbs
_initReportAction()  : Mage_Adminhtml_Controller_Report_Abstract
Report action init operations
addActionLayoutHandles()  : $this
bestsellersAction()  : void
couponsAction()  : void
deniedAction()  : void
dispatch()  : mixed
exportBestsellersCsvAction()  : void
Export bestsellers report grid to CSV format
exportBestsellersExcelAction()  : void
Export bestsellers report grid to Excel XML format
exportCouponsCsvAction()  : void
Export coupons report grid to CSV format
exportCouponsExcelAction()  : void
Export coupons report grid to Excel XML format
exportInvoicedCsvAction()  : void
Export invoiced report grid to CSV format
exportInvoicedExcelAction()  : void
Export invoiced report grid to Excel XML format
exportRefundedCsvAction()  : void
Export refunded report grid to CSV format
exportRefundedExcelAction()  : void
Export refunded report grid to Excel XML format
exportSalesCsvAction()  : void
Export sales report grid to CSV format
exportSalesExcelAction()  : void
Export sales report grid to Excel XML format
exportShippingCsvAction()  : void
Export shipping report grid to CSV format
exportShippingExcelAction()  : void
Export shipping report grid to Excel XML format
exportTaxCsvAction()  : void
Export tax report grid to CSV format
exportTaxExcelAction()  : void
Export tax report grid to Excel XML format
generateLayoutBlocks()  : $this
generateLayoutXml()  : $this
getActionMethodName()  : string
Retrieve action method name
getFlag()  : array<string|int, mixed>|bool
Retrieve flag value
getFullActionName()  : string
Retrieve full bane of current action current controller and current module
getLayout()  : Mage_Core_Model_Layout
Retrieve current layout object
getRequest()  : Mage_Core_Controller_Request_Http
Retrieve request object
getResponse()  : Mage_Core_Controller_Response_Http
Retrieve response object
getUrl()  : string
Generate url by route and parameters
getUsedModuleName()  : string
Retrieve currently used module name
hasAction()  : bool
initLayoutMessages()  : $this
Initializing layout messages by message storage(s), loading and adding messages to layout messages block
invoicedAction()  : void
loadLayout()  : $this
Load layout by handles(s)
loadLayoutUpdates()  : $this
norouteAction()  : void
postDispatch()  : mixed
Dispatches event after action
preDispatch()  : $this
Controller pre-dispatch method
refundedAction()  : void
renderLayout()  : $this|void
Rendering layout
salesAction()  : void
setFlag()  : $this
Setting flag value
setRedirectWithCookieCheck()  : $this
setUsedModuleName()  : $this
Set currently used module name
shippingAction()  : void
taxAction()  : void
_addBreadcrumb()  : $this
_addContent()  : $this
_addJs()  : mixed
_addLeft()  : mixed
_construct()  : void
_filterDates()  : array<string|int, mixed>
Convert dates in array from localized to internal format
_filterDateTime()  : array<string|int, mixed>
Convert dates with time in array from localized to internal format
_forward()  : mixed
Throw control to different action (control and module if was specified).
_getHelper()  : Mage_Adminhtml_Helper_Data
Retrieve base admihtml helper
_getRealModuleName()  : string
Get real module name (like 'Mage_Module')
_getRefererUrl()  : string
Identify referer url via all accepted methods (HTTP_REFERER, regular or base64-encoded request param)
_getSession()  : Mage_Admin_Model_Session
Retrieve admin session model
_initLayoutMessages()  : $this
Initializing layout messages by message storage(s), loading and adding messages to layout messages block
_isAllowed()  : bool
Check current user permission on resource and privilege
_isUrlInternal()  : bool
Check url to be used as internal
_prepareDownloadResponse()  : $this
Declare headers and content file in response for file download
_redirect()  : $this
Set redirect into response
_redirectError()  : $this
Redirect to error page
_redirectReferer()  : Mage_Adminhtml_Controller_Action
Set referer url for redirect in response
_redirectSuccess()  : $this
Redirect to success page
_redirectUrl()  : $this
Set redirect url into response
_renderTitles()  : mixed
Prepare titles in the 'head' layout block Supposed to work only in actions where layout is rendered Falls back to the default logic if there are no titles eventually
_rewrite()  : bool
Support for controllers rewrites
_setActiveMenu()  : $this
Define active menu item in menu block
_showLastExecutionTime()  : Mage_Adminhtml_Controller_Report_Abstract
Add refresh statistics links
_title()  : $this
Add an extra title to the end or one from the end, or remove all
_validateCurrentPassword()  : mixed
Validate password for current admin user
_validateFormKey()  : bool
Validate Form Key
_validateRequestParam()  : bool
Validate request parameter
_validateRequestParams()  : bool
Validate request parameters
_validateSecretKey()  : bool
Validate Secret Key

Constants

FLAG_IS_URLS_CHECKED

Name of "is URLs checked" flag

public mixed FLAG_IS_URLS_CHECKED = 'check_url_settings'

FLAG_NO_CHECK_INSTALLATION

public mixed FLAG_NO_CHECK_INSTALLATION = 'no-install-check'

FLAG_NO_DISPATCH

public mixed FLAG_NO_DISPATCH = 'no-dispatch'

FLAG_NO_DISPATCH_BLOCK_EVENT

public mixed FLAG_NO_DISPATCH_BLOCK_EVENT = 'no-beforeGenerateLayoutBlocksDispatch'

FLAG_NO_POST_DISPATCH

public mixed FLAG_NO_POST_DISPATCH = 'no-postDispatch'

FLAG_NO_PRE_DISPATCH

public mixed FLAG_NO_PRE_DISPATCH = 'no-preDispatch'

FLAG_NO_START_SESSION

public mixed FLAG_NO_START_SESSION = 'no-startSession'

PARAM_NAME_BASE64_URL

public mixed PARAM_NAME_BASE64_URL = 'r64'

PARAM_NAME_ERROR_URL

public mixed PARAM_NAME_ERROR_URL = 'error_url'

PARAM_NAME_REFERER_URL

public mixed PARAM_NAME_REFERER_URL = 'referer_url'

PARAM_NAME_SUCCESS_URL

public mixed PARAM_NAME_SUCCESS_URL = 'success_url'

PARAM_NAME_URL_ENCODED

public mixed PARAM_NAME_URL_ENCODED = 'uenc'

PROFILER_KEY

public mixed PROFILER_KEY = 'dispatch.controller.action'

SESSION_MAX_LIFETIME

public mixed SESSION_MAX_LIFETIME = 60 * 60 * 24 * 400

SESSION_MIN_LIFETIME

public mixed SESSION_MIN_LIFETIME = 60

SESSION_NAMESPACE

Session constants to refer in other places

public mixed SESSION_NAMESPACE = 'maho_admin_session'

Max lifetime is set to 400 days, as chromium based browsers will not allow anything higher https://httpwg.org/http-extensions/draft-ietf-httpbis-rfc6265bis.html#name-cookie-lifetime-limits

Properties

$_currentArea

Currently used area

protected string $_currentArea = \Mage_Core_Model_App_Area::AREA_ADMINHTML

$_flags

Action flags

protected array<string|int, mixed> $_flags = []

for example used to disable rendering default layout

$_isLayoutLoaded

Whether layout is loaded

protected bool $_isLayoutLoaded = \false
Tags
see
self::loadLayout()

$_publicActions

Array of actions which can be processed without secret key validation

protected array<string|int, mixed> $_publicActions = []

$_realModuleName

Real module name (like 'Mage_Module')

protected string $_realModuleName

$_removeDefaultTitle

Whether the default title should be removed

protected bool $_removeDefaultTitle = \false
Tags
see
self::_title()

$_sessionNamespace

Namespace for session.

protected string $_sessionNamespace = self::SESSION_NAMESPACE

$_titles

Title parts to be rendered in the page head title

protected array<string|int, mixed> $_titles = []
Tags
see
self::_title()

$_usedModuleName

Used module name in current adminhtml controller

protected mixed $_usedModuleName = 'adminhtml'

Methods

__()

Translate a phrase

public __() : string
Return values
string

_initAction()

Add report/sales breadcrumbs

public _initAction() : $this
Attributes
#[Override]
#[Route]
'/admin/report_sales/_init'
Return values
$this

bestsellersAction()

public bestsellersAction() : void
Attributes
#[Route]
'/admin/report_sales/bestsellers'

couponsAction()

public couponsAction() : void
Attributes
#[Route]
'/admin/report_sales/coupons'

deniedAction()

public deniedAction() : void

dispatch()

public dispatch(string $action) : mixed
Parameters
$action : string

exportBestsellersCsvAction()

Export bestsellers report grid to CSV format

public exportBestsellersCsvAction() : void
Attributes
#[Route]
'/admin/report_sales/exportBestsellersCsv'

exportBestsellersExcelAction()

Export bestsellers report grid to Excel XML format

public exportBestsellersExcelAction() : void
Attributes
#[Route]
'/admin/report_sales/exportBestsellersExcel'

exportCouponsCsvAction()

Export coupons report grid to CSV format

public exportCouponsCsvAction() : void
Attributes
#[Route]
'/admin/report_sales/exportCouponsCsv'

exportCouponsExcelAction()

Export coupons report grid to Excel XML format

public exportCouponsExcelAction() : void
Attributes
#[Route]
'/admin/report_sales/exportCouponsExcel'

exportInvoicedCsvAction()

Export invoiced report grid to CSV format

public exportInvoicedCsvAction() : void
Attributes
#[Route]
'/admin/report_sales/exportInvoicedCsv'

exportInvoicedExcelAction()

Export invoiced report grid to Excel XML format

public exportInvoicedExcelAction() : void
Attributes
#[Route]
'/admin/report_sales/exportInvoicedExcel'

exportRefundedCsvAction()

Export refunded report grid to CSV format

public exportRefundedCsvAction() : void
Attributes
#[Route]
'/admin/report_sales/exportRefundedCsv'

exportRefundedExcelAction()

Export refunded report grid to Excel XML format

public exportRefundedExcelAction() : void
Attributes
#[Route]
'/admin/report_sales/exportRefundedExcel'

exportSalesCsvAction()

Export sales report grid to CSV format

public exportSalesCsvAction() : void
Attributes
#[Route]
'/admin/report_sales/exportSalesCsv'

exportSalesExcelAction()

Export sales report grid to Excel XML format

public exportSalesExcelAction() : void
Attributes
#[Route]
'/admin/report_sales/exportSalesExcel'

exportShippingCsvAction()

Export shipping report grid to CSV format

public exportShippingCsvAction() : void
Attributes
#[Route]
'/admin/report_sales/exportShippingCsv'

exportShippingExcelAction()

Export shipping report grid to Excel XML format

public exportShippingExcelAction() : void
Attributes
#[Route]
'/admin/report_sales/exportShippingExcel'

exportTaxCsvAction()

Export tax report grid to CSV format

public exportTaxCsvAction() : void
Attributes
#[Route]
'/admin/report_sales/exportTaxCsv'

exportTaxExcelAction()

Export tax report grid to Excel XML format

public exportTaxExcelAction() : void
Attributes
#[Route]
'/admin/report_sales/exportTaxExcel'

generateLayoutBlocks()

public generateLayoutBlocks() : $this
Return values
$this

generateLayoutXml()

public generateLayoutXml() : $this
Return values
$this

getActionMethodName()

Retrieve action method name

public getActionMethodName(string $action) : string
Parameters
$action : string
Return values
string

getFlag()

Retrieve flag value

public getFlag(string $action[, string $flag = '' ]) : array<string|int, mixed>|bool
Parameters
$action : string
$flag : string = ''
Return values
array<string|int, mixed>|bool

getFullActionName()

Retrieve full bane of current action current controller and current module

public getFullActionName([string $delimiter = '_' ]) : string
Parameters
$delimiter : string = '_'
Return values
string

getUrl()

Generate url by route and parameters

public getUrl([string $route = '' ][, array<string|int, mixed> $params = [] ]) : string
Parameters
$route : string = ''
$params : array<string|int, mixed> = []
Return values
string

getUsedModuleName()

Retrieve currently used module name

public getUsedModuleName() : string
Return values
string

hasAction()

public hasAction(string $action) : bool
Parameters
$action : string
Return values
bool

initLayoutMessages()

Initializing layout messages by message storage(s), loading and adding messages to layout messages block

public initLayoutMessages(string|array<string|int, mixed> $messagesStorage) : $this
Parameters
$messagesStorage : string|array<string|int, mixed>
Return values
$this

invoicedAction()

public invoicedAction() : void
Attributes
#[Route]
'/admin/report_sales/invoiced'

loadLayout()

Load layout by handles(s)

public loadLayout([mixed $ids = null ][, mixed $generateBlocks = true ][, mixed $generateXml = true ]) : $this
Parameters
$ids : mixed = null
$generateBlocks : mixed = true
$generateXml : mixed = true
Attributes
#[Override]
Return values
$this

norouteAction()

public norouteAction([mixed $coreRoute = null ]) : void
Parameters
$coreRoute : mixed = null
Attributes
#[Override]

postDispatch()

Dispatches event after action

public postDispatch() : mixed

preDispatch()

Controller pre-dispatch method

public preDispatch() : $this
Attributes
#[Override]
Return values
$this

refundedAction()

public refundedAction() : void
Attributes
#[Route]
'/admin/report_sales/refunded'

renderLayout()

Rendering layout

public renderLayout([string $output = '' ]) : $this|void
Parameters
$output : string = ''
Return values
$this|void

setFlag()

Setting flag value

public setFlag(string $action, string $flag, string|int|bool $value) : $this
Parameters
$action : string
$flag : string
$value : string|int|bool
Return values
$this

setRedirectWithCookieCheck()

public setRedirectWithCookieCheck(string $path[, array<string|int, mixed> $arguments = [] ]) : $this
Parameters
$path : string
$arguments : array<string|int, mixed> = []
Return values
$this

setUsedModuleName()

Set currently used module name

public setUsedModuleName(string $moduleName) : $this
Parameters
$moduleName : string
Return values
$this

shippingAction()

public shippingAction() : void
Attributes
#[Route]
'/admin/report_sales/shipping'

_addBreadcrumb()

protected _addBreadcrumb(mixed $label, mixed $title[, mixed $link = null ]) : $this
Parameters
$label : mixed
$title : mixed
$link : mixed = null
Return values
$this

_construct()

protected _construct() : void

_filterDates()

Convert dates in array from localized to internal format

protected _filterDates(array<string|int, mixed> $array, array<string|int, mixed> $dateFields) : array<string|int, mixed>
Parameters
$array : array<string|int, mixed>
$dateFields : array<string|int, mixed>
Return values
array<string|int, mixed>

_filterDateTime()

Convert dates with time in array from localized to internal format

protected _filterDateTime(array<string|int, mixed> $array, array<string|int, mixed> $dateFields) : array<string|int, mixed>
Parameters
$array : array<string|int, mixed>
$dateFields : array<string|int, mixed>
Return values
array<string|int, mixed>

_forward()

Throw control to different action (control and module if was specified).

protected _forward(mixed $action[, mixed $controller = null ][, mixed $module = null ][, array<string|int, mixed>|null $params = null ]) : mixed
Parameters
$action : mixed
$controller : mixed = null
$module : mixed = null
$params : array<string|int, mixed>|null = null
Attributes
#[Override]

_getRealModuleName()

Get real module name (like 'Mage_Module')

protected _getRealModuleName() : string
Return values
string

_getRefererUrl()

Identify referer url via all accepted methods (HTTP_REFERER, regular or base64-encoded request param)

protected _getRefererUrl() : string
Return values
string

_initLayoutMessages()

Initializing layout messages by message storage(s), loading and adding messages to layout messages block

protected _initLayoutMessages(string|array<string|int, mixed> $messagesStorage) : $this
Parameters
$messagesStorage : string|array<string|int, mixed>
Return values
$this

_isAllowed()

Check current user permission on resource and privilege

protected _isAllowed() : bool
Attributes
#[Override]
Return values
bool

_isUrlInternal()

Check url to be used as internal

protected _isUrlInternal(string $url) : bool
Parameters
$url : string
Return values
bool

_prepareDownloadResponse()

Declare headers and content file in response for file download

protected _prepareDownloadResponse(string $fileName, string|array<string|int, mixed> $content[, string $contentType = 'application/octet-stream' ][, int $contentLength = null ]) : $this
Parameters
$fileName : string
$content : string|array<string|int, mixed>

set to null to avoid starting output, $contentLength should be set explicitly in that case

$contentType : string = 'application/octet-stream'
$contentLength : int = null

explicit content length, if strlen($content) isn't applicable

Return values
$this

_redirect()

Set redirect into response

protected _redirect(string $path[, array<string|int, mixed> $arguments = [] ]) : $this
Parameters
$path : string
$arguments : array<string|int, mixed> = []
Attributes
#[Override]
Return values
$this

_redirectError()

Redirect to error page

protected _redirectError(string $defaultUrl) : $this
Parameters
$defaultUrl : string
Return values
$this

_redirectSuccess()

Redirect to success page

protected _redirectSuccess(string $defaultUrl) : $this
Parameters
$defaultUrl : string
Return values
$this

_redirectUrl()

Set redirect url into response

protected _redirectUrl(string $url) : $this
Parameters
$url : string
Return values
$this

_renderTitles()

Prepare titles in the 'head' layout block Supposed to work only in actions where layout is rendered Falls back to the default logic if there are no titles eventually

protected _renderTitles() : mixed
Tags
see
self::loadLayout()
self::renderLayout()

_rewrite()

Support for controllers rewrites

protected _rewrite() : bool

Example of configuration: <core_module> <core_controller> new_route/new_controller <override_actions>true</override_actions> <core_action>new_module/new_controller/new_action</core_action> <core_controller> </core_module>

This will override:

  1. core_module/core_controller/core_action to new_module/new_controller/new_action
  2. all other actions of core_module/core_controller to new_module/new_controller
Return values
bool

true if rewrite happened

_setActiveMenu()

Define active menu item in menu block

protected _setActiveMenu(mixed $menuPath) : $this
Parameters
$menuPath : mixed
Return values
$this

_title()

Add an extra title to the end or one from the end, or remove all

protected _title([string|false|int|null $text = null ][, bool $resetIfExists = true ]) : $this

Usage examples: $this->_title('foo')->_title('bar'); => bar / foo /

$this->_title()->_title('foo')->_title('bar'); => bar / foo

$this->_title('foo')->_title(false)->_title('bar'); bar /

Parameters
$text : string|false|int|null = null
$resetIfExists : bool = true
Tags
see
self::_renderTitles()
Return values
$this

_validateCurrentPassword()

Validate password for current admin user

protected _validateCurrentPassword(string $password) : mixed
Parameters
$password : string
  • current password
Return values
mixed
  • returns true or array of errors

_validateFormKey()

Validate Form Key

protected _validateFormKey() : bool
Return values
bool

_validateRequestParam()

Validate request parameter

protected _validateRequestParam(string $param[, string $pattern = '' ]) : bool
Parameters
$param : string
  • request parameter
$pattern : string = ''
  • pattern that should be contained in parameter
Return values
bool

_validateRequestParams()

Validate request parameters

protected _validateRequestParams(array<string|int, mixed> $params[, string $pattern = '' ]) : bool
Parameters
$params : array<string|int, mixed>
  • array of request parameters
$pattern : string = ''
  • pattern that should be contained in parameter
Return values
bool

_validateSecretKey()

Validate Secret Key

protected _validateSecretKey() : bool
Return values
bool
On this page

Search results