Skip to content
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

More hooks #3093

Merged
Merged

Conversation

AdrienClairembault
Copy link
Contributor

Changes description

Some additionals hooks needed for advancedforms.

Two very simple hooks:

  • formcreator_question_description triggered when displaying a question's description
  • formcreator_question_default_value triggered when displaying a question's default value

And a more complex hook formcreator_actors_type that allow to define custom actors.

This hooks expect a class name, which must implement the new PluginFormcreatorPluginTarget interface.
You'll find an example here: https://gist.github.com/AdrienClairembault/89346d3e545260651f8375a772fc06e6, which allow to select an actor specified in a question from a previous form of the same workflow.

image

The only impact on existing code is a rewrite of the changeActor javascript which handle hiding/showing the custom html forms for each actors types.

This javascript code now rely on data attributes instead of specific instructions, which was needed to allow plugins using the formcreator_actors_type hook to have their specific html forms displayed.

Also it seems that the same changeActor was written twice, I've deleted the second occurrence.

inc/plugintarget.class.php Outdated Show resolved Hide resolved
@btry btry merged commit f9a23b6 into pluginsGLPI:support/2.13.0 Nov 24, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants