Documentation

CRM_Contact_Task extends CRM_Core_Task
in package

Class to represent the actions that can be performed on a group of contacts used by the search forms.

Table of Contents

Constants

ADD_EVENT  = 105
Contact tasks
ADD_TO_CASE  = 111
Contact tasks
BATCH_UPDATE  = 6
These constants are only used as enumerators for each of the batch tasks.
COMMUNICATION_PREFS  = 109
Contact tasks
CREATE_MAILING  = 14
These constants are only used as enumerators for each of the batch tasks.
DELETE_PERMANENTLY  = 15
These constants are only used as enumerators for each of the batch tasks.
EMAIL_UNHOLD  = 107
Contact tasks
GROUP_ADD  = 2
These constants are only used as enumerators for each of the batch tasks.
GROUP_REMOVE  = 1
These constants are only used as enumerators for each of the batch tasks.
HOUSEHOLD_CONTACTS  = 101
Contact tasks
INDIVIDUAL_CONTACTS  = 110
Contact tasks
LABEL_CONTACTS  = 16
These constants are only used as enumerators for each of the batch tasks.
MAP_CONTACTS  = 104
Contact tasks
MERGE_CONTACTS  = 106
Contact tasks
ORGANIZATION_CONTACTS  = 102
Contact tasks
PDF_LETTER  = 3
These constants are only used as enumerators for each of the batch tasks.
RECORD_CONTACTS  = 103
Contact tasks
RESTORE  = 108
Contact tasks
SAVE_SEARCH  = 12
These constants are only used as enumerators for each of the batch tasks.
SAVE_SEARCH_UPDATE  = 13
These constants are only used as enumerators for each of the batch tasks.
TAG_ADD  = 10
These constants are only used as enumerators for each of the batch tasks.
TAG_REMOVE  = 11
These constants are only used as enumerators for each of the batch tasks.
TASK_DELETE  = 4
These constants are only used as enumerators for each of the batch tasks.
TASK_EMAIL  = 9
These constants are only used as enumerators for each of the batch tasks.
TASK_EXPORT  = 8
These constants are only used as enumerators for each of the batch tasks.
TASK_PRINT  = 5
These constants are only used as enumerators for each of the batch tasks.
TASK_SMS  = 7
These constants are only used as enumerators for each of the batch tasks.

Properties

$_tasks  : array<string|int, mixed>
The task array
$objectType  : string

Methods

corePermissionedTaskTitles()  : array<string|int, mixed>
Show tasks selectively based on the permission level of the user This function should be called by permissionedTaskTitles in children
getTask()  : array<string|int, mixed>
These tasks are the core set of tasks that the user can perform on participants
getTaskAndTitleByClass()  : array<string|int, mixed>
Function to return the task information on basis of provided task's form name
permissionedTaskTitles()  : array<string|int, mixed>
Show tasks selectively based on the permission level of the user
tasks()  : mixed
Generates a list of batch tasks available for the current entities.
taskTitles()  : array<string|int, mixed>
These tasks are the core set of tasks that the user can perform on a contact / group of contacts
getTasksFilteredByPermission()  : array<string|int, mixed>
Filter tasks based on the permission key, if available.
getTitlesFilteredByPermission()  : array<string|int, mixed>
Get task tiles filtered by any declared permissions.

Constants

ADD_EVENT

Contact tasks

public mixed ADD_EVENT = 105

ADD_TO_CASE

Contact tasks

public mixed ADD_TO_CASE = 111

BATCH_UPDATE

These constants are only used as enumerators for each of the batch tasks.

public mixed BATCH_UPDATE = 6

COMMUNICATION_PREFS

Contact tasks

public mixed COMMUNICATION_PREFS = 109

CREATE_MAILING

These constants are only used as enumerators for each of the batch tasks.

public mixed CREATE_MAILING = 14

DELETE_PERMANENTLY

These constants are only used as enumerators for each of the batch tasks.

public mixed DELETE_PERMANENTLY = 15

EMAIL_UNHOLD

Contact tasks

public mixed EMAIL_UNHOLD = 107

GROUP_ADD

These constants are only used as enumerators for each of the batch tasks.

public mixed GROUP_ADD = 2

GROUP_REMOVE

These constants are only used as enumerators for each of the batch tasks.

public mixed GROUP_REMOVE = 1

HOUSEHOLD_CONTACTS

Contact tasks

public mixed HOUSEHOLD_CONTACTS = 101

INDIVIDUAL_CONTACTS

Contact tasks

public mixed INDIVIDUAL_CONTACTS = 110

LABEL_CONTACTS

These constants are only used as enumerators for each of the batch tasks.

public mixed LABEL_CONTACTS = 16

MAP_CONTACTS

Contact tasks

public mixed MAP_CONTACTS = 104

MERGE_CONTACTS

Contact tasks

public mixed MERGE_CONTACTS = 106

ORGANIZATION_CONTACTS

Contact tasks

public mixed ORGANIZATION_CONTACTS = 102

PDF_LETTER

These constants are only used as enumerators for each of the batch tasks.

public mixed PDF_LETTER = 3

RECORD_CONTACTS

Contact tasks

public mixed RECORD_CONTACTS = 103

RESTORE

Contact tasks

public mixed RESTORE = 108

These constants are only used as enumerators for each of the batch tasks.

public mixed SAVE_SEARCH = 12

SAVE_SEARCH_UPDATE

These constants are only used as enumerators for each of the batch tasks.

public mixed SAVE_SEARCH_UPDATE = 13

TAG_ADD

These constants are only used as enumerators for each of the batch tasks.

public mixed TAG_ADD = 10

TAG_REMOVE

These constants are only used as enumerators for each of the batch tasks.

public mixed TAG_REMOVE = 11

TASK_DELETE

These constants are only used as enumerators for each of the batch tasks.

public mixed TASK_DELETE = 4

TASK_EMAIL

These constants are only used as enumerators for each of the batch tasks.

public mixed TASK_EMAIL = 9

TASK_EXPORT

These constants are only used as enumerators for each of the batch tasks.

public mixed TASK_EXPORT = 8

TASK_PRINT

These constants are only used as enumerators for each of the batch tasks.

public mixed TASK_PRINT = 5

TASK_SMS

These constants are only used as enumerators for each of the batch tasks.

public mixed TASK_SMS = 7

Properties

$_tasks

The task array

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

$objectType

public static string $objectType = 'contact'

Methods

corePermissionedTaskTitles()

Show tasks selectively based on the permission level of the user This function should be called by permissionedTaskTitles in children

public static corePermissionedTaskTitles(array<string|int, mixed> $tasks, int $permission, array<string|int, mixed> $params) : array<string|int, mixed>
Parameters
$tasks : array<string|int, mixed>

The array of tasks generated by permissionedTaskTitles

$permission : int
$params : array<string|int, mixed>

"ssID: Saved Search ID": If !empty we are in saved search context

Return values
array<string|int, mixed>

set of tasks that are valid for the user

getTask()

These tasks are the core set of tasks that the user can perform on participants

public static getTask(mixed $value) : array<string|int, mixed>
Parameters
$value : mixed
Return values
array<string|int, mixed>

getTaskAndTitleByClass()

Function to return the task information on basis of provided task's form name

public static getTaskAndTitleByClass(string $className) : array<string|int, mixed>
Parameters
$className : string
Return values
array<string|int, mixed>

[ 0 => Task ID, 1 => Task Title ]

permissionedTaskTitles()

Show tasks selectively based on the permission level of the user

public static permissionedTaskTitles(int $permission[, array<string|int, mixed> $params = [] ]) : array<string|int, mixed>
Parameters
$permission : int
$params : array<string|int, mixed> = []

bool deletedContacts: Are these tasks for operating on deleted contacts?.

Return values
array<string|int, mixed>

set of tasks that are valid for the user

tasks()

Generates a list of batch tasks available for the current entities.

public static tasks() : mixed

Each child class should populate $_tasks array and then call this parent function for shared functionality.

  • @return array The set of tasks for a group of contacts [ 'title' => The Task title, 'class' => The Task Form class name, 'result => Boolean. FIXME: Not sure what this is for ]

taskTitles()

These tasks are the core set of tasks that the user can perform on a contact / group of contacts

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

the set of tasks for a group of contacts

getTasksFilteredByPermission()

Filter tasks based on the permission key, if available.

protected static getTasksFilteredByPermission(array<string|int, mixed> $tasks, bool $hasEditContactPermission) : array<string|int, mixed>
Parameters
$tasks : array<string|int, mixed>
$hasEditContactPermission : bool

Does the user have permission to edit the given contact. Required where permission to edit the user is required in conjunction with permission to do the task.

Return values
array<string|int, mixed>

getTitlesFilteredByPermission()

Get task tiles filtered by any declared permissions.

protected static getTitlesFilteredByPermission(array<string|int, mixed> $tasks, bool $hasEditContactPermission) : array<string|int, mixed>
Parameters
$tasks : array<string|int, mixed>
$hasEditContactPermission : bool

Does the user have permission to edit the given contact. Required where permission to edit the user is required in conjunction with permission to do the task.

Return values
array<string|int, mixed>

        
On this page

Search results