Documentation

CRM_Contribute_Page_UserDashboard extends CRM_Contact_Page_View_UserDashBoard
in package

This class is used to build User Dashboard

Tags
copyright

CiviCRM LLC https://civicrm.org/licensing

Table of Contents

Properties

$_contactId  : mixed
$_edit  : mixed
$_links  : array<string|int, mixed>
The action links that we need to display for the browse screen.
$_onlyPublicGroups  : bool
Always show public groups.
$_permission  : string
The permission we have on this contact
$ajaxResponse  : array<string|int, mixed>
What to return to the client if in ajax mode (snippet=json)
$expectedSmartyVariables  : array<string|int, string>
Variables smarty expects to have set.
$urlPath  : array<string|int, mixed>
Url path used to reach this page
$useLivePageJS  : bool
Should crm.livePage.js be added to the page?
$_action  : int
$_embedded  : bool
Is this object being embedded in another object. If so the display routine needs to not do any work. (The parent object takes care of the display)
$_id  : int
$_mode  : int
A page can have multiple modes. (i.e. displays a different set of data based on the input
$_name  : string
The name of the page (auto generated from class name)
$_print  : int|string
Are we in print mode? if so we need to modify the display functionality to do a minimal display :)
$_session  : CRM_Core_Session
Cache the session for efficiency reasons
$_template  : CRM_Core_Smarty
Cache the smarty template for efficiency reasons
$_title  : object
The title associated with this page.

Methods

__construct()  : CRM_Core_Page
Class constructor.
addExpectedSmartyVariable()  : void
Add an expected smarty variable to the array.
addExpectedSmartyVariables()  : void
Add an expected smarty variable to the array.
append()  : mixed
Appends values to template variables.
assign()  : mixed
Assign value to name in template.
assign_by_ref()  : mixed
Assign value to name in template by reference.
buildUserDashBoard()  : mixed
Build user dashboard.
crmIcon()  : string
Handy helper to produce the standard markup for an icon with alternative text for a title and screen readers.
get()  : mixed
Get the variable from the form scope.
get_template_vars()  : array<string|int, mixed>
Returns an array containing template variables.
getEmbedded()  : bool
Getter for embedded.
getHookedTemplateFileName()  : mixed
A wrapper for getTemplateFileName that includes calling the hook to prevent us from having to copy & paste the logic of calling the hook
getPrint()  : int|string
Getter for print.
getTemplate()  : CRM_Core_Smarty
getTemplateFileName()  : string
Use the form name to create the tpl file name.
getTemplateVars()  : mixed
Get the value/s assigned to the Template Engine (Smarty).
getVar()  : null
invalidKey()  : mixed
isIncludeInvoiceLinks()  : mixed
Should invoice links be displayed on the template.
links()  : array<string|int, mixed>
Get action links.
listContribution()  : void
called when action is browse.
overrideExtraTemplateFileName()  : string
Default extra tpl file basically just replaces .tpl with .extra.tpl i.e. we dont override
preProcess()  : mixed
Heart of the viewing process.
reset()  : mixed
Destroy all the session state of this page.
run()  : mixed
the main function that is called when the page loads, it decides the which action has to be taken for the page.
set()  : mixed
Store the variable with the value in the form scope.
setEmbedded()  : mixed
Setter for embedded.
setPrint()  : void
Setter for print.
setVar()  : mixed
assignFieldMetadataToTemplate()  : mixed
Assign metadata about fields to the template.
getContributions()  : array<string|int, mixed>
Get the contact's contributions.
getUserChecksum()  : string|false
Get the user checksum from the url to use in links.

Properties

The action links that we need to display for the browse screen.

public static array<string|int, mixed> $_links

$_onlyPublicGroups

Always show public groups.

public bool $_onlyPublicGroups = \TRUE

$_permission

The permission we have on this contact

public string $_permission

$ajaxResponse

What to return to the client if in ajax mode (snippet=json)

public array<string|int, mixed> $ajaxResponse = []

$expectedSmartyVariables

Variables smarty expects to have set.

public array<string|int, string> $expectedSmartyVariables = [ 'isForm', 'hookContent', 'hookContentPlacement', // required for footer.tpl 'contactId', // required for info.tpl 'infoMessage', 'infoTitle', 'infoType', 'infoOptions', // required for Summary.tpl (contact summary) but seems // likely to be used more broadly to warrant inclusion here. 'context', // for CMSPrint.tpl 'urlIsPublic', 'breadcrumb', 'pageTitle', 'isDeleted', // Required for footer.tpl, // See ExampleHookTest:testPageOutput. 'footer_status_severity', // in 'body.tpl 'suppressForm', 'beginHookFormElements', // This is checked in validate.tpl 'snippet_type', ]

We ensure these are assigned (value = NULL) when Smarty is instantiated in order to avoid e-notices / having to use empty or isset in the template layer.

$urlPath

Url path used to reach this page

public array<string|int, mixed> $urlPath = []

$useLivePageJS

Should crm.livePage.js be added to the page?

public bool $useLivePageJS

$_action

protected int $_action

$_embedded

Is this object being embedded in another object. If so the display routine needs to not do any work. (The parent object takes care of the display)

protected bool $_embedded = \FALSE

$_id

protected int $_id

$_mode

A page can have multiple modes. (i.e. displays a different set of data based on the input

protected int $_mode

$_name

The name of the page (auto generated from class name)

protected string $_name

$_print

Are we in print mode? if so we need to modify the display functionality to do a minimal display :)

protected int|string $_print = \FALSE

Should match a CRM_Core_Smarty::PRINT_* constant, or equal 0 if not in print mode

$_template

Cache the smarty template for efficiency reasons

protected static CRM_Core_Smarty $_template

$_title

The title associated with this page.

protected object $_title

Methods

addExpectedSmartyVariable()

Add an expected smarty variable to the array.

public addExpectedSmartyVariable(string $elementName) : void
Parameters
$elementName : string

addExpectedSmartyVariables()

Add an expected smarty variable to the array.

public addExpectedSmartyVariables(array<string|int, mixed> $elementNames) : void
Parameters
$elementNames : array<string|int, mixed>

append()

Appends values to template variables.

public append(array<string|int, mixed>|string $tpl_var[, mixed $value = NULL ][, bool $merge = FALSE ]) : mixed
Parameters
$tpl_var : array<string|int, mixed>|string

the template variable name(s)

$value : mixed = NULL

The value to append.

$merge : bool = FALSE

assign()

Assign value to name in template.

public assign(string $var[, mixed $value = NULL ]) : mixed
Parameters
$var : string
$value : mixed = NULL

Value of variable.

assign_by_ref()

Assign value to name in template by reference.

public assign_by_ref(string $var, mixed &$value) : mixed

since 5.72 will be removed around 5.84

Parameters
$var : string
$value : mixed

(reference) value of variable.

crmIcon()

Handy helper to produce the standard markup for an icon with alternative text for a title and screen readers.

public static crmIcon(string $icon[, string $text = NULL ][, bool $condition = TRUE ][, array<string|int, mixed> $attribs = [] ]) : string

See also the smarty block function icon

Parameters
$icon : string

The class name of the icon to display.

$text : string = NULL

The translated text to display.

$condition : bool = TRUE

Whether to display anything at all. This helps simplify code when a checkmark should appear if something is true.

$attribs : array<string|int, mixed> = []

Attributes to set or override on the icon element. Any standard attribute can be unset by setting the value to an empty string.

Return values
string

The whole bit to drop in.

get()

Get the variable from the form scope.

public get(string $name) : mixed
Parameters
$name : string

name of the variable

get_template_vars()

Returns an array containing template variables.

public get_template_vars([string $name = NULL ]) : array<string|int, mixed>

since 5.69 will be removed around 5.93. use getTemplateVars.

Parameters
$name : string = NULL
Return values
array<string|int, mixed>

getEmbedded()

Getter for embedded.

public getEmbedded() : bool
Return values
bool

return the embedded value

getHookedTemplateFileName()

A wrapper for getTemplateFileName that includes calling the hook to prevent us from having to copy & paste the logic of calling the hook

public getHookedTemplateFileName() : mixed

getPrint()

Getter for print.

public getPrint() : int|string
Return values
int|string

Value matching a CRM_Core_Smarty::PRINT_* constant, or 0 if not in print mode

getTemplateFileName()

Use the form name to create the tpl file name.

public getTemplateFileName() : string
Return values
string

getTemplateVars()

Get the value/s assigned to the Template Engine (Smarty).

public getTemplateVars([string|null $name = NULL ]) : mixed
Parameters
$name : string|null = NULL

getVar()

public getVar(string $name) : null
Parameters
$name : string
Return values
null

invalidKey()

public invalidKey() : mixed

Should invoice links be displayed on the template.

public isIncludeInvoiceLinks() : mixed
Tags
todo

This should be moved to a hook-like structure on the invoicing class (currently CRM_Utils_Invoicing) with a view to possible removal from core.

Get action links.

public static & links() : array<string|int, mixed>
Return values
array<string|int, mixed>

(reference) of action links

overrideExtraTemplateFileName()

Default extra tpl file basically just replaces .tpl with .extra.tpl i.e. we dont override

public overrideExtraTemplateFileName() : string
Return values
string

preProcess()

Heart of the viewing process.

public preProcess() : mixed

The runner gets all the meta data for the contact and calls the appropriate type of page to view.

Tags
throws
CRM_Core_Exception

reset()

Destroy all the session state of this page.

public reset() : mixed

run()

the main function that is called when the page loads, it decides the which action has to be taken for the page.

public run() : mixed
Tags
throws
CRM_Core_Exception

set()

Store the variable with the value in the form scope.

public set(string|array<string|int, mixed> $name[, mixed $value = NULL ]) : mixed
Parameters
$name : string|array<string|int, mixed>

name of the variable or an assoc array of name/value pairs

$value : mixed = NULL

Value of the variable if string.

setEmbedded()

Setter for embedded.

public setEmbedded(bool $embedded) : mixed
Parameters
$embedded : bool

setPrint()

Setter for print.

public setPrint(int|string $print) : void
Parameters
$print : int|string

Should match a CRM_Core_Smarty::PRINT_* constant, or equal 0 if not in print mode

setVar()

public setVar(string $name, mixed $value) : mixed
Parameters
$name : string
$value : mixed

assignFieldMetadataToTemplate()

Assign metadata about fields to the template.

protected assignFieldMetadataToTemplate(string $entity) : mixed

In order to allow the template to format fields we assign information about them to the template.

At this stage only date field metadata is assigned as that is the only use-case in play and we don't want to assign a lot of unneeded data.

Parameters
$entity : string

The entity being queried.

Tags
throws
CRM_Core_Exception

getContributions()

Get the contact's contributions.

protected getContributions([bool $isSoftCredit = FALSE ]) : array<string|int, mixed>
Parameters
$isSoftCredit : bool = FALSE

Return contributions for which the contact is the soft credit contact instead.

Tags
throws
CRM_Core_Exception
Return values
array<string|int, mixed>

getUserChecksum()

Get the user checksum from the url to use in links.

protected getUserChecksum() : string|false
Tags
throws
CRM_Core_Exception
Return values
string|false

        
On this page

Search results