Handler
extends SecuredServerPlugin
in package
Implement handler for crm
This class provides interfaces for system hooks
Tags
Table of Contents
- $config : stdClass|null
- Buffer for configuration
- $defaultPermissions : array<string|int, mixed>
- The default permission set
- $dir : string
- The implementation directory
- $name : string
- Name of the plugin
- $user_fields : array<string|int, mixed>
- The reduced user fields for notification serialize
- __construct() : mixed
- Handler constructor.
- Domain() : Domain|null
- FindNotices() : array<string|int, Notice>
- Find list of notices by certain criteria
- GetAccessList() : array<string|int, mixed>
- Link() : string
- Name() : string
- OnAddOrUpdateContent() : void
- OnDeleteContent() : void
- OnMapArrayIncludes() : void
- OnMergeUserAccount() : void
- OnRegisterWidgetIncludes() : void
- PhoneCallEndedWithoutProcess() : void
- RegisterHooks() : array<string|int, mixed>
- Register system hooks
- RequestOnUrlParsed() : mixed
- The request hook
- ServeRequest() : mixed
- Serve request Serve the request and return appropriate result.
- settings() : Result|object
- Get/Set the settings
- SetupTemplate() : mixed
- handleConfig() : void
- Handle the context requests
- hasAccess() : bool
- Check if endpoint is accessible for this user group
- isInContext() : bool
- Is in certain context?
- setupAttributes() : void
- Set up the permission attribute table
- doneLink() : string|null
- Generate use once set done link
- handleAdd() : void
- handleConfigPreset() : void
- Handle the context requests
- handleDownload() : void
- Handle the file download of a single notice
- handleDrop() : void
- handleFetch() : void
- Fetch the notice and the next notice
- handleFetchInboxes() : void
- handleSearch() : void
- handleUpdate() : void
- handleUpdateStatus() : void
- open() : Notice|null
- resolveConfig() : void
- sendMail() : Result
Properties
$config
Buffer for configuration
protected
stdClass|null
$config
= null
$defaultPermissions
The default permission set
protected
array<string|int, mixed>
$defaultPermissions
= [['endpoint' => 'config', 'root' => true, 'admin' => true]]
$dir
The implementation directory
protected
string
$dir
= ''
$name
Name of the plugin
protected
string
$name
= ''
$user_fields
The reduced user fields for notification serialize
private
array<string|int, mixed>
$user_fields
= ['emailaddress', 'id', 'salutation', 'firstname', 'surname']
Methods
__construct()
Handler constructor.
public
__construct() : mixed
Return values
mixed —Domain()
public
Domain() : Domain|null
Return values
Domain|null —FindNotices()
Find list of notices by certain criteria
public
FindNotices(array<string|int, mixed> $filter) : array<string|int, Notice>
Parameters
- $filter : array<string|int, mixed>
Return values
array<string|int, Notice> —GetAccessList()
public
GetAccessList(User $user) : array<string|int, mixed>
Parameters
- $user : User
Return values
array<string|int, mixed> —Link()
public
Link( $notice_id[, string $lang = FAA_DEFAULT_LANGUAGE ]) : string
Parameters
Return values
string —Name()
public
Name() : string
Return values
string —OnAddOrUpdateContent()
public
OnAddOrUpdateContent(HookArgument $reference) : void
Parameters
- $reference : HookArgument
Return values
void —OnDeleteContent()
public
OnDeleteContent(HookArgument $reference) : void
Parameters
- $reference : HookArgument
Return values
void —OnMapArrayIncludes()
public
OnMapArrayIncludes( $param) : void
Parameters
Return values
void —OnMergeUserAccount()
public
OnMergeUserAccount(HookArgument $reference) : void
Parameters
- $reference : HookArgument
Return values
void —OnRegisterWidgetIncludes()
public
OnRegisterWidgetIncludes( $param) : void
Parameters
Return values
void —PhoneCallEndedWithoutProcess()
public
PhoneCallEndedWithoutProcess(HookArgument $reference) : void
Parameters
- $reference : HookArgument
Return values
void —RegisterHooks()
Register system hooks
public
RegisterHooks() : array<string|int, mixed>
Register a set of handler functions to be called in certain positions.
Return values
array<string|int, mixed> —A list of hooks to register
RequestOnUrlParsed()
The request hook
public
RequestOnUrlParsed(HookArgument $param) : mixed
Parameters
- $param : HookArgument
-
The hook values
Return values
mixed —ServeRequest()
Serve request Serve the request and return appropriate result.
public
ServeRequest(Request $request, Response $response) : mixed
Parameters
Return values
mixed —settings()
Get/Set the settings
public
settings([mixed $new = null ]) : Result|object
Parameters
- $new : mixed = null
-
New set of settings to store
Tags
Return values
Result|object —SetupTemplate()
public
SetupTemplate([mixed $data = null ]) : mixed
Parameters
- $data : mixed = null
Tags
Return values
mixed —handleConfig()
Handle the context requests
protected
handleConfig(Request &$request, Response &$response) : void
Parameters
Return values
void —hasAccess()
Check if endpoint is accessible for this user group
protected
hasAccess(string|array<string|int, string> $right[, Response|null $response = null ][, User|null $user = null ]) : bool
Parameters
Return values
bool —isInContext()
Is in certain context?
protected
isInContext(HookArgument $param, string $type, string $widget) : bool
Parameters
- $param : HookArgument
-
The hook argument
- $type : string
-
The type can be scss, css and js to search in widgets or _ to search in global includes
- $widget : string
-
The widget to search for
Return values
bool —setupAttributes()
Set up the permission attribute table
protected
setupAttributes( &$attributes, $l) : void
Parameters
Return values
void —doneLink()
Generate use once set done link
private
doneLink(Notice $notice, Domain $dom) : string|null
Parameters
Return values
string|null —Link with tiny url
handleAdd()
private
handleAdd(Request $request, Response $resp) : void
Parameters
Return values
void —handleConfigPreset()
Handle the context requests
private
handleConfigPreset(Request $request, Response $response) : void
Parameters
Return values
void —handleDownload()
Handle the file download of a single notice
private
handleDownload(Request $request, Response $response) : void
Parameters
Return values
void —handleDrop()
private
handleDrop(Request $request, Response $resp) : void
Parameters
Return values
void —handleFetch()
Fetch the notice and the next notice
private
handleFetch(Request $request, Response $resp) : void
Parameters
Return values
void —handleFetchInboxes()
private
handleFetchInboxes(Request $request, Response $response) : void
Parameters
Return values
void —handleSearch()
private
handleSearch(Request $request, Response $resp, string $context) : void
Parameters
- $request : Request
- $resp : Response
- $context : string
-
The context, either general, context or employee
Return values
void —handleUpdate()
private
handleUpdate(Request $request, Response $resp) : void
Parameters
Return values
void —handleUpdateStatus()
private
handleUpdateStatus(Request $request, Response $resp) : void
Parameters
Return values
void —open()
private
open(Request $request, Response $resp) : Notice|null
Parameters
Return values
Notice|null —resolveConfig()
private
resolveConfig(Request $request, Response $response) : void
Parameters
Return values
void —sendMail()
private
sendMail(string $action, Notice $notice, User $user) : Result