Bug 24697: Split items.uri on staff detail view

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>
This commit is contained in:
Marcel de Rooy 2020-02-20 12:10:57 +00:00 committed by Martin Renvoize
parent 60f4104626
commit 0ef1e1a24c
No known key found for this signature in database
GPG Key ID: 422B469130441A0F
1 changed files with 9 additions and 5 deletions

View 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 ) %]