Skip to content

Add per-field hide condition (new "Conditions to hide field" tab) - #1252

Draft
UncleTomsCabi wants to merge 2 commits into
pluginsGLPI:mainfrom
UncleTomsCabi:feature/field-hide-condition
Draft

UncleTomsCabi wants to merge 2 commits into
pluginsGLPI:mainfrom
UncleTomsCabi:feature/field-hide-condition

Conversation

@UncleTomsCabi

Copy link
Copy Markdown

Currently, PluginFieldsContainerDisplayCondition only lets you hide the whole block when the main object matches a condition. This PR adds a separate mechanism to hide a single field of the block instead, without affecting the rest of the block. A new tab, "Conditions to hide field", appears on the container's edit page next to the existing "Conditions to hide block" tab. The two are independent: a block-level condition still hides everything, a field-level condition only hides the one field you pick. What's new

  • New table glpi_plugin_fields_fielddisplayconditions and new class PluginFieldsFieldDisplayCondition (CommonDBChild of PluginFieldsContainer), mirroring PluginFieldsContainerDisplayCondition and delegating to it for the parts that don't depend on the storage table.
  • New required "Field to hide" dropdown on the condition form.
  • PluginFieldsField::prepareHtmlFields() now filters out fields whose condition matches the current item, before rendering — covers tab, dom/domtab and massive-action paths through a single integration point.
  • New ajax/field_display_condition.php and front/fielddisplaycondition.form.php controllers, two new Twig templates.
  • container.class.php::defineTabs() registers the new tab.
image image image image

Currently, PluginFieldsContainerDisplayCondition only lets you hide the whole block when the main object matches a condition. This PR adds a separate mechanism to hide a single field of the block instead, without affecting the rest of the block. A new tab, "Conditions to hide field", appears on the container's edit page next to the existing "Conditions to hide block" tab. The two are independent: a block-level condition still hides everything, a field-level condition only hides the one field you pick. What's new
New table glpi_plugin_fields_fielddisplayconditions and new class PluginFieldsFieldDisplayCondition (CommonDBChild of PluginFieldsContainer), mirroring PluginFieldsContainerDisplayCondition and delegating to it for the parts that don't depend on the storage table.
New required "Field to hide" dropdown on the condition form.
PluginFieldsField::prepareHtmlFields() now filters out fields whose condition matches the current item, before rendering — covers tab, dom/domtab and massive-action paths through a single integration point.
New ajax/field_display_condition.php and front/fielddisplaycondition.form.php controllers, two new Twig templates.
container.class.php::defineTabs() registers the new tab.
@stonebuzz
stonebuzz self-requested a review August 28, 2026 14:41
@stonebuzz

Copy link
Copy Markdown
Contributor

I’ll put the PR back into draft status, as it is not yet complete and has not been updated for some time.

@stonebuzz
stonebuzz marked this pull request as draft October 1, 2026 07:56
@stonebuzz

Copy link
Copy Markdown
Contributor

Hello,

This is a substantial piece of work that deserves the necessary time and attention.

We are currently in the middle of a plugin release phase, particularly focusing on compatibility with GLPI 12. This is a priority for the team and is currently requiring significant resources.

To avoid adding further complexity to the current process or delaying the ongoing releases, we will need to wait until this phase is complete before considering the integration of this feature and merging the PR.

Thank you for your understanding.

Best regards,

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants