Documentation

CRM_Report_Form_Contribute_Sybunt extends CRM_Report_Form
in package

Class CRM_Report_Form

Tags
copyright

CiviCRM LLC https://civicrm.org/licensing

Table of Contents

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  = 'mark_x_'
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  = 7
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  = 'mark_y_'
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  = 'mark_z_'
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
OP_DATE  = 4
Operator types - used for displaying filter elements
OP_DATETIME  = 5
Operator types - used for displaying filter elements
OP_ENTITYREF  = 256
Operator types - used for displaying filter elements
OP_FLOAT  = 8
Operator types - used for displaying filter elements
OP_INT  = 1
Operator types - used for displaying filter elements
OP_MONTH  = 128
Operator types - used for displaying filter elements
OP_MULTISELECT  = 65
Operator types - used for displaying filter elements
OP_MULTISELECT_SEPARATOR  = 66
Operator types - used for displaying filter elements
OP_SELECT  = 64
Operator types - used for displaying filter elements
OP_STRING  = 2
Operator types - used for displaying filter elements
ROW_COUNT_LIMIT  = 50
Deprecated constant, Reports should be updated to use the getRowCount function.

Properties

$_absoluteUrl  : bool
Whether to generate absolute URLs (ex: in report emails).
$_action  : int
(QUASI-PROTECTED) The mode of operation for this form
$_columnHeaders  : mixed
$_dashBoardRowCount  : int
DashBoardRowCount Dashboard row count.
$_defaults  : array<string|int, mixed>
The default values for the form.
$_description  : string
Report description.
$_drilldownReport  : mixed
$_from  : string
SQL from clause. May be altered by hook_civicrm_alterReportVar.
$_groupBy  : mixed
$_having  : mixed
$_havingClauses  : mixed
$_navigation  : array<string|int, mixed>
Navigation fields
$_options  : array<string|int, mixed>
The set of optional columns in the report
$_orderBy  : mixed
$_orderByArray  : mixed
$_orderByFields  : mixed
$_paymentProcessorIDs  : array<string|int, mixed>
Available payment processors (IDS).
$_section  : int
$_select  : mixed
$_selectClauses  : mixed
$_where  : string
SQL where clause. May be altered by hook_civicrm_alterReportVar.
$_whereClauses  : mixed
$ajaxResponse  : array<string|int, mixed>
What to return to the client if in ajax mode (snippet=json)
$controller  : CRM_Core_Controller
$expectedSmartyVariables  : array<string|int, string>
Variables smarty expects to have set.
$html5Types  : array<string|int, mixed>
Extra input types we support via the "add" method
$noController  : bool
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.
$optimisedForOnlyFullGroupBy  : bool
Can this report use the sql mode ONLY_FULL_GROUP_BY.
$printOnly  : bool
Are we in print mode. Can be set by another outputMode, ex: sendmail.
$submitOnce  : bool
$urlPath  : array<string|int, mixed>
Url path used to reach this page
$_aclFrom  : string|null
Variables to hold the acl inner join and where clause
$_aclWhere  : mixed
$_actionButtonName  : string
Name of action button
$_add2groupSupported  : mixed
$_addressField  : bool
Is an address field selected.
$_aliases  : array<string|int, mixed>
$_autoIncludeIndexedFieldsAsOrderBys  : mixed
$_chartButtonName  : mixed
$_chartId  : int
$_charts  : array<string|int, string>
Determines which chart types are supported for this report
$_columns  : array<string|int, mixed>
The set of all columns in the report. An associative array with column name as the key and attributes as the value
$_createNew  : bool
Create new report instance? (or update existing) on save.
$_createNewButtonName  : mixed
$_criteriaForm  : mixed
$_csvSupported  : mixed
$_currencyColumn  : string|null
Variable to hold the currency alias.
$_customGroupExtends  : null
Object type that a custom group extends
$_customGroupExtendsJoin  : mixed
$_customGroupFilters  : mixed
$_customGroupGroupBy  : mixed
$_customGroupJoin  : mixed
$_databaseAttributes  : string
Database attributes - character set and collation.
$_emailField  : bool
Is an email field selected.
$_exposeContactID  : bool
By default most reports hide contact id.
$_filters  : array<string|int, mixed>
The set of filters in the report
$_force  : mixed
$_format  : string|null
Format of any chart in use.
$_formValues  : mixed
$_fourColumnAttribute  : array<string|int, mixed>
An attribute for checkbox/radio form field layout
$_grandFlag  : mixed
$_groupButtonName  : mixed
$_groupByArray  : array<string|int, mixed>
Array of clauses to group by.
$_groupByDateFreq  : array<string|int, mixed>
To what frequency group-by a date column
$_groupFilter  : bool
Build groups filter.
$_groups  : mixed
$_id  : int
The id of the report instance
$_instanceButtonName  : mixed
$_instanceForm  : mixed
$_instanceValues  : mixed
$_interval  : string
$_limit  : string
SQL Limit clause
$_limitValue  : int
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.
$_name  : string
The name of this form
$_noDisplay  : array<string|int, mixed>
List of fields not to be displayed
$_noFields  : mixed
$_noRepeats  : array<string|int, mixed>
List of fields not to be repeated during display
$_offsetValue  : int
This can be set to specify row offset See notes on _limitValue
$_outputMode  : string
Output mode e.g 'print', 'csv', 'pdf'.
$_params  : mixed
$_paymentProcessorID  : int
Default or selected processor id.
$_paymentProcessors  : array<string|int, mixed>
Available payment processors.
$_phoneField  : bool
Is a phone field selected.
$_renderer  : object
The renderer used for this form
$_resultSet  : bool
When _storeResultSet Flag is set use this var to store result set in form of array
$_rollup  : mixed
$_rowCount  : int
The Number of rows to display on screen
$_rowsFound  : mixed
$_sections  : array<string|int, mixed>
$_selectAliases  : array<string|int, mixed>
$_selectedTables  : array<string|int, mixed>
Array of DAO tables having columns included in SELECT or ORDER BY clause.
$_sendmail  : bool
$_state  : object
The state object that this form belongs to
$_statFields  : array<string|int, mixed>
Set of statistic fields
$_statistics  : array<string|int, mixed>
Set of statistics data
$_storeResultSet  : bool
Flag to indicate if result-set is to be stored in a class variable which could be retrieved using getResultSet() method.
$_tagFilter  : bool
Build tags filter
$_tagFilterTable  : string
specify entity table for tags filter
$_template  : CRM_Core_Smarty
Cache the smarty template for efficiency reasons
$_templateID  : int
The id of the report template
$_title  : string
The report title
$addPaging  : bool
Should we add paging.
$campaigns  : array<string|int, mixed>
Array of campaign data, populated by calling `$this::addCampaignFields()`
$context  : string
Context of the form being loaded.
$exportedValues  : array<string|int, mixed>
Values submitted by the user.
$filteredTables  : array<string|int, mixed>
Array of DAO tables having columns included in WHERE or HAVING clause
$groupConcatTested  : mixed
$groupFilterNotOptimised  : bool
This report has been optimised for group filtering.
$groupTempTable  : string
Table containing list of contact IDs within the group filter.
$isForceGroupBy  : mixed
$noGroupBy  : bool
An instruction not to add a Group By.
$optionalQuickFormElements  : array<string|int, mixed>
Quick form elements which are conditionally added to the form.
$rollupRow  : array<string|int, mixed>
When a grand total row has calculated the status we pop it off to here.
$sql  : string
SQL being run in this report.
$sqlArray  : array<string|int, mixed>
SQL being run in this report as an array.
$statusClause  : string
$submittableMoneyFields  : array<string|int, mixed>
Monetary fields that may be submitted.
$tabs  : array<string|int, mixed>
Array of tabs to display on report.
$temporaryTables  : array<string|int, mixed>
Tables created for the report that need removal afterwards.
$unsavedChangesWarn  : bool
Indicate if this form should warn users of unsaved changes
$authenticatedContactID  : int
The contact ID that has been authenticated and can be used for checking permissions.
$isValidated  : true
$outputHandler  : OutputHandlerInterface

Methods

__construct()  : CRM_Core_Form
Class constructor.
add()  : HTML_QuickForm_Element
Simple easy to use wrapper around addElement.
add2group()  : mixed
Add contact to group.
addAddressFields()  : array<string|int, mixed>
Add address fields.
addAutocomplete()  : HTML_QuickForm_Element
addAutoSelector()  : mixed
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
addBreadCrumb()  : mixed
Add bread crumb.
addButtons()  : mixed
Add default Next / Back buttons.
addCampaignFields()  : mixed
Add campaign fields.
addChainSelect()  : HTML_QuickForm_Element
Create a chain-select target field. All settings are optional; the defaults usually work.
addChartOptions()  : mixed
Add chart options to the report.
addCheckBox()  : mixed
addCIDZeroOptions()  : mixed
Add the options appropriate to cid = zero - ie. autocomplete
addClass()  : mixed
Add one or more css classes to the form.
addColumns()  : mixed
Add columns to report.
addCurrency()  : mixed
Add currency element to the form.
addCustomDataToColumns()  : mixed
Add custom data to the columns.
addDate()  : mixed
Add date.
addDatePickerRange()  : mixed
Add a search for a range using date picker fields.
addDateRange()  : mixed
addDateTime()  : mixed
Function that will add date and time.
addDefaultButtons()  : mixed
Simple shell that derived classes can call to add buttons to the form with a customized title for the main Submit
addEntityRef()  : HTML_QuickForm_Element
Create a single or multiple entity ref field.
addExpectedSmartyVariable()  : void
Add an expected smarty variable to the array.
addExpectedSmartyVariables()  : void
Add an expected smarty variable to the array.
addField()  : mixed
Adds a field based on metadata.
addFilters()  : mixed
Add filters to report.
addFinancialTrxnFromClause()  : mixed
Add Financial Transaction into From Table if required.
addGroupBys()  : mixed
Add group by options to the report.
addMoney()  : HTML_QuickForm_Element
Add a currency and money element to the form.
addOptionalQuickFormElement()  : void
Add an optional element to the optional elements array.
addOptions()  : mixed
Add options defined in $this->_options to the report.
addOrderBys()  : mixed
Add data for order by tab.
addProfileSelector()  : mixed
Add a widget for selecting/editing/creating/copying a profile form
addRadio()  : HTML_QuickForm_group
addRules()  : mixed
This is a virtual function that adds group and global rules to the form.
addSelect()  : HTML_QuickForm_Element
Adds a select based on field metadata.
addTaskMenu()  : mixed
Add actions menu to results form.
addToDeveloperTab()  : void
The intent is to add a tab for developers to view the sql.
addUploadElement()  : mixed
addYesNo()  : mixed
allowAjaxSubmit()  : mixed
Sets form attribute.
alterCustomDataDisplay()  : mixed
Alter the way in which custom data fields are displayed.
alterDisplay()  : mixed
Alter display of rows.
alterDisplayAddressFields()  : bool
Do AlterDisplay processing on Address Fields.
alterDisplayContactFields()  : bool
Do AlterDisplay processing on Address Fields.
alterSectionHeaderForDateTime()  : mixed
CRM-17793 - Alter DateTime section header to group by date from the datetime field.
append()  : mixed
Appends values to template variables.
assign()  : mixed
Assign value to name in template.
assign_by_ref()  : mixed
Assign value to name in template by reference.
assignBillingName()  : string
Assign billing name to the template.
assignBillingType()  : mixed
Assign billing type id to bltID.
assignVariables()  : mixed
Assign an array of variables to the form/tpl
beginPostProcess()  : mixed
Post Processing function for Form.
beginPostProcessCommon()  : mixed
BeginPostProcess function run in both report mode and non-report mode (api).
buildACLClause()  : mixed
Build contact acl clause
buildChart()  : mixed
Build chart.
buildForm()  : mixed
Core function that builds the form.
buildGroupFilter()  : mixed
Adds group filters to _columns (called from _Construct).
buildGroupTempTable()  : void
Create a table of the contact ids included by the group filter.
buildInstanceAndButtons()  : mixed
This adds the tab referred to as Title and Format, rendered through Instance.tpl.
buildPermissionClause()  : mixed
Build the permission clause for all entities in this report
buildQuery()  : string
Build the report query.
buildQuickForm()  : mixed
Main build form function.
buildRows()  : mixed
Build output rows.
buildTagFilter()  : mixed
Build the tag filter field to display on the filters tab.
cancelAction()  : mixed
Function that can be defined in Form to override or.
canUseAjaxContactLookups()  : bool
cleanUpTemporaryTables()  : mixed
Remove any temporary tables.
compileContent()  : string
Compile the report content.
countStat()  : mixed
Add count statistics.
createTemporaryTable()  : string
Create a temporary table.
customDataFormRule()  : array<string|int, mixed>
A form rule function for custom data.
customDataFrom()  : mixed
Build custom data from clause.
dateClause()  : null|string
Get SQL where clause for a date field.
doTemplateAssignment()  : mixed
Assign rows to the template.
endPostProcess()  : mixed
End post processing.
error()  : mixed
Error reporting mechanism.
filterStat()  : mixed
Filter statistics.
fiscalYearOffset()  : string
Adjusts dates passed in to YEAR() for fiscal year.
fixSubTotalDisplay()  : mixed
Fix subtotal display.
formatDisplay()  : mixed
Format display output.
from()  : mixed
get()  : mixed
Get the variable from the form scope.
get_template_vars()  : array<string|int, mixed>
Returns an array containing template variables.
getAction()  : int|null
Getter for action.
getAuthenticatedContactID()  : int
Get the authenticated contact ID.
getBasicContactFields()  : array<string|int, mixed>
Get a standard set of contact fields.
getBasicContactFilters()  : array<string|int, mixed>
Get a standard set of contact filters.
getCompleteTitle()  : string
getContactID()  : int|null
Get the contact id that the form is being submitted for.
getContext()  : string
getCurrency()  : string
Get the currency for the form.
getDefaultContext()  : mixed
Classes extending CRM_Core_Form should implement this method.
getDefaultEntity()  : mixed
Classes extending CRM_Core_Form should implement this method.
getDefaultValues()  : array<string|int, mixed>
Getter for $_defaultValues.
getElementFromGroup()  : object|bool
Get element from group.
getFromTo()  : array<string|int, mixed>
Get values for from and to for date ranges.
getHookedTemplateFileName()  : mixed
A wrapper for getTemplateFileName.
getID()  : int
Getter for $_id.
getLabels()  : mixed
Get all labels for fields that are used in a group concat.
getLoggedInUserContactID()  : int|false
Get the contact id of the logged in user.
getName()  : string
Getter function for Name.
getOperationPair()  : array<string|int, mixed>
Override "This Year" $op options
getOptionalQuickFormElements()  : array<string|int, mixed>
Get any quick-form elements that may not be present in the form.
getOutputMode()  : string
Getter for _outputMode
getParams()  : void|array<string|int, mixed>
Getter for $_params.
getPaymentProcessorID()  : int|null
getPhoneColumns()  : array<string|int, mixed>
Get phone columns to add to array.
getProfileDefaults()  : array<string|int, mixed>
Set default values on form for given contact (or no contact defaults)
getRenderer()  : CRM_Core_Form_Renderer
Getter function for renderer.
getReportFooter()  : string
Getter for report footer form field value
getReportHeader()  : string
Getter for report header form field value
getReportSql()  : string
Get the sql used to generate the report.
getRequestedContactID()  : int|null
Get the contact ID that has been requested (via url or form value).
getResultSet()  : bool
Get result set.
getResultsLabel()  : string
Get label for show results buttons.
getRootTitle()  : null
getRowCount()  : int
Get the number of rows to show
getSelectColumns()  : array<string|int, mixed>
Get an array of the columns that have been selected for display.
getSQLOperator()  : string
Get SQL operator from form text version.
getState()  : object
Getter function for State.
getStateType()  : int
Getter function for StateType.
getSubmittedValue()  : mixed|null
Get value submitted by the user.
getSubmittedValues()  : array<string|int, mixed>
Get values submitted by the user.
getTemplate()  : CRM_Core_Smarty
getTemplateFileName()  : string
Use the form name to create the tpl file name.
getTemplateVars()  : mixed
Get the value/s assigned to the Template Engine (Smarty).
getTitle()  : string
Getter function for title.
getUFGroupIDs()  : array<string|int, mixed>
Get the active UFGroups (profiles) on this form Many forms load one or more UFGroups (profiles).
getVar()  : mixed
grandTotal()  : bool
Calculate grant total.
groupBy()  : mixed
Build group by clause.
groupByStat()  : mixed
Add group by statistics.
isFieldSelected()  : bool
Check if the field is selected.
isFormInEditMode()  : bool
Is the form in edit mode.
isFormInViewMode()  : bool
Is the form in view mode.
isTableFiltered()  : bool
Check if table name has columns in WHERE or HAVING clause.
isTableSelected()  : bool
Check if table name has columns in SELECT clause.
joinGroupTempTable()  : mixed
Join the temp table contacting contacts who are members of the filtered groups.
legacySlowGroupFilterClause()  : string
Build a group filter with contempt for large data sets.
limit()  : array<string|int, mixed>
Set limit.
mainProcess()  : mixed
Main process wrapper.
modifyColumnHeaders()  : mixed
Modify column headers.
moveSummaryColumnsToTheRightHandSide()  : mixed
Move totals columns to the right edge of the table.
orderBy()  : mixed
Build order by clause.
overrideExtraTemplateFileName()  : string
Default extra tpl file basically just replaces .tpl with .extra.tpl.
postProcess()  : mixed
Post process function.
postProcessHook()  : mixed
The postProcess hook is typically called by the framework.
preProcess()  : mixed
Pre process function.
preProcessCommon()  : mixed
Shared pre-process function.
preProcessOrderBy()  : mixed
Check for empty order_by configurations and remove them.
preventAjaxSubmit()  : mixed
Sets form attribute.
processReportMode()  : mixed
Set output mode.
registerFileField()  : void
Register a field with quick form as supporting a file upload.
registerRules()  : mixed
Register all the standard rules that most forms potentially use.
removeDuplicates()  : mixed
Remove duplicate rows.
removeFileRequiredRules()  : mixed
resetValues()  : mixed
resultsDisplayed()  : bool
Has this form been submitted already?
sectionTotals()  : mixed
Calculate section totals.
select()  : mixed
Generate the SELECT clause and set class variable $_select.
selectClause()  : bool
Build select clause for a single field.
selectedTables()  : array<string|int, mixed>
Fetch array of DAO tables having columns included in SELECT or ORDER BY clause.
selectivelyAddLocationTablesJoinsToFilterQuery()  : mixed
Add location tables to the query if they are used for filtering.
sendEmail()  : mixed
Send report by email
set()  : mixed
Store the variable with the value in the form scope.
setAction()  : mixed
Setter for action.
setAddPaging()  : mixed
Setter for $addPaging.
setContext()  : mixed
Set context variable.
setDefaultValues()  : array<string|int, mixed>
Set default values.
setEntityRefDefaults()  : mixed
Apply common settings to entityRef fields.
setForce()  : mixed
Setter for $_force.
setFromBase()  : mixed
Set the base table for the FROM clause.
setID()  : mixed
Setter for $_id.
setLimitValue()  : mixed
Setter for $_limitValue.
setOffsetValue()  : mixed
Setter for $_offsetValue.
setOptions()  : mixed
Setter function for options.
setOutputHandler()  : void
Retrieve a suitable object from the factory depending on the report parameters, which typically might just be dependent on outputMode.
setPager()  : mixed
Set pager.
setPageTitle()  : void
Sets page title based on entity and action.
setParams()  : mixed
Setter for $_params.
setPurifiedDefaults()  : mixed
setRowCount()  : void
set the number of rows to show
setSelectedChild()  : mixed
Set the active tab
setTitle()  : mixed
Setter function for title.
setVar()  : mixed
statistics()  : array<string|int, mixed>
Build report statistics.
storeOrderByArray()  : mixed
Extract order by fields and store as an array.
storeResultSet()  : mixed
Set store result set indicator to TRUE.
storeWhereHavingClauseArray()  : mixed
Store Where clauses into an array.
toSmarty()  : string
Render form and return contents.
unselectedOrderByColumns()  : array<string|int, mixed>
Determine unselected columns.
unselectedSectionColumns()  : array<string|int, mixed>
Determine unselected columns.
validate()  : bool
Performs the server side validation.
validateMandatoryFields()  : mixed
Helper function to verify that required fields have been filled.
where()  : mixed
Build where clause.
whereClause()  : null|string
Generate where clause.
whereGroupClause()  : string
Build where clause for groups.
whereMembershipOrgClause()  : string
Generate membership organization clause.
whereMembershipTypeClause()  : string
Generate Membership Type SQL Clause.
whereSubtypeClause()  : string
Get SQL where clause for contact subtypes
whereTagClause()  : string
Build where clause for tags.
addBasicFieldToSelect()  : array<string|int, mixed>
Add a basic field to the select clause.
addLinkToRow()  : mixed
Add link fields to the row.
addStatisticsToSelect()  : array<string|int, mixed>
Add statistics columns.
alterBoolean()  : mixed
alterCommunicationtMethod()  : mixed
alterContactID()  : mixed
alterCountryID()  : array<string|int, mixed>
alterCountyID()  : array<string|int, mixed>
alterLocationTypeID()  : mixed
alterStateProvinceID()  : array<string|int, mixed>
assignPaymentProcessor()  : mixed
This if a front end form function for setting the payment processor.
assignTabs()  : mixed
Function to assign the tabs to the template in the correct order.
buildColumns()  : array<string|int, mixed>
Build the columns.
executeReportQuery()  : CRM_Core_DAO|object
Execute query and add it to the developer tab.
formatParamsForPaymentProcessor()  : array<string|int, mixed>
Format the fields in $this->_params for the payment processor.
generateFilterClause()  : string
Generate clause for the selected filter.
getActions()  : array<string|int, mixed>
Get the actions for this report instance.
getAddressColumns()  : array<string|int, mixed>
Get address columns to add to array.
getApiAction()  : mixed
Based on form action, return a string representing the api action.
getAuthenticatedCheckSumContactID()  : int
Get the contact ID authenticated as a valid by checksum.
getColumns()  : array<string|int, mixed>
Function to add columns to reports.
getContactColumns()  : array<string|int, mixed>
Get columns for contact table.
getContactIDIfAccessingOwnRecord()  : int|false
Get the contact if from the url, using the checksum or the cid if it is the logged in user.
getDefaultsFromOptions()  : array<string|int, mixed>
getFieldsToExcludeFromPurification()  : array<string|int, mixed>
Override this in a subclass to prevent fields intended to contain "raw html" from getting broken. E.g. system message templates
getSelectClauseWithGroupConcatIfNotGroupedBy()  : string
Get the select clause for a field, wrapping in GROUP_CONCAT if appropriate.
getSubmittableFields()  : array<string|int, string>
Get the fields that can be submitted in this form flow.
handlePreApproval()  : mixed
Handle pre approval for processors.
isFieldFiltered()  : bool
Check if the field is used as a filter.
isFormInViewOrEditMode()  : bool
Is the form in view or edit mode.
joinAddressFromContact()  : mixed
Add Address into From Table if required.
joinCountryFromAddress()  : mixed
Add Country into From Table if required.
joinEmailFromContact()  : mixed
Add Email into From Table if required.
joinPhoneFromContact()  : mixed
Add Phone into From Table if required.
prepareParamsForPaymentProcessor()  : array<string|int, mixed>
Format the fields in $params for the payment processor.
preProcessPaymentOptions()  : mixed
Handle Payment Processor switching for contribution and event registration forms.
pushUrlToUserContext()  : void
Push path to the userContext (defaults to current url path).
setContactID()  : null|int
Get contact iD for a form object.
setOutputMode()  : mixed
Determine the output mode from the url or input.
setTableAlias()  : string
Set table alias.
setTranslatedFields()  : mixed
Set translated fields.
storeGroupByArray()  : mixed
Store group bys into array - so we can check elsewhere what is grouped.
validateAuthenticatedCheckSumContactID()  : int
Verify that a contact ID is authenticated as a valid contact by checksum
formatReferenceFieldAttributes()  : mixed
preProcessChainSelectFields()  : mixed
Set options and attributes for chain select fields based on the controlling field's value
selectOrAnyPlaceholder()  : string
Handles a repeated bit supplying a placeholder for entity selection
validateChainSelectFields()  : mixed
Validate country / state / county match and suppress unwanted "required" errors

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

public string ATTR_SPACING = '&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;'

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

public string|int CB_PREFIX = 'mark_x_'

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

public string|int CB_PREFIX_LEN = 7

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

public string|int CB_PREFIY = 'mark_y_'

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

public string|int CB_PREFIZ = 'mark_z_'

OP_DATE

Operator types - used for displaying filter elements

public mixed OP_DATE = 4

OP_DATETIME

Operator types - used for displaying filter elements

public mixed OP_DATETIME = 5

OP_ENTITYREF

Operator types - used for displaying filter elements

public mixed OP_ENTITYREF = 256

OP_FLOAT

Operator types - used for displaying filter elements

public mixed OP_FLOAT = 8

OP_INT

Operator types - used for displaying filter elements

public mixed OP_INT = 1

OP_MONTH

Operator types - used for displaying filter elements

public mixed OP_MONTH = 128

OP_MULTISELECT

Operator types - used for displaying filter elements

public mixed OP_MULTISELECT = 65

OP_MULTISELECT_SEPARATOR

Operator types - used for displaying filter elements

public mixed OP_MULTISELECT_SEPARATOR = 66

OP_SELECT

Operator types - used for displaying filter elements

public mixed OP_SELECT = 64

OP_STRING

Operator types - used for displaying filter elements

public mixed OP_STRING = 2

ROW_COUNT_LIMIT

Deprecated constant, Reports should be updated to use the getRowCount function.

public mixed ROW_COUNT_LIMIT = 50

Properties

$_absoluteUrl

Whether to generate absolute URLs (ex: in report emails).

public bool $_absoluteUrl = \FALSE

$_action

(QUASI-PROTECTED) The mode of operation for this form

public int $_action

This field should marked protected and is not generally intended for external callers, but some edge-cases do use it.

$_columnHeaders

public mixed $_columnHeaders = []

$_dashBoardRowCount

DashBoardRowCount Dashboard row count.

public int $_dashBoardRowCount

$_defaults

The default values for the form.

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

$_description

Report description.

public string $_description

$_drilldownReport

public mixed $_drilldownReport = ['contribute/detail' => 'Link to Detail Report']

$_from

SQL from clause. May be altered by hook_civicrm_alterReportVar.

public string $_from

$_groupBy

public mixed $_groupBy = \NULL

$_having

public mixed $_having = \NULL

$_havingClauses

public mixed $_havingClauses = []

$_navigation

Navigation fields

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

$_options

The set of optional columns in the report

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

$_orderBy

public mixed $_orderBy = \NULL

$_orderByArray

public mixed $_orderByArray = []

$_orderByFields

public mixed $_orderByFields = []

$_paymentProcessorIDs

Available payment processors (IDS).

public array<string|int, mixed> $_paymentProcessorIDs

As part of trying to consolidate various payment pages we store processors here & have functions at this level to manage them. An alternative would be to have a separate Form that is inherited by all forms that allow payment processing.

An array of the IDS available on this form.

$_section

public int $_section

$_select

public mixed $_select = \NULL

$_selectClauses

public mixed $_selectClauses = []

$_where

SQL where clause. May be altered by hook_civicrm_alterReportVar.

public string $_where

$_whereClauses

public mixed $_whereClauses = []

$ajaxResponse

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

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

$expectedSmartyVariables

Variables smarty expects to have set.

public array<string|int, string> $expectedSmartyVariables = ['pager', 'skip', 'sections', 'grandStat', 'chartEnabled', 'uniqueId', 'rows', 'group_bys_freq']

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

$html5Types

Extra input types we support via the "add" method

public static array<string|int, mixed> $html5Types = ['number', 'url', 'email', 'color']

$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.

public bool $noController = \FALSE

$optimisedForOnlyFullGroupBy

Can this report use the sql mode ONLY_FULL_GROUP_BY.

public bool $optimisedForOnlyFullGroupBy = \TRUE

$printOnly

Are we in print mode. Can be set by another outputMode, ex: sendmail.

public bool $printOnly = \FALSE

$submitOnce

public bool $submitOnce = \FALSE

$urlPath

Url path used to reach this page

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

$_aclFrom

Variables to hold the acl inner join and where clause

protected string|null $_aclFrom = \NULL

$_aclWhere

protected mixed $_aclWhere = \NULL

$_actionButtonName

Name of action button

protected string $_actionButtonName

$_add2groupSupported

protected mixed $_add2groupSupported = \TRUE

$_addressField

Is an address field selected.

protected bool $_addressField

This was intended to determine if the address table should be joined in The isTableSelected function is now preferred for this purpose

$_aliases

protected array<string|int, mixed> $_aliases = []

$_autoIncludeIndexedFieldsAsOrderBys

protected mixed $_autoIncludeIndexedFieldsAsOrderBys = 0

$_chartButtonName

protected mixed $_chartButtonName = \NULL

$_chartId

protected int $_chartId

$_charts

Determines which chart types are supported for this report

protected array<string|int, string> $_charts = []

$_columns

The set of all columns in the report. An associative array with column name as the key and attributes as the value

protected array<string|int, mixed> $_columns = []

$_createNew

Create new report instance? (or update existing) on save.

protected bool $_createNew

$_createNewButtonName

protected mixed $_createNewButtonName = \NULL

$_criteriaForm

protected mixed $_criteriaForm = \FALSE

$_csvSupported

protected mixed $_csvSupported = \TRUE

$_currencyColumn

Variable to hold the currency alias.

protected string|null $_currencyColumn = \NULL

$_customGroupExtends

Object type that a custom group extends

protected null $_customGroupExtends = ['Contact', 'Individual', 'Contribution']

$_customGroupExtendsJoin

protected mixed $_customGroupExtendsJoin = []

$_customGroupFilters

protected mixed $_customGroupFilters = \TRUE

$_customGroupGroupBy

protected mixed $_customGroupGroupBy = \FALSE

$_customGroupJoin

protected mixed $_customGroupJoin = 'LEFT JOIN'

$_databaseAttributes

Database attributes - character set and collation.

protected string $_databaseAttributes = ' DEFAULT CHARACTER SET utf8 COLLATE utf8_unicode_ci'

$_emailField

Is an email field selected.

protected bool $_emailField

This was intended to determine if the email table should be joined in The isTableSelected function is now preferred for this purpose

$_exposeContactID

By default most reports hide contact id.

protected bool $_exposeContactID = \TRUE

Setting this to true makes it available

$_filters

The set of filters in the report

protected array<string|int, mixed> $_filters = []

$_force

protected mixed $_force = 1

$_format

Format of any chart in use.

protected string|null $_format

(it's unclear if this could be merged with outputMode at this stage)

$_formValues

protected mixed $_formValues = \NULL

$_fourColumnAttribute

An attribute for checkbox/radio form field layout

protected array<string|int, mixed> $_fourColumnAttribute = ['</td><td width="25%">', '</td><td width="25%">', '</td><td width="25%">', '</tr><tr><td>']

$_grandFlag

protected mixed $_grandFlag = \FALSE

$_groupButtonName

protected mixed $_groupButtonName = \NULL

$_groupByArray

Array of clauses to group by.

protected array<string|int, mixed> $_groupByArray = []

$_groupByDateFreq

To what frequency group-by a date column

protected array<string|int, mixed> $_groupByDateFreq = ['MONTH' => 'Month', 'YEARWEEK' => 'Week', 'QUARTER' => 'Quarter', 'YEAR' => 'Year']

$_groupFilter

Build groups filter.

protected bool $_groupFilter = \FALSE

$_groups

protected mixed $_groups = \NULL

$_id

The id of the report instance

protected int $_id

$_instanceButtonName

protected mixed $_instanceButtonName = \NULL

$_instanceForm

protected mixed $_instanceForm = \FALSE

$_instanceValues

protected mixed $_instanceValues = \NULL

$_interval

protected string $_interval

$_limit

SQL Limit clause

protected string $_limit = \NULL

$_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.

protected int $_limitValue = \NULL

$_name

The name of this form

protected string $_name

$_noDisplay

List of fields not to be displayed

protected array<string|int, mixed> $_noDisplay = []

$_noFields

protected mixed $_noFields = \FALSE

$_noRepeats

List of fields not to be repeated during display

protected array<string|int, mixed> $_noRepeats = []

$_offsetValue

This can be set to specify row offset See notes on _limitValue

protected int $_offsetValue = \NULL

$_outputMode

Output mode e.g 'print', 'csv', 'pdf'.

protected string $_outputMode

$_params

protected mixed $_params = \NULL

$_paymentProcessorID

Default or selected processor id.

protected int $_paymentProcessorID

As part of trying to consolidate various payment pages we store processors here & have functions at this level to manage them. An alternative would be to have a separate Form that is inherited by all forms that allow payment processing.

$_paymentProcessors

Available payment processors.

protected array<string|int, mixed> $_paymentProcessors

As part of trying to consolidate various payment pages we store processors here & have functions at this level to manage them.

An array of payment processor details with objects loaded in the 'object' field.

$_phoneField

Is a phone field selected.

protected bool $_phoneField

This was intended to determine if the phone table should be joined in The isTableSelected function is now preferred for this purpose

$_renderer

The renderer used for this form

protected object $_renderer

$_resultSet

When _storeResultSet Flag is set use this var to store result set in form of array

protected bool $_resultSet = []

$_rollup

protected mixed $_rollup

$_rowCount

The Number of rows to display on screen

protected int $_rowCount

$_rowsFound

protected mixed $_rowsFound

$_sections

protected array<string|int, mixed> $_sections = []

$_selectAliases

protected array<string|int, mixed> $_selectAliases = []

$_selectedTables

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

protected array<string|int, mixed> $_selectedTables = []

Where has also been added to this although perhaps the 'includes both' array should have a different name.

$_sendmail

protected bool $_sendmail

$_state

The state object that this form belongs to

protected object $_state

$_statFields

Set of statistic fields

protected array<string|int, mixed> $_statFields = []

$_statistics

Set of statistics data

protected array<string|int, mixed> $_statistics = []

$_storeResultSet

Flag to indicate if result-set is to be stored in a class variable which could be retrieved using getResultSet() method.

protected bool $_storeResultSet = \FALSE

$_tagFilter

Build tags filter

protected bool $_tagFilter = \FALSE

$_tagFilterTable

specify entity table for tags filter

protected string $_tagFilterTable = 'civicrm_contact'

$_template

Cache the smarty template for efficiency reasons

protected static CRM_Core_Smarty $_template

$_templateID

The id of the report template

protected int $_templateID

$_title

The report title

protected string $_title

$addPaging

Should we add paging.

protected bool $addPaging = \TRUE

$campaigns

Array of campaign data, populated by calling `$this::addCampaignFields()`

protected array<string|int, mixed> $campaigns = []

$context

Context of the form being loaded.

protected string $context

'event' or null

$exportedValues

Values submitted by the user.

protected array<string|int, mixed> $exportedValues = []

These values have been checked for injection per https://pear.php.net/manual/en/package.html.html-quickform.html-quickform.exportvalues.php and are as submitted.

Once set this array should be treated as read only.

$filteredTables

Array of DAO tables having columns included in WHERE or HAVING clause

protected array<string|int, mixed> $filteredTables

$groupConcatTested

protected mixed $groupConcatTested = \FALSE

$groupTempTable

Table containing list of contact IDs within the group filter.

protected string $groupTempTable = ''

$isForceGroupBy

protected mixed $isForceGroupBy = \FALSE

$noGroupBy

An instruction not to add a Group By.

protected bool $noGroupBy = \FALSE

This is relevant where the group by might be otherwise added after the code that determines the group by array.

e.g. where stat fields are being added but other settings cause it to not be desirable to add a group by such as in pivot charts when no row header is set

$optionalQuickFormElements

Quick form elements which are conditionally added to the form.

protected array<string|int, mixed> $optionalQuickFormElements = []

Elements in this array will be added to the form at the end if not present so that smarty does not e-notice on things like '{if $form.group}' when 'group' is not added to the form (e.g when no groups exist).

$rollupRow

When a grand total row has calculated the status we pop it off to here.

protected array<string|int, mixed> $rollupRow = []

This allows us to access it from the stats function and avoid recalculating.

$sql

SQL being run in this report.

protected string $sql

The sql in the report is stored in this variable in order to be displayed on the developer tab.

$sqlArray

SQL being run in this report as an array.

protected array<string|int, mixed> $sqlArray

The sql in the report is stored in this variable in order to be returned to api & test calls.

$statusClause

protected string $statusClause = ''

$submittableMoneyFields

Monetary fields that may be submitted.

protected array<string|int, mixed> $submittableMoneyFields = []

Any fields in this list will be converted to non-localised format if retrieved by getSubmittedValue

$tabs

Array of tabs to display on report.

protected array<string|int, mixed> $tabs = []

E.g we define the tab title, the tpl and the tab-specific part of the css or html link.

$this->tabs['OrderBy'] = array( 'title' => ts('Sorting'), 'tpl' => 'OrderBy', 'div_label' => 'order-by', );

$temporaryTables

Tables created for the report that need removal afterwards.

protected array<string|int, mixed> $temporaryTables = []

['civicrm_temp_report_x' => ['temporary' => TRUE, 'name' => 'civicrm_temp_report_x']

$unsavedChangesWarn

Indicate if this form should warn users of unsaved changes

protected bool $unsavedChangesWarn

$authenticatedContactID

The contact ID that has been authenticated and can be used for checking permissions.

private int $authenticatedContactID

It could be a combination of cid in the url plus a checksum or the logged in user. Importantly it can be used to run permission checks on.

$isValidated

private true $isValidated = \FALSE

Methods

add()

Simple easy to use wrapper around addElement.

public & add(string $type, string $name[, string $label = '' ][, array<string|int, mixed> $attributes = NULL ][, bool $required = FALSE ][, array<string|int, mixed> $extra = NULL ]) : HTML_QuickForm_Element

Deal with simple validation rules.

Parameters
$type : string
$name : string
$label : string = ''
$attributes : array<string|int, mixed> = NULL

(options for select elements)

$required : bool = FALSE
$extra : array<string|int, mixed> = NULL

(attributes for select elements). For datepicker elements this is consistent with the data from CRM_Utils_Date::getDatePickerExtra

Tags
noinspection

PhpDocMissingThrowsInspection

noinspection

PhpUnhandledExceptionInspection

Return values
HTML_QuickForm_Element

Could be an error object

add2group()

Add contact to group.

public add2group(int $groupID) : mixed
Parameters
$groupID : int

addAddressFields()

Add address fields.

public addAddressFields([bool $groupBy = TRUE ][, bool $orderBy = FALSE ][, bool $filters = TRUE ][, array<string|int, mixed> $defaults = ['country_id' => TRUE] ]) : array<string|int, mixed>
  • 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

Parameters
$groupBy : bool = TRUE

Add GroupBy? Not appropriate for detail report.

$orderBy : bool = FALSE

Add GroupBy? Not appropriate for detail report.

$filters : bool = TRUE
$defaults : array<string|int, mixed> = ['country_id' => TRUE]
Return values
array<string|int, mixed>

address fields for construct clause

addAutocomplete()

public addAutocomplete(string $name[, string $label = '' ][, array<string|int, mixed> $props = [] ][, bool $required = FALSE ]) : HTML_QuickForm_Element
Parameters
$name : string
$label : string = ''
$props : array<string|int, mixed> = []
$required : bool = FALSE
Return values
HTML_QuickForm_Element

addAutoSelector()

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

public addAutoSelector([array<string|int, mixed> $profiles = [] ][, array<string|int, mixed> $autoCompleteField = [] ]) : mixed

{if !empty($selectable)}

{$form.select_contact.label}
{$form.select_contact.html}
{/if}
Parameters
$profiles : array<string|int, mixed> = []

Ids of profiles that are on the form (to be autofilled).

$autoCompleteField : array<string|int, mixed> = []
  • name_field
  • id_field
  • url (for ajax lookup)
Tags
throws
CRM_Core_Exception
todo

add data attributes so we can deal with multiple instances on a form

addBreadCrumb()

Add bread crumb.

public addBreadCrumb() : mixed

addButtons()

Add default Next / Back buttons.

public addButtons(array<string|int, mixed> $params) : mixed
Parameters
$params : array<string|int, mixed>

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.

addCampaignFields()

Add campaign fields.

public addCampaignFields([string $entityTable = 'civicrm_contribution' ][, bool $groupBy = FALSE ][, bool $orderBy = FALSE ][, bool $filters = TRUE ]) : mixed
Parameters
$entityTable : string = 'civicrm_contribution'
$groupBy : bool = FALSE

Add GroupBy? Not appropriate for detail report.

$orderBy : bool = FALSE

Add OrderBy? Not appropriate for detail report.

$filters : bool = TRUE

addChainSelect()

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

public addChainSelect(string $elementName[, array<string|int, mixed> $settings = [] ]) : HTML_QuickForm_Element
Parameters
$elementName : string
$settings : array<string|int, mixed> = []
Return values
HTML_QuickForm_Element

addChartOptions()

Add chart options to the report.

public addChartOptions() : mixed

addCheckBox()

public addCheckBox(int $id, string $title, array<string|int, mixed> $values[, null $other = NULL ][, null $attributes = NULL ][, null $required = NULL ][, null $javascriptMethod = NULL ][, string $separator = '<br />' ][, bool $flipValues = FALSE ]) : mixed
Parameters
$id : int
$title : string
$values : array<string|int, mixed>
$other : null = NULL
$attributes : null = NULL
$required : null = NULL
$javascriptMethod : null = NULL
$separator : string = '<br />'
$flipValues : bool = FALSE

addCIDZeroOptions()

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

public addCIDZeroOptions() : mixed
Tags
todo

there is considerable code duplication between the contribution forms & event forms. It is apparent that small pieces of duplication are not being refactored into separate functions because their only shared parent is this form. Inserting a class FrontEndForm.php between the contribution & event & this class would allow functions like this and a dozen other small ones to be refactored into a shared parent with the reduction of much code duplication

addClass()

Add one or more css classes to the form.

public addClass(string $className) : mixed
Parameters
$className : string

addColumns()

Add columns to report.

public addColumns() : mixed

addCurrency()

Add currency element to the form.

public addCurrency([string $name = 'currency' ][, string $label = NULL ][, bool $required = TRUE ][, string $defaultCurrency = NULL ][, bool $freezeCurrency = FALSE ][, bool $setDefaultCurrency = TRUE ]) : mixed
Parameters
$name : string = 'currency'
$label : string = NULL
$required : bool = TRUE
$defaultCurrency : string = NULL
$freezeCurrency : bool = FALSE
$setDefaultCurrency : bool = TRUE

addCustomDataToColumns()

Add custom data to the columns.

public addCustomDataToColumns([bool $addFields = TRUE ]) : mixed
Parameters
$addFields : bool = TRUE

addDate()

Add date.

public addDate(string $name, string $label[, bool $required = FALSE ][, array<string|int, mixed> $attributes = NULL ]) : mixed

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

Parameters
$name : string

Name of the element.

$label : string

Label of the element.

$required : bool = FALSE

True if required.

$attributes : array<string|int, mixed> = NULL

Key / value pair.

addDatePickerRange()

Add a search for a range using date picker fields.

public addDatePickerRange(string $fieldName, string $label[, bool $isDateTime = FALSE ][, bool $required = FALSE ][, string $fromLabel = 'From' ][, string $toLabel = 'To' ][, array<string|int, mixed> $additionalOptions = [] ][, string $to = '_high' ][, string $from = '_low' ]) : mixed
Parameters
$fieldName : string
$label : string
$isDateTime : bool = FALSE

Is this a date-time field (not just date).

$required : bool = FALSE
$fromLabel : string = 'From'
$toLabel : string = 'To'
$additionalOptions : array<string|int, mixed> = []
$to : string = '_high'

string to append to the to field.

$from : string = '_low'

string to append to the from field.

addDateRange()

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

Use $this->addDatePickerRange() instead.

Parameters
$name : string
$from : string = '_from'
$to : string = '_to'
$label : string = 'From:'
$dateFormat : string = 'searchDate'
$required : bool = FALSE
$displayTime : bool = FALSE

addDateTime()

Function that will add date and time.

public addDateTime(string $name, string $label[, bool $required = FALSE ][, array<string|int, mixed> $attributes = NULL ]) : mixed

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

Parameters
$name : string
$label : string
$required : bool = FALSE
$attributes : array<string|int, mixed> = NULL

addDefaultButtons()

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

public addDefaultButtons(string $title[, string $nextType = 'next' ][, string $backType = 'back' ][, bool|string $submitOnce = FALSE ]) : mixed
Parameters
$title : string

Title of the main button.

$nextType : string = 'next'

Button type for the form after processing.

$backType : string = 'back'
$submitOnce : bool|string = FALSE

addEntityRef()

Create a single or multiple entity ref field.

public addEntityRef(string $name[, string $label = '' ][, array<string|int, mixed> $props = [] ][, bool $required = FALSE ]) : HTML_QuickForm_Element
Parameters
$name : string
$label : string = ''
$props : array<string|int, mixed> = []

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
$required : bool = FALSE
Return values
HTML_QuickForm_Element

addExpectedSmartyVariable()

Add an expected smarty variable to the array.

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

addExpectedSmartyVariables()

Add an expected smarty variable to the array.

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

addField()

Adds a field based on metadata.

public addField(mixed $name[, array<string|int, mixed> $props = [] ][, bool $required = FALSE ][, bool $legacyDate = TRUE ]) : mixed
Parameters
$name : mixed

Field name to go on the form.

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

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
$required : bool = FALSE
$legacyDate : bool = TRUE

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.

Tags
throws
CRM_Core_Exception
throws
Exception
Return values
mixed

HTML_QuickForm_element void

addFinancialTrxnFromClause()

Add Financial Transaction into From Table if required.

public addFinancialTrxnFromClause() : mixed

addGroupBys()

Add group by options to the report.

public addGroupBys() : mixed

addMoney()

Add a currency and money element to the form.

public addMoney(string $name, string $label[, bool $required = FALSE ][, array<string|int, mixed> $attributes = NULL ][, bool $addCurrency = TRUE ][, string $currencyName = 'currency' ][, string $defaultCurrency = NULL ][, bool $freezeCurrency = FALSE ]) : HTML_QuickForm_Element
Parameters
$name : string
$label : string
$required : bool = FALSE
$attributes : array<string|int, mixed> = NULL
$addCurrency : bool = TRUE
$currencyName : string = 'currency'
$defaultCurrency : string = NULL
$freezeCurrency : bool = FALSE
Return values
HTML_QuickForm_Element

addOptionalQuickFormElement()

Add an optional element to the optional elements array.

public addOptionalQuickFormElement(string $elementName) : void

These elements are assigned as empty (null) variables if there is no real field - allowing smarty to use them without notices.

Parameters
$elementName : string

addOptions()

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

public addOptions() : mixed

addOrderBys()

Add data for order by tab.

public addOrderBys() : mixed

addProfileSelector()

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

public addProfileSelector(string $name, string $label, string $allowCoreTypes, string $allowSubTypes, array<string|int, mixed> $entities[, bool $default = FALSE ][, string $usedFor = NULL ]) : mixed
Parameters
$name : string

HTML form-element name.

$label : string

Printable label.

$allowCoreTypes : string

Only present a UFGroup if its group_type includes a subset of $allowCoreTypes; e.g. 'Individual', 'Activity'.

$allowSubTypes : string

Only present a UFGroup if its group_type is compatible with $allowSubypes.

$entities : array<string|int, mixed>
$default : bool = FALSE

//CRM-15427.

$usedFor : string = NULL

addRadio()

public & addRadio(string $name, string $title, array<string|int, mixed> $values[, array<string|int, mixed> $attributes = [] ][, string $separator = NULL ][, bool $required = FALSE ][, array<string|int, mixed> $optionAttributes = [] ]) : HTML_QuickForm_group
Parameters
$name : string
$title : string
$values : array<string|int, mixed>
$attributes : array<string|int, mixed> = []
$separator : string = NULL
$required : bool = FALSE
$optionAttributes : array<string|int, mixed> = []
  • Option specific attributes
Return values
HTML_QuickForm_group

addRules()

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

public addRules() : mixed

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

addSelect()

Adds a select based on field metadata.

public addSelect(string $name[, array<string|int, mixed> $props = [] ][, bool $required = FALSE ]) : HTML_QuickForm_Element

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 : string

Field name to go on the form.

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

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
$required : bool = FALSE
Tags
throws
CRM_Core_Exception
Return values
HTML_QuickForm_Element

addTaskMenu()

Add actions menu to results form.

public addTaskMenu(array<string|int, mixed> $tasks) : mixed
Parameters
$tasks : array<string|int, mixed>

addToDeveloperTab()

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

public addToDeveloperTab(string $sql) : void

Currently using dpm.

Parameters
$sql : string

addUploadElement()

public addUploadElement(array<string|int, string>|string $elementName) : mixed
Parameters
$elementName : array<string|int, string>|string

addYesNo()

public addYesNo(string $id, string $title[, bool $allowClear = FALSE ][, bool $required = NULL ][, array<string|int, mixed> $attributes = [] ]) : mixed
Parameters
$id : string
$title : string
$allowClear : bool = FALSE
$required : bool = NULL
$attributes : array<string|int, mixed> = []

allowAjaxSubmit()

Sets form attribute.

public allowAjaxSubmit() : mixed
Tags
see

CRM.loadForm

alterCustomDataDisplay()

Alter the way in which custom data fields are displayed.

public alterCustomDataDisplay(array<string|int, mixed> &$rows) : mixed
Parameters
$rows : array<string|int, mixed>

alterDisplay()

Alter display of rows.

public alterDisplay(array<string|int, mixed> &$rows) : mixed

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

Parameters
$rows : array<string|int, mixed>

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

alterDisplayAddressFields()

Do AlterDisplay processing on Address Fields.

public alterDisplayAddressFields(array<string|int, mixed> &$row, array<string|int, mixed> &$rows, int &$rowNum, string|null $baseUrl, string|null $linkText[, string $separator = ',' ]) : bool

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

Parameters
$row : array<string|int, mixed>
$rows : array<string|int, mixed>
$rowNum : int
$baseUrl : string|null
$linkText : string|null
$separator : string = ','
Return values
bool

alterDisplayContactFields()

Do AlterDisplay processing on Address Fields.

public alterDisplayContactFields(array<string|int, mixed> &$row, array<string|int, mixed> &$rows, int &$rowNum, string|null $baseUrl, string|null $linkText) : bool
Parameters
$row : array<string|int, mixed>
$rows : array<string|int, mixed>
$rowNum : int
$baseUrl : string|null
$linkText : string|null
Return values
bool

alterSectionHeaderForDateTime()

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

public alterSectionHeaderForDateTime(string $tempTable, string $columnName) : mixed
Parameters
$tempTable : string
$columnName : string

append()

Appends values to template variables.

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

the template variable name(s)

$value : mixed = NULL

The value to append.

$merge : bool = FALSE

assign()

Assign value to name in template.

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

Name of variable.

$value : mixed = NULL

Value of variable.

assign_by_ref()

Assign value to name in template by reference.

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

since 5.72 will be removed around 5.84

Parameters
$var : string

Name of variable.

$value : mixed

Value of variable.

assignBillingName()

Assign billing name to the template.

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

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

Return values
string

assignBillingType()

Assign billing type id to bltID.

public assignBillingType() : mixed
Tags
throws
CRM_Core_Exception

assignVariables()

Assign an array of variables to the form/tpl

public assignVariables(array<string|int, mixed> $values, array<string|int, mixed> $keys) : mixed
Parameters
$values : array<string|int, mixed>

Array of [key => value] to assign to the form

$keys : array<string|int, mixed>

Array of keys to assign from the values array

beginPostProcess()

Post Processing function for Form.

public beginPostProcess() : mixed

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.

beginPostProcessCommon()

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

public beginPostProcessCommon() : mixed

buildACLClause()

Build contact acl clause

public buildACLClause([string $tableAlias = 'contact_a' ]) : mixed

in favor of buildPermissionClause

Note that if the buildPermissionClause function is called (which most reports do from buildQuery then the results of this function are re-calculated and overwritten.

Parameters
$tableAlias : string = 'contact_a'

buildChart()

Build chart.

public buildChart(array<string|int, mixed> &$rows) : mixed
Parameters
$rows : array<string|int, mixed>

buildForm()

Core function that builds the form.

public buildForm() : mixed

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

buildGroupFilter()

Adds group filters to _columns (called from _Construct).

public buildGroupFilter() : mixed

buildGroupTempTable()

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

public buildGroupTempTable() : void

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

Tags
throws
CRM_Core_Exception

buildInstanceAndButtons()

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

public buildInstanceAndButtons() : mixed
Tags
todo

call this tab into the report template in the same way as OrderBy etc, ie by adding a description of the tab to $this->tabs, causing the tab to be added in Criteria.tpl.

buildPermissionClause()

Build the permission clause for all entities in this report

public buildPermissionClause() : mixed

buildQuery()

Build the report query.

public buildQuery([bool $applyLimit = TRUE ]) : string
Parameters
$applyLimit : bool = TRUE
Return values
string

buildQuickForm()

Main build form function.

public buildQuickForm() : mixed

buildRows()

Build output rows.

public buildRows(string $sql, array<string|int, mixed> &$rows) : mixed
Parameters
$sql : string
$rows : array<string|int, mixed>

buildTagFilter()

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

public buildTagFilter() : mixed

cancelAction()

Function that can be defined in Form to override or.

public cancelAction() : mixed

perform specific action on cancel action

canUseAjaxContactLookups()

public canUseAjaxContactLookups() : bool
Return values
bool

cleanUpTemporaryTables()

Remove any temporary tables.

public cleanUpTemporaryTables() : mixed

compileContent()

Compile the report content.

public compileContent() : string

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

Return values
string

countStat()

Add count statistics.

public countStat(array<string|int, mixed> &$statistics, int $count) : mixed
Parameters
$statistics : array<string|int, mixed>
$count : int

createTemporaryTable()

Create a temporary table.

public createTemporaryTable(string $identifier, string $sql[, bool $isColumns = FALSE ][, bool $isMemory = FALSE ]) : string

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

Parameters
$identifier : string

This is the key that will be used for the table in the temporaryTables property.

$sql : string

Sql select statement or column description (the latter requires the columns flag)

$isColumns : bool = FALSE

Is the sql describing columns to create (rather than using a select query).

$isMemory : bool = FALSE

Create a memory table rather than a normal INNODB table.

Return values
string

customDataFormRule()

A form rule function for custom data.

public customDataFormRule(array<string|int, mixed> $fields[, array<string|int, mixed> $ignoreFields = [] ]) : array<string|int, mixed>

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
$fields : array<string|int, mixed>
$ignoreFields : array<string|int, mixed> = []
Return values
array<string|int, mixed>

customDataFrom()

Build custom data from clause.

public customDataFrom([bool $joinsForFiltersOnly = FALSE ]) : mixed
Parameters
$joinsForFiltersOnly : bool = FALSE

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

dateClause()

Get SQL where clause for a date field.

public dateClause(string $fieldName, string $relative, string $from, string $to[, string $type = NULL ][, string $fromTime = NULL ][, string $toTime = NULL ]) : null|string
Parameters
$fieldName : string
$relative : string
$from : string
$to : string
$type : string = NULL
$fromTime : string = NULL
$toTime : string = NULL
Return values
null|string

doTemplateAssignment()

Assign rows to the template.

public doTemplateAssignment(array<string|int, mixed> &$rows) : mixed
Parameters
$rows : array<string|int, mixed>

endPostProcess()

End post processing.

public endPostProcess([array<string|int, mixed>|null &$rows = NULL ]) : mixed
Parameters
$rows : array<string|int, mixed>|null = NULL

error()

Error reporting mechanism.

public error(string $message[, int $code = NULL ][, CRM_Core_DAO $dao = NULL ]) : mixed
Parameters
$message : string

Error Message.

$code : int = NULL

Error Code.

$dao : CRM_Core_DAO = NULL

A data access object on which we perform a rollback if non - empty.

filterStat()

Filter statistics.

public filterStat(array<string|int, mixed> &$statistics) : mixed
Parameters
$statistics : array<string|int, mixed>

fiscalYearOffset()

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

public fiscalYearOffset(string $fieldName) : string
Parameters
$fieldName : string
Return values
string

fixSubTotalDisplay()

Fix subtotal display.

public fixSubTotalDisplay(array<string|int, mixed> &$row, array<string|int, mixed> $fields[, bool $subtotal = TRUE ]) : mixed
Parameters
$row : array<string|int, mixed>
$fields : array<string|int, mixed>
$subtotal : bool = TRUE

formatDisplay()

Format display output.

public formatDisplay(array<string|int, mixed> &$rows[, bool $pager = TRUE ]) : mixed
Parameters
$rows : array<string|int, mixed>
$pager : bool = TRUE

get()

Get the variable from the form scope.

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

Name of the variable

get_template_vars()

Returns an array containing template variables.

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

since 5.69 will be removed around 5.93. use getTemplateVars.

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

getAction()

Getter for action.

public getAction() : int|null
Return values
int|null

getAuthenticatedContactID()

Get the authenticated contact ID.

public getAuthenticatedContactID() : int
APIYes

This is either

  • a contact ID authenticated by checksum
  • the logged in user
  • 0 for none.
Tags
throws
CRM_Core_Exception
Return values
int

getBasicContactFields()

Get a standard set of contact fields.

public getBasicContactFields() : array<string|int, mixed>
  • use getColumns('Contact') instead
Return values
array<string|int, mixed>

getBasicContactFilters()

Get a standard set of contact filters.

public getBasicContactFilters([array<string|int, mixed> $defaults = [] ]) : array<string|int, mixed>
Parameters
$defaults : array<string|int, mixed> = []
Return values
array<string|int, mixed>

getCompleteTitle()

public getCompleteTitle() : string
Return values
string

getContactID()

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

public getContactID() : int|null
Return values
int|null

getContext()

public getContext() : string
Return values
string

getCurrency()

Get the currency for the form.

public getCurrency() : string
Return values
string

getDefaultContext()

Classes extending CRM_Core_Form should implement this method.

public getDefaultContext() : mixed

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

Tags
throws
Exception

getDefaultEntity()

Classes extending CRM_Core_Form should implement this method.

public getDefaultEntity() : mixed
Tags
throws
Exception

getDefaultValues()

Getter for $_defaultValues.

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

getElementFromGroup()

Get element from group.

public getElementFromGroup(string $group, string $grpFieldName) : object|bool
Parameters
$group : string
$grpFieldName : string
Return values
object|bool

getFromTo()

Get values for from and to for date ranges.

public getFromTo(bool $relative, string $from, string $to[, string $fromTime = NULL ][, string $toTime = NULL ]) : array<string|int, mixed>
Parameters
$relative : bool
$from : string
$to : string
$fromTime : string = NULL
$toTime : string = NULL
Return values
array<string|int, mixed>

getHookedTemplateFileName()

A wrapper for getTemplateFileName.

public getHookedTemplateFileName() : mixed

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

getID()

Getter for $_id.

public getID() : int
Return values
int

getLabels()

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

public getLabels(string $options, string $baoName, string $fieldName) : mixed
Parameters
$options : string

comma separated option values.

$baoName : string

The BAO name for the field.

$fieldName : string

The name of the field for which labels should be retrieved.

return string

getLoggedInUserContactID()

Get the contact id of the logged in user.

public getLoggedInUserContactID() : int|false
Return values
int|false

getName()

Getter function for Name.

public getName() : string
Return values
string

getOperationPair()

Override "This Year" $op options

public getOperationPair([string $type = "string" ][, null $fieldName = NULL ]) : array<string|int, mixed>
Parameters
$type : string = "string"
$fieldName : null = NULL
Return values
array<string|int, mixed>

getOptionalQuickFormElements()

Get any quick-form elements that may not be present in the form.

public getOptionalQuickFormElements() : array<string|int, mixed>

To make life simpler for smarty we ensure they are set to null rather than unset. This is done at the last minute when $this is converted to an array to be assigned to the form.

Return values
array<string|int, mixed>

getOutputMode()

Getter for _outputMode

public getOutputMode() : string

Note you can implement hook_civicrm_alterReportVar('actions', ...) which indirectly allows setting _outputMode if the user chooses your action.

Return values
string

getParams()

Getter for $_params.

public getParams() : void|array<string|int, mixed>
Return values
void|array<string|int, mixed>

$params

getPaymentProcessorID()

public getPaymentProcessorID() : int|null
Return values
int|null

getPhoneColumns()

Get phone columns to add to array.

public getPhoneColumns([array<string|int, mixed> $options = [] ]) : array<string|int, mixed>
Parameters
$options : array<string|int, mixed> = []
  • 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 values
array<string|int, mixed>

phone columns definition

getProfileDefaults()

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

public getProfileDefaults([mixed $profile_id = 'Billing' ][, int $contactID = NULL ]) : array<string|int, mixed>
Parameters
$profile_id : mixed = 'Billing'

(can be id, or profile name).

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

getReportFooter()

Getter for report footer form field value

public getReportFooter() : string
Return values
string

getReportHeader()

Getter for report header form field value

public getReportHeader() : string
Return values
string

getReportSql()

Get the sql used to generate the report.

public getReportSql() : string
Return values
string

getRequestedContactID()

Get the contact ID that has been requested (via url or form value).

public getRequestedContactID() : int|null

Ideally the forms would override this so only the cid in the url would be checked in the shared form function.

Tags
throws
CRM_Core_Exception
Return values
int|null

getResultSet()

Get result set.

public getResultSet() : bool
Return values
bool

getResultsLabel()

Get label for show results buttons.

public getResultsLabel() : string
Return values
string

getRootTitle()

public getRootTitle() : null
Return values
null

getRowCount()

Get the number of rows to show

public getRowCount() : int
Return values
int

getSelectColumns()

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

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

getSQLOperator()

Get SQL operator from form text version.

public getSQLOperator([string $operator = "like" ]) : string
Parameters
$operator : string = "like"
Return values
string

getState()

Getter function for State.

public & getState() : object
Return values
object

getStateType()

Getter function for StateType.

public getStateType() : int
Return values
int

getSubmittedValue()

Get value submitted by the user.

public getSubmittedValue(string $fieldName) : mixed|null
APIYes

These values have been validated against the fields added to the form. https://pear.php.net/manual/en/package.html.html-quickform.html-quickform.exportvalues.php unless the function is being called during before the submission has been validated. In which the values are not yet validated & hence taking directly from $_POST.

Fields with money or number formats are converted from localised formats before returning.

Parameters
$fieldName : string
Return values
mixed|null

getSubmittedValues()

Get values submitted by the user.

public getSubmittedValues() : array<string|int, mixed>
APIYes

Compared with $this->controller->exportValues this has a couple of changes

  1. any fields declared in $this->submittableMoneyFields will be de-formatted first.
  2. it is possible to store access fields from related forms if they are declared in getSubmittableFields(). This is notably used in imports to combine fields from the various screens & save the resulting 'submitted_values' to the UserJob.
Return values
array<string|int, mixed>

getTemplateFileName()

Use the form name to create the tpl file name.

public getTemplateFileName() : string
Return values
string

getTemplateVars()

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

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

getTitle()

Getter function for title.

public getTitle() : string

Should be over-ridden by derived class.

Return values
string

getUFGroupIDs()

Get the active UFGroups (profiles) on this form Many forms load one or more UFGroups (profiles).

public getUFGroupIDs() : array<string|int, mixed>

This provides a standard function to retrieve the IDs of those profiles from the form so that you can implement things such as "is is_captcha field set on any of the active profiles on this form?"

NOT SUPPORTED FOR USE OUTSIDE CORE EXTENSIONS - Added for reCAPTCHA core extension.

Return values
array<string|int, mixed>

getVar()

public getVar(string $name) : mixed
  • use of this function assumes that an otherwise unavailable variable can be used form outside the class in question. However, the very fact it is otherwise unavailable means there is no contract that it will not be changed or become unused. This function is OK for temporary usage but should be accompanied with an effort to establish a more correct method or property tested hook / api interface if this is being done from outside of core.
Parameters
$name : string

grandTotal()

Calculate grant total.

public grandTotal(array<string|int, mixed> &$rows) : bool
Parameters
$rows : array<string|int, mixed>
Return values
bool

groupBy()

Build group by clause.

public groupBy() : mixed

groupByStat()

Add group by statistics.

public groupByStat(array<string|int, mixed> &$statistics) : mixed
Parameters
$statistics : array<string|int, mixed>

isFieldSelected()

Check if the field is selected.

public isFieldSelected(string $prop) : bool
Parameters
$prop : string
Return values
bool

isFormInEditMode()

Is the form in edit mode.

public isFormInEditMode() : bool

Helper function, notably for extensions implementing the buildForm hook, so that they can return early.

Return values
bool

isFormInViewMode()

Is the form in view mode.

public isFormInViewMode() : bool

Helper function, notably for extensions implementing the buildForm hook, so that they can return early.

Return values
bool

isTableFiltered()

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

public isTableFiltered(string $tableName) : bool
Parameters
$tableName : string

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

Return values
bool

isTableSelected()

Check if table name has columns in SELECT clause.

public isTableSelected(string $tableName) : bool
Parameters
$tableName : string

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

Return values
bool

joinGroupTempTable()

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

public joinGroupTempTable(string $baseTable, string $field, string $tableAlias) : mixed

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

Parameters
$baseTable : string
$field : string
$tableAlias : string

legacySlowGroupFilterClause()

Build a group filter with contempt for large data sets.

public legacySlowGroupFilterClause(array<string|int, mixed> $field, mixed $value, string $op) : string

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
$field : array<string|int, mixed>
$value : mixed
$op : string
Return values
string

limit()

Set limit.

public limit([int|null $rowCount = NULL ]) : array<string|int, mixed>
Parameters
$rowCount : int|null = NULL
Return values
array<string|int, mixed>

mainProcess()

Main process wrapper.

public mainProcess([bool $allowAjax = TRUE ]) : mixed

Implemented so that we can call all the hook functions.

Parameters
$allowAjax : bool = TRUE

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

modifyColumnHeaders()

Modify column headers.

public modifyColumnHeaders() : mixed

moveSummaryColumnsToTheRightHandSide()

Move totals columns to the right edge of the table.

public moveSummaryColumnsToTheRightHandSide() : mixed

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.

orderBy()

Build order by clause.

public orderBy() : mixed

overrideExtraTemplateFileName()

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

public overrideExtraTemplateFileName() : string

i.e. we do not override.

Return values
string

postProcess()

Post process function.

public postProcess() : mixed

postProcessHook()

The postProcess hook is typically called by the framework.

public postProcessHook() : mixed

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

preProcess()

Pre process function.

public preProcess() : mixed

Called prior to build form.

preProcessCommon()

Shared pre-process function.

public preProcessCommon() : mixed

If overriding preProcess function this should still be called.

Tags
throws
Exception

preProcessOrderBy()

Check for empty order_by configurations and remove them.

public preProcessOrderBy(array<string|int, mixed> &$formValues) : mixed

Also set template to hide them.

Parameters
$formValues : array<string|int, mixed>

preventAjaxSubmit()

Sets form attribute.

public preventAjaxSubmit() : mixed
Tags
see

CRM.loadForm

processReportMode()

Set output mode.

public processReportMode() : mixed

registerFileField()

Register a field with quick form as supporting a file upload.

public registerFileField(array<string|int, mixed> $fieldNames) : void
Parameters
$fieldNames : array<string|int, mixed>

registerRules()

Register all the standard rules that most forms potentially use.

public registerRules() : mixed

removeDuplicates()

Remove duplicate rows.

public removeDuplicates(array<string|int, mixed> &$rows) : mixed
Parameters
$rows : array<string|int, mixed>

removeFileRequiredRules()

public removeFileRequiredRules(mixed $elementName) : mixed
Parameters
$elementName : mixed

resetValues()

public resetValues() : mixed

resultsDisplayed()

Has this form been submitted already?

public resultsDisplayed() : bool
Return values
bool

sectionTotals()

Calculate section totals.

public sectionTotals() : mixed

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}.

select()

Generate the SELECT clause and set class variable $_select.

public select() : mixed

selectClause()

Build select clause for a single field.

public selectClause(string &$tableName, string $tableKey, string &$fieldName, array<string|int, mixed> &$field) : bool
Parameters
$tableName : string
$tableKey : string
$fieldName : string
$field : array<string|int, mixed>
Return values
bool

selectedTables()

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

public selectedTables() : array<string|int, mixed>

If the array is unset it will be built.

Return values
array<string|int, mixed>

selectedTables

selectivelyAddLocationTablesJoinsToFilterQuery()

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

public selectivelyAddLocationTablesJoinsToFilterQuery() : mixed

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

sendEmail()

Send report by email

public sendEmail() : mixed

set()

Store the variable with the value in the form scope.

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

Name of the variable.

$value : mixed

Value of the variable.

setAction()

Setter for action.

public setAction(int $action) : mixed
Parameters
$action : int

The mode we want to set the form.

setAddPaging()

Setter for $addPaging.

public setAddPaging(bool $value) : mixed
Parameters
$value : bool

setContext()

Set context variable.

public setContext() : mixed

setDefaultValues()

Set default values.

public setDefaultValues([bool $freeze = TRUE ]) : array<string|int, mixed>
Parameters
$freeze : bool = TRUE
Return values
array<string|int, mixed>

setEntityRefDefaults()

Apply common settings to entityRef fields.

public setEntityRefDefaults(array<string|int, mixed> &$field, string $table) : mixed
Parameters
$field : array<string|int, mixed>
$table : string

setForce()

Setter for $_force.

public setForce(bool $isForce) : mixed
Parameters
$isForce : bool

setFromBase()

Set the base table for the FROM clause.

public setFromBase(string $baseTable[, string $field = 'id' ][, string|null $tableAlias = NULL ]) : mixed

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
$baseTable : string
$field : string = 'id'
$tableAlias : string|null = NULL

setID()

Setter for $_id.

public setID(int $instanceID) : mixed
Parameters
$instanceID : int

setLimitValue()

Setter for $_limitValue.

public setLimitValue(int $_limitValue) : mixed
Parameters
$_limitValue : int

setOffsetValue()

Setter for $_offsetValue.

public setOffsetValue(int $_offsetValue) : mixed
Parameters
$_offsetValue : int

setOptions()

Setter function for options.

public setOptions(mixed $options) : mixed
Parameters
$options : mixed

setOutputHandler()

Retrieve a suitable object from the factory depending on the report parameters, which typically might just be dependent on outputMode.

public setOutputHandler() : void

If there is no suitable output handler, e.g. if outputMode is "copy", then this sets it to NULL.

setPager()

Set pager.

public setPager([int|null $rowCount = NULL ]) : mixed
Parameters
$rowCount : int|null = NULL

setPageTitle()

Sets page title based on entity and action.

public setPageTitle([string|null $entityLabel = NULL ]) : void
Parameters
$entityLabel : string|null = NULL
Tags
throws
CRM_Core_Exception

setParams()

Setter for $_params.

public setParams(array<string|int, mixed> $params) : mixed
Parameters
$params : array<string|int, mixed>

setPurifiedDefaults()

public setPurifiedDefaults(mixed $defaults) : mixed
Parameters
$defaults : mixed

setRowCount()

set the number of rows to show

public setRowCount(int $rowCount) : void
Parameters
$rowCount : int

setSelectedChild()

Set the active tab

public setSelectedChild([string $default = NULL ]) : mixed
Parameters
$default : string = NULL
Tags
noinspection

PhpUnhandledExceptionInspection

setTitle()

Setter function for title.

public setTitle(string $title) : mixed
Parameters
$title : string

The title of the form.

setVar()

public setVar(string $name, mixed $value) : mixed
  • use of this function assumes that an otherwise unavailable variable can be used form outside the class in question. However, the very fact it is otherwise unavailable means there is no contract that it will not be changed or become unused. This function is OK for temporary usage but should be accompanied with an effort to establish a more correct method or property tested hook / api interface if this is being done from outside of core.
Parameters
$name : string
$value : mixed

statistics()

Build report statistics.

public statistics(array<string|int, mixed> &$rows) : array<string|int, mixed>
Parameters
$rows : array<string|int, mixed>
Return values
array<string|int, mixed>

storeOrderByArray()

Extract order by fields and store as an array.

public storeOrderByArray() : mixed

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

storeResultSet()

Set store result set indicator to TRUE.

public storeResultSet() : mixed

This is used by unit tests, along with getResultSet(), to get just the output rows unformatted.

storeWhereHavingClauseArray()

Store Where clauses into an array.

public storeWhereHavingClauseArray() : mixed

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

toSmarty()

Render form and return contents.

public toSmarty() : string
Return values
string

unselectedOrderByColumns()

Determine unselected columns.

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

unselectedSectionColumns()

Determine unselected columns.

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

validate()

Performs the server side validation.

public validate() : bool
Tags
since
1.0
throws
HTML_QuickForm_Error
Return values
bool

true if no error found

validateMandatoryFields()

Helper function to verify that required fields have been filled.

public static validateMandatoryFields(array<string|int, mixed> $fields, array<string|int, mixed> $values, array<string|int, mixed> &$errors) : mixed

Typically called within the scope of a FormRule function

Parameters
$fields : array<string|int, mixed>
$values : array<string|int, mixed>
$errors : array<string|int, mixed>

where()

Build where clause.

public where() : mixed

whereClause()

Generate where clause.

public whereClause(array<string|int, mixed> &$field, string $op, mixed $value, float $min, float $max) : null|string

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

Parameters
$field : array<string|int, mixed>

Field specifications

$op : string

Query operator (not an exact match to sql)

$value : mixed
$min : float
$max : float
Return values
null|string

whereGroupClause()

Build where clause for groups.

public whereGroupClause(array<string|int, mixed> $field, mixed $value, string $op) : string
Parameters
$field : array<string|int, mixed>
$value : mixed
$op : string
Return values
string

whereMembershipOrgClause()

Generate membership organization clause.

public whereMembershipOrgClause(mixed $value, string $op) : string
Parameters
$value : mixed
$op : string

SQL Operator

Return values
string

whereMembershipTypeClause()

Generate Membership Type SQL Clause.

public whereMembershipTypeClause(mixed $value, string $op) : string
Parameters
$value : mixed
$op : string
Return values
string

SQL query string

whereSubtypeClause()

Get SQL where clause for contact subtypes

public whereSubtypeClause(array<string|int, mixed> $field, mixed $value, string $op) : string
Parameters
$field : array<string|int, mixed>

Field specifications

$value : mixed
$op : string

SQL Operator

Return values
string

whereTagClause()

Build where clause for tags.

public whereTagClause(array<string|int, mixed> $field, mixed $value, string $op) : string
Parameters
$field : array<string|int, mixed>
$value : mixed
$op : string
Return values
string

addBasicFieldToSelect()

Add a basic field to the select clause.

protected addBasicFieldToSelect(string $tableName, string $fieldName, array<string|int, mixed> $field, array<string|int, mixed> $select) : array<string|int, mixed>
Parameters
$tableName : string
$fieldName : string
$field : array<string|int, mixed>
$select : array<string|int, mixed>
Return values
array<string|int, mixed>

addLinkToRow()

Add link fields to the row.

protected addLinkToRow(array<string|int, mixed> &$row, string $baseUrl, string $linkText, string $value, string $fieldName, string $tablePrefix, string $fieldLabel) : mixed

Function adds the _link & _hover fields to the row.

Parameters
$row : array<string|int, mixed>
$baseUrl : string
$linkText : string
$value : string
$fieldName : string
$tablePrefix : string
$fieldLabel : string

addStatisticsToSelect()

Add statistics columns.

protected addStatisticsToSelect(array<string|int, mixed> $field, string $tableName, string $fieldName, array<string|int, mixed> $select) : array<string|int, mixed>

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
$field : array<string|int, mixed>
$tableName : string
$fieldName : string
$select : array<string|int, mixed>
Return values
array<string|int, mixed>

alterBoolean()

protected alterBoolean(mixed $value) : mixed
Parameters
$value : mixed

alterCommunicationtMethod()

protected alterCommunicationtMethod(mixed $value, array<string|int, mixed> &$row, mixed $fieldname) : mixed
Parameters
$value : mixed
$row : array<string|int, mixed>
$fieldname : mixed

alterContactID()

protected alterContactID(mixed $value, array<string|int, mixed> &$row, mixed $fieldname) : mixed
Parameters
$value : mixed
$row : array<string|int, mixed>
$fieldname : mixed

alterCountryID()

protected alterCountryID(mixed $value, array<string|int, mixed> &$row, mixed $selectedField, mixed $criteriaFieldName) : array<string|int, mixed>
Parameters
$value : mixed
$row : array<string|int, mixed>
$selectedField : mixed
$criteriaFieldName : mixed
Return values
array<string|int, mixed>

alterCountyID()

protected alterCountyID(mixed $value, array<string|int, mixed> &$row, mixed $selectedfield, mixed $criteriaFieldName) : array<string|int, mixed>
Parameters
$value : mixed
$row : array<string|int, mixed>
$selectedfield : mixed
$criteriaFieldName : mixed
Return values
array<string|int, mixed>

alterLocationTypeID()

protected alterLocationTypeID(mixed $value, array<string|int, mixed> &$row, mixed $selectedfield, mixed $criteriaFieldName) : mixed
Parameters
$value : mixed
$row : array<string|int, mixed>
$selectedfield : mixed
$criteriaFieldName : mixed

alterStateProvinceID()

protected alterStateProvinceID(mixed $value, array<string|int, mixed> &$row, mixed $selectedfield, mixed $criteriaFieldName) : array<string|int, mixed>
Parameters
$value : mixed
$row : array<string|int, mixed>
$selectedfield : mixed
$criteriaFieldName : mixed
Return values
array<string|int, mixed>

assignPaymentProcessor()

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

protected assignPaymentProcessor(bool $isPayLaterEnabled) : mixed

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

Parameters
$isPayLaterEnabled : bool
Tags
throws
CRM_Core_Exception

assignTabs()

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

protected assignTabs() : mixed

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

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

buildColumns()

Build the columns.

protected buildColumns(array<string|int, mixed> $specs, string $tableName[, string $daoName = NULL ][, string $tableAlias = NULL ][, array<string|int, mixed> $defaults = [] ][, array<string|int, mixed> $options = [] ]) : array<string|int, mixed>

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
  1. 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

  2. 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
$specs : array<string|int, mixed>
$tableName : string
$daoName : string = NULL
$tableAlias : string = NULL
$defaults : array<string|int, mixed> = []
$options : array<string|int, mixed> = []
Return values
array<string|int, mixed>

executeReportQuery()

Execute query and add it to the developer tab.

protected executeReportQuery(string $query[, array<string|int, mixed> $params = [] ]) : CRM_Core_DAO|object
Parameters
$query : string
$params : array<string|int, mixed> = []
Return values
CRM_Core_DAO|object

formatParamsForPaymentProcessor()

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

protected formatParamsForPaymentProcessor(array<string|int, mixed> $fields) : array<string|int, mixed>

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

Parameters
$fields : array<string|int, mixed>
Return values
array<string|int, mixed>

generateFilterClause()

Generate clause for the selected filter.

protected generateFilterClause(array<string|int, mixed> $field, string $fieldName) : string
Parameters
$field : array<string|int, mixed>

Field specification

$fieldName : string

Field name.

Return values
string

Relevant where clause.

getActions()

Get the actions for this report instance.

protected getActions(int $instanceId) : array<string|int, mixed>
Parameters
$instanceId : int
Return values
array<string|int, mixed>

getAddressColumns()

Get address columns to add to array.

protected getAddressColumns([array<string|int, mixed> $options = [] ]) : array<string|int, mixed>
Parameters
$options : array<string|int, mixed> = []
  • 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 values
array<string|int, mixed>

address columns definition

getApiAction()

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

protected getApiAction() : mixed

Used by addField method.

Return string

getAuthenticatedCheckSumContactID()

Get the contact ID authenticated as a valid by checksum.

protected getAuthenticatedCheckSumContactID() : int
Tags
throws
CRM_Core_Exception
Return values
int

getColumns()

Function to add columns to reports.

protected getColumns(string $type[, array<string|int, mixed> $options = [] ]) : array<string|int, mixed>

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

Parameters
$type : string
$options : array<string|int, mixed> = []
  • 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 values
array<string|int, mixed>

getContactColumns()

Get columns for contact table.

protected getContactColumns([array<string|int, mixed> $options = [] ]) : array<string|int, mixed>
Parameters
$options : array<string|int, mixed> = []
Return values
array<string|int, mixed>

getContactIDIfAccessingOwnRecord()

Get the contact if from the url, using the checksum or the cid if it is the logged in user.

protected getContactIDIfAccessingOwnRecord() : int|false

use getAuthenticatedContactID()

This function returns the user being validated. It is not intended to get another user they have permission to (setContactID does do that) and can be used to check if the user is accessing their own record.

Tags
throws
CRM_Core_Exception
Return values
int|false

getDefaultsFromOptions()

protected getDefaultsFromOptions(array<string|int, mixed> $options) : array<string|int, mixed>
Parameters
$options : array<string|int, mixed>
Return values
array<string|int, mixed>

getFieldsToExcludeFromPurification()

Override this in a subclass to prevent fields intended to contain "raw html" from getting broken. E.g. system message templates

protected getFieldsToExcludeFromPurification() : array<string|int, mixed>
Return values
array<string|int, mixed>

getSelectClauseWithGroupConcatIfNotGroupedBy()

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

protected getSelectClauseWithGroupConcatIfNotGroupedBy(string $tableName, string &$fieldName, array<string|int, mixed> &$field) : string

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
$tableName : string
$fieldName : string
$field : array<string|int, mixed>
Return values
string

getSubmittableFields()

Get the fields that can be submitted in this form flow.

protected getSubmittableFields() : array<string|int, string>
APIYes

To make fields in related forms (ie within the same wizard like Contribution_Main and Contribution_Confirm) accessible you can override this function as CRM_Import_Forms does.

Return values
array<string|int, string>

handlePreApproval()

Handle pre approval for processors.

protected handlePreApproval(array<string|int, mixed> &$params) : mixed

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
$params : array<string|int, mixed>

isFieldFiltered()

Check if the field is used as a filter.

protected isFieldFiltered(string $prop) : bool
Parameters
$prop : string
Return values
bool

isFormInViewOrEditMode()

Is the form in view or edit mode.

protected isFormInViewOrEditMode() : bool

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 values
bool

joinAddressFromContact()

Add Address into From Table if required.

protected joinAddressFromContact([string $prefix = '' ][, array<string|int, mixed> $extra = [] ]) : mixed

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

Parameters
$prefix : string = ''
$extra : array<string|int, mixed> = []

Additional options. Not currently used in core but may be used in override extensions.

joinCountryFromAddress()

Add Country into From Table if required.

protected joinCountryFromAddress([string $prefix = '' ][, array<string|int, mixed> $extra = [] ]) : mixed

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

Parameters
$prefix : string = ''
$extra : array<string|int, mixed> = []

Additional options. Not currently used in core but may be used in override extensions.

joinEmailFromContact()

Add Email into From Table if required.

protected joinEmailFromContact([string $prefix = '' ][, array<string|int, mixed> $extra = [] ]) : mixed

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

Parameters
$prefix : string = ''
$extra : array<string|int, mixed> = []

Additional options. Not currently used in core but may be used in override extensions.

joinPhoneFromContact()

Add Phone into From Table if required.

protected joinPhoneFromContact([string $prefix = '' ][, array<string|int, mixed> $extra = [] ]) : mixed

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

Parameters
$prefix : string = ''
$extra : array<string|int, mixed> = []

Additional options. Not currently used in core but may be used in override extensions.

prepareParamsForPaymentProcessor()

Format the fields in $params for the payment processor.

protected prepareParamsForPaymentProcessor(array<string|int, mixed> $params) : array<string|int, mixed>

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

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

Payment processor params

Return values
array<string|int, mixed>

$params

preProcessPaymentOptions()

Handle Payment Processor switching for contribution and event registration forms.

protected preProcessPaymentOptions() : mixed

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.

pushUrlToUserContext()

Push path to the userContext (defaults to current url path).

protected pushUrlToUserContext([string|null $path = NULL ]) : void

This is like a save point :-). The next status bounce will return the browser to this url unless another is added.

Parameters
$path : string|null = NULL

Path string e.g. civicrm/foo/bar?reset=1, defaults to current path.

setContactID()

Get contact iD for a form object.

protected setContactID() : null|int

This checks the requestedContactID and returns it if

  • it is the number 0 (relevant for online contribution & event forms).
  • it is the logged in user
  • it is validated by a checksum in the url.
  • it is a contact that the logged in user has permission to view

Failing that it returns the logged in user, if any. This is may be useful for users taking actions from their contact dashboard (although usually one of the variants above would be hit).

Tags
throws
CRM_Core_Exception
Return values
null|int

setOutputMode()

Determine the output mode from the url or input.

protected setOutputMode() : mixed

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.

setTableAlias()

Set table alias.

protected setTableAlias(array<string|int, mixed> $table, string $tableName) : string
Parameters
$table : array<string|int, mixed>
$tableName : string
Return values
string

Alias for table.

setTranslatedFields()

Set translated fields.

protected setTranslatedFields() : mixed

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.

storeGroupByArray()

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

protected storeGroupByArray() : mixed

validateAuthenticatedCheckSumContactID()

Verify that a contact ID is authenticated as a valid contact by checksum

protected validateAuthenticatedCheckSumContactID(int|null $contactID) : int
Parameters
$contactID : int|null
Tags
throws
CRM_Core_Exception
Return values
int

formatReferenceFieldAttributes()

private formatReferenceFieldAttributes(array<string|int, mixed> &$props, string $formName) : mixed
Parameters
$props : array<string|int, mixed>
$formName : string

preProcessChainSelectFields()

Set options and attributes for chain select fields based on the controlling field's value

private preProcessChainSelectFields() : mixed

selectOrAnyPlaceholder()

Handles a repeated bit supplying a placeholder for entity selection

private static selectOrAnyPlaceholder(string $props, bool $required[, string $title = NULL ]) : string
Parameters
$props : string

The field properties, including the entity and context.

$required : bool

If the field is required.

$title : string = NULL

A field title, if applicable.

Return values
string

The placeholder text.

validateChainSelectFields()

Validate country / state / county match and suppress unwanted "required" errors

private validateChainSelectFields() : mixed

        
On this page

Search results