Add per-field hide condition (new "Conditions to hide field" tab) - #1252
Draft
UncleTomsCabi wants to merge 2 commits into
Draft
UncleTomsCabi wants to merge 2 commits into
UncleTomsCabi wants to merge 2 commits into
Conversation
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
self-requested a review
August 28, 2026 14:41
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
marked this pull request as draft
October 1, 2026 07:56
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, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
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