class CRM_Report_Form_Mailing_Bounce extends CRM_Report_Form

Constants

ATTR_SPACING

Constants for attributes for various form elements attempt to standardize on the number of variations that we use of the below form elements

CB_PREFIX

All checkboxes are defined with a common prefix. This allows us to have the same javascript to check / clear all the checkboxes etc If u have multiple groups of checkboxes, you will need to give them different ids to avoid potential name collision

CB_PREFIY

All checkboxes are defined with a common prefix. This allows us to have the same javascript to check / clear all the checkboxes etc If u have multiple groups of checkboxes, you will need to give them different ids to avoid potential name collision

CB_PREFIZ

All checkboxes are defined with a common prefix. This allows us to have the same javascript to check / clear all the checkboxes etc If u have multiple groups of checkboxes, you will need to give them different ids to avoid potential name collision

CB_PREFIX_LEN

All checkboxes are defined with a common prefix. This allows us to have the same javascript to check / clear all the checkboxes etc If u have multiple groups of checkboxes, you will need to give them different ids to avoid potential name collision

ROW_COUNT_LIMIT

OP_INT

Operator types - used for displaying filter elements

OP_STRING

Operator types - used for displaying filter elements

OP_DATE

Operator types - used for displaying filter elements

OP_DATETIME

Operator types - used for displaying filter elements

OP_FLOAT

Operator types - used for displaying filter elements

OP_SELECT

Operator types - used for displaying filter elements

OP_MULTISELECT

Operator types - used for displaying filter elements

OP_MULTISELECT_SEPARATOR

Operator types - used for displaying filter elements

OP_MONTH

Operator types - used for displaying filter elements

OP_ENTITYREF

Operator types - used for displaying filter elements

Properties

protected object $_state The state object that this form belongs to from CRM_Core_Form
protected string $_name The name of this form from CRM_Core_Form
protected string $_title The report title from CRM_Report_Form
array $_defaults The default values for the form. from CRM_Core_Form
array $_options The set of optional columns in the report from CRM_Report_Form
int $_action (QUASI-PROTECTED) The mode of operation for this form from CRM_Core_Form
protected array $_paymentProcessors Available payment processors. from CRM_Core_Form
array $_paymentProcessorIDs Available payment processors (IDS). from CRM_Core_Form
protected int $_paymentProcessorID Default or selected processor id. from CRM_Core_Form
protected int $_is_pay_later_enabled Is pay later enabled for the form. from CRM_Core_Form
protected object $_renderer The renderer used for this form from CRM_Core_Form
protected array $_dateFields An array to hold a list of datefields on the form so that they can be converted to ISO in a consistent manner from CRM_Core_Form
static protected CRM_Core_Smarty $_template Cache the smarty template for efficiency reasons from CRM_Core_Form
protected bool $unsavedChangesWarn Indicate if this form should warn users of unsaved changes from CRM_Core_Form
array $ajaxResponse What to return to the client if in ajax mode (snippet=json) from CRM_Core_Form
array $urlPath Url path used to reach this page from CRM_Core_Form
protected string $context Context of the form being loaded. from CRM_Core_Form
bool $submitOnce from CRM_Core_Form
CRM_Core_Controller $controller from CRM_Core_Form
static array $html5Types Extra input types we support via the "add" method from CRM_Core_Form
protected int $_id The id of the report instance from CRM_Report_Form
protected int $_templateID The id of the report template from CRM_Report_Form
protected $_noFields from CRM_Report_Form
protected array $_columns The set of all columns in the report. An associative array with column name as the key and attributes as the value from CRM_Report_Form
protected array $_filters The set of filters in the report from CRM_Report_Form
protected bool $_exposeContactID By default most reports hide contact id. from CRM_Report_Form
protected array $_statFields Set of statistic fields from CRM_Report_Form
protected array $_statistics Set of statistics data from CRM_Report_Form
protected array $_noRepeats List of fields not to be repeated during display from CRM_Report_Form
protected array $_noDisplay List of fields not to be displayed from CRM_Report_Form
protected $_customGroupExtends
protected $_customGroupExtendsJoin from CRM_Report_Form
protected $_customGroupFilters from CRM_Report_Form
protected $_customGroupGroupBy from CRM_Report_Form
protected $_customGroupJoin from CRM_Report_Form
protected bool $_tagFilter Build tags filter from CRM_Report_Form
protected string $_tagFilterTable specify entity table for tags filter from CRM_Report_Form
protected bool $_groupFilter Build groups filter. from CRM_Report_Form
protected bool $groupFilterNotOptimised This report has not been optimised for group filtering.
array $_navigation Navigation fields from CRM_Report_Form
$_drilldownReport from CRM_Report_Form
protected array $tabs Array of tabs to display on report. from CRM_Report_Form
protected bool $addPaging Should we add paging. from CRM_Report_Form
protected $isForceGroupBy from CRM_Report_Form
protected $groupConcatTested from CRM_Report_Form
protected array $_fourColumnAttribute An attribute for checkbox/radio form field layout from CRM_Report_Form
protected $_force from CRM_Report_Form
protected $_params from CRM_Report_Form
protected $_formValues from CRM_Report_Form
protected $_instanceValues from CRM_Report_Form
protected $_instanceForm from CRM_Report_Form
protected $_criteriaForm from CRM_Report_Form
protected $_instanceButtonName from CRM_Report_Form
protected $_createNewButtonName from CRM_Report_Form
protected $_printButtonName from CRM_Report_Form
protected $_pdfButtonName from CRM_Report_Form
protected $_csvButtonName from CRM_Report_Form
protected $_groupButtonName from CRM_Report_Form
protected $_chartButtonName from CRM_Report_Form
protected $_csvSupported from CRM_Report_Form
protected $_add2groupSupported from CRM_Report_Form
protected $_groups from CRM_Report_Form
protected $_grandFlag from CRM_Report_Form
protected $_rowsFound from CRM_Report_Form
protected $_selectAliases from CRM_Report_Form
protected $_rollup from CRM_Report_Form
protected string $groupTempTable Table containing list of contact IDs within the group filter. from CRM_Report_Form
protected array $_aliases from CRM_Report_Form
protected string $_where from CRM_Report_Form
protected string $_from from CRM_Report_Form
protected string $_limit SQL Limit clause from CRM_Report_Form
protected int $_limitValue This can be set to specify a limit to the number of rows Since it is currently envisaged as part of the api usage it is only being applied when $_output mode is not 'html' or 'group' so as not to have to interpret / mess with that part of the code (see limit() fn. from CRM_Report_Form
protected int $_offsetValue This can be set to specify row offset See notes on _limitValue from CRM_Report_Form
protected null $_sections from CRM_Report_Form
protected $_autoIncludeIndexedFieldsAsOrderBys from CRM_Report_Form
protected $_absoluteUrl from CRM_Report_Form
protected bool $_storeResultSet Flag to indicate if result-set is to be stored in a class variable which could be retrieved using getResultSet() method. from CRM_Report_Form
protected bool $_resultSet When _storeResultSet Flag is set use this var to store result set in form of array from CRM_Report_Form
protected array $_groupByDateFreq To what frequency group-by a date column from CRM_Report_Form
protected string|null $_aclFrom Variables to hold the acl inner join and where clause from CRM_Report_Form
protected $_aclWhere from CRM_Report_Form
protected array $_selectedTables Array of DAO tables having columns included in SELECT or ORDER BY clause. from CRM_Report_Form
protected array $filteredTables Array of DAO tables having columns included in WHERE or HAVING clause from CRM_Report_Form
protected string $_outputMode Output mode e.g 'print', 'csv', 'pdf'. from CRM_Report_Form
protected string|null $_format Format of any chart in use. from CRM_Report_Form
$_having from CRM_Report_Form
$_select from CRM_Report_Form
$_selectClauses from CRM_Report_Form
$_columnHeaders from CRM_Report_Form
$_orderBy from CRM_Report_Form
$_orderByFields from CRM_Report_Form
$_orderByArray from CRM_Report_Form
protected array $_groupByArray Array of clauses to group by. from CRM_Report_Form
$_groupBy from CRM_Report_Form
$_whereClauses from CRM_Report_Form
$_havingClauses from CRM_Report_Form
int $_dashBoardRowCount DashBoardRowCount Dashboard row count. from CRM_Report_Form
bool $noController Is this being called without a form controller (ie. the report is being render outside the normal form - e.g the api is retrieving the rows. from CRM_Report_Form
protected string|null $_currencyColumn Variable to hold the currency alias. from CRM_Report_Form
protected string $_interval from CRM_Report_Form
protected bool $_sendmail from CRM_Report_Form
protected int $_chartId from CRM_Report_Form
int $_section from CRM_Report_Form
string $_description Report description. from CRM_Report_Form
protected bool $_addressField Is an address field selected. from CRM_Report_Form
protected $_emailField
protected $_phoneField
protected bool $_createNew Create new report instance? (or update existing) on save. from CRM_Report_Form
protected array $rollupRow When a grand total row has calculated the status we pop it off to here. from CRM_Report_Form
protected string $_databaseAttributes Database attributes - character set and collation. from CRM_Report_Form
protected string $sql SQL being run in this report. from CRM_Report_Form
protected bool $noGroupBy An instruction not to add a Group By. from CRM_Report_Form
protected string $sqlArray SQL being run in this report as an array. from CRM_Report_Form
protected array $temporaryTables Tables created for the report that need removal afterwards. from CRM_Report_Form
bool $optimisedForOnlyFullGroupBy Can this report use the sql mode ONLY_FULL_GROUP_BY. from CRM_Report_Form
protected $_summary
protected $_charts

Methods

string
getContext()

No description

setContext()

Set context variable.

__construct()

Class constructor.

setTranslatedFields()

Set translated fields.

addClass(string $className)

Add one or more css classes to the form.

registerRules()

Register all the standard rules that most forms potentially use.

HTML_QuickForm_Element
add(string $type, string $name, string $label = '', string|array $attributes = '', bool $required = FALSE, array $extra = NULL)

Simple easy to use wrapper around addElement.

preProcess()

Pre process function.

postProcess()

Post process function.

mainProcess(bool $allowAjax = TRUE)

Main process wrapper.

postProcessHook()

The postProcess hook is typically called by the framework.

buildQuickForm()

Main build form function.

array|NULL
setDefaultValues(bool $freeze = TRUE)

Set default values.

addRules()

This is a virtual function that adds group and global rules to the form.

bool
validate()

Performs the server side validation.

buildForm()

Core function that builds the form.

addButtons(array $params)

Add default Next / Back buttons.

string
getName()

Getter function for Name.

object
getState()

Getter function for State.

int
getStateType()

Getter function for StateType.

string
getTitle()

Getter function for title.

setTitle(string $title)

Setter function for title.

assignBillingType()

Assign billing type id to bltID.

int
getPaymentProcessorID()

No description

assignPaymentProcessor(bool $isPayLaterEnabled)

This if a front end form function for setting the payment processor.

array
formatParamsForPaymentProcessor(array $fields)

Format the fields in $this->_params for the payment processor.

array
prepareParamsForPaymentProcessor(array $params)

Format the fields in $params for the payment processor.

preProcessPaymentOptions()

Handle Payment Processor switching for contribution and event registration forms.

handlePreApproval(array $params)

Handle pre approval for processors.

setOptions(mixed $options)

Setter function for options.

string
toSmarty()

Render form and return contents.

object
getRenderer()

Getter function for renderer.

string
getTemplateFileName()

Use the form name to create the tpl file name.

getHookedTemplateFileName()

A wrapper for getTemplateFileName.

string
overrideExtraTemplateFileName()

Default extra tpl file basically just replaces .tpl with .extra.tpl.

error(string $message, int $code = NULL, CRM_Core_DAO $dao = NULL)

Error reporting mechanism.

set(string $name, mixed $value)

Store the variable with the value in the form scope.

mixed
get(string $name)

Get the variable from the form scope.

int
getAction()

Getter for action.

setAction(int $action)

Setter for action.

assign(string $var, mixed $value = NULL)

Assign value to name in template.

assign_by_ref(string $var, mixed $value)

Assign value to name in template by reference.

append(array|string $tpl_var, mixed $value = NULL, bool $merge = FALSE)

Appends values to template variables.

array
get_template_vars(string $name = NULL)

Returns an array containing template variables.

HTML_QuickForm_group
addRadio(string $name, $title, $values, array $attributes = [], null $separator = NULL, bool $required = FALSE)

No description

addYesNo(int $id, $title, bool $allowClear = FALSE, null $required = NULL, array $attributes = [])

No description

addCheckBox(int $id, $title, $values, null $other = NULL, null $attributes = NULL, null $required = NULL, null $javascriptMethod = NULL, string $separator = '<br />', bool $flipValues = FALSE)

No description

resetValues()

No description

addDefaultButtons(string $title, string $nextType = 'next', string $backType = 'back', bool|string $submitOnce = FALSE)

Simple shell that derived classes can call to add buttons to the form with a customized title for the main Submit

addDateRange(string $name, string $from = '_from', string $to = '_to', string $label = 'From:', string $dateFormat = 'searchDate', bool $required = FALSE, bool $displayTime = FALSE)

No description

addDatePickerRange(string $fieldName, string $label, bool $isDateTime = FALSE, bool $required = FALSE, string $fromLabel = 'From', string $toLabel = 'To')

Add a search for a range using date picker fields.

getApiAction()

Based on form action, return a string representing the api action.

getDefaultEntity()

Classes extending CRM_Core_Form should implement this method.

getDefaultContext()

Classes extending CRM_Core_Form should implement this method.

HTML_QuickForm_Element
addSelect($name, array $props = [], bool $required = FALSE)

Adds a select based on field metadata.

mixed
addField($name, array $props = [], bool $required = FALSE, bool $legacyDate = TRUE)

Adds a field based on metadata.

addProfileSelector(string $name, string $label, string $allowCoreTypes, string $allowSubTypes, array $entities, bool $default = FALSE, string $usedFor = NULL)

Add a widget for selecting/editing/creating/copying a profile form

null
getRootTitle()

No description

string
getCompleteTitle()

No description

static CRM_Core_Smarty
getTemplate()

No description

addUploadElement($elementName)

No description

null
getVar($name)

No description

setVar($name, $value)

No description

addDate(string $name, string $label, bool $required = FALSE, array $attributes = NULL) deprecated

Add date.

addDateTime(string $name, string $label, bool $required = FALSE, null $attributes = NULL) deprecated

Function that will add date and time.

HTML_QuickForm_Element
addMoney(string $name, string $label, bool $required = FALSE, null $attributes = NULL, bool $addCurrency = TRUE, string $currencyName = 'currency', null $defaultCurrency = NULL, bool $freezeCurrency = FALSE)

Add a currency and money element to the form.

addCurrency(string $name = 'currency', null $label = NULL, bool $required = TRUE, string $defaultCurrency = NULL, bool $freezeCurrency = FALSE, bool $setDefaultCurrency = TRUE)

Add currency element to the form.

HTML_QuickForm_Element
addEntityRef(string $name, string $label = '', array $props = [], bool $required = FALSE)

Create a single or multiple entity ref field.

convertDateFieldsToMySQL(array $params)

Convert all date fields within the params to mysql date ready for the BAO layer. In this case fields are checked against the $_datefields defined for the form and if time is defined it is incorporated

removeFileRequiredRules($elementName)

No description

cancelAction()

Function that can be defined in Form to override or.

static 
validateMandatoryFields(array $fields, array $values, array $errors)

Helper function to verify that required fields have been filled.

NULL|int
setContactID()

Get contact if for a form object. Prioritise - cid in URL if 0 (on behalf on someoneelse) (@todo consider setting a variable if onbehalf for clarity of downstream 'if's - logged in user id if it matches the one in the cid in the URL - contact id validated from a checksum from a checksum - cid from the url if the caller has ACL permission to view - fallback is logged in user (or ? NULL if no logged in user) (@todo wouldn't 0 be more intuitive?)

int|null
getContactID()

Get the contact id that the form is being submitted for.

getLoggedInUserContactID()

Get the contact id of the logged in user.

addAutoSelector(array $profiles = [], array $autoCompleteField = [])

Add autoselector field -if user has permission to view contacts If adding this to a form you also need to add to the tpl e.g

canUseAjaxContactLookups()

No description

addCIDZeroOptions()

Add the options appropriate to cid = zero - ie. autocomplete

array
getProfileDefaults(mixed $profile_id = 'Billing', int $contactID = NULL)

Set default values on form for given contact (or no contact defaults)

preventAjaxSubmit()

Sets form attribute.

allowAjaxSubmit()

Sets form attribute.

setPageTitle(string $entityLabel)

Sets page title based on entity and action.

HTML_QuickForm_Element
addChainSelect(string $elementName, array $settings = [])

Create a chain-select target field. All settings are optional; the defaults usually work.

addTaskMenu(array $tasks)

Add actions menu to results form.

string
assignBillingName(array $params = [])

Assign billing name to the template.

string
getCurrency(array $submittedValues = [])

Get the currency for the form.

bool
isFormInViewOrEditMode()

Is the form in view or edit mode.

preProcessCommon()

Shared pre-process function.

addBreadCrumb()

Add bread crumb.

bool
getElementFromGroup(string $group, string $grpFieldName)

Get element from group.

setParams(array $params)

Setter for $_params.

void|array
getParams()

Getter for $_params.

setID(int $instanceID)

Setter for $_id.

setForce(bool $isForce)

Setter for $_force.

setLimitValue(int $_limitValue)

Setter for $_limitValue.

setOffsetValue(int $_offsetValue)

Setter for $_offsetValue.

setAddPaging(bool $value)

Setter for $addPaging.

array
getDefaultValues()

Getter for $_defaultValues.

cleanUpTemporaryTables()

Remove any temporary tables.

string
createTemporaryTable(string $identifier, string $sql, bool $isColumns = FALSE, bool $isMemory = FALSE)

Create a temporary table.

addColumns()

Add columns to report.

addFilters()

Add filters to report.

assignTabs()

Function to assign the tabs to the template in the correct order.

addToDeveloperTab(string $sql)

The intent is to add a tab for developers to view the sql.

addOptions()

Add options defined in $this->_options to the report.

addChartOptions()

Add chart options to the report.

addGroupBys()

Add group by options to the report.

addOrderBys()

Add data for order by tab.

buildInstanceAndButtons()

This adds the tab referred to as Title and Format, rendered through Instance.tpl.

bool
resultsDisplayed()

Has this form been submitted already?

array
getActions(int $instanceId)

Get the actions for this report instance.

array
customDataFormRule(array $fields, array $ignoreFields = [])

A form rule function for custom data.

array
getOperationPair(string $type = "string", string $fieldName = NULL)

Get operators to display on form.

buildTagFilter()

Build the tag filter field to display on the filters tab.

buildGroupFilter()

Adds group filters to _columns (called from _Construct).

string
getSQLOperator(string $operator = "like")

Get SQL operator from form text version.

null|string
whereClause(array $field, string $op, mixed $value, float $min, float $max)

Generate where clause.

string
whereSubtypeClause(string $field, mixed $value, string $op)

Get SQL where clause for contact subtypes

null|string
dateClause(string $fieldName, string $relative, string $from, string $to, string $type = NULL, string $fromTime = NULL, string $toTime = NULL)

Get SQL where clause for a date field.

array
getFromTo(bool $relative, string $from, string $to, string $fromTime = NULL, string $toTime = NULL) deprecated

Get values for from and to for date ranges.

alterDisplay(array $rows)

Alter display of rows.

alterCustomDataDisplay(array $rows)

Alter the way in which custom data fields are displayed.

removeDuplicates(array $rows)

Remove duplicate rows.

fixSubTotalDisplay(array $row, array $fields, bool $subtotal = TRUE)

Fix subtotal display.

bool
grandTotal(array $rows)

Calculate grant total.

formatDisplay(array $rows, bool $pager = TRUE)

Format display output.

array
alterStateProvinceID($value, $row, $selectedfield, $criteriaFieldName)

No description

array
alterCountryID($value, $row, $selectedField, $criteriaFieldName)

No description

array
alterCountyID($value, $row, $selectedfield, $criteriaFieldName)

No description

mixed
alterLocationTypeID($value, $row, $selectedfield, $criteriaFieldName)

No description

mixed
alterContactID($value, $row, $fieldname)

No description

mixed
alterBoolean($value)

No description

buildChart(array $rows)

No description

select()

Generate the SELECT clause and set class variable $_select.

bool
selectClause(string $tableName, string $tableKey, string $fieldName, string $field)

Build select clause for a single field.

where()

Build where clause.

storeWhereHavingClauseArray()

Store Where clauses into an array.

processReportMode()

Set output mode.

beginPostProcess()

Post Processing function for Form.

beginPostProcessCommon()

BeginPostProcess function run in both report mode and non-report mode (api).

string
buildQuery(bool $applyLimit = TRUE)

Build the report query.

groupBy()

Build group by clause.

orderBy()

Build order by clause.

storeOrderByArray()

Extract order by fields and store as an array.

array
unselectedOrderByColumns()

Determine unselected columns.

array
unselectedSectionColumns()

Determine unselected columns.

buildRows(string $sql, array $rows)

Build output rows.

sectionTotals()

Calculate section totals.

modifyColumnHeaders()

Modify column headers.

moveSummaryColumnsToTheRightHandSide()

Move totals columns to the right edge of the table.

doTemplateAssignment(array $rows)

Assign rows to the template.

array
statistics(array $rows)

Build report statistics.

countStat(array $statistics, int $count)

Add count statistics.

groupByStat(array $statistics)

Add group by statistics.

filterStat(array $statistics)

Filter statistics.

endPostProcess(array|null $rows = NULL)

End post processing.

storeResultSet()

Set store result set indicator to TRUE.

bool
getResultSet()

Get result set.

string
getReportSql()

Get the sql used to generate the report.

string
compileContent()

Compile the report content.

array
limit(int $rowCount = self::ROW_COUNT_LIMIT)

Set limit.

setPager(int $rowCount = self::ROW_COUNT_LIMIT)

Set pager.

string
legacySlowGroupFilterClause(string $field, mixed $value, string $op) deprecated

Build a group filter with contempt for large data sets.

string
whereGroupClause(string $field, mixed $value, string $op)

Build where clause for groups.

buildGroupTempTable()

Create a table of the contact ids included by the group filter.

CRM_Core_DAO|object
executeReportQuery(string $query, array $params = [])

Execute query and add it to the developer tab.

string
whereTagClause(string $field, mixed $value, string $op)

Build where clause for tags.

string
whereMembershipOrgClause(mixed $value, string $op)

Generate membership organization clause.

string
whereMembershipTypeClause(mixed $value, string $op)

Generate Membership Type SQL Clause.

buildACLClause(string $tableAlias = 'contact_a') deprecated

Buld contact acl clause

buildPermissionClause()

Build the permision clause for all entities in this report

addCustomDataToColumns(bool $addFields = TRUE, array $permCustomGroupIds = [])

Add custom data to the columns.

customDataFrom(bool $joinsForFiltersOnly = FALSE)

Build custom data from clause.

bool
isFieldSelected(string $prop)

Check if the field is selected.

bool
isFieldFiltered(string $prop)

Check if the field is used as a filter.

preProcessOrderBy(array $formValues)

Check for empty order_by configurations and remove them.

bool
isTableSelected(string $tableName)

Check if table name has columns in SELECT clause.

bool
isTableFiltered(string $tableName)

Check if table name has columns in WHERE or HAVING clause.

array
selectedTables()

Fetch array of DAO tables having columns included in SELECT or ORDER BY clause.

addCampaignFields(string $entityTable = 'civicrm_contribution', bool $groupBy = FALSE, bool $orderBy = FALSE, bool $filters = TRUE)

Add campaign fields.

array
addAddressFields(bool $groupBy = TRUE, bool $orderBy = FALSE, bool $filters = TRUE, array $defaults = ['country_id' => TRUE]) deprecated

Add address fields.

bool
alterDisplayAddressFields(array $row, array $rows, int $rowNum, string $baseUrl, string $linkText, string $separator = ',')

Do AlterDisplay processing on Address Fields.

bool
alterDisplayContactFields(array $row, array $rows, int $rowNum, string $baseUrl, string $linkText)

Do AlterDisplay processing on Address Fields.

string
fiscalYearOffset(string $fieldName)

Adjusts dates passed in to YEAR() for fiscal year.

addAddressFromClause() deprecated

Add Address into From Table if required.

addPhoneFromClause() deprecated

Add Phone into From Table if required.

joinAddressFromContact(string $prefix = '', array $extra = [])

Add Address into From Table if required.

joinCountryFromAddress(string $prefix = '', array $extra = [])

Add Country into From Table if required.

joinPhoneFromContact(string $prefix = '', array $extra = [])

Add Phone into From Table if required.

joinEmailFromContact(string $prefix = '', array $extra = [])

Add Email into From Table if required.

addFinancialTrxnFromClause()

Add Financial Transaction into From Table if required.

array
getPhoneColumns(array $options = [])

Get phone columns to add to array.

array
getBasicContactFields() deprecated

Get a standard set of contact fields.

array
getBasicContactFilters(array $defaults = [])

Get a standard set of contact filters.

add2group(int $groupID)

Add contact to group.

setEntityRefDefaults(array $field, string $table)

Apply common settings to entityRef fields.

mixed
addLinkToRow(array $row, string $baseUrl, string $linkText, string $value, string $fieldName, string $tablePrefix, string $fieldLabel)

Add link fields to the row.

string
getResultsLabel()

Get label for show results buttons.

setOutputMode()

Determine the output mode from the url or input.

alterSectionHeaderForDateTime($tempTable, $columnName)

CRM-17793 - Alter DateTime section header to group by date from the datetime field.

array
getSelectColumns()

Get an array of the columns that have been selected for display.

selectivelyAddLocationTablesJoinsToFilterQuery()

Add location tables to the query if they are used for filtering.

setFromBase(string $baseTable, string $field = 'id', null $tableAlias = NULL)

Set the base table for the FROM clause.

joinGroupTempTable(string $baseTable, string $field, string $tableAlias)

Join the temp table contacting contacts who are members of the filtered groups.

getLabels(string $options, string $baoName, string $fieldName)

Get all labels for fields that are used in a group concat.

array
addStatisticsToSelect(array $field, string $tableName, string $fieldName, array $select)

Add statistics columns.

array
addBasicFieldToSelect(string $tableName, string $fieldName, array $field, string $select)

Add a basic field to the select clause.

string
setTableAlias(array $table, string $tableName)

Set table alias.

array
getColumns(string $type, array $options = [])

Function to add columns to reports.

array
getContactColumns(array $options = [])

Get columns for contact table.

array
getAddressColumns(array $options = [])

Get address columns to add to array.

array
buildColumns(array $specs, string $tableName, string $daoName = NULL, string $tableAlias = NULL, array $defaults = [], array $options = [])

Build the columns.

storeGroupByArray()

Store group bys into array - so we can check elsewhere what is grouped.

array
getDefaultsFromOptions($options)

No description

string
getSelectClauseWithGroupConcatIfNotGroupedBy(string $tableName, string $fieldName, string $field)

Get the select clause for a field, wrapping in GROUP_CONCAT if appropriate.

string
generateFilterClause(array $field, string $fieldName)

Generate clause for the selected filter.

static array
formRule($fields, $files, $self)

No description

from()

No description

array
bounce_type()

No description

Details

in CRM_Core_Form at line 200
string getContext()

Return Value

string

in CRM_Core_Form at line 207
setContext()

Set context variable.

at line 70
CRM_Core_Form __construct()

Class constructor.

Return Value

CRM_Core_Form

in CRM_Core_Form at line 311
protected setTranslatedFields()

Set translated fields.

This function is called from the class constructor, allowing us to set fields on the class that can't be set as properties due to need for translation or other non-input specific handling.

in CRM_Core_Form at line 318
addClass(string $className)

Add one or more css classes to the form.

Parameters

string $className

in CRM_Core_Form at line 326
registerRules()

Register all the standard rules that most forms potentially use.

in CRM_Core_Form at line 379
HTML_QuickForm_Element add(string $type, string $name, string $label = '', string|array $attributes = '', bool $required = FALSE, array $extra = NULL)

Simple easy to use wrapper around addElement.

Deal with simple validation rules.

Parameters

string $type
string $name
string $label
string|array $attributes (options for select elements)
bool $required
array $extra (attributes for select elements). For datepicker elements this is consistent with the data from CRM_Utils_Date::getDatePickerExtra

Return Value

HTML_QuickForm_Element Could be an error object

at line 267
preProcess()

Pre process function.

Called prior to build form.

at line 396
postProcess()

Post process function.

in CRM_Core_Form at line 494
mainProcess(bool $allowAjax = TRUE)

Main process wrapper.

Implemented so that we can call all the hook functions.

Parameters

bool $allowAjax FIXME: This feels kind of hackish, ideally we would take the json-related code from this function. and bury it deeper down in the controller

in CRM_Core_Form at line 520
postProcessHook()

The postProcess hook is typically called by the framework.

However in a few cases, the form exits or redirects early in which case it needs to call this function so other modules can do the needful Calling this function directly should be avoided if possible. In general a better way is to do setUserContext so the framework does the redirect

in CRM_Report_Form at line 1688
buildQuickForm()

Main build form function.

in CRM_Report_Form at line 921
array|NULL setDefaultValues(bool $freeze = TRUE)

Set default values.

Parameters

bool $freeze

Return Value

array|NULL reference to the array of default values

in CRM_Core_Form at line 549
addRules()

This is a virtual function that adds group and global rules to the form.

Keeping it distinct from the form to keep code small and localized in the form building code

in CRM_Core_Form at line 559
bool validate()

Performs the server side validation.

Return Value

bool true if no error found

Exceptions

HTML_QuickForm_Error

in CRM_Core_Form at line 587
buildForm()

Core function that builds the form.

We redefine this function here and expect all CRM forms to build their form in the function buildQuickForm.

in CRM_Core_Form at line 650
addButtons(array $params)

Add default Next / Back buttons.

Parameters

array $params Array of associative arrays in the order in which the buttons should be displayed. The associate array has 3 fields: 'type', 'name' and 'isDefault' The base form class will define a bunch of static arrays for commonly used formats.

in CRM_Core_Form at line 723
string getName()

Getter function for Name.

Return Value

string

in CRM_Core_Form at line 732
object getState()

Getter function for State.

Return Value

object

in CRM_Core_Form at line 741
int getStateType()

Getter function for StateType.

Return Value

int

in CRM_Core_Form at line 752
string getTitle()

Getter function for title.

Should be over-ridden by derived class.

Return Value

string

in CRM_Core_Form at line 762
setTitle(string $title)

Setter function for title.

Parameters

string $title The title of the form.

in CRM_Core_Form at line 772
assignBillingType()

Assign billing type id to bltID.

Exceptions

CRM_Core_Exception

in CRM_Core_Form at line 781
int getPaymentProcessorID()

Return Value

int

in CRM_Core_Form at line 794
protected assignPaymentProcessor(bool $isPayLaterEnabled)

This if a front end form function for setting the payment processor.

It would be good to sync it with the back-end function on abstractEditPayment & use one everywhere.

Parameters

bool $isPayLaterEnabled

Exceptions

CRM_Core_Exception

in CRM_Core_Form at line 832
protected array formatParamsForPaymentProcessor(array $fields)

Format the fields in $this->_params for the payment processor.

In order to pass fields to the payment processor in a consistent way we add some renamed parameters.

Parameters

array $fields

Return Value

array

in CRM_Core_Form at line 848
protected array prepareParamsForPaymentProcessor(array $params)

Format the fields in $params for the payment processor.

In order to pass fields to the payment processor in a consistent way we add some renamed parameters.

Parameters

array $params Payment processor params

Return Value

array $params

in CRM_Core_Form at line 896
protected preProcessPaymentOptions()

Handle Payment Processor switching for contribution and event registration forms.

This function is shared between contribution & event forms & this is their common class.

However, this should be seen as an in-progress refactor, the end goal being to also align the backoffice forms that action payments.

This function overlaps assignPaymentProcessor, in a bad way.

in CRM_Core_Form at line 948
protected handlePreApproval(array $params)

Handle pre approval for processors.

This fits with the flow where a pre-approval is done and then confirmed in the next stage when confirm is hit.

This function is shared between contribution & event forms & this is their common class.

However, this should be seen as an in-progress refactor, the end goal being to also align the backoffice forms that action payments.

Parameters

array $params

in CRM_Core_Form at line 973
setOptions(mixed $options)

Setter function for options.

Parameters

mixed $options

in CRM_Core_Form at line 982
string toSmarty()

Render form and return contents.

Return Value

string

in CRM_Core_Form at line 1000
object getRenderer()

Getter function for renderer.

If renderer is not set create one and initialize it.

Return Value

object

in CRM_Report_Form at line 3525
string getTemplateFileName()

Use the form name to create the tpl file name.

Return Value

string

in CRM_Core_Form at line 1035
getHookedTemplateFileName()

A wrapper for getTemplateFileName.

This includes calling the hook to prevent us from having to copy & paste the logic of calling the hook.

in CRM_Core_Form at line 1048
string overrideExtraTemplateFileName()

Default extra tpl file basically just replaces .tpl with .extra.tpl.

i.e. we do not override.

Return Value

string

in CRM_Core_Form at line 1062
error(string $message, int $code = NULL, CRM_Core_DAO $dao = NULL)

Error reporting mechanism.

Parameters

string $message Error Message.
int $code Error Code.
CRM_Core_DAO $dao A data access object on which we perform a rollback if non - empty.

in CRM_Core_Form at line 1080
set(string $name, mixed $value)

Store the variable with the value in the form scope.

Parameters

string $name Name of the variable.
mixed $value Value of the variable.

in CRM_Core_Form at line 1092
mixed get(string $name)

Get the variable from the form scope.

Parameters

string $name Name of the variable

Return Value

mixed

in CRM_Core_Form at line 1101
int getAction()

Getter for action.

Return Value

int

in CRM_Core_Form at line 1111
setAction(int $action)

Setter for action.

Parameters

int $action The mode we want to set the form.

in CRM_Core_Form at line 1123
assign(string $var, mixed $value = NULL)

Assign value to name in template.

Parameters

string $var Name of variable.
mixed $value Value of variable.

in CRM_Core_Form at line 1135
assign_by_ref(string $var, mixed $value)

Assign value to name in template by reference.

Parameters

string $var Name of variable.
mixed $value Value of variable.

in CRM_Core_Form at line 1147
append(array|string $tpl_var, mixed $value = NULL, bool $merge = FALSE)

Appends values to template variables.

Parameters

array|string $tpl_var the template variable name(s)
mixed $value The value to append.
bool $merge

in CRM_Core_Form at line 1158
array get_template_vars(string $name = NULL)

Returns an array containing template variables.

Parameters

string $name

Return Value

array

in CRM_Core_Form at line 1172
HTML_QuickForm_group addRadio(string $name, $title, $values, array $attributes = [], null $separator = NULL, bool $required = FALSE)

Parameters

string $name
$title
$values
array $attributes
null $separator
bool $required

Return Value

HTML_QuickForm_group

in CRM_Core_Form at line 1204
addYesNo(int $id, $title, bool $allowClear = FALSE, null $required = NULL, array $attributes = [])

Parameters

int $id
$title
bool $allowClear
null $required
array $attributes

in CRM_Core_Form at line 1230
addCheckBox(int $id, $title, $values, null $other = NULL, null $attributes = NULL, null $required = NULL, null $javascriptMethod = NULL, string $separator = '<br />', bool $flipValues = FALSE)

Parameters

int $id
$title
$values
null $other
null $attributes
null $required
null $javascriptMethod
string $separator
bool $flipValues

in CRM_Core_Form at line 1277
resetValues()

in CRM_Core_Form at line 1293
addDefaultButtons(string $title, string $nextType = 'next', string $backType = 'back', bool|string $submitOnce = FALSE)

Simple shell that derived classes can call to add buttons to the form with a customized title for the main Submit

Parameters

string $title Title of the main button.
string $nextType Button type for the form after processing.
string $backType
bool|string $submitOnce

in CRM_Core_Form at line 1324
addDateRange(string $name, string $from = '_from', string $to = '_to', string $label = 'From:', string $dateFormat = 'searchDate', bool $required = FALSE, bool $displayTime = FALSE)

Parameters

string $name
string $from
string $to
string $label
string $dateFormat
bool $required
bool $displayTime

in CRM_Core_Form at line 1346
addDatePickerRange(string $fieldName, string $label, bool $isDateTime = FALSE, bool $required = FALSE, string $fromLabel = 'From', string $toLabel = 'To')

Add a search for a range using date picker fields.

Parameters

string $fieldName
string $label
bool $isDateTime Is this a date-time field (not just date).
bool $required
string $fromLabel
string $toLabel

in CRM_Core_Form at line 1372
protected getApiAction()

Based on form action, return a string representing the api action.

Used by addField method.

Return string

in CRM_Core_Form at line 1391
getDefaultEntity()

Classes extending CRM_Core_Form should implement this method.

Exceptions

Exception

in CRM_Core_Form at line 1401
getDefaultContext()

Classes extending CRM_Core_Form should implement this method.

TODO: Merge with CRM_Core_DAO::buildOptionsContext($context) and add validation.

Exceptions

Exception

in CRM_Core_Form at line 1423
HTML_QuickForm_Element addSelect($name, array $props = [], bool $required = FALSE)

Adds a select based on field metadata.

TODO: This could be even more generic and widget type (select in this case) could also be read from metadata Perhaps a method like $form->bind($name) which would look up all metadata for named field

Parameters

$name Field name to go on the form.
array $props Mix of html attributes and special properties, namely. - entity (api entity name, can usually be inferred automatically from the form class) - field (field name - only needed if different from name used on the form) - option_url - path to edit this option list - usually retrieved automatically - set to NULL to disable link - placeholder - set to NULL to disable - multiple - bool - context - see CRM_Core_DAO::buildOptionsContext
bool $required

Return Value

HTML_QuickForm_Element

Exceptions

CRM_Core_Exception

in CRM_Core_Form at line 1507
mixed addField($name, array $props = [], bool $required = FALSE, bool $legacyDate = TRUE)

Adds a field based on metadata.

Parameters

$name Field name to go on the form.
array $props Mix of html attributes and special properties, namely. - entity (api entity name, can usually be inferred automatically from the form class) - name (field name - only needed if different from name used on the form) - option_url - path to edit this option list - usually retrieved automatically - set to NULL to disable link - placeholder - set to NULL to disable - multiple - bool - context - see CRM_Core_DAO::buildOptionsContext
bool $required
bool $legacyDate Temporary param to facilitate the conversion of fields to use the datepicker in a controlled way. To convert the field the jcalendar code needs to be removed from the tpl as well. That file is intended to be EOL.

Return Value

mixed HTML_QuickForm_Element void

Exceptions

CiviCRM_API3_Exception
Exception

in CRM_Core_Form at line 1710
addProfileSelector(string $name, string $label, string $allowCoreTypes, string $allowSubTypes, array $entities, bool $default = FALSE, string $usedFor = NULL)

Add a widget for selecting/editing/creating/copying a profile form

Parameters

string $name HTML form-element name.
string $label Printable label.
string $allowCoreTypes Only present a UFGroup if its group_type includes a subset of $allowCoreTypes; e.g. 'Individual', 'Activity'.
string $allowSubTypes Only present a UFGroup if its group_type is compatible with $allowSubypes.
array $entities
bool $default //CRM-15427.
string $usedFor

in CRM_Core_Form at line 1729
null getRootTitle()

Return Value

null

in CRM_Core_Form at line 1736
string getCompleteTitle()

Return Value

string

in CRM_Core_Form at line 1743
static CRM_Core_Smarty getTemplate()

Return Value

CRM_Core_Smarty

in CRM_Core_Form at line 1750
addUploadElement($elementName)

Parameters

$elementName

in CRM_Core_Form at line 1780
null getVar($name)

Parameters

$name

Return Value

null

in CRM_Core_Form at line 1788
setVar($name, $value)

Parameters

$name
$value

in CRM_Core_Form at line 1807
addDate(string $name, string $label, bool $required = FALSE, array $attributes = NULL) deprecated

deprecated Use $this->add('datepicker', ...) instead.

Add date.

Parameters

string $name Name of the element.
string $label Label of the element.
bool $required True if required.
array $attributes Key / value pair.

in CRM_Core_Form at line 1896
addDateTime(string $name, string $label, bool $required = FALSE, null $attributes = NULL) deprecated

deprecated Use $this->add('datepicker', ...) instead.

Function that will add date and time.

Parameters

string $name
string $label
bool $required
null $attributes

in CRM_Core_Form at line 1922
HTML_QuickForm_Element addMoney(string $name, string $label, bool $required = FALSE, null $attributes = NULL, bool $addCurrency = TRUE, string $currencyName = 'currency', null $defaultCurrency = NULL, bool $freezeCurrency = FALSE)

Add a currency and money element to the form.

Parameters

string $name
string $label
bool $required
null $attributes
bool $addCurrency
string $currencyName
null $defaultCurrency
bool $freezeCurrency

Return Value

HTML_QuickForm_Element

in CRM_Core_Form at line 1952
addCurrency(string $name = 'currency', null $label = NULL, bool $required = TRUE, string $defaultCurrency = NULL, bool $freezeCurrency = FALSE, bool $setDefaultCurrency = TRUE)

Add currency element to the form.

Parameters

string $name
null $label
bool $required
string $defaultCurrency
bool $freezeCurrency
bool $setDefaultCurrency

in CRM_Core_Form at line 2006
HTML_QuickForm_Element addEntityRef(string $name, string $label = '', array $props = [], bool $required = FALSE)

Create a single or multiple entity ref field.

Parameters

string $name
string $label
array $props Mix of html and widget properties, including:. - select - params to give to select2 widget - entity - defaults to Contact - create - can the user create a new entity on-the-fly? Set to TRUE if entity is contact and you want the default profiles, or pass in your own set of links. see CRM_Campaign_BAO_Campaign::getEntityRefCreateLinks for format note that permissions are checked automatically - api - array of settings for the getlist api wrapper note that it accepts a 'params' setting which will be passed to the underlying api - placeholder - string - multiple - bool - class, etc. - other html properties
bool $required

Return Value

HTML_QuickForm_Element

in CRM_Core_Form at line 2055
convertDateFieldsToMySQL(array $params)

Convert all date fields within the params to mysql date ready for the BAO layer. In this case fields are checked against the $_datefields defined for the form and if time is defined it is incorporated

Parameters

array $params Input params from the form.

in CRM_Core_Form at line 2075
removeFileRequiredRules($elementName)

Parameters

$elementName

in CRM_Core_Form at line 2093
cancelAction()

Function that can be defined in Form to override or.

perform specific action on cancel action

in CRM_Core_Form at line 2105
static validateMandatoryFields(array $fields, array $values, array $errors)

Helper function to verify that required fields have been filled.

Typically called within the scope of a FormRule function

Parameters

array $fields
array $values
array $errors

in CRM_Core_Form at line 2124
protected NULL|int setContactID()

Get contact if for a form object. Prioritise - cid in URL if 0 (on behalf on someoneelse) (@todo consider setting a variable if onbehalf for clarity of downstream 'if's - logged in user id if it matches the one in the cid in the URL - contact id validated from a checksum from a checksum - cid from the url if the caller has ACL permission to view - fallback is logged in user (or ? NULL if no logged in user) (@todo wouldn't 0 be more intuitive?)

Return Value

NULL|int

in CRM_Core_Form at line 2179
int|null getContactID()

Get the contact id that the form is being submitted for.

Return Value

int|null

in CRM_Core_Form at line 2186
getLoggedInUserContactID()

Get the contact id of the logged in user.

in CRM_Core_Form at line 2215
addAutoSelector(array $profiles = [], array $autoCompleteField = [])

Add autoselector field -if user has permission to view contacts If adding this to a form you also need to add to the tpl e.g

{if !empty($selectable)}

{$form.select_contact.label}
{$form.select_contact.html}

{/if}

Parameters

array $profiles Ids of profiles that are on the form (to be autofilled).
array $autoCompleteField
  • name_field
    • id_field
    • url (for ajax lookup)

in CRM_Core_Form at line 2240
canUseAjaxContactLookups()

in CRM_Core_Form at line 2256
addCIDZeroOptions()

Add the options appropriate to cid = zero - ie. autocomplete

in CRM_Core_Form at line 2280
array getProfileDefaults(mixed $profile_id = 'Billing', int $contactID = NULL)

Set default values on form for given contact (or no contact defaults)

Parameters

mixed $profile_id (can be id, or profile name).
int $contactID

Return Value

array

in CRM_Core_Form at line 2299
preventAjaxSubmit()

Sets form attribute.

See also

CRM.loadForm

in CRM_Core_Form at line 2307
allowAjaxSubmit()

Sets form attribute.

See also

CRM.loadForm

in CRM_Core_Form at line 2315
setPageTitle(string $entityLabel)

Sets page title based on entity and action.

Parameters

string $entityLabel

in CRM_Core_Form at line 2344
HTML_QuickForm_Element addChainSelect(string $elementName, array $settings = [])

Create a chain-select target field. All settings are optional; the defaults usually work.

Parameters

string $elementName
array $settings

Return Value

HTML_QuickForm_Element

in CRM_Core_Form at line 2379
addTaskMenu(array $tasks)

Add actions menu to results form.

Parameters

array $tasks

in CRM_Core_Form at line 2496
string assignBillingName(array $params = [])

Assign billing name to the template.

Parameters

array $params Form input params, default to $this->_params.

Return Value

string

in CRM_Core_Form at line 2531
string getCurrency(array $submittedValues = [])

Get the currency for the form.

Parameters

array $submittedValues Array allowed so forms inheriting this class do not break. Ideally we would make a clear standard around how submitted values are stored (is $this->_values consistently doing that?).

Return Value

string

in CRM_Core_Form at line 2553
protected bool isFormInViewOrEditMode()

Is the form in view or edit mode.

The 'addField' function relies on the form action being one of a set list of actions. Checking for these allows for an early return.

Return Value

bool

in CRM_Report_Form at line 586
preProcessCommon()

Shared pre-process function.

If overriding preProcess function this should still be called.

Exceptions

Exception

in CRM_Report_Form at line 728
addBreadCrumb()

Add bread crumb.

in CRM_Report_Form at line 1076
bool getElementFromGroup(string $group, string $grpFieldName)

Get element from group.

Parameters

string $group
string $grpFieldName

Return Value

bool

in CRM_Report_Form at line 1091
setParams(array $params)

Setter for $_params.

Parameters

array $params

in CRM_Report_Form at line 1100
void|array getParams()

Getter for $_params.

Return Value

void|array $params

in CRM_Report_Form at line 1109
setID(int $instanceID)

Setter for $_id.

Parameters

int $instanceID

in CRM_Report_Form at line 1118
setForce(bool $isForce)

Setter for $_force.

Parameters

bool $isForce

in CRM_Report_Form at line 1127
setLimitValue(int $_limitValue)

Setter for $_limitValue.

Parameters

int $_limitValue

in CRM_Report_Form at line 1136
setOffsetValue(int $_offsetValue)

Setter for $_offsetValue.

Parameters

int $_offsetValue

in CRM_Report_Form at line 1145
setAddPaging(bool $value)

Setter for $addPaging.

Parameters

bool $value

in CRM_Report_Form at line 1154
array getDefaultValues()

Getter for $_defaultValues.

Return Value

array

in CRM_Report_Form at line 1161
cleanUpTemporaryTables()

Remove any temporary tables.

in CRM_Report_Form at line 1183
string createTemporaryTable(string $identifier, string $sql, bool $isColumns = FALSE, bool $isMemory = FALSE)

Create a temporary table.

This function creates a table AND adds the details to the developer tab & $this->>temporary tables.

Parameters

string $identifier This is the key that will be used for the table in the temporaryTables property.
string $sql Sql select statement or column description (the latter requires the columns flag)
bool $isColumns Is the sql describing columns to create (rather than using a select query).
bool $isMemory Create a memory table rather than a normal INNODB table.

Return Value

string

in CRM_Report_Form at line 1205
addColumns()

Add columns to report.

in CRM_Report_Form at line 1266
addFilters()

Add filters to report.

in CRM_Report_Form at line 1413
protected assignTabs()

Function to assign the tabs to the template in the correct order.

We want the tabs to wind up in this order (if not overridden).

  • Field Selection
  • Group Bys
  • Order Bys
  • Other Options
  • Filters

in CRM_Report_Form at line 1433
addToDeveloperTab(string $sql)

The intent is to add a tab for developers to view the sql.

Currently using dpm.

Parameters

string $sql

in CRM_Report_Form at line 1466
addOptions()

Add options defined in $this->_options to the report.

in CRM_Report_Form at line 1502
addChartOptions()

Add chart options to the report.

in CRM_Report_Form at line 1513
addGroupBys()

Add group by options to the report.

in CRM_Report_Form at line 1550
addOrderBys()

Add data for order by tab.

in CRM_Report_Form at line 1611
buildInstanceAndButtons()

This adds the tab referred to as Title and Format, rendered through Instance.tpl.

in CRM_Report_Form at line 1649
bool resultsDisplayed()

Has this form been submitted already?

Return Value

bool

in CRM_Report_Form at line 1661
protected array getActions(int $instanceId)

Get the actions for this report instance.

Parameters

int $instanceId

Return Value

array

in CRM_Report_Form at line 1723
array customDataFormRule(array $fields, array $ignoreFields = [])

A form rule function for custom data.

The rule ensures that fields selected in group_by if any) should only be the ones present in display/select fields criteria; note: works if and only if any custom field selected in group_by.

Parameters

array $fields
array $ignoreFields

Return Value

array

in CRM_Report_Form at line 1765
array getOperationPair(string $type = "string", string $fieldName = NULL)

Get operators to display on form.

Note: $fieldName param allows inheriting class to build operationPairs specific to a field.

Parameters

string $type
string $fieldName

Return Value

array

in CRM_Report_Form at line 1840
buildTagFilter()

Build the tag filter field to display on the filters tab.

in CRM_Report_Form at line 1862
buildGroupFilter()

Adds group filters to _columns (called from _Construct).

in CRM_Report_Form at line 1888
string getSQLOperator(string $operator = "like")

Get SQL operator from form text version.

Parameters

string $operator

Return Value

string

in CRM_Report_Form at line 1943
null|string whereClause(array $field, string $op, mixed $value, float $min, float $max)

Generate where clause.

This can be overridden in reports for special treatment of a field

Parameters

array $field Field specifications
string $op Query operator (not an exact match to sql)
mixed $value
float $min
float $max

Return Value

null|string

in CRM_Report_Form at line 2131
string whereSubtypeClause(string $field, mixed $value, string $op)

Get SQL where clause for contact subtypes

Parameters

string $field
mixed $value
string $op SQL Operator

Return Value

string

in CRM_Report_Form at line 2175
null|string dateClause(string $fieldName, string $relative, string $from, string $to, string $type = NULL, string $fromTime = NULL, string $toTime = NULL)

Get SQL where clause for a date field.

Parameters

string $fieldName
string $relative
string $from
string $to
string $type
string $fromTime
string $toTime

Return Value

null|string

in CRM_Report_Form at line 2215
array getFromTo(bool $relative, string $from, string $to, string $fromTime = NULL, string $toTime = NULL) deprecated

deprecated

Get values for from and to for date ranges.

Parameters

bool $relative
string $from
string $to
string $fromTime
string $toTime

Return Value

array

at line 463
alterDisplay(array $rows)

Alter display of rows.

Iterate through the rows retrieved via SQL and make changes for display purposes, such as rendering contacts as links.

Parameters

array $rows Rows generated by SQL, with an array for each row.

in CRM_Report_Form at line 2242
alterCustomDataDisplay(array $rows)

Alter the way in which custom data fields are displayed.

Parameters

array $rows

in CRM_Report_Form at line 2298
removeDuplicates(array $rows)

Remove duplicate rows.

Parameters

array $rows

in CRM_Report_Form at line 2325
fixSubTotalDisplay(array $row, array $fields, bool $subtotal = TRUE)

Fix subtotal display.

Parameters

array $row
array $fields
bool $subtotal

in CRM_Report_Form at line 2348
bool grandTotal(array $rows)

Calculate grant total.

Parameters

array $rows

Return Value

bool

in CRM_Report_Form at line 2383
formatDisplay(array $rows, bool $pager = TRUE)

Format display output.

Parameters

array $rows
bool $pager

in CRM_Report_Form at line 2473
protected array alterStateProvinceID($value, $row, $selectedfield, $criteriaFieldName)

Parameters

$value
$row
$selectedfield
$criteriaFieldName

Return Value

array

in CRM_Report_Form at line 2494
protected array alterCountryID($value, $row, $selectedField, $criteriaFieldName)

Parameters

$value
$row
$selectedField
$criteriaFieldName

Return Value

array

in CRM_Report_Form at line 2514
protected array alterCountyID($value, $row, $selectedfield, $criteriaFieldName)

Parameters

$value
$row
$selectedfield
$criteriaFieldName

Return Value

array

in CRM_Report_Form at line 2534
protected mixed alterLocationTypeID($value, $row, $selectedfield, $criteriaFieldName)

Parameters

$value
$row
$selectedfield
$criteriaFieldName

Return Value

mixed

in CRM_Report_Form at line 2545
protected mixed alterContactID($value, $row, $fieldname)

Parameters

$value
$row
$fieldname

Return Value

mixed

in CRM_Report_Form at line 2570
protected mixed alterBoolean($value)

Parameters

$value

Return Value

mixed

at line 415
buildChart(array $rows)

Parameters

array $rows

at line 272
select()

Generate the SELECT clause and set class variable $_select.

in CRM_Report_Form at line 2738
bool selectClause(string $tableName, string $tableKey, string $fieldName, string $field)

Build select clause for a single field.

Parameters

string $tableName
string $tableKey
string $fieldName
string $field

Return Value

bool

at line 343
where()

Build where clause.

in CRM_Report_Form at line 2781
storeWhereHavingClauseArray()

Store Where clauses into an array.

Breaking out this step makes over-riding more flexible as the clauses can be used in constructing a temp table that may not be part of the final where clause or added in other functions

in CRM_Report_Form at line 2809
processReportMode()

Set output mode.

in CRM_Report_Form at line 2870
beginPostProcess()

Post Processing function for Form.

postProcessCommon should be used to set other variables from input as the api accesses that function. This function is not accessed when the api calls the report.

in CRM_Report_Form at line 2904
beginPostProcessCommon()

BeginPostProcess function run in both report mode and non-report mode (api).

in CRM_Report_Form at line 2914
string buildQuery(bool $applyLimit = TRUE)

Build the report query.

Parameters

bool $applyLimit

Return Value

string

at line 386
groupBy()

Build group by clause.

in CRM_Report_Form at line 2965
orderBy()

Build order by clause.

in CRM_Report_Form at line 2982
storeOrderByArray()

Extract order by fields and store as an array.

In some cases other functions want to know which fields are selected for ordering by Separating this into a separate function allows it to be called separately from constructing the order by clause

in CRM_Report_Form at line 3048
array unselectedOrderByColumns()

Determine unselected columns.

Return Value

array

in CRM_Report_Form at line 3057
array unselectedSectionColumns()

Determine unselected columns.

Return Value

array

in CRM_Report_Form at line 3072
buildRows(string $sql, array $rows)

Build output rows.

Parameters

string $sql
array $rows

in CRM_Report_Form at line 3116
sectionTotals()

Calculate section totals.

When "order by" fields are marked as sections, this assigns to the template an array of total counts for each section. This data is used by the Smarty plugin {sectionTotal}.

in CRM_Report_Form at line 3180
modifyColumnHeaders()

Modify column headers.

in CRM_Report_Form at line 3190
moveSummaryColumnsToTheRightHandSide()

Move totals columns to the right edge of the table.

It seems like a more logical layout to have any totals columns on the far right regardless of the location of the rest of their table.

in CRM_Report_Form at line 3200
doTemplateAssignment(array $rows)

Assign rows to the template.

Parameters

array $rows

in CRM_Report_Form at line 3215
array statistics(array $rows)

Build report statistics.

Override this method to build your own statistics.

Parameters

array $rows

Return Value

array

in CRM_Report_Form at line 3241
countStat(array $statistics, int $count)

Add count statistics.

Parameters

array $statistics
int $count

in CRM_Report_Form at line 3260
groupByStat(array $statistics)

Add group by statistics.

Parameters

array $statistics

in CRM_Report_Form at line 3286
filterStat(array $statistics)

Filter statistics.

Parameters

array $statistics

in CRM_Report_Form at line 3393
endPostProcess(array|null $rows = NULL)

End post processing.

Parameters

array|null $rows

in CRM_Report_Form at line 3498
storeResultSet()

Set store result set indicator to TRUE.

in CRM_Report_Form at line 3507
bool getResultSet()

Get result set.

Return Value

bool

in CRM_Report_Form at line 3516
string getReportSql()

Get the sql used to generate the report.

Return Value

string

in CRM_Report_Form at line 3541
string compileContent()

Compile the report content.

Although this function is super-short it is useful to keep separate so it can be over-ridden by report classes.

Return Value

string

in CRM_Report_Form at line 3580
array limit(int $rowCount = self::ROW_COUNT_LIMIT)

Set limit.

Parameters

int $rowCount

Return Value

array

in CRM_Report_Form at line 3630
setPager(int $rowCount = self::ROW_COUNT_LIMIT)

Set pager.

Parameters

int $rowCount

in CRM_Report_Form at line 3674
string legacySlowGroupFilterClause(string $field, mixed $value, string $op) deprecated

deprecated

Build a group filter with contempt for large data sets.

This function has been retained as it takes time to migrate the reports over to the new method which will not crash on large datasets.

Parameters

string $field
mixed $value
string $op

Return Value

string

in CRM_Report_Form at line 3729
string whereGroupClause(string $field, mixed $value, string $op)

Build where clause for groups.

Parameters

string $field
mixed $value
string $op

Return Value

string

in CRM_Report_Form at line 3745
buildGroupTempTable()

Create a table of the contact ids included by the group filter.

This function is called by both the api (tests) and the UI.

in CRM_Report_Form at line 3787
protected CRM_Core_DAO|object executeReportQuery(string $query, array $params = [])

Execute query and add it to the developer tab.

Parameters

string $query
array $params

Return Value

CRM_Core_DAO|object

in CRM_Report_Form at line 3801
string whereTagClause(string $field, mixed $value, string $op)

Build where clause for tags.

Parameters

string $field
mixed $value
string $op

Return Value

string

in CRM_Report_Form at line 3825
string whereMembershipOrgClause(mixed $value, string $op)

Generate membership organization clause.

Parameters

mixed $value
string $op SQL Operator

Return Value

string

in CRM_Report_Form at line 3853
string whereMembershipTypeClause(mixed $value, string $op)

Generate Membership Type SQL Clause.

Parameters

mixed $value
string $op

Return Value

string SQL query string

in CRM_Report_Form at line 3878
buildACLClause(string $tableAlias = 'contact_a') deprecated

deprecated in favor of buildPermissionClause

Buld contact acl clause

Parameters

string $tableAlias

in CRM_Report_Form at line 3885
buildPermissionClause()

Build the permision clause for all entities in this report

in CRM_Report_Form at line 3911
addCustomDataToColumns(bool $addFields = TRUE, array $permCustomGroupIds = [])

Add custom data to the columns.

Parameters

bool $addFields
array $permCustomGroupIds

in CRM_Report_Form at line 4066
customDataFrom(bool $joinsForFiltersOnly = FALSE)

Build custom data from clause.

Parameters

bool $joinsForFiltersOnly Only include joins to support filters. This would be used if creating a table of contacts to include first.

in CRM_Report_Form at line 4114
bool isFieldSelected(string $prop)

Check if the field is selected.

Parameters

string $prop

Return Value

bool

in CRM_Report_Form at line 4169
protected bool isFieldFiltered(string $prop)

Check if the field is used as a filter.

Parameters

string $prop

Return Value

bool

in CRM_Report_Form at line 4207
preProcessOrderBy(array $formValues)

Check for empty order_by configurations and remove them.

Also set template to hide them.

Parameters

array $formValues

in CRM_Report_Form at line 4251
bool isTableSelected(string $tableName)

Check if table name has columns in SELECT clause.

Parameters

string $tableName Name of table (index of $this->_columns array).

Return Value

bool

in CRM_Report_Form at line 4263
bool isTableFiltered(string $tableName)

Check if table name has columns in WHERE or HAVING clause.

Parameters

string $tableName Name of table (index of $this->_columns array).

Return Value

bool

in CRM_Report_Form at line 4279
array selectedTables()

Fetch array of DAO tables having columns included in SELECT or ORDER BY clause.

If the array is unset it will be built.

Return Value

array selectedTables

in CRM_Report_Form at line 4340
addCampaignFields(string $entityTable = 'civicrm_contribution', bool $groupBy = FALSE, bool $orderBy = FALSE, bool $filters = TRUE)

Add campaign fields.

Parameters

string $entityTable
bool $groupBy Add GroupBy? Not appropriate for detail report.
bool $orderBy Add OrderBy? Not appropriate for detail report.
bool $filters

in CRM_Report_Form at line 4389
array addAddressFields(bool $groupBy = TRUE, bool $orderBy = FALSE, bool $filters = TRUE, array $defaults = ['country_id' => TRUE]) deprecated

deprecated - use getAddressColumns which is a more accurate description and also accepts an array of options rather than a long list adding address fields to construct function in reports

Add address fields.

Parameters

bool $groupBy Add GroupBy? Not appropriate for detail report.
bool $orderBy Add GroupBy? Not appropriate for detail report.
bool $filters
array $defaults

Return Value

array address fields for construct clause

in CRM_Report_Form at line 4536
bool alterDisplayAddressFields(array $row, array $rows, int $rowNum, string $baseUrl, string $linkText, string $separator = ',')

Do AlterDisplay processing on Address Fields.

If there are multiple address field values then on basis of provided separator the code values are translated into respective labels

Parameters

array $row
array $rows
int $rowNum
string $baseUrl
string $linkText
string $separator

Return Value

bool

in CRM_Report_Form at line 4585
bool alterDisplayContactFields(array $row, array $rows, int $rowNum, string $baseUrl, string $linkText)

Do AlterDisplay processing on Address Fields.

Parameters

array $row
array $rows
int $rowNum
string $baseUrl
string $linkText

Return Value

bool

in CRM_Report_Form at line 4641
string fiscalYearOffset(string $fieldName)

Adjusts dates passed in to YEAR() for fiscal year.

Parameters

string $fieldName

Return Value

string

in CRM_Report_Form at line 4659
addAddressFromClause() deprecated

deprecated use joinAddressFromContact (left here in case extensions use it).

Add Address into From Table if required.

in CRM_Report_Form at line 4681
addPhoneFromClause() deprecated

deprecated use joinPhoneFromContact (left here in case extensions use it).

Add Phone into From Table if required.

in CRM_Report_Form at line 4703
protected joinAddressFromContact(string $prefix = '', array $extra = [])

Add Address into From Table if required.

Prefix will be added to both tables as it is assumed you are using it to get address of a secondary contact.

Parameters

string $prefix
array $extra Additional options. Not currently used in core but may be used in override extensions.

in CRM_Report_Form at line 4736
protected joinCountryFromAddress(string $prefix = '', array $extra = [])

Add Country into From Table if required.

Prefix will be added to both tables as it is assumed you are using it to get address of a secondary contact.

Parameters

string $prefix
array $extra Additional options. Not currently used in core but may be used in override extensions.

in CRM_Report_Form at line 4765
protected joinPhoneFromContact(string $prefix = '', array $extra = [])

Add Phone into From Table if required.

Prefix will be added to both tables as it is assumed you are using it to get address of a secondary contact.

Parameters

string $prefix
array $extra Additional options. Not currently used in core but may be used in override extensions.

in CRM_Report_Form at line 4791
protected joinEmailFromContact(string $prefix = '', array $extra = [])

Add Email into From Table if required.

Prefix will be added to both tables as it is assumed you are using it to get address of a secondary contact.

Parameters

string $prefix
array $extra Additional options. Not currently used in core but may be used in override extensions.

in CRM_Report_Form at line 4810
addFinancialTrxnFromClause()

Add Financial Transaction into From Table if required.

in CRM_Report_Form at line 4831
array getPhoneColumns(array $options = [])

Get phone columns to add to array.

Parameters

array $options
  • prefix Prefix to add to table (in case of more than one instance of the table)
    • prefix_label Label to give columns from this phone table instance

Return Value

array phone columns definition

in CRM_Report_Form at line 4858
array getBasicContactFields() deprecated

deprecated - use getColumns('Contact') instead

Get a standard set of contact fields.

Return Value

array

in CRM_Report_Form at line 4935
array getBasicContactFilters(array $defaults = [])

Get a standard set of contact filters.

Parameters

array $defaults

Return Value

array

in CRM_Report_Form at line 5009
add2group(int $groupID)

Add contact to group.

Parameters

int $groupID

in CRM_Report_Form at line 5041
setEntityRefDefaults(array $field, string $table)

Apply common settings to entityRef fields.

Parameters

array $field
string $table

in CRM_Report_Form at line 5065
protected mixed addLinkToRow(array $row, string $baseUrl, string $linkText, string $value, string $fieldName, string $tablePrefix, string $fieldLabel)

Add link fields to the row.

Function adds the _link & _hover fields to the row.

Parameters

array $row
string $baseUrl
string $linkText
string $value
string $fieldName
string $tablePrefix
string $fieldLabel

Return Value

mixed

in CRM_Report_Form at line 5083
string getResultsLabel()

Get label for show results buttons.

Return Value

string

in CRM_Report_Form at line 5102
protected setOutputMode()

Determine the output mode from the url or input.

Output could be - pdf : Render as pdf - csv : Render as csv - print : Render in print format - save : save the report and display the new report - copy : save the report as a new instance and display that. - group : go to the add to group screen.

Potentially chart variations could also be included but the complexity is that we might print a bar chart as a pdf.

in CRM_Report_Form at line 5125
alterSectionHeaderForDateTime($tempTable, $columnName)

CRM-17793 - Alter DateTime section header to group by date from the datetime field.

Parameters

$tempTable
$columnName

in CRM_Report_Form at line 5143
array getSelectColumns()

Get an array of the columns that have been selected for display.

Return Value

array

in CRM_Report_Form at line 5165
selectivelyAddLocationTablesJoinsToFilterQuery()

Add location tables to the query if they are used for filtering.

This is for when we are running the query separately for filtering and retrieving display fields.

in CRM_Report_Form at line 5196
setFromBase(string $baseTable, string $field = 'id', null $tableAlias = NULL)

Set the base table for the FROM clause.

Sets up the from clause, allowing for the possibility it might be a temp table pre-filtered by groups if a group filter is in use.

Parameters

string $baseTable
string $field
null $tableAlias

in CRM_Report_Form at line 5214
joinGroupTempTable(string $baseTable, string $field, string $tableAlias)

Join the temp table contacting contacts who are members of the filtered groups.

If we are using an IN filter we use an inner join, otherwise a left join.

Parameters

string $baseTable
string $field
string $tableAlias

in CRM_Report_Form at line 5240
getLabels(string $options, string $baoName, string $fieldName)

Get all labels for fields that are used in a group concat.

Parameters

string $options comma separated option values.
string $baoName The BAO name for the field.
string $fieldName The name of the field for which labels should be retrieved.

return string

in CRM_Report_Form at line 5264
protected array addStatisticsToSelect(array $field, string $tableName, string $fieldName, array $select)

Add statistics columns.

If a group by is in play then add columns for the statistics fields.

This would lead to a new field in the $row such as $fieldName_sum and a new, matching column header field.

Parameters

array $field
string $tableName
string $fieldName
array $select

Return Value

array

in CRM_Report_Form at line 5314
protected array addBasicFieldToSelect(string $tableName, string $fieldName, array $field, string $select)

Add a basic field to the select clause.

Parameters

string $tableName
string $fieldName
array $field
string $select

Return Value

array

in CRM_Report_Form at line 5332
protected string setTableAlias(array $table, string $tableName)

Set table alias.

Parameters

array $table
string $tableName

Return Value

string Alias for table.

in CRM_Report_Form at line 5370
protected array getColumns(string $type, array $options = [])

Function to add columns to reports.

This is ported from extended reports, which also adds join filters to the options.

Parameters

string $type
array $options
  • prefix - A string to prepend to the table name
    • prefix_label A string to prepend to the fields
    • fields (bool) - should the fields for this table be made available
    • group_by (bool) - should the group bys for this table be made available.
    • order_by (bool) - should the group bys for this table be made available.
    • filters (bool) - should the filters for this table by made available.
    • fields_defaults (array) array of fields that should be displayed by default.
    • filters_defaults (array) array of fields that should be filtered by default.
    • join_filters (array) fields available for filtering joins (requires additional custom code).
    • join_fields (array) fields available from join (requires additional custom code).
    • group_by_defaults (array) array of group bys that should be applied by default.
    • order_by_defaults (array) array of order bys that should be applied by default.
    • custom_fields (array) array of entity types for custom fields (not usually required).
    • contact_type (string) optional restriction on contact type for some tables.
    • fields_excluded (array) fields that are in the generic set for the table but not in the report.

Return Value

array

in CRM_Report_Form at line 5397
protected array getContactColumns(array $options = [])

Get columns for contact table.

Parameters

array $options

Return Value

array

in CRM_Report_Form at line 5616
protected array getAddressColumns(array $options = [])

Get address columns to add to array.

Parameters

array $options
  • prefix Prefix to add to table (in case of more than one instance of the table)
    • prefix_label Label to give columns from this address table instance
    • group_bys enable these fields for group by - default false
    • order_bys enable these fields for order by
    • filters enable these fields for filtering

Return Value

array address columns definition

in CRM_Report_Form at line 5812
protected array buildColumns(array $specs, string $tableName, string $daoName = NULL, string $tableAlias = NULL, array $defaults = [], array $options = [])

Build the columns.

The normal report class needs you to remember to do a few things that are often erratic

1) use a unique key for any field that might not be unique (e.g. start date, label) - this class will prepend an alias to the key & set the 'name' if you don't set it yourself. You can suppress the alias with 'no_field_disambiguation' if transitioning existing reports. This means any saved filters / fields on saved report instances. This will mean that matching names from different tables may be ambigious, but it will smooth any code transition. - note that it assumes the value being passed in is the actual table field name

2) set the field & set it to no display if you don't want the field but you might want to use the field in other contexts - the code looks up the fields array for data - so it both defines the field spec & the fields you want to show

3) this function also sets the 'metadata' array - the extended report class now uses this in place of the fields array to reduce the issues caused when metadata is needed but 'fields' are not defined. Code in the core classes can start to move towards that.

Parameters

array $specs
string $tableName
string $daoName
string $tableAlias
array $defaults
array $options

Return Value

array

in CRM_Report_Form at line 5857
protected storeGroupByArray()

Store group bys into array - so we can check elsewhere what is grouped.

in CRM_Report_Form at line 5907
protected array getDefaultsFromOptions($options)

Parameters

$options

Return Value

array

in CRM_Report_Form at line 5929
protected string getSelectClauseWithGroupConcatIfNotGroupedBy(string $tableName, string $fieldName, string $field)

Get the select clause for a field, wrapping in GROUP_CONCAT if appropriate.

Full group by mode dictates that a field must either be in the group by function or wrapped in a aggregate function. Here we wrap the field in GROUP_CONCAT if it is not in the group concat.

Parameters

string $tableName
string $fieldName
string $field

Return Value

string

in CRM_Report_Form at line 5955
protected string generateFilterClause(array $field, string $fieldName)

Generate clause for the selected filter.

Parameters

array $field Field specification
string $fieldName Field name.

Return Value

string Relevant where clause.

at line 314
static array formRule($fields, $files, $self)

Parameters

$fields
$files
$self

Return Value

array

at line 319
from()

at line 439
array bounce_type()

Return Value

array