Dashboard
extends Controller
in package
Description of Dashboard
Table of Contents
Properties
- $createLinks : array<string|int, mixed>
- $empresa : Empresa
- Selected company.
- $lowStock : array<string|int, mixed>
- $multiRequestProtection : MultiRequestProtection
- $news : array<string|int, mixed>
- $openLinks : array<string|int, mixed>
- $permissions : ControllerPermissions
- User permissions on this controller.
- $receipts : array<string|int, mixed>
- $registered : bool
- $request : Request
- Request on which we can get data.
- $sections : array<string|int, mixed>
- $stats : array<string|int, mixed>
- $title : string
- Title of the page.
- $updated : bool
- $uri : string
- Given uri, default is empty.
- $user : User|false
- User logged in.
- $dataBase : DataBase
- It provides direct access to the database.
- $response : Response
- HTTP Response object.
Methods
- __construct() : mixed
- Initialize all objects and properties.
- addExtension() : mixed
- getPageData() : array<string|int, mixed>
- Return the basic data for this page.
- getTemplate() : string|false
- Return the template to use for this controller.
- pipe() : mixed
- pipeFalse() : bool
- privateCore() : void
- Runs the controller's private logic.
- publicCore() : mixed
- Execute the public part of the controller.
- redirect() : mixed
- Redirect to an url or controller.
- request() : Request
- run() : void
- setTemplate() : bool
- Set the template to use for this controller.
- showBackupWarning() : bool
- url() : string
- Return the URL of the actual controller.
- db() : DataBase
- getClassName() : string
- Return the name of the controller.
- response() : Response
- validateFormToken() : bool
- Check request token. Returns an error if: - the token does not exist - the token is invalid - the token is duplicated
- getStatsMonth() : string
- Gets the name of the month for the statistics.
- getStatsWhere() : array<string|int, DataBaseWhere>
- Gets the where filter for calc of the statistics.
- loadCreateLinks() : void
- Set the quick links for data creation.
- loadExtensions() : void
- Establish the sections to be displayed on the dashboard.
- loadLowStockSection() : void
- Load the data regarding the stock under minimum.
- loadNews() : void
- Load last news from facturascripts.com
- loadOpenLinks() : void
- Loads the links to the latest data created by the user.
- loadReceiptSection() : void
- Load the receipts pending collection.
- loadStats() : void
- Load statistical data.
- setOpenLinksForDocument() : void
Properties
$createLinks
public
array<string|int, mixed>
$createLinks
= []
$empresa
Selected company.
public
Empresa
$empresa
$lowStock
public
array<string|int, mixed>
$lowStock
= []
$multiRequestProtection
public
MultiRequestProtection
$multiRequestProtection
$news
public
array<string|int, mixed>
$news
= []
$openLinks
public
array<string|int, mixed>
$openLinks
= []
$permissions
User permissions on this controller.
public
ControllerPermissions
$permissions
$receipts
public
array<string|int, mixed>
$receipts
= []
$registered
public
bool
$registered
= false
$request
Request on which we can get data.
public
Request
$request
$sections
public
array<string|int, mixed>
$sections
= []
$stats
public
array<string|int, mixed>
$stats
= []
$title
Title of the page.
public
string
$title
título de la página.
$updated
public
bool
$updated
= false
$uri
Given uri, default is empty.
public
string
$uri
$user
User logged in.
public
User|false
$user
= false
$dataBase
It provides direct access to the database.
protected
DataBase
$dataBase
$response
HTTP Response object.
protected
Response
$response
Methods
__construct()
Initialize all objects and properties.
public
__construct(string $className[, string $uri = '' ]) : mixed
Parameters
- $className : string
- $uri : string = ''
addExtension()
public
static addExtension(mixed $extension) : mixed
Parameters
- $extension : mixed
getPageData()
Return the basic data for this page.
public
getPageData() : array<string|int, mixed>
Return values
array<string|int, mixed>getTemplate()
Return the template to use for this controller.
public
getTemplate() : string|false
Return values
string|falsepipe()
public
pipe(string $name, array<string|int, mixed> ...$arguments) : mixed
Parameters
- $name : string
- $arguments : array<string|int, mixed>
pipeFalse()
public
pipeFalse(string $name, array<string|int, mixed> ...$arguments) : bool
Parameters
- $name : string
- $arguments : array<string|int, mixed>
Return values
boolprivateCore()
Runs the controller's private logic.
public
privateCore(Response &$response, User $user, ControllerPermissions $permissions) : void
Parameters
- $response : Response
- $user : User
- $permissions : ControllerPermissions
publicCore()
Execute the public part of the controller.
public
publicCore(Response &$response) : mixed
Parameters
- $response : Response
redirect()
Redirect to an url or controller.
public
redirect(string $url[, int $delay = 0 ]) : mixed
Parameters
- $url : string
- $delay : int = 0
request()
public
request() : Request
Return values
Requestrun()
public
run() : void
setTemplate()
Set the template to use for this controller.
public
setTemplate(string|false $template) : bool
Parameters
- $template : string|false
Return values
boolshowBackupWarning()
public
showBackupWarning() : bool
Return values
boolurl()
Return the URL of the actual controller.
public
url() : string
Return values
stringdb()
protected
db() : DataBase
Return values
DataBasegetClassName()
Return the name of the controller.
protected
getClassName() : string
Return values
stringresponse()
protected
response() : Response
Return values
ResponsevalidateFormToken()
Check request token. Returns an error if: - the token does not exist - the token is invalid - the token is duplicated
protected
validateFormToken() : bool
Return values
boolgetStatsMonth()
Gets the name of the month for the statistics.
private
getStatsMonth(int $previous) : string
Parameters
- $previous : int
Return values
stringgetStatsWhere()
Gets the where filter for calc of the statistics.
private
getStatsWhere(string $field, int $previous) : array<string|int, DataBaseWhere>
Parameters
- $field : string
- $previous : int
Return values
array<string|int, DataBaseWhere>loadCreateLinks()
Set the quick links for data creation.
private
loadCreateLinks() : void
Example: createLinks['EditControllerName'] = 'label'
loadExtensions()
Establish the sections to be displayed on the dashboard.
private
loadExtensions() : void
loadLowStockSection()
Load the data regarding the stock under minimum.
private
loadLowStockSection() : void
loadNews()
Load last news from facturascripts.com
private
loadNews() : void
loadOpenLinks()
Loads the links to the latest data created by the user.
private
loadOpenLinks() : void
loadReceiptSection()
Load the receipts pending collection.
private
loadReceiptSection() : void
loadStats()
Load statistical data.
private
loadStats() : void
setOpenLinksForDocument()
private
setOpenLinksForDocument(BusinessDocument $model, string $label) : void
Parameters
- $model : BusinessDocument
- $label : string