Bug 24697: Split items.uri on staff detail view
authorMarcel de Rooy <m.de.rooy@rijksmuseum.nl>
Thu, 20 Feb 2020 12:10:57 +0000 (12:10 +0000)
committerMartin Renvoize <martin.renvoize@ptfs-europe.com>
Wed, 15 Apr 2020 07:32:12 +0000 (08:32 +0100)
If there are more URIs, we split on vertical bar and show the real URL
instead of duplicated text. Otherwise display depends on the pref
URLLinkText.

Test plan:
Create item with uri = A | B | C
Create another item with uri = D
Check the results on staff detail view (items table).

Signed-off-by: Bernardo Gonzalez Kriegel <bgkriegel@gmail.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>

koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/detail.tt

index f164618..a477bb4 100644 (file)
@@ -404,12 +404,16 @@ Note that permanent location is a code, and location may be an authval.
                     <td class="dateaccessioned"><span title="[% item.dateaccessioned | html %]">[% item.dateaccessioned | $KohaDates %]</span></td>
                     <td><a href="/cgi-bin/koha/catalogue/moredetail.pl?type=[% item.type | uri %]&amp;itemnumber=[% item.itemnumber | uri %]&amp;biblionumber=[% item.biblionumber | uri %]&amp;bi=[% item.biblioitemnumber | uri %]#item[% item.itemnumber | uri %]">[% item.barcode | html %]</a></td>
                     [% IF ( itemdata_uri ) %]
-                        [% IF Koha.Preference('URLLinkText') %]
-                            <td class="uri"><a href="[% item.uri | url %]">[% Koha.Preference('URLLinkText') | html %]</a></td>
-                        [% ELSIF item.uri %]
-                            <td class="uri"><a href="[% item.uri | url %]">Link to resource</a></td>
+                        [% IF item.uri.split(' \| ').size > 1 %]
+                            <td class="uri">
+                                [% FOREACH uri IN item.uri.split(' \| ') %]<a href="[% uri | url %]">[% uri | html %]</a><br>[% END %]
+                            </td>
                         [% ELSE %]
-                            <td></td>
+                            <td class="uri">
+                                [% IF item.uri %]
+                                    <a href="[% item.uri | url %]">[% IF Koha.Preference('URLLinkText') %][% Koha.Preference('URLLinkText') | html %][% ELSE %]Link to resource[% END %]</a>
+                                [% END %]
+                            </td>
                         [% END %]
                     [% END %]
                     [% IF ( itemdata_copynumber ) %]