Allow specific display preferences to be configured for the helpdesk
Checklist before requesting a review
- [X] I have performed a self-review of my code.
- [X] I have added tests that prove my fix is effective or that my feature works.
Description
- Allow specific display preferences to be configured for the
helpdeskinterface. - This view is only added for itemtypes that define a
supportHelpdeskDisplayPreferences()method that returntrue(so only ticket for now). - There are no restrictions on the criteria that can be selected, despite some ticket's search criteria being disabled for the helpdesk interface (see
Ticket::rawSearchOption()). This is because:- It is hard to filter the selectable criteria depending on the interface because of bad session management in the code.
We would need a proper service that accept a given interface and then return the available search options.
Instead, we have a direct call to
Session::getCurrentInterface()deeply nested into the stack trace, which mean passing a specific interface value would require adding new parameters to every method in the call stack until we reachTicket::rawSearchOption(). -
Ticket::rawSearchOption()do not actually remove search options for the helpdesk, it set them asnosearch = true. This mean they can't be used to search data but are actually valid to be used as display preferences. Thus, it is the administrator responsibility to not add columns that may contain sensitive informations in the helpdesk view.
- It is hard to filter the selectable criteria depending on the interface because of bad session management in the code.
We would need a proper service that accept a given interface and then return the available search options.
Instead, we have a direct call to
Screenshots
@cedric-anne I'm stuck on this one.
This PR add a new column to the display_preference unicity constraint. This result in the key being too long for MyISAM (works perfectly on innoDB).
Can we discuss it on monday ?
It works on MariaDB tho, I thought it was because of this:
So I added USING HASH to the query to try to get the same "limitless" length but without success.
@cedric-anne I'm stuck on this one.
This PR add a new column to the display_preference unicity constraint. This result in the key being too long for MyISAM (works perfectly on innoDB).
Seems unlikely we will have more than helpdesk or central interfaces. At least for now, this could be a is_helpdesk or is_central tinyint column which should get it under the key length limit.
Maybe interface can be an tinyint with just constants in code GLPI side?