class ActionsMyModule extends CommonHookActions (View source)

Class ActionsMyModule

Properties

?string $resprints
mixed[] $results
string $error
string[] $errors
string[] $warnings from  CommonHookActions
DoliDB $db
int $priority

Methods

bool
isContext(array<string, mixed> $parameters, string[]|string $allContexts)

Check context of hook

__construct($db)

Constructor

int
getNomUrl(array<string, mixed> $parameters, CommonObject $object, string $action)

Execute action

int
doActions(array<string, mixed> $parameters, CommonObject $object, ?string $action, HookManager $hookmanager)

Overload the doActions function : replacing the parent's function with the one below

int
doMassActions(array<string, mixed> $parameters, CommonObject $object, ?string $action, HookManager $hookmanager)

Overload the doMassActions function : replacing the parent's function with the one below

int
addMoreMassActions(array<string, mixed> $parameters, CommonObject $object, ?string $action, HookManager $hookmanager)

Overload the addMoreMassActions function : replacing the parent's function with the one below

int
beforePDFCreation(array<string, mixed> $parameters, CommonObject $object, string $action)

Execute action before PDF (document) creation

int
afterPDFCreation(array<string, mixed> $parameters, CommonDocGenerator $pdfhandler, string $action)

Execute action after PDF (document) creation

int
loadDataForCustomReports(array<string, mixed> $parameters, ?string $action, HookManager $hookmanager)

Overload the loadDataForCustomReports function : returns data to complete the customreport tool

int
restrictedArea(array<string, mixed> $parameters, CommonObject $object, string $action, HookManager $hookmanager)

Overload the restrictedArea function : check permission on an object

int
completeTabsHead(array<string, mixed> $parameters, CommonObject $object, string $action, HookManager $hookmanager)

Execute action completeTabsHead

int
showLinkToObjectBlock(array<string, mixed> $parameters, CommonObject $object, ?string $action, HookManager $hookmanager)

Overload the showLinkToObjectBlock function : add or replace array of object linkable

Details

protected bool isContext(array<string, mixed> $parameters, string[]|string $allContexts)

Check context of hook

Parameters

array<string, mixed> $parameters

Hook parameters.

string[]|string $allContexts

Context to check

Return Value

bool

__construct($db)

Constructor

@param DoliDB $db Database handler

Parameters

$db

int getNomUrl(array<string, mixed> $parameters, CommonObject $object, string $action)

Execute action

Parameters

array<string, mixed> $parameters

Array of parameters

CommonObject $object

The object to process (an invoice if you are in invoice module, a propale in propale's module, etc...)

string $action

'add', 'update', 'view'

Return Value

int

Return integer <0 if KO, =0 if OK but we want to process standard actions too,

0 if OK and we want to replace standard actions.

int doActions(array<string, mixed> $parameters, CommonObject $object, ?string $action, HookManager $hookmanager)

Overload the doActions function : replacing the parent's function with the one below

Parameters

array<string, mixed> $parameters

Hook metadata (context, etc...)

CommonObject $object

The object to process (an invoice if you are in invoice module, a propale in propale's module, etc...)

?string $action

Current action (if set). Generally create or edit or null

HookManager $hookmanager

Hook manager propagated to allow calling another hook

Return Value

int

Return integer < 0 on error, 0 on success, 1 to replace standard code

int doMassActions(array<string, mixed> $parameters, CommonObject $object, ?string $action, HookManager $hookmanager)

Overload the doMassActions function : replacing the parent's function with the one below

Parameters

array<string, mixed> $parameters

Hook metadata (context, etc...)

CommonObject $object

The object to process (an invoice if you are in invoice module, a propale in propale's module, etc...)

?string $action

Current action (if set). Generally create or edit or null

HookManager $hookmanager

Hook manager propagated to allow calling another hook

Return Value

int

Return integer < 0 on error, 0 on success, 1 to replace standard code

int addMoreMassActions(array<string, mixed> $parameters, CommonObject $object, ?string $action, HookManager $hookmanager)

Overload the addMoreMassActions function : replacing the parent's function with the one below

Parameters

array<string, mixed> $parameters

Hook metadata (context, etc...)

CommonObject $object

The object to process (an invoice if you are in invoice module, a propale in propale's module, etc...)

?string $action

Current action (if set). Generally create or edit or null

HookManager $hookmanager

Hook manager propagated to allow calling another hook

Return Value

int

Return integer < 0 on error, 0 on success, 1 to replace standard code

int beforePDFCreation(array<string, mixed> $parameters, CommonObject $object, string $action)

Execute action before PDF (document) creation

Parameters

array<string, mixed> $parameters

Array of parameters

CommonObject $object

Object output on PDF

string $action

'add', 'update', 'view'

Return Value

int

Return integer <0 if KO, =0 if OK but we want to process standard actions too,

0 if OK and we want to replace standard actions.

int afterPDFCreation(array<string, mixed> $parameters, CommonDocGenerator $pdfhandler, string $action)

Execute action after PDF (document) creation

Parameters

array<string, mixed> $parameters

Array of parameters

CommonDocGenerator $pdfhandler

PDF builder handler

string $action

'add', 'update', 'view'

Return Value

int

Return integer <0 if KO, =0 if OK but we want to process standard actions too,

0 if OK and we want to replace standard actions.

int loadDataForCustomReports(array<string, mixed> $parameters, ?string $action, HookManager $hookmanager)

Overload the loadDataForCustomReports function : returns data to complete the customreport tool

Parameters

array<string, mixed> $parameters

Hook metadata (context, etc...)

?string $action

Current action (if set). Generally create or edit or null

HookManager $hookmanager

Hook manager propagated to allow calling another hook

Return Value

int

Return integer < 0 on error, 0 on success, 1 to replace standard code

int restrictedArea(array<string, mixed> $parameters, CommonObject $object, string $action, HookManager $hookmanager)

Overload the restrictedArea function : check permission on an object

Parameters

array<string, mixed> $parameters

Hook metadata (context, etc...)

CommonObject $object

The object to process (an invoice if you are in invoice module, a propale in propale's module, etc...)

string $action

Current action (if set). Generally create or edit or null

HookManager $hookmanager

Hook manager propagated to allow calling another hook

Return Value

int

Return integer <0 if KO, =0 if OK but we want to process standard actions too,

0 if OK and we want to replace standard actions.

int completeTabsHead(array<string, mixed> $parameters, CommonObject $object, string $action, HookManager $hookmanager)

Execute action completeTabsHead

Parameters

array<string, mixed> $parameters

Array of parameters

CommonObject $object

The object to process (an invoice if you are in invoice module, a propale in propale's module, etc...)

string $action

'add', 'update', 'view'

HookManager $hookmanager Hookmanager

Return Value

int

Return integer <0 if KO, =0 if OK but we want to process standard actions too,

0 if OK and we want to replace standard actions.

int showLinkToObjectBlock(array<string, mixed> $parameters, CommonObject $object, ?string $action, HookManager $hookmanager)

Overload the showLinkToObjectBlock function : add or replace array of object linkable

Parameters

array<string, mixed> $parameters

Hook metadata (context, etc...)

CommonObject $object

The object to process (an invoice if you are in invoice module, a propale in propale's module, etc...)

?string $action

Current action (if set). Generally create or edit or null

HookManager $hookmanager

Hook manager propagated to allow calling another hook

Return Value

int

Return integer < 0 on error, 0 on success, 1 to replace standard code