Skip to content

Conversation

@RomainLvr
Copy link
Contributor

@RomainLvr RomainLvr commented Nov 21, 2025

Checklist before requesting a review

Please delete options that are not relevant.

  • I have read the CONTRIBUTING document.
  • I have performed a self-review of my code.
  • I have added tests that prove my fix is effective or that my feature works.
  • This change requires a documentation update.

Description

  • It fixes !40409
  • Here is a brief description of what this PR does

This PR improves the project task linking interface for tickets and ensures consistent behavior by filtering closed/finished projects and tasks.

Issues Fixed

  • Project dropdown now shows only open projects (closed/finished projects are filtered out)
  • Project task dropdown now shows only open tasks (tasks with finished states are filtered out)
  • Task dropdown only appears after selecting a project (better UX with cascading dropdowns)
  • Tasks are properly filtered by the selected project
  • Already linked tasks are excluded from the dropdown to prevent duplicates
  • Fixed hardcoded project state IDs (now dynamically queries finished states)

Screenshots (if appropriate):

image image

@RomainLvr RomainLvr self-assigned this Nov 21, 2025
@RomainLvr RomainLvr requested a review from Rom1-B November 21, 2025 13:36
Copy link
Contributor

@AdrienClairembault AdrienClairembault left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've tested manually and it seems to work as expected 👍

Just some minor comments regarding the ajax file.

@AdrienClairembault
Copy link
Contributor

E2E failure can be ignored.

Copy link
Member

@cedric-anne cedric-anne left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This filtering was added in #4598. I am not against removing it, but I would like to have a validation from @orthagh on this functional change.

@cedric-anne cedric-anne requested a review from orthagh November 26, 2025 09:30
@orthagh
Copy link
Contributor

orthagh commented Nov 26, 2025

This filtering was added in #4598

This is typically the case where we can't satisfy everybody, and I'm strongly against adding an option for this.
Honestly, I think we'll bother fewer people by filtering the closed cases.

Regarding the original ticket, not wanted by the requester, but if we want to harmonize, we also shouldn't allow linking closed projects in ticket UI

@cedric-anne
Copy link
Member

This filtering was added in #4598

This is typically the case where we can't satisfy everybody, and I'm strongly against adding an option for this. Honestly, I think we'll bother fewer people by filtering the closed cases.

Regarding the original ticket, not wanted by the requester, but if we want to harmonize, we also shouldn't allow linking closed projects in ticket UI

The current PR removes the filtering on closed tickets. It means that, if we validate it, closed projects will be shown in project/tickets link dropdowns. Is this OK for you?

@orthagh
Copy link
Contributor

orthagh commented Nov 26, 2025

Is this OK for you?

No, Like I said, It will bother more people.

@AdrienClairembault
Copy link
Contributor

(If you don't merge this, the $condition = ['glpi_projecttasks.projectstates_id' => ['<>', 3]]; line should still be modified as projects states IDs are not hardcoded.)

@RomainLvr
Copy link
Contributor Author

@orthagh @cedric-anne @AdrienClairembault
What should we do in this case? We need to agree on a solution.

@orthagh
Copy link
Contributor

orthagh commented Nov 26, 2025

@RomainLvr

wanted behavior and points listed at top:

  • open tickets can be linked in closed project -> OK in this pr but check only open are displayed
  • Projects dropdown should list only open and not close ones -> not OK
  • Task dropdown only appears after selecting a project -> OK
  • Tasks are properly filtered by the selected project -> OK
  • Already linked tasks are excluded from the dropdown -> OK

More generaly, if you want to extends this behavior regarding the original ticket
-> Dropdowns should only list items that are not closed/archived.

Making the inverse behavior will pollute a lot of people process.

And finally, contact the customer, I know him and if we want precision I'm available

@RomainLvr
Copy link
Contributor Author

RomainLvr commented Nov 28, 2025

I think the E2E failures are the same and can therefore be ignored

@RomainLvr
Copy link
Contributor Author

ping @orthagh

@RomainLvr RomainLvr requested a review from cedric-anne December 2, 2025 13:02
@RomainLvr
Copy link
Contributor Author

I will send the patch to the client for approval.

@cedric-anne cedric-anne marked this pull request as draft December 9, 2025 13:31
@cedric-anne
Copy link
Member

I put the PR to draft until we get the client approval.

@cedric-anne cedric-anne added this to the 11.0.5 milestone Dec 9, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

7 participants