From 9e56b53b5b27d60cb9612d49672779f93a2110f9 Mon Sep 17 00:00:00 2001
From: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Date: Tue, 12 Nov 2019 21:24:24 +0100
Subject: [PATCH] Bug 23592: Link to the bibliographic record from the
 suggestion
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

If there is a link between a suggestion and a bibliographic record (ie.
if suggestion.biblionumber is set), it makes sense to have an hyperlink
on the suggestion detail page.

Test plan:
- Create 2 suggestions
- Create an order from one of them
- Go to the detail page of the suggestion
=> The one with the order has a to the bibliographic record
=> The other one is not linked with a bibliographic record, and so the
title is displayed, without hyperlink

Signed-off-by: Séverine QUEUNE <severine.queune@bulac.fr>
---
 koha-tmpl/intranet-tmpl/prog/en/modules/suggestion/suggestion.tt | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/suggestion/suggestion.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/suggestion/suggestion.tt
index 06a289c..49ec4af 100644
--- a/koha-tmpl/intranet-tmpl/prog/en/modules/suggestion/suggestion.tt
+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/suggestion/suggestion.tt
@@ -64,7 +64,11 @@
             [% IF ( title ) %]
                 <li>
                     <span class="label">Title:</span>
-                    [% title | html %]
+                    [% IF suggestion.biblionumber %]
+                        <a href="/cgi-bin/koha/catalogue/detail.pl?biblionumber=[% suggestion.biblionumber | uri %]">[% suggestion.title | html %]</a>
+                    [% ELSE %]
+                        [% title | html %]
+                    [% END %]
                 </li>
             [% END %]
             [% IF ( author ) %]
-- 
2.1.4