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>
<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 %]&itemnumber=[% item.itemnumber | uri %]&biblionumber=[% item.biblionumber | uri %]&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 ) %]