Skip to content

N°10242 - Add backoffice event OnDisplayStimulusForm - #1083

Open
TdlQ wants to merge 3 commits into
Combodo:developfrom
TdlQ:develop
Open

TdlQ wants to merge 3 commits into
Combodo:developfrom
TdlQ:develop

Conversation

@TdlQ

@TdlQ TdlQ commented Oct 16, 2026

Copy link
Copy Markdown

I haven't created an issue but this has been discussed with Combodo people before.

Base information

Question Answer
Related to a SourceForge thread / Another PR / A GitHub Issue / Combodo ticket? No
Type of change? Enhancement

Objective (enhancement)

Much like OnDisplayProperties is used to customize the object display interface, this PR introduces OnDisplayStimulusForm, which allows customizing the stimulus form interface. There are several potential use cases; mine was to patch the "precanned-replies" extension and add its "Templates" button to the UserRequest form to make the extension compatible with the solution field.

Proposed solution

I've added interface iStimulusFormExtension which holds OnDisplayStimulusForm().
OnDisplayStimulusForm() is called from DisplayStimulusForm() of cmdbAbstractObject.

Checklist before requesting a review

  • If my PR is a bug fix or an enhancement, I opened an issue that got reviewed and approved by Combodo
  • I have performed a self-review of my code
  • I have tested all changes I made on an iTop instance
  • I have added a unit test, otherwise I have explained why I couldn't
  • Is the PR clear and detailed enough so anyone can understand without digging in the code?

Copilot AI balanced review requested due to automatic review settings October 16, 2026 15:20

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Changes recommended

The missing PHP opening tag prevents interface declaration and causes application initialization to fail.

2 open findings
What changed in this PR

Adds a backoffice extension hook for customizing stimulus forms, supporting integrations such as template buttons.

Changes:

  • Introduces and registers iStimulusFormExtension.
  • Calls OnDisplayStimulusForm() when displaying a stimulus dialog.
File Description
core/​metamodel.class.php Registers the extension API for discovery.
application/​cmdbabstract.class.inc.php Invokes the stimulus-form hook.
application/​applicationextension/​backoffice/​iStimulusFormExtension.php Defines the callback interface.
application/​applicationextension.inc.php Loads the new interface file.

🧠 Review effort: Balanced


💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread core/metamodel.class.php
'iLoginUIExtension',
'iPreferencesExtension',
'iApplicationUIExtension',
'iStimulusFormExtension',

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe an idea to start using this notation here as well:

Suggested change
'iStimulusFormExtension',
iStimulusFormExtension::class,

Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
@jf-cbd

jf-cbd commented Oct 23, 2026

Copy link
Copy Markdown
Member

Hello @TdlQ, thank you for your PR. It has been accepted functionally, and we'll work on it on iTop 3.4.

@jf-cbd jf-cbd moved this from Pending review to Assigned to a sprint in Combodo PRs dashboard Oct 23, 2026
@jf-cbd jf-cbd changed the title Add backoffice event OnDisplayStimulusForm N°10242 - Add backoffice event OnDisplayStimulusForm Oct 23, 2026
@jf-cbd jf-cbd added this to the 3.4.0 milestone Oct 23, 2026
@jf-cbd

jf-cbd commented Oct 23, 2026

Copy link
Copy Markdown
Member

Could you please provide an example (code snippet/delta XML) so our QA can test the PR with ease ? That would be really nice, thank you!

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Assigned to a sprint

Development

Successfully merging this pull request may close these issues.

4 participants