glpi icon indicating copy to clipboard operation
glpi copied to clipboard

Fix(core): Mutualize / harmonize linked item form / process / ui (Ticket / Problem / Change / TicketRecurrent)

Open stonebuzz opened this issue 1 year ago • 6 comments

Alternative to https://github.com/glpi-project/glpi/pull/15751

add _add_fromitem as default value to be restored from restoreInputAndDefaults (and keep the link to the asset when the Change / Problem form is reloaded after changing the category)

Only for Change and Problem because it's actually worked for Ticket and Ticket has its own process (dedicated showform / dedicated code in front/ticket.form.php / dedicated code to get item entities_id)

Q A
Bug fix? yes
New feature? no
BC breaks? no
Deprecations? no
Tests pass? yes
Fixed tickets #15358

stonebuzz avatar Oct 11 '23 06:10 stonebuzz

This one sounds better. @Lainow could you confirm this solve original issue please?

trasher avatar Oct 12 '23 07:10 trasher

This one sounds better. @Lainow could you confirm this solve original issue please?

I've just tested it and can confirm that it solves the problem.

Lainow avatar Oct 23 '23 09:10 Lainow

Maybe the solution is to add the items panel to the changes and problems, and to handle the input in the same way.

@orthagh Do you agree?

cedric-anne avatar Oct 24 '23 13:10 cedric-anne

Make the form item visible, if possible in future, if you have a choice where you can have similar code between all commonITILObject or an exception, prefers the first.

orthagh avatar Oct 31 '23 09:10 orthagh

First attempt at pooling code for processing and displaying linked objects for CommonITILObject

stonebuzz avatar Nov 06 '23 10:11 stonebuzz

@delcroip

Can you check this pull request (concerning this -> https://github.com/glpi-project/glpi/pull/11304)

Best regards

stonebuzz avatar Nov 07 '23 10:11 stonebuzz

Each commit should be reviewed separately.

Commit 1: Mutualize the code to use the same code for changes and problems as the code already used for ticket<>items relation form/tab. Commit 2: Merge an included file into the only ajax script that is using it. Commit 3: Fix a bug that was previously existing.

cedric-anne avatar Apr 17 '24 12:04 cedric-anne