Make the attach-to-workflows setting per financial type
I admit this looks a little big. I could break it up, or think of it in 5 parts as below. Also the changes in cdntaxreceipts.php and the unit test are easier to see with whitespace changes hidden.
- Moving the related code into its own function for tidiness and ease of unit testing.
- Removing the groupName etc extra logic needed to support pre-5.47 code. It's just
$params['workflow']
now. - The actual feature, which converts the setting from '0'/'1' to a list of financial types and then uses that list. Note the way select2 returns the values is as a string like '0,2,3', which oddly means "2 and 3". Or in the case of no selection, is also oddly '0'.
- And I tacked on a hook to allow using your own criteria.
- The upgrade step.
- Updating/adding unit tests.