glpi icon indicating copy to clipboard operation
glpi copied to clipboard

Allow specific display preferences to be configured for the helpdesk

Open AdrienClairembault opened this issue 1 year ago • 3 comments

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 helpdesk interface.
  • This view is only added for itemtypes that define a supportHelpdeskDisplayPreferences() method that return true (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 reach Ticket::rawSearchOption().
    • Ticket::rawSearchOption() do not actually remove search options for the helpdesk, it set them as nosearch = 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.

Screenshots

image

AdrienClairembault avatar Oct 03 '24 14:10 AdrienClairembault

@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 ?

image

It works on MariaDB tho, I thought it was because of this:

image

So I added USING HASH to the query to try to get the same "limitless" length but without success.

AdrienClairembault avatar Oct 04 '24 13:10 AdrienClairembault

@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.

cconard96 avatar Oct 04 '24 13:10 cconard96

Maybe interface can be an tinyint with just constants in code GLPI side?

trasher avatar Oct 04 '24 13:10 trasher