Skip to content
Snippets Groups Projects
Commit 6f35a875 authored by Peter Rotich's avatar Peter Rotich
Browse files

Ticket Link: Always return a link

parent d3b0a944
No related branches found
No related tags found
No related merge requests found
...@@ -58,25 +58,21 @@ implements EmailContact, ITicketUser, TemplateVariable { ...@@ -58,25 +58,21 @@ implements EmailContact, ITicketUser, TemplateVariable {
switch (strtolower($tag)) { switch (strtolower($tag)) {
case 'ticket_link': case 'ticket_link':
$qstr = array(); $qstr = array();
$ticket = $this->getTicket();
if ($cfg && $cfg->isAuthTokenEnabled() if ($cfg && $cfg->isAuthTokenEnabled()
&& ($ticket=$this->getTicket())) { && $ticket
if (!$ticket->getThread()->getNumCollaborators()) { && !$ticket->getNumCollaborators()) {
$qstr['auth'] = $ticket->getAuthToken($this); $qstr['auth'] = $ticket->getAuthToken($this);
return sprintf('%s/view.php?%s', return sprintf('%s/view.php?%s',
$cfg->getBaseUrl(), $cfg->getBaseUrl(),
Http::build_query($qstr, false) Http::build_query($qstr, false)
); );
} } else {
else { return sprintf('%s/tickets.php?id=%s',
return sprintf('%s/tickets.php?id=%s', $cfg->getBaseUrl(),
$cfg->getBaseUrl(), $ticket ? $ticket->getId() : 0
$ticket->getId() );
); }
}
}
break; break;
} }
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment