Documentation

CRM_Contact_Page_AJAX
in package

This class contains all contact related functions that are called using AJAX (jQuery)

Table of Contents

Constants

AUTOCOMPLETE_TTL  = 21600
CHECK_USERNAME_TTL  = 10800
When a user chooses a username, CHECK_USERNAME_TTL is the time window in which they can check usernames (without reloading the overall form).

Methods

_convertToId()  : string
buildDedupeRules()  : mixed
buildSubTypes()  : mixed
checkUserName()  : mixed
check the CMS username.
contactReference()  : mixed
Ajax callback for custom fields of type ContactReference
deleteCustomValue()  : mixed
Delete custom value.
flipDupePairs()  : mixed
Swap contacts in a dupe pair i.e main with duplicate contact.
getAddressDisplay()  : mixed
getContactEmail()  : mixed
Function to get email address of a contact.
getContactRelationships()  : mixed
getDedupes()  : mixed
Retrieve list of duplicate pairs from cache table.
getPCPList()  : mixed
Fetch PCP ID by PCP Supporter sort_name, also displays PCP title and associated Contribution Page title
getSearchOptionsFromRequest()  : array<string|int, mixed>
Get the searchable options from the request.
getSignature()  : mixed
Retrieve signature based on email id.
groupTree()  : mixed
isOrQuery()  : bool
Is the query an OR query.
markNonDuplicates()  : CRM_Core_DAO|mixed|null
Mark not duplicates.
paperSize()  : mixed
Retrieve Paper Size dimensions.
pdfFormat()  : mixed
Retrieve a PDF Page Format for the PDF Letter form.
processDupes()  : mixed
Process dupes.
relationship()  : mixed
selectUnselectContacts()  : mixed
Used to store selected contacts across multiple pages in advanced search.
toggleDedupeSelect()  : mixed
Mark dupe pairs as selected from un-selected state or vice-versa, in dupe cache table.

Constants

AUTOCOMPLETE_TTL

public mixed AUTOCOMPLETE_TTL = 21600

CHECK_USERNAME_TTL

When a user chooses a username, CHECK_USERNAME_TTL is the time window in which they can check usernames (without reloading the overall form).

public mixed CHECK_USERNAME_TTL = 10800

Methods

_convertToId()

public static _convertToId(string $name) : string
Parameters
$name : string
Return values
string

buildDedupeRules()

public static buildDedupeRules() : mixed

buildSubTypes()

public static buildSubTypes() : mixed

checkUserName()

check the CMS username.

public static checkUserName() : mixed

contactReference()

Ajax callback for custom fields of type ContactReference

public static contactReference() : mixed

Todo: Migrate contact reference fields to use EntityRef

deleteCustomValue()

Delete custom value.

public static deleteCustomValue() : mixed

flipDupePairs()

Swap contacts in a dupe pair i.e main with duplicate contact.

public static flipDupePairs([int $prevNextId = NULL ]) : mixed
Parameters
$prevNextId : int = NULL

getAddressDisplay()

public static getAddressDisplay() : mixed

getContactEmail()

Function to get email address of a contact.

public static getContactEmail() : mixed

getContactRelationships()

public static getContactRelationships() : mixed

since 5.68. Will be removed around 5.74.

Only-used-by-user-dashboard.

getDedupes()

Retrieve list of duplicate pairs from cache table.

public static getDedupes() : mixed

getPCPList()

Fetch PCP ID by PCP Supporter sort_name, also displays PCP title and associated Contribution Page title

public static getPCPList() : mixed

getSearchOptionsFromRequest()

Get the searchable options from the request.

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

getSignature()

Retrieve signature based on email id.

public static getSignature() : mixed

groupTree()

public static groupTree() : mixed

isOrQuery()

Is the query an OR query.

public static isOrQuery() : bool

If a generic search value is passed in - ie. $_REQUEST['search']['value'] = 'abc' then all fields are searched for this.

It is unclear if there is any code that still passes this in or whether is is just legacy. It could cause a server-killing query on a large site so it probably is NOT in use if we haven't had complaints.

Return values
bool

markNonDuplicates()

Mark not duplicates.

public static markNonDuplicates(int $cid, int $oid, string $oper) : CRM_Core_DAO|mixed|null

Note this function would sensibly be replaced by an api-call but extracting here to add a test first.

I would have like to make it private but test class accesses it & it doesn't warrant being a BAO class as it should feel very endangered.

Parameters
$cid : int
$oid : int
$oper : string

'nondupe-dupe' or 'dupe-nondupe'

Return values
CRM_Core_DAO|mixed|null

paperSize()

Retrieve Paper Size dimensions.

public static paperSize() : mixed

pdfFormat()

Retrieve a PDF Page Format for the PDF Letter form.

public static pdfFormat() : mixed

processDupes()

Process dupes.

public static processDupes() : mixed

relationship()

public static relationship() : mixed

selectUnselectContacts()

Used to store selected contacts across multiple pages in advanced search.

public static selectUnselectContacts() : mixed

toggleDedupeSelect()

Mark dupe pairs as selected from un-selected state or vice-versa, in dupe cache table.

public static toggleDedupeSelect() : mixed

        
On this page

Search results