CRM_Member_Form_Membership
class CRM_Member_Form_Membership extends CRM_Member_Form
This class generates form components for offline membership 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 |
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 title of this form | from CRM_Core_Form |
array | $_defaults | The default values for the form. | from CRM_Core_Form |
array | $_options | Stores all product option | from CRM_Contribute_Form_AbstractEditPayment |
$_action | from CRM_Contribute_Form_AbstractEditPayment | ||
protected array | $_paymentProcessors | Available payment processors with full details including the key 'object' indexed by their id | from CRM_Contribute_Form_AbstractEditPayment |
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 date fields on the form so that they can be converted to ISO in a consistent manner | |
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 int | $_task | The task being performed | from CRM_Contact_Form_Task |
array | $_contactIds | The array that holds all the contact ids | from CRM_Contact_Form_Task |
array | $_contactTypes | The array that holds all the contact types | from CRM_Contact_Form_Task |
protected string | $_componentClause | The additional clause that we restrict the search with | from CRM_Contact_Form_Task |
protected string | $_componentTable | The name of the temp table where we store the contact IDs | from CRM_Contact_Form_Task |
protected array | $_componentIds | The array that holds all the component ids | from CRM_Contact_Form_Task |
static protected | $_searchFormValues | This includes the submitted values of the search form | from CRM_Contact_Form_Task |
$_mode | |||
$_bltID | from CRM_Contribute_Form_AbstractEditPayment | ||
$_fields | from CRM_Contribute_Form_AbstractEditPayment | ||
array | $_paymentProcessor | from CRM_Contribute_Form_AbstractEditPayment | |
array | $_recurPaymentProcessors | Available recurring processors. | from CRM_Contribute_Form_AbstractEditPayment |
array | $_processors | Array of processor options in the format id => array($id => $label) WARNING it appears that the format used to differ to this and there are places in the code that expect the old format. $this->_paymentProcessors provides the additional data which this array seems to have provided in the past | from CRM_Contribute_Form_AbstractEditPayment |
protected CRM_Core_Payment | $_paymentObject | Instance of the payment processor object. | from CRM_Contribute_Form_AbstractEditPayment |
int | $_id | The id of the object being edited / created | from CRM_Member_Form |
int | $_premiumID | The id of the premium that we are proceessing. | from CRM_Contribute_Form_AbstractEditPayment |
CRM_Contribute_DAO_ContributionProduct | $_productDAO | from CRM_Contribute_Form_AbstractEditPayment | |
int | $_noteID | The id of the note | from CRM_Contribute_Form_AbstractEditPayment |
int | $_contactID | Contact ID of the member. | |
int | $_ppID | The id of the pledge payment that we are processing | from CRM_Contribute_Form_AbstractEditPayment |
int | $_pledgeID | The id of the pledge that we are processing | from CRM_Contribute_Form_AbstractEditPayment |
boolean | $_online | Is this contribution associated with an online financial transaction | from CRM_Contribute_Form_AbstractEditPayment |
int | $_honorID | Stores the honor id | from CRM_Contribute_Form_AbstractEditPayment |
array | $_contributionType | Store the financial Type ID | from CRM_Contribute_Form_AbstractEditPayment |
$_values | The contribution values if an existing contribution | from CRM_Contribute_Form_AbstractEditPayment | |
$_pledgeValues | The pledge values if this contribution is associated with pledge | from CRM_Contribute_Form_AbstractEditPayment | |
$_contributeMode | |||
$_context | from CRM_Contribute_Form_AbstractEditPayment | ||
$_compId | from CRM_Contribute_Form_AbstractEditPayment | ||
$_lineItems | Store the line items if price set used. | from CRM_Contribute_Form_AbstractEditPayment | |
bool | $isBackOffice | Is this a backoffice form | from CRM_Contribute_Form_AbstractEditPayment |
protected | $_formType | from CRM_Contribute_Form_AbstractEditPayment | |
int | $paymentInstrumentID | Payment instrument id for the transaction. | from CRM_Contribute_Form_AbstractEditPayment |
array | $billingFieldSets | Array of fields to display on billingBlock.tpl - this is not fully implemented but basically intent is the panes/fieldsets on this page should be all in this array in order like 'credit_card' => array('credit_card_number' . | from CRM_Contribute_Form_AbstractEditPayment |
protected | $_memType | ||
protected array | $_fromEmails | Array of from email ids | from CRM_Member_Form |
protected array | $allMembershipTypeDetails | Details of all enabled membership types. | from CRM_Member_Form |
protected array | $membershipTypeRenewalStatus | Array of membership type IDs and whether they permit autorenewal. | from CRM_Member_Form |
int | $_priceSetId | Price set ID configured for the form. | from CRM_Member_Form |
array | $_priceSet | Price set details as an array. | from CRM_Member_Form |
protected array | $_params | Values submitted to the form, processed along the way. | from CRM_Member_Form |
protected | $_onlinePendingContributionId | ||
protected | $_recurMembershipTypes | ||
protected | $_memTypeSelected | ||
protected string | $_memberDisplayName | Display name of the member. | |
protected | $_memberEmail | email of the person paying for the membership (used for receipts) | |
protected string | $_contributorDisplayName | Display name of the person paying for the membership (used for receipts) | |
protected | $_contributorEmail | email of the person paying for the membership (used for receipts) | |
protected int | $_contributorContactID | email of the person paying for the membership (used for receipts) | |
protected int | $_receiptContactId | ID of the person the receipt is to go to. | |
protected array | $_membershipIDs | Keep a class variable for ALL membership IDs so postProcess hook function can do something with it |
Methods
Constructor for the basic form page.
Simple easy to use wrapper around addElement.
Form preProcess function.
Process the form submission.
Build the form object.
Set default values for 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 form buttons.
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.
Replace ids of household members in $this->_contactIds with the id of their household.
Given this task's list of targets, produce a hidden group.
No description
No description
Assign $this->processors, $this->recurPaymentProcessors, and related Smarty variables
Get current currency from DB or use default currency.
No description
Common block for setting up the parts of a form that relate to credit / debit card
Format credit card details like: 1. Retrieve last 4 digit from credit card number as pan_truncation 2. Retrieve credit card type id from name
Add the billing address to the contact who paid.
Get default values for billing fields.
Get the default payment instrument id.
Extract values from the contact create boxes on the form and assign appropriately to
Set variables in a way that can be accessed from different places.
Create a recurring contribution record.
Get the details for the selected price set.
Store parameters relating to price sets.
Get selected membership type from the form values.
Extract price set fields and values from $params.
Submit function.
Set context in session.
Get status message for updating membership.
Get status message for create action.
No description
Details
in CRM_Core_Form at line 239
CRM_Core_Form
__construct(object $state = NULL, const|enum|int $action = CRM_Core_Action::NONE, string $method = 'post', string $name = NULL)
Constructor for the basic form page.
We should not use QuickForm directly. This class provides a lot of default convenient functions, rules and buttons
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 172
preProcess()
Form preProcess function.
at line 943
postProcess()
Process the form submission.
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
at line 404
buildQuickForm()
Build the form object.
at line 268
array|NULL
setDefaultValues()
Set default values for the form.
in CRM_Contact_Form_Task at line 338
addRules()
Add the rules for form.
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_Core_Form at line 924
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_Contact_Form_Task at line 366
addDefaultButtons(string $title, string $nextType = 'next', string $backType = 'back', bool|string $submitOnce = FALSE)
Simple shell that derived classes can call to add form buttons.
Allows 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_Contact_Form_Task at line 99
static
preProcessCommon(CRM_Core_Form $form, bool $useTable = FALSE)
Common pre-processing function.
in CRM_Contact_Form_Task at line 278
getContactIds()
Get the contact id for custom search.
we are not using prev/next table in case of custom search
in CRM_Contact_Form_Task at line 387
mergeContactIdsByHousehold()
Replace ids of household members in $this->_contactIds with the id of their household.
CRM-8338
in CRM_Contact_Form_Task at line 470
array
createHiddenGroup()
Given this task's list of targets, produce a hidden group.
in CRM_Contribute_Form_AbstractEditPayment at line 231
showRecordLinkMesssage(int $id)
in CRM_Contribute_Form_AbstractEditPayment at line 247
buildValuesAndAssignOnline_Note_Type(int $id, $values)
in CRM_Contribute_Form_AbstractEditPayment at line 283
applyCustomData(string $type, string $subType, int $entityId)
in CRM_Contribute_Form_AbstractEditPayment at line 297
assignPremiumProduct(int $id)
in CRM_Contribute_Form_AbstractEditPayment at line 318
array
getValidProcessors()
in CRM_Contribute_Form_AbstractEditPayment at line 331
assignProcessors()
Assign $this->processors, $this->recurPaymentProcessors, and related Smarty variables
in CRM_Contribute_Form_AbstractEditPayment at line 381
mixed
getCurrency($submittedValues)
Get current currency from DB or use default currency.
in CRM_Contribute_Form_AbstractEditPayment at line 397
preProcessPledge()
in CRM_Contribute_Form_AbstractEditPayment at line 478
mixed
unsetCreditCardFields(array $submittedValues)
in CRM_Contribute_Form_AbstractEditPayment at line 510
protected
assignPaymentRelatedVariables()
Common block for setting up the parts of a form that relate to credit / debit card
in CRM_Contribute_Form_AbstractEditPayment at line 533
protected
beginPostProcess()
Begin post processing.
This function aims to start to bring together common postProcessing functions.
Eventually these are also shared with the front end forms & may need to be moved to where they can also access this function.
in CRM_Contribute_Form_AbstractEditPayment at line 563
static void
formatCreditCardDetails(array $params)
Format credit card details like: 1. Retrieve last 4 digit from credit card number as pan_truncation 2. Retrieve credit card type id from name
in CRM_Contribute_Form_AbstractEditPayment at line 579
protected
processBillingAddress()
Add the billing address to the contact who paid.
Note that this function works based on the presence or otherwise of billing fields & can be called regardless of whether they are 'expected' (due to assumptions about the payment processor type or the setting to collect billing for pay later.
in CRM_Contribute_Form_AbstractEditPayment at line 629
protected array
getBillingDefaults($defaults)
Get default values for billing fields.
in CRM_Contribute_Form_AbstractEditPayment at line 649
protected int
getDefaultPaymentInstrumentId()
Get the default payment instrument id.
in CRM_Member_Form at line 260
storeContactFields(array $formValues)
Extract values from the contact create boxes on the form and assign appropriately to
- $this->_contributorEmail,
- $this->_memberEmail &
- $this->_contributionName
- $this->_memberName
- $this->_contactID (effectively memberContactId but changing might have spin-off effects)
- $this->_contributorContactId - id of the contributor
- $this->_receiptContactId
If the member & contributor are the same then the values will be the same. But if different people paid then they weill differ
in CRM_Member_Form at line 291
protected
setContextVariables(array $params)
Set variables in a way that can be accessed from different places.
This is part of refactoring for unit testability on the submit function.
in CRM_Member_Form at line 323
protected array
processRecurringContribution($paymentParams)
Create a recurring contribution record.
Recurring contribution parameters are set explicitly rather than merging paymentParams because it's hard to know the downstream impacts if we keep passing around the same array.
in CRM_Member_Form at line 365
protected
ensurePriceParamsAreSet(array $formValues)
Ensure price parameters are set.
If they are not set it means a quick config option has been chosen so we fill them in here to make the two flows the same. They look like 'price_2' => 2 etc.
in CRM_Member_Form at line 388
static protected array
getPriceSetDetails(array $params)
Get the details for the selected price set.
in CRM_Member_Form at line 408
static protected int
getPriceSetID(array $params)
Get the selected price set id.
in CRM_Member_Form at line 424
protected array
setPriceSetParameters(array $formValues)
Store parameters relating to price sets.
in CRM_Member_Form at line 438
testSubmit(array $formValues)
Wrapper function for unit tests.
at line 122
static array
getSelectedMemberships(array $priceSet, array $params)
Get selected membership type from the form values.
at line 146
static array
getPriceFieldIDs(array $params, array $priceSet)
Extract price set fields and values from $params.
at line 739
static bool|array
formRule(array $params, array $files, CRM_Member_Form_Membership $self)
Validation.
at line 968
static bool
emailReceipt(CRM_Core_Form $form, array $formValues, object $membership)
Send email receipt.
at line 1105
array
submit()
Submit function.
This is also accessed by unit tests.
at line 1733
protected
setUserContext()
Set context in session.
at line 1765
protected string
getStatusMessageForUpdate(CRM_Member_BAO_Membership $membership, string $endDate, bool $receiptSend)
Get status message for updating membership.
at line 1794
protected array|string
getStatusMessageForCreate(string $endDate, bool $receiptSend, array $membershipTypes, array $createdMemberships, bool $isRecur, array $calcDates, bool $mailSent)
Get status message for create action.