Hortcut to check 'my tickets'

In the Ticket module, there is a shortcut to check ‘my tickets’, which also displays a message saying: ‘This page shows tickets created by or flagged for the current user.’ However, I only see tickets that are assigned to the user and I don’t see those he created. Is this a permission issue or an actual bug? Because when I search in the list shortcut, I can see all the tickets correctly

Guys, I’m not a programmer, but I’m trying to understand a little PHP to improve my understanding of this topic. After looking at the list.php script of the ticket module, I realized that it does a screening to validate the TICKET_LIMIT_VIEW_ASSIGNED_ONLY function, if it is true it only releases the view of assigned tickets, through the query:
$sql .= " AND (t.fk_user_assign = ".((int) $user->id);
I would like to include in “mine” mode the tickets that were created by the current user, just below line 450 and also include another query as follows:
$sql .= " OR t.fk_user_create = ".((int) $user->id);
For me it worked perfectly and I would like to share this solution.

1 Like

Hello,

Thanks for the tip !

I propose a PR base on your imput : FIX: Show tickets created by current user by ksar-ksar · Pull Request #27876 · Dolibarr/dolibarr · GitHub

1 Like

Hello,

In fact, I do not check carefully but Eldy point out that this condition is already in the file 2 lines after.
So your issue is related to TICKET_LIMIT_VIEW_ASSIGNED_ONLY that is 1 in your installation.