Use template variable to add or remove swap button. #21003
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Overview
Use template variable to add or remove swap button.
Before
Rendering of 'swap button'
on activity form driven by whether or not the activity assignee field is frozen
After
Presence rendered by a template variable
Technical Details
In combination with email notifications this button can be dangerous - ie an accidental click and
a donor rather than a staff member gets the email.
My thinking is to disable this via the activity assignee extension,
https://lab.civicrm.org/extensions/assignee/-/issues/2 - but it's cleaner for
an extension to intervene by setting a smarty variable than using javascript
to remove the button and I feel like it makes more sense for the form to
assign 'instruction variables' than for the decision to freeze to
also have 'hidden' effects further down
This doesn't wind up being any more supported than the js but it will be easier for us to write a unit test within the extension to ensure it doesn't quietly stop working
Comments