From c49e7e882fc2cf01bdcd54705e2ff11647b70712 Mon Sep 17 00:00:00 2001 From: Mathieu Date: Sat, 26 Nov 2022 00:20:27 +0100 Subject: [PATCH] FIX#20415 --- htdocs/core/lib/project.lib.php | 12 ++++++++++++ htdocs/core/modules/modTicket.class.php | 1 - 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/htdocs/core/lib/project.lib.php b/htdocs/core/lib/project.lib.php index 15162c8b273..7265ad4149c 100644 --- a/htdocs/core/lib/project.lib.php +++ b/htdocs/core/lib/project.lib.php @@ -207,6 +207,18 @@ function project_prepare_head(Project $project, $moreparam = '') $head[$h][2] = 'element'; $h++; } + if (!empty($conf->ticket->enabled)) { + $Tickettatic = new Ticket($db); + $nbTicket = count($Tickettatic->getAllItemsLinkedByObjectID($project->id,'*','fk_project','ticket')); + $head[$h][0] = DOL_URL_ROOT.'/ticket/list.php?projectid='.((int) $project->id); + $head[$h][1] = $langs->trans("Ticket"); + if ($nbTicket > 0) { + $head[$h][1] .= ''.($nbTicket).''; + } + $head[$h][2] = 'ticket'; + $h++; + } + if ($conf->eventorganization->enabled && !empty($project->usage_organize_event)) { $langs->load('eventorganization'); diff --git a/htdocs/core/modules/modTicket.class.php b/htdocs/core/modules/modTicket.class.php index 01561b40b01..8d258f63a96 100644 --- a/htdocs/core/modules/modTicket.class.php +++ b/htdocs/core/modules/modTicket.class.php @@ -112,7 +112,6 @@ class modTicket extends DolibarrModules $this->tabs = array( 'thirdparty:+ticket:Tickets:@ticket:$user->rights->ticket->read:/ticket/list.php?socid=__ID__', - 'project:+ticket:Tickets:@ticket:$user->rights->ticket->read:/ticket/list.php?projectid=__ID__', ); // Dictionaries