From 983616812284a758106272f431f6a447aacb7d04 Mon Sep 17 00:00:00 2001 From: Marc Michalsky Date: Fri, 26 Apr 2024 18:19:16 +0200 Subject: [PATCH] add profile settings for note mapping --- CRM/Twingle/Form/Profile.php | 25 +++++++++++++++ CRM/Twingle/Profile.php | 4 +++ templates/CRM/Twingle/Form/Profile.hlp | 12 ++++++- templates/CRM/Twingle/Form/Profile.tpl | 44 ++++++++++++++++++++++++++ 4 files changed, 84 insertions(+), 1 deletion(-) diff --git a/CRM/Twingle/Form/Profile.php b/CRM/Twingle/Form/Profile.php index 2f7a750..2159d3b 100644 --- a/CRM/Twingle/Form/Profile.php +++ b/CRM/Twingle/Form/Profile.php @@ -498,6 +498,31 @@ class CRM_Twingle_Form_Profile extends CRM_Core_Form { [] ); + $this->add( + 'select', + 'map_as_contribution_notes', + E::ts('Create contribution notes for'), + [ + 'purpose' => E::ts('Purpose'), + 'remarks' => E::ts('Remarks'), + ], + // is not required + FALSE, + ['class' => 'crm-select2 huge', 'multiple' => 'multiple'] + ); + + $this->add( + 'select', + 'map_as_contact_notes', + E::ts('Create contact notes for'), + [ + 'user_extrafield' => E::ts('User Extra Field'), + ], + // is not required + FALSE, + ['class' => 'crm-select2 huge', 'multiple' => 'multiple'] + ); + $this->addButtons([ [ 'type' => 'submit', diff --git a/CRM/Twingle/Profile.php b/CRM/Twingle/Profile.php index 79c11ca..94a8a2e 100644 --- a/CRM/Twingle/Profile.php +++ b/CRM/Twingle/Profile.php @@ -530,6 +530,8 @@ class CRM_Twingle_Profile { 'membership_postprocess_call' => ['required' => FALSE], 'newsletter_double_opt_in' => ['required' => FALSE], 'required_address_components' => ['required' => FALSE], + 'map_as_contribution_notes' => ['required' => FALSE], + 'map_as_contact_notes' => ['required' => FALSE], ], // Add payment methods. array_combine( @@ -646,6 +648,8 @@ class CRM_Twingle_Profile { 'city', 'country', ], + 'map_as_contribution_notes' => [], + 'map_as_contact_notes' => [], ] // Add contribution status for all payment methods. // phpcs:ignore Drupal.Formatting.SpaceUnaryOperator.PlusMinus diff --git a/templates/CRM/Twingle/Form/Profile.hlp b/templates/CRM/Twingle/Form/Profile.hlp index e3841d7..b8d67a4 100644 --- a/templates/CRM/Twingle/Form/Profile.hlp +++ b/templates/CRM/Twingle/Form/Profile.hlp @@ -75,4 +75,14 @@
  • ContributionRecur – Will be set on the recurring contribution and deriving single contributions
  • {/ts} {/htxt} -{/crmScope} \ No newline at end of file + +{htxt id='id-map_as_contribution_notes'} + {ts domain="de.systopia.twingle"}

    Create a contribution note for each field specified in this selection.

    +

    Tip: You can enable or disable this fields in the TwingleMANAGER.

    {/ts} +{/htxt} + +{htxt id='id-map_as_contact_notes'} + {ts domain="de.systopia.twingle"}

    Create a contact note for each field specified in this selection.

    +

    Tip: You can enable or disable this fields in the TwingleMANAGER.

    {/ts} +{/htxt} +{/crmScope} diff --git a/templates/CRM/Twingle/Form/Profile.tpl b/templates/CRM/Twingle/Form/Profile.tpl index a090abd..4557e0d 100644 --- a/templates/CRM/Twingle/Form/Profile.tpl +++ b/templates/CRM/Twingle/Form/Profile.tpl @@ -313,6 +313,50 @@ {$form.contribution_source.html} + + + {$form.map_as_contribution_notes.label} + + + {$form.map_as_contribution_notes.html} + + + + + {$form.map_as_contact_notes.label} + + + {$form.map_as_contact_notes.html} + + {$form.custom_field_mapping.label}