twomice / com.joineryhq.reltoken

CiviCRM extension: Provides tokens for any related contact, for all available contact tokens. E.g., to get the spouse's first name, or parent's marriage date.
Other
1 stars 5 forks source link

Specify which relationships to generate tokens for #5

Closed MegaphoneJon closed 5 years ago

MegaphoneJon commented 5 years ago

This PR allows a user to configure which relationship types should get tokens generated via the UI. I updated the README to document this and to remove this option from the "Room for Improvement" section.

Note that:

So this looks like a big PR, but the only code changes are:

MegaphoneJon commented 5 years ago

My last PR passes a $context value to getTokenDetails(). That's a very expensive call, especially if you have other extensions providing custom tokens. By passing the context, I can skip processing tokens in other extensions that I know aren't necessary here. It gives me a 10x speedup when using the Salutations extension!

MegaphoneJon commented 5 years ago

That's correct, it's an arbitrary string.

MegaphoneJon commented 5 years ago

Oh, good thinking. If this is the only change you have, I'll push that on this branch. Otherwise I'll wait until you've reviewed everything.

twomice commented 5 years ago

@MegaphoneJon sure, this is great otherwise. Default to 1 on that custom field, and we can merge.

MegaphoneJon commented 5 years ago

@twomice updated!

twomice commented 5 years ago

Thanks - merged!