CRM_Report_Form_Contribute_OrganizationSummary
class CRM_Report_Form_Contribute_OrganizationSummary extends CRM_Report_Form
Constants
ATTR_SPACING |
Constants for attributes for various form elements attempt to standardize on the number of variations that we use of the below form elements |
CB_PREFIX |
All checkboxes are defined with a common prefix. This allows us to have the same javascript to check / clear all the checkboxes etc If u have multiple groups of checkboxes, you will need to give them different ids to avoid potential name collision |
CB_PREFIY |
All checkboxes are defined with a common prefix. This allows us to have the same javascript to check / clear all the checkboxes etc If u have multiple groups of checkboxes, you will need to give them different ids to avoid potential name collision |
CB_PREFIZ |
All checkboxes are defined with a common prefix. This allows us to have the same javascript to check / clear all the checkboxes etc If u have multiple groups of checkboxes, you will need to give them different ids to avoid potential name collision |
CB_PREFIX_LEN |
All checkboxes are defined with a common prefix. This allows us to have the same javascript to check / clear all the checkboxes etc If u have multiple groups of checkboxes, you will need to give them different ids to avoid potential name collision |
ROW_COUNT_LIMIT |
|
OP_INT |
Operator types - used for displaying filter elements |
OP_STRING |
Operator types - used for displaying filter elements |
OP_DATE |
Operator types - used for displaying filter elements |
OP_DATETIME |
Operator types - used for displaying filter elements |
OP_FLOAT |
Operator types - used for displaying filter elements |
OP_SELECT |
Operator types - used for displaying filter elements |
OP_MULTISELECT |
Operator types - used for displaying filter elements |
OP_MULTISELECT_SEPARATOR |
Operator types - used for displaying filter elements |
OP_MONTH |
Operator types - used for displaying filter elements |
OP_ENTITYREF |
Operator types - used for displaying filter elements |
Properties
protected object | $_state | The state object that this form belongs to | from CRM_Core_Form |
protected string | $_name | The name of this form | from CRM_Core_Form |
protected string | $_title | The report title | from CRM_Report_Form |
array | $_defaults | The default values for the form. | from CRM_Core_Form |
array | $_options | The set of optional columns in the report | from CRM_Report_Form |
int | $_action | (QUASI-PROTECTED) The mode of operation for this form | from CRM_Core_Form |
protected array | $_paymentProcessors | Available payment processors. | from CRM_Core_Form |
array | $_paymentProcessorIDs | Available payment processors (IDS). | from CRM_Core_Form |
protected int | $_paymentProcessorID | Default or selected processor id. | from CRM_Core_Form |
protected int | $_is_pay_later_enabled | Is pay later enabled for the form. | from CRM_Core_Form |
protected object | $_renderer | The renderer used for this form | from CRM_Core_Form |
protected array | $_dateFields | An array to hold a list of datefields on the form so that they can be converted to ISO in a consistent manner | from CRM_Core_Form |
static protected CRM_Core_Smarty | $_template | Cache the smarty template for efficiency reasons | from CRM_Core_Form |
protected | $unsavedChangesWarn | Indicate if this form should warn users of unsaved changes | from CRM_Core_Form |
array | $ajaxResponse | What to return to the client if in ajax mode (snippet=json) | from CRM_Core_Form |
array | $urlPath | Url path used to reach this page | from CRM_Core_Form |
CRM_Core_Controller | $controller | from CRM_Core_Form | |
static array | $html5Types | Extra input types we support via the "add" method | from CRM_Core_Form |
protected integer | $_id | The id of the report instance | from CRM_Report_Form |
protected integer; | $_templateID | The id of the report template | from CRM_Report_Form |
protected | $_noFields | from CRM_Report_Form | |
protected array | $_columns | The set of all columns in the report. An associative array with column name as the key and attributes as the value | from CRM_Report_Form |
protected array | $_filters | The set of filters in the report | from CRM_Report_Form |
protected | $_exposeContactID | By default most reports hide contact id. | from CRM_Report_Form |
protected array | $_statFields | Set of statistic fields | from CRM_Report_Form |
protected array | $_statistics | Set of statistics data | from CRM_Report_Form |
protected array | $_noRepeats | List of fields not to be repeated during display | from CRM_Report_Form |
protected array | $_noDisplay | List of fields not to be displayed | from CRM_Report_Form |
protected null | $_customGroupExtends | Object type that a custom group extends | from CRM_Report_Form |
protected | $_customGroupExtendsJoin | from CRM_Report_Form | |
protected | $_customGroupFilters | from CRM_Report_Form | |
protected | $_customGroupGroupBy | from CRM_Report_Form | |
protected | $_customGroupJoin | from CRM_Report_Form | |
protected | $_tagFilter | Build tags filter | from CRM_Report_Form |
protected | $_tagFilterTable | specify entity table for tags filter | from CRM_Report_Form |
protected bool | $_groupFilter | Build groups filter. | from CRM_Report_Form |
protected bool | $groupFilterNotOptimised | Has the report been optimised for group filtering. | from CRM_Report_Form |
array | $_navigation | Navigation fields | from CRM_Report_Form |
$_drilldownReport | |||
protected array | $tabs | Array of tabs to display on report. | from CRM_Report_Form |
protected bool | $addPaging | Should we add paging. | from CRM_Report_Form |
protected array | $_fourColumnAttribute | An attribute for checkbox/radio form field layout | from CRM_Report_Form |
protected | $_force | from CRM_Report_Form | |
protected | $_params | from CRM_Report_Form | |
protected | $_formValues | from CRM_Report_Form | |
protected | $_instanceValues | from CRM_Report_Form | |
protected | $_instanceForm | from CRM_Report_Form | |
protected | $_criteriaForm | from CRM_Report_Form | |
protected | $_instanceButtonName | from CRM_Report_Form | |
protected | $_createNewButtonName | from CRM_Report_Form | |
protected | $_printButtonName | from CRM_Report_Form | |
protected | $_pdfButtonName | from CRM_Report_Form | |
protected | $_csvButtonName | from CRM_Report_Form | |
protected | $_groupButtonName | from CRM_Report_Form | |
protected | $_chartButtonName | from CRM_Report_Form | |
protected | $_csvSupported | from CRM_Report_Form | |
protected | $_add2groupSupported | from CRM_Report_Form | |
protected | $_groups | from CRM_Report_Form | |
protected | $_grandFlag | from CRM_Report_Form | |
protected | $_rowsFound | from CRM_Report_Form | |
protected | $_selectAliases | from CRM_Report_Form | |
protected | $_rollup | from CRM_Report_Form | |
protected string | $groupTempTable | Table containing list of contact IDs within the group filter. | from CRM_Report_Form |
protected array | $_aliases | from CRM_Report_Form | |
protected string | $_where | from CRM_Report_Form | |
protected string | $_from | from CRM_Report_Form | |
protected string | $_limit | SQL Limit clause | from CRM_Report_Form |
protected integer | $_limitValue | This can be set to specify a limit to the number of rows Since it is currently envisaged as part of the api usage it is only being applied when $_output mode is not 'html' or 'group' so as not to have to interpret / mess with that part of the code (see limit() fn. | from CRM_Report_Form |
protected integer | $_offsetValue | This can be set to specify row offset See notes on _limitValue | from CRM_Report_Form |
protected null | $_sections | from CRM_Report_Form | |
protected | $_autoIncludeIndexedFieldsAsOrderBys | from CRM_Report_Form | |
protected | $_absoluteUrl | from CRM_Report_Form | |
protected boolean | $_storeResultSet | Flag to indicate if result-set is to be stored in a class variable which could be retrieved using getResultSet() method. | from CRM_Report_Form |
protected boolean | $_resultSet | When _storeResultSet Flag is set use this var to store result set in form of array | from CRM_Report_Form |
protected array | $_groupByDateFreq | To what frequency group-by a date column | from CRM_Report_Form |
protected | $_aclFrom | Variables to hold the acl inner join and where clause | from CRM_Report_Form |
protected | $_aclWhere | from CRM_Report_Form | |
protected array | $_selectedTables | Array of DAO tables having columns included in SELECT or ORDER BY clause. | from CRM_Report_Form |
protected array | $filteredTables | Array of DAO tables having columns included in WHERE or HAVING clause | from CRM_Report_Form |
protected string | $_outputMode | Output mode e.g 'print', 'csv', 'pdf'. | from CRM_Report_Form |
protected | $_format | Format of any chart in use. | from CRM_Report_Form |
$_having | from CRM_Report_Form | ||
$_select | from CRM_Report_Form | ||
$_selectClauses | from CRM_Report_Form | ||
$_columnHeaders | from CRM_Report_Form | ||
$_orderBy | from CRM_Report_Form | ||
$_orderByFields | from CRM_Report_Form | ||
$_orderByArray | from CRM_Report_Form | ||
$_groupBy | from CRM_Report_Form | ||
$_whereClauses | from CRM_Report_Form | ||
$_havingClauses | from CRM_Report_Form | ||
Integer | $_dashBoardRowCount | DashBoardRowCount Dashboard row count | from CRM_Report_Form |
boolean | $noController | Is this being called without a form controller (ie. the report is being render outside the normal form - e.g the api is retrieving the rows | from CRM_Report_Form |
protected | $_currencyColumn | Variable to hold the currency alias | from CRM_Report_Form |
protected string | $_interval | from CRM_Report_Form | |
protected bool | $_sendmail | from CRM_Report_Form | |
protected int | $_chartId | from CRM_Report_Form | |
int | $_section | from CRM_Report_Form | |
string | $_description | from CRM_Report_Form | |
protected | $_addressField | ||
protected | $_emailField | ||
protected bool | $_phoneField | from CRM_Report_Form | |
protected bool | $_createNew | from CRM_Report_Form | |
protected | $rollupRow | When a grand total row has calculated the status we pop it off to here. | from CRM_Report_Form |
protected string | $_databaseAttributes | from CRM_Report_Form | |
protected string | $sql | SQL being run in this report. | from CRM_Report_Form |
protected string | $sqlArray | SQL being run in this report as an array. | from CRM_Report_Form |
protected | $_summary | ||
protected string | $orgContact | Organisation contact ie. 'contact_id_b' or 'contact_id_a' | |
protected string | $otherContact | Related Contact ie. 'contact_id_b' or 'contact_id_a' |
Methods
No description
Simple easy to use wrapper around addElement.
Pre process function.
Post process function.
This is a virtual function that adds group and global rules to the form.
This if a front end form function for setting the payment processor.
Format the fields for the payment processor.
Handle Payment Processor switching for contribution and event registration forms.
Default extra tpl file basically just replaces .tpl with .extra.tpl.
Store the variable with the value in the form scope.
Assign value to name in template by reference.
Appends values to template variables.
Returns an array containing template variables.
No description
No description
No description
Simple shell that derived classes can call to add buttons to the form with a customized title for the main Submit
No description
Classes extending CRM_Core_Form should implement this method.
Adds a select based on field metadata.
Adds a field based on metadata.
Add a widget for selecting/editing/creating/copying a profile form
Add date.
Function that will add date and time.
Add a currency and money element to the form.
Add currency element to the form.
Create a single or multiple entity ref field.
Convert all date fields within the params to mysql date ready for the BAO layer. In this case fields are checked against the $_datefields defined for the form and if time is defined it is incorporated
Helper function to verify that required fields have been filled.
Get contact if for a form object. Prioritise - cid in URL if 0 (on behalf on someoneelse) (@todo consider setting a variable if onbehalf for clarity of downstream 'if's - logged in user id if it matches the one in the cid in the URL - contact id validated from a checksum from a checksum - cid from the url if the caller has ACL permission to view - fallback is logged in user (or ? NULL if no logged in user) (@todo wouldn't 0 be more intuitive?)
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
Add the options appropriate to cid = zero - ie. autocomplete
Set default values on form for given contact (or no contact defaults)
Create a chain-select target field. All settings are optional; the defaults usually work.
Assign billing name to the template.
Get element from group.
The intent is to add a tab for developers to view the sql.
This adds the tab referred to as Title and Format, rendered through Instance.tpl.
A form rule function for custom data.
Get operators to display on form.
Get SQL operator from form text version.
Generate where clause.
Get SQL where clause for a date field.
Get values for from and to for date ranges.
Alter display of rows.
Alter the way in which custom data fields are displayed.
Fix subtotal display.
Generate the SELECT clause and set class variable $_select.
Build select clause for a single field.
Build where clause.
Set variables to be accessed by API and form layer in processing.
Build group by clause.
Build order by clause.
Move totals columns to the right edge of the table.
No description
Build a group filter with contempt for large data sets.
Build where clause for groups.
Create a table of the contact ids included by the group filter.
Execute query and add it to the developer tab.
Build where clause for tags.
Generate membership organization clause.
Generate Membership Type SQL Clause.
Build the permision clause for all entities in this report
Add custom data to the columns.
Build custom data from clause.
Check for empty order_by configurations and remove them.
Check if table name has columns in SELECT clause.
Check if table name has columns in WHERE or HAVING clause.
Fetch array of DAO tables having columns included in SELECT or ORDER BY clause.
Add address fields.
Do AlterDisplay processing on Address Fields.
Do AlterDisplay processing on Address Fields.
Adjusts dates passed in to YEAR() for fiscal year.
Add Financial Transaction into From Table if required.
Get phone columns to add to array.
Get address columns to add to array.
Add link fields to the row.
Generate temporary table to hold all contributions with permissioned FTs.
CRM-17793 - Alter DateTime section header to group by date from the datetime field.
Get an array of the columns that have been selected for display.
Add location tables to the query if they are used for filtering.
Set the base table for the FROM clause.
Join the temp table contacting contacts who are members of the filtered groups.
Get all labels for fields that are used in a group concat.
Add statistics columns.
Add a basic field to the select clause.
No description
No description
Details
at line 61
CRM_Core_Form
__construct()
in CRM_Core_Form at line 279
addClass(string $className)
Add one or more css classes to the form.
in CRM_Core_Form at line 287
registerRules()
Register all the standard rules that most forms potentially use.
in CRM_Core_Form at line 340
HTML_QuickForm_Element
add(string $type, string $name, string $label = '', string|array $attributes = '', bool $required = FALSE, array $extra = NULL)
Simple easy to use wrapper around addElement.
Deal with simple validation rules.
at line 233
preProcess()
Pre process function.
Called prior to build form.
at line 384
postProcess()
Post process function.
in CRM_Core_Form at line 446
mainProcess(bool $allowAjax = TRUE)
Main process wrapper.
Implemented so that we can call all the hook functions.
in CRM_Core_Form at line 473
postProcessHook()
The postProcess hook is typically called by the framework.
However in a few cases, the form exits or redirects early in which case it needs to call this function so other modules can do the needful Calling this function directly should be avoided if possible. In general a better way is to do setUserContext so the framework does the redirect
in CRM_Report_Form at line 1556
buildQuickForm()
Main build form function.
in CRM_Report_Form at line 851
array|NULL
setDefaultValues(bool $freeze = TRUE)
Set default values.
in CRM_Core_Form at line 502
addRules()
This is a virtual function that adds group and global rules to the form.
Keeping it distinct from the form to keep code small and localized in the form building code
in CRM_Core_Form at line 512
bool
validate()
Performs the server side validation.
in CRM_Core_Form at line 540
buildForm()
Core function that builds the form.
We redefine this function here and expect all CRM forms to build their form in the function buildQuickForm.
in CRM_Core_Form at line 599
addButtons(array $params)
Add default Next / Back buttons.
in CRM_Core_Form at line 668
string
getName()
Getter function for Name.
in CRM_Core_Form at line 677
object
getState()
Getter function for State.
in CRM_Core_Form at line 686
int
getStateType()
Getter function for StateType.
in CRM_Core_Form at line 697
string
getTitle()
Getter function for title.
Should be over-ridden by derived class.
in CRM_Core_Form at line 707
setTitle(string $title)
Setter function for title.
in CRM_Core_Form at line 716
assignBillingType()
Assign billing type id to bltID.
in CRM_Core_Form at line 731
protected
assignPaymentProcessor(bool $is_pay_later_enabled)
This if a front end form function for setting the payment processor.
It would be good to sync it with the back-end function on abstractEditPayment & use one everywhere.
in CRM_Core_Form at line 769
protected array
formatParamsForPaymentProcessor(array $fields)
Format the fields for the payment processor.
In order to pass fields to the payment processor in a consistent way we add some renamed parameters.
in CRM_Core_Form at line 807
protected
preProcessPaymentOptions()
Handle Payment Processor switching for contribution and event registration forms.
This function is shared between contribution & event forms & this is their common class.
However, this should be seen as an in-progress refactor, the end goal being to also align the backoffice forms that action payments.
This function overlaps assignPaymentProcessor, in a bad way.
in CRM_Core_Form at line 860
protected
handlePreApproval(array $params)
Handle pre approval for processors.
This fits with the flow where a pre-approval is done and then confirmed in the next stage when confirm is hit.
This function is shared between contribution & event forms & this is their common class.
However, this should be seen as an in-progress refactor, the end goal being to also align the backoffice forms that action payments.
in CRM_Core_Form at line 885
setOptions(mixed $options)
Setter function for options.
in CRM_Core_Form at line 894
string
toSmarty()
Render form and return contents.
in CRM_Core_Form at line 912
object
getRenderer()
Getter function for renderer.
If renderer is not set create one and initialize it.
in CRM_Report_Form at line 3208
string
getTemplateFileName()
Use the form name to create the tpl file name.
in CRM_Core_Form at line 947
getHookedTemplateFileName()
A wrapper for getTemplateFileName.
This includes calling the hook to prevent us from having to copy & paste the logic of calling the hook.
in CRM_Core_Form at line 960
string
overrideExtraTemplateFileName()
Default extra tpl file basically just replaces .tpl with .extra.tpl.
i.e. we do not override.
in CRM_Core_Form at line 974
error(string $message, int $code = NULL, CRM_Core_DAO $dao = NULL)
Error reporting mechanism.
in CRM_Core_Form at line 992
set(string $name, mixed $value)
Store the variable with the value in the form scope.
in CRM_Core_Form at line 1004
mixed
get(string $name)
Get the variable from the form scope.
in CRM_Core_Form at line 1013
int
getAction()
Getter for action.
in CRM_Core_Form at line 1023
setAction(int $action)
Setter for action.
in CRM_Core_Form at line 1035
assign(string $var, mixed $value = NULL)
Assign value to name in template.
in CRM_Core_Form at line 1047
assign_by_ref(string $var, mixed $value)
Assign value to name in template by reference.
in CRM_Core_Form at line 1059
append(array|string $tpl_var, mixed $value = NULL, bool $merge = FALSE)
Appends values to template variables.
in CRM_Core_Form at line 1070
array
get_template_vars(string $name = NULL)
Returns an array containing template variables.
in CRM_Core_Form at line 1084
HTML_QuickForm_group
addRadio(string $name, $title, $values, array $attributes = array(), null $separator = NULL, bool $required = FALSE)
in CRM_Core_Form at line 1110
addYesNo(int $id, $title, bool $allowClear = FALSE, null $required = NULL, array $attributes = array())
in CRM_Core_Form at line 1136
addCheckBox(int $id, $title, $values, null $other = NULL, null $attributes = NULL, null $required = NULL, null $javascriptMethod = NULL, string $separator = '<br />', bool $flipValues = FALSE)
in CRM_Core_Form at line 1179
resetValues()
in CRM_Core_Form at line 1195
addDefaultButtons(string $title, string $nextType = 'next', string $backType = 'back', bool|string $submitOnce = FALSE)
Simple shell that derived classes can call to add buttons to the form with a customized title for the main Submit
in CRM_Core_Form at line 1226
addDateRange(string $name, string $from = '_from', string $to = '_to', string $label = 'From:', string $dateFormat = 'searchDate', bool $required = FALSE, bool $displayTime = FALSE)
in CRM_Core_Form at line 1259
getDefaultEntity()
Classes extending CRM_Core_Form should implement this method.
in CRM_Core_Form at line 1269
getDefaultContext()
Classes extending CRM_Core_Form should implement this method.
TODO: Merge with CRM_Core_DAO::buildOptionsContext($context) and add validation.
in CRM_Core_Form at line 1291
HTML_QuickForm_Element
addSelect($name, array $props = array(), bool $required = FALSE)
Adds a select based on field metadata.
TODO: This could be even more generic and widget type (select in this case) could also be read from metadata Perhaps a method like $form->bind($name) which would look up all metadata for named field
in CRM_Core_Form at line 1372
HTML_QuickForm_Element
addField($name, array $props = array(), bool $required = FALSE, bool $legacyDate = TRUE)
Adds a field based on metadata.
in CRM_Core_Form at line 1553
addProfileSelector(string $name, string $label, string $allowCoreTypes, string $allowSubTypes, array $entities, bool $default = FALSE, string $usedFor = NULL)
Add a widget for selecting/editing/creating/copying a profile form
in CRM_Core_Form at line 1572
null
getRootTitle()
in CRM_Core_Form at line 1579
string
getCompleteTitle()
in CRM_Core_Form at line 1586
static CRM_Core_Smarty
getTemplate()
in CRM_Core_Form at line 1593
addUploadElement($elementName)
in CRM_Core_Form at line 1623
null
getVar($name)
in CRM_Core_Form at line 1631
setVar($name, $value)
in CRM_Core_Form at line 1650
addDate(string $name, string $label, bool $required = FALSE, array $attributes = NULL)
deprecated
deprecated
Add date.
in CRM_Core_Form at line 1739
addDateTime(string $name, string $label, bool $required = FALSE, null $attributes = NULL)
deprecated
deprecated
Function that will add date and time.
in CRM_Core_Form at line 1765
HTML_QuickForm_Element
addMoney(string $name, string $label, bool $required = FALSE, null $attributes = NULL, bool $addCurrency = TRUE, string $currencyName = 'currency', null $defaultCurrency = NULL, bool $freezeCurrency = FALSE)
Add a currency and money element to the form.
in CRM_Core_Form at line 1795
addCurrency(string $name = 'currency', null $label = NULL, bool $required = TRUE, string $defaultCurrency = NULL, bool $freezeCurrency = FALSE, bool $setDefaultCurrency = TRUE)
Add currency element to the form.
in CRM_Core_Form at line 1845
HTML_QuickForm_Element
addEntityRef(string $name, string $label = '', array $props = array(), bool $required = FALSE)
Create a single or multiple entity ref field.
in CRM_Core_Form at line 1894
convertDateFieldsToMySQL(array $params)
Convert all date fields within the params to mysql date ready for the BAO layer. In this case fields are checked against the $_datefields defined for the form and if time is defined it is incorporated
in CRM_Core_Form at line 1914
removeFileRequiredRules($elementName)
in CRM_Core_Form at line 1932
cancelAction()
Function that can be defined in Form to override or.
perform specific action on cancel action
in CRM_Core_Form at line 1944
static
validateMandatoryFields(array $fields, array $values, array $errors)
Helper function to verify that required fields have been filled.
Typically called within the scope of a FormRule function
in CRM_Core_Form at line 1963
protected NULL|int
setContactID()
Get contact if for a form object. Prioritise - cid in URL if 0 (on behalf on someoneelse) (@todo consider setting a variable if onbehalf for clarity of downstream 'if's - logged in user id if it matches the one in the cid in the URL - contact id validated from a checksum from a checksum - cid from the url if the caller has ACL permission to view - fallback is logged in user (or ? NULL if no logged in user) (@todo wouldn't 0 be more intuitive?)
in CRM_Core_Form at line 2018
int|NULL
getContactID()
Get the contact id that the form is being submitted for.
in CRM_Core_Form at line 2025
getLoggedInUserContactID()
Get the contact id of the logged in user.
in CRM_Core_Form at line 2054
addAutoSelector(array $profiles = array(), array $autoCompleteField = array())
Add autoselector field -if user has permission to view contacts If adding this to a form you also need to add to the tpl e.g
{if !empty($selectable)}
{/if}
in CRM_Core_Form at line 2079
canUseAjaxContactLookups()
in CRM_Core_Form at line 2097
addCIDZeroOptions($onlinePaymentProcessorEnabled)
Add the options appropriate to cid = zero - ie. autocomplete
in CRM_Core_Form at line 2123
array
getProfileDefaults(mixed $profile_id = 'Billing', int $contactID = NULL)
Set default values on form for given contact (or no contact defaults)
in CRM_Core_Form at line 2142
preventAjaxSubmit()
Sets form attribute.
in CRM_Core_Form at line 2150
allowAjaxSubmit()
Sets form attribute.
in CRM_Core_Form at line 2158
setPageTitle(string $entityLabel)
Sets page title based on entity and action.
in CRM_Core_Form at line 2187
HTML_QuickForm_Element
addChainSelect(string $elementName, array $settings = array())
Create a chain-select target field. All settings are optional; the defaults usually work.
in CRM_Core_Form at line 2222
addTaskMenu(array $tasks)
Add actions menu to results form.
in CRM_Core_Form at line 2337
string
assignBillingName(array $params = array())
Assign billing name to the template.
in CRM_Report_Form at line 526
preProcessCommon()
Shared pre-process function.
If overriding preProcess function this should still be called.
in CRM_Report_Form at line 668
addBreadCrumb()
Add bread crumb.
in CRM_Report_Form at line 1006
bool
getElementFromGroup(string $group, string $grpFieldName)
Get element from group.
in CRM_Report_Form at line 1021
setParams(array $params)
Setter for $_params.
in CRM_Report_Form at line 1030
setID(int $instanceID)
Setter for $_id.
in CRM_Report_Form at line 1039
setForce(bool $isForce)
Setter for $_force.
in CRM_Report_Form at line 1048
setLimitValue(int $_limitValue)
Setter for $_limitValue.
in CRM_Report_Form at line 1057
setOffsetValue(int $_offsetValue)
Setter for $_offsetValue.
in CRM_Report_Form at line 1066
setAddPaging(bool $value)
Setter for $addPaging.
in CRM_Report_Form at line 1075
array
getDefaultValues()
Getter for $_defaultValues.
in CRM_Report_Form at line 1082
addColumns()
Add columns to report.
in CRM_Report_Form at line 1143
addFilters()
Add filters to report.
in CRM_Report_Form at line 1287
protected
assignTabs()
Function to assign the tabs to the template in the correct order.
We want the tabs to wind up in this order (if not overridden).
- Field Selection
- Group Bys
- Order Bys
- Other Options
- Filters
in CRM_Report_Form at line 1307
protected
addToDeveloperTab(string $sql)
The intent is to add a tab for developers to view the sql.
Currently using dpm.
in CRM_Report_Form at line 1334
addOptions()
Add options defined in $this->_options to the report.
in CRM_Report_Form at line 1370
addChartOptions()
Add chart options to the report.
in CRM_Report_Form at line 1381
addGroupBys()
Add group by options to the report.
in CRM_Report_Form at line 1418
addOrderBys()
Add data for order by tab.
in CRM_Report_Form at line 1479
buildInstanceAndButtons()
This adds the tab referred to as Title and Format, rendered through Instance.tpl.
in CRM_Report_Form at line 1518
bool
resultsDisplayed()
Has this form been submitted already?
in CRM_Report_Form at line 1530
protected array
getActions(int $instanceId)
Get the actions for this report instance.
in CRM_Report_Form at line 1591
array
customDataFormRule(array $fields, array $ignoreFields = array())
A form rule function for custom data.
The rule ensures that fields selected in group_by if any) should only be the ones present in display/select fields criteria; note: works if and only if any custom field selected in group_by.
in CRM_Report_Form at line 1633
array
getOperationPair(string $type = "string", string $fieldName = NULL)
Get operators to display on form.
Note: $fieldName param allows inheriting class to build operationPairs specific to a field.
in CRM_Report_Form at line 1706
buildTagFilter()
Build the tag filter field to display on the filters tab.
in CRM_Report_Form at line 1728
buildGroupFilter()
Adds group filters to _columns (called from _Construct).
in CRM_Report_Form at line 1754
string
getSQLOperator(string $operator = "like")
Get SQL operator from form text version.
in CRM_Report_Form at line 1809
null|string
whereClause(array $field, string $op, mixed $value, float $min, float $max)
Generate where clause.
This can be overridden in reports for special treatment of a field
in CRM_Report_Form at line 1998
null|string
dateClause(string $fieldName, string $relative, string $from, string $to, string $type = NULL, string $fromTime = NULL, string $toTime = NULL)
Get SQL where clause for a date field.
in CRM_Report_Form at line 2038
array
getFromTo(bool $relative, string $from, string $to, string $fromTime = NULL, string $toTime = NULL)
Get values for from and to for date ranges.
at line 450
alterDisplay(array $rows)
Alter display of rows.
Iterate through the rows retrieved via SQL and make changes for display purposes, such as rendering contacts as links.
in CRM_Report_Form at line 2072
alterCustomDataDisplay(array $rows)
Alter the way in which custom data fields are displayed.
in CRM_Report_Form at line 2129
removeDuplicates(array $rows)
Remove duplicate rows.
in CRM_Report_Form at line 2156
fixSubTotalDisplay(array $row, array $fields, bool $subtotal = TRUE)
Fix subtotal display.
in CRM_Report_Form at line 2179
bool
grandTotal(array $rows)
Calculate grant total.
in CRM_Report_Form at line 2214
formatDisplay(array $rows, bool $pager = TRUE)
Format display output.
in CRM_Report_Form at line 2265
buildChart(array $rows)
Build chart.
at line 237
select()
Generate the SELECT clause and set class variable $_select.
in CRM_Report_Form at line 2407
bool
selectClause(string $tableName, string $tableKey, string $fieldName, string $field)
Build select clause for a single field.
at line 302
where()
Build where clause.
in CRM_Report_Form at line 2442
storeWhereHavingClauseArray()
Store Where clauses into an array.
Breaking out this step makes over-riding more flexible as the clauses can be used in constructing a temp table that may not be part of the final where clause or added in other functions
in CRM_Report_Form at line 2502
processReportMode()
Set output mode.
in CRM_Report_Form at line 2563
beginPostProcess()
Post Processing function for Form.
postProcessCommon should be used to set other variables from input as the api accesses that function. This function is not accessed when the api calls the report.
at line 398
beginPostProcessCommon()
Set variables to be accessed by API and form layer in processing.
in CRM_Report_Form at line 2607
string
buildQuery(bool $applyLimit = TRUE)
Build the report query.
at line 351
groupBy()
Build group by clause.
at line 361
orderBy()
Build order by clause.
in CRM_Report_Form at line 2680
storeOrderByArray()
Extract order by fields and store as an array.
In some cases other functions want to know which fields are selected for ordering by Separating this into a separate function allows it to be called separately from constructing the order by clause
in CRM_Report_Form at line 2737
array
unselectedSectionColumns()
Determine unselected columns.
in CRM_Report_Form at line 2752
buildRows(string $sql, array $rows)
Build output rows.
in CRM_Report_Form at line 2789
sectionTotals()
Calculate section totals.
When "order by" fields are marked as sections, this assigns to the template an array of total counts for each section. This data is used by the Smarty plugin {sectionTotal}.
in CRM_Report_Form at line 2853
modifyColumnHeaders()
Modify column headers.
in CRM_Report_Form at line 2863
moveSummaryColumnsToTheRightHandSide()
Move totals columns to the right edge of the table.
It seems like a more logical layout to have any totals columns on the far right regardless of the location of the rest of their table.
in CRM_Report_Form at line 2873
doTemplateAssignment(array $rows)
Assign rows to the template.
at line 370
array
statistics(array $rows)
in CRM_Report_Form at line 2914
countStat(array $statistics, int $count)
Add count statistics.
in CRM_Report_Form at line 2933
groupByStat(array $statistics)
Add group by statistics.
in CRM_Report_Form at line 2959
filterStat(array $statistics)
Filter statistics.
in CRM_Report_Form at line 3066
endPostProcess(array|null $rows = NULL)
End post processing.
in CRM_Report_Form at line 3181
storeResultSet()
Set store result set indicator to TRUE.
in CRM_Report_Form at line 3190
bool
getResultSet()
Get result set.
in CRM_Report_Form at line 3199
string
getReportSql()
Get the sql used to generate the report.
in CRM_Report_Form at line 3224
string
compileContent()
Compile the report content.
Although this function is super-short it is useful to keep separate so it can be over-ridden by report classes.
in CRM_Report_Form at line 3264
array
limit(int $rowCount = self::ROW_COUNT_LIMIT)
Set limit.
in CRM_Report_Form at line 3314
setPager(int $rowCount = self::ROW_COUNT_LIMIT)
Set pager.
in CRM_Report_Form at line 3358
string
legacySlowGroupFilterClause(string $field, mixed $value, string $op)
deprecated
deprecated
Build a group filter with contempt for large data sets.
This function has been retained as it takes time to migrate the reports over to the new method which will not crash on large datasets.
in CRM_Report_Form at line 3413
string
whereGroupClause(string $field, mixed $value, string $op)
Build where clause for groups.
in CRM_Report_Form at line 3430
buildGroupTempTable()
Create a table of the contact ids included by the group filter.
This function is called by both the api (tests) and the UI.
in CRM_Report_Form at line 3476
protected CRM_Core_DAO|object
executeReportQuery(string $query, array $params = array())
Execute query and add it to the developer tab.
in CRM_Report_Form at line 3490
string
whereTagClause(string $field, mixed $value, string $op)
Build where clause for tags.
in CRM_Report_Form at line 3514
string
whereMembershipOrgClause(mixed $value, string $op)
Generate membership organization clause.
in CRM_Report_Form at line 3542
string
whereMembershipTypeClause(mixed $value, string $op)
Generate Membership Type SQL Clause.
in CRM_Report_Form at line 3567
buildACLClause(string $tableAlias = 'contact_a')
deprecated
deprecated
Buld contact acl clause
in CRM_Report_Form at line 3574
buildPermissionClause()
Build the permision clause for all entities in this report
in CRM_Report_Form at line 3600
addCustomDataToColumns(bool $addFields = TRUE, array $permCustomGroupIds = array())
Add custom data to the columns.
in CRM_Report_Form at line 3755
customDataFrom(bool $joinsForFiltersOnly = FALSE)
Build custom data from clause.
in CRM_Report_Form at line 3803
bool
isFieldSelected(string $prop)
Check if the field is selected.
in CRM_Report_Form at line 3858
protected bool
isFieldFiltered(string $prop)
Check if the field is used as a filter.
in CRM_Report_Form at line 3896
preProcessOrderBy(array $formValues)
Check for empty order_by configurations and remove them.
Also set template to hide them.
in CRM_Report_Form at line 3940
bool
isTableSelected(string $tableName)
Check if table name has columns in SELECT clause.
in CRM_Report_Form at line 3952
bool
isTableFiltered(string $tableName)
Check if table name has columns in WHERE or HAVING clause.
in CRM_Report_Form at line 3968
array
selectedTables()
Fetch array of DAO tables having columns included in SELECT or ORDER BY clause.
If the array is unset it will be built.
in CRM_Report_Form at line 4035
array
addAddressFields(bool $groupBy = TRUE, bool $orderBy = FALSE, bool $filters = TRUE, array $defaults = array('country_id' => TRUE))
deprecated
deprecated
Add address fields.
in CRM_Report_Form at line 4179
bool
alterDisplayAddressFields(array $row, array $rows, int $rowNum, string $baseUrl, string $linkText)
Do AlterDisplay processing on Address Fields.
in CRM_Report_Form at line 4250
bool
alterDisplayContactFields(array $row, array $rows, int $rowNum, string $baseUrl, string $linkText)
Do AlterDisplay processing on Address Fields.
in CRM_Report_Form at line 4294
string
fiscalYearOffset(string $fieldName)
Adjusts dates passed in to YEAR() for fiscal year.
in CRM_Report_Form at line 4309
addAddressFromClause()
Add Address into From Table if required.
in CRM_Report_Form at line 4327
addPhoneFromClause()
Add Phone into From Table if required.
in CRM_Report_Form at line 4341
addFinancialTrxnFromClause()
Add Financial Transaction into From Table if required.
in CRM_Report_Form at line 4362
array
getPhoneColumns(array $options = array())
Get phone columns to add to array.
in CRM_Report_Form at line 4394
array
getAddressColumns(array $options = array())
Get address columns to add to array.
in CRM_Report_Form at line 4416
array
getBasicContactFields()
Get a standard set of contact fields.
in CRM_Report_Form at line 4488
array
getBasicContactFilters()
Get a standard set of contact filters.
in CRM_Report_Form at line 4557
add2group(int $groupID)
Add contact to group.
in CRM_Report_Form at line 4586
static
uploadChartImage()
Show charts on print screen.
in CRM_Report_Form at line 4644
protected mixed
addLinkToRow(array $row, string $baseUrl, string $linkText, string $value, string $fieldName, string $tablePrefix, string $fieldLabel)
Add link fields to the row.
Function adds the _link & _hover fields to the row.
in CRM_Report_Form at line 4666
string
getPermissionedFTQuery(object $query, string $alias = NULL, bool $return = FALSE)
Generate temporary table to hold all contributions with permissioned FTs.
in CRM_Report_Form at line 4715
string
getResultsLabel()
Get label for show results buttons.
in CRM_Report_Form at line 4734
protected
setOutputMode()
Determine the output mode from the url or input.
Output could be - pdf : Render as pdf - csv : Render as csv - print : Render in print format - save : save the report and display the new report - copy : save the report as a new instance and display that. - group : go to the add to group screen.
Potentially chart variations could also be included but the complexity is that we might print a bar chart as a pdf.
in CRM_Report_Form at line 4757
alterSectionHeaderForDateTime($tempTable, $columnName)
CRM-17793 - Alter DateTime section header to group by date from the datetime field.
in CRM_Report_Form at line 4775
array
getSelectColumns()
Get an array of the columns that have been selected for display.
in CRM_Report_Form at line 4797
selectivelyAddLocationTablesJoinsToFilterQuery()
Add location tables to the query if they are used for filtering.
This is for when we are running the query separately for filtering and retrieving display fields.
in CRM_Report_Form at line 4828
setFromBase(string $baseTable, string $field = 'id', null $tableAlias = NULL)
Set the base table for the FROM clause.
Sets up the from clause, allowing for the possibility it might be a temp table pre-filtered by groups if a group filter is in use.
in CRM_Report_Form at line 4846
joinGroupTempTable(string $baseTable, string $field, string $tableAlias)
Join the temp table contacting contacts who are members of the filtered groups.
If we are using an IN filter we use an inner join, otherwise a left join.
in CRM_Report_Form at line 4872
getLabels(string $options, string $baoName, string $fieldName)
Get all labels for fields that are used in a group concat.
in CRM_Report_Form at line 4896
protected array
addStatisticsToSelect(array $field, string $tableName, string $fieldName, array $select)
Add statistics columns.
If a group by is in play then add columns for the statistics fields.
This would lead to a new field in the $row such as $fieldName_sum and a new, matching column header field.
in CRM_Report_Form at line 4946
protected array
addBasicFieldToSelect(string $tableName, string $fieldName, array $field, string $select)
Add a basic field to the select clause.
in CRM_Report_Form at line 4964
protected string
setTableAlias(array $table, string $tableName)
Set table alias.