Make required address components configurable
The required address components can be selected in the corresponding profile.
This commit is contained in:
parent
89638a172d
commit
9969c99f70
5 changed files with 63 additions and 9 deletions
|
@ -416,6 +416,20 @@ class CRM_Twingle_Form_Profile extends CRM_Core_Form {
|
|||
array()
|
||||
);
|
||||
|
||||
$this->add(
|
||||
'select',
|
||||
'required_address_components',
|
||||
E::ts('Required address components'),
|
||||
[
|
||||
'street_address' => E::ts("Street"),
|
||||
'postal_code' => E::ts("Postal Code"),
|
||||
'city' => E::ts("City"),
|
||||
'country' => E::ts("Country"),
|
||||
],
|
||||
FALSE, // is not required
|
||||
['class' => 'crm-select2 huge', 'multiple' => 'multiple']
|
||||
);
|
||||
|
||||
$this->add(
|
||||
'textarea', // field type
|
||||
'custom_field_mapping', // field name
|
||||
|
|
|
@ -226,7 +226,8 @@ class CRM_Twingle_Profile {
|
|||
'membership_type_id',
|
||||
'membership_type_id_recur',
|
||||
'membership_postprocess_call',
|
||||
'newsletter_double_opt_in'
|
||||
'newsletter_double_opt_in',
|
||||
'required_address_components',
|
||||
),
|
||||
// Add payment methods.
|
||||
array_keys(static::paymentInstruments()),
|
||||
|
@ -300,6 +301,12 @@ class CRM_Twingle_Profile {
|
|||
'membership_type_id' => NULL,
|
||||
'membership_type_id_recur' => NULL,
|
||||
'newsletter_double_opt_in' => NULL,
|
||||
'required_address_components' => [
|
||||
'street_address',
|
||||
'postal_code',
|
||||
'city',
|
||||
'country',
|
||||
],
|
||||
)
|
||||
// Add contribution status for all payment methods.
|
||||
+ array_fill_keys(array_map(function($attribute) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue