-
-
Notifications
You must be signed in to change notification settings - Fork 817
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
afform - add dynamic forms for creating/update custom group data #31484
base: master
Are you sure you want to change the base?
Conversation
add dynamic forms for editing and adding custom group data
🤖 Thank you for contributing to CiviCRM! ❤️ We will need to test and review this PR. 👷 Introduction for new contributors...
Quick links for reviewers...
|
@colemanw just putting this up as WIP on the custom group afforms. Started on the create/update forms as they are a bit simpler, but have made some in-roads into the search listings too. Got a bit bogged down in I wondered about just using an afform with a url to add the tabs directly, rather than via the afform placement tag? e.g. the following basically seemed to work
I got got by the contact summary seemingly force the url to begin /civicrm/contact , so not happy with a generic url for a listing that works to any custom group (I had /civicrm/af/custom/GROUPNAME/list ). |
* | ||
* For single value custom groups we generate: | ||
* - a field block with all of the fields from the group | ||
* - a submission form for editing these fields on a parent entity record |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not sure how this would work. Probably not needed unless I'm missing something?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this one does work already - because you can pass in the parent entity (e.g. contact id) to the primary af-entity
The multi value ones are trickier, because you want to be able to specify the id of the af-join element by param - but that doesn't work.
Hence my thinking to make the Custom_[abc]
entity a primary entity for afform purposes.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Agreed, the multi-record custom groups will need to be treated as primary entities.
* - a submission form for adding a new Custom record to a parent entity record | ||
* - a submission form for editing a particular Custom record |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think these 2 could be the same form actually.
entity_id
could be a hidden field passed through the url.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ah yes I see what you mean, good point
I don't think you need to reinvent the wheel here. I can answer your questions about |
Overview
Currently afform blocks are auto generated for custom group data, which you can add to your own forms.
This adds automatic forms which can be used to edit the custom group data.
Comments
I've moved the form generation from the Afform/Get class to a dedicated action on CustomGroup entity, as it gets a bit more involved creating multiple forms for each Group.
Still a bit WIP.
Questions:
entity_id
field).civicrm_admin_ui
, because there are a bit more involvedNext step: