Bugzilla – Attachment 99355 Details for
Bug 24699
Split items.uri on OPAC detail page
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 24699: Split items.uri in OPAC detail view
Bug-24699-Split-itemsuri-in-OPAC-detail-view.patch (text/plain), 6.16 KB, created by
Marcel de Rooy
on 2020-02-21 08:22:35 UTC
(
hide
)
Description:
Bug 24699: Split items.uri in OPAC detail view
Filename:
MIME Type:
Creator:
Marcel de Rooy
Created:
2020-02-21 08:22:35 UTC
Size:
6.16 KB
patch
obsolete
>From 210a4378e6c692d73a32312f4a1d83111ba8e06f Mon Sep 17 00:00:00 2001 >From: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> >Date: Thu, 20 Feb 2020 14:43:43 +0000 >Subject: [PATCH] Bug 24699: Split items.uri in OPAC detail view >Content-Type: text/plain; charset=utf-8 > >Same change as in bug 24697 for staff. If there are more URIs in 952u, >we split them and show the real URL instead of Link to resource or the >value of pref URLLinkText. > >I introduced a few template variables here to make the code a bit more >compact and readable. > >Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> >--- > .../opac-tmpl/bootstrap/en/modules/opac-detail.tt | 43 +++++++--------------- > 1 file changed, 14 insertions(+), 29 deletions(-) > >diff --git a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-detail.tt b/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-detail.tt >index f0e06a78a9..bc1214ed9e 100644 >--- a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-detail.tt >+++ b/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-detail.tt >@@ -1351,37 +1351,22 @@ > [% END %] > [% IF ( itemdata_uri ) %] > <td class="url"> >- [% IF ITEM_RESULT.uri %] >- [% IF Koha.Preference('URLLinkText') %] >- [% IF trackclicks == 'track' || trackclicks == 'anonymous' %] >- [% IF Koha.Preference("OPACURLOpenInNewWindow") %] >- <a target="_blank" rel="noreferrer" href="/cgi-bin/koha/tracklinks.pl?uri=[% ITEM_RESULT.uri | uri %]&biblionumber=[% biblio.biblionumber | html %]&itemnumber=[% ITEM_RESULT.itemnumber | url %]" property="url">[% Koha.Preference('URLLinkText') | html %]</a> >- [% ELSIF ITEM_RESULT.uri %] >- <a href="/cgi-bin/koha/tracklinks.pl?uri=[% ITEM_RESULT.uri | uri %]&biblionumber=[% biblio.biblionumber | uri %]&itemnumber=[% ITEM_RESULT.itemnumber | url %]" property="url">[% Koha.Preference('URLLinkText') | html %]</a> >- [% END %] >- [% ELSE %] >- [% IF Koha.Preference("OPACURLOpenInNewWindow") %] >- <a target="_blank" rel="noreferrer" href="[% ITEM_RESULT.uri | url %]" property="url">[% Koha.Preference('URLLinkText') | html %]</a> >- [% ELSIF ITEM_RESULT.uri %] >- <a href="[% ITEM_RESULT.uri | url %]" property="url">[% Koha.Preference('URLLinkText') | html %]</a> >- [% END %] >- [% END %] >- [% ELSE %] >- [% IF trackclicks == 'track' || trackclicks == 'anonymous' %] >- [% IF Koha.Preference("OPACURLOpenInNewWindow") %] >- <a target="_blank" rel="noreferrer" href="/cgi-bin/koha/tracklinks.pl?uri=[% ITEM_RESULT.uri | uri %]&biblionumber=[% biblio.biblionumber | html %]&itemnumber=[% ITEM_RESULT.itemnumber | url %]" property="url">Link to resource</a> >- [% ELSIF ITEM_RESULT.uri %] >- <a href="/cgi-bin/koha/tracklinks.pl?uri=[% ITEM_RESULT.uri | uri %]&biblionumber=[% biblio.biblionumber | uri %]&itemnumber=[% ITEM_RESULT.itemnumber | url %]" property="url">Link to resource</a> >- [% END %] >- [% ELSE %] >- [% IF Koha.Preference("OPACURLOpenInNewWindow") %] >- <a target="_blank" rel="noreferrer" href="[% ITEM_RESULT.uri | url %]" property="url">Link to resource</a> >- [% ELSIF ITEM_RESULT.uri %] >- <a href="[% ITEM_RESULT.uri | url %]" property="url">Link to resource</a> >- [% END %] >- [% END %] >+ [% IF ITEM_RESULT.uri %] >+ [%# Initialize three helper vars %] >+ [% SET target_attr = ''; SET rel_attr = ''; SET href_attr = '' %] >+ [% IF Koha.Preference('OPACURLOpenInNewWindow') %][% SET target_attr = '_blank'; SET rel_attr = 'noreferrer' %][% END %] >+ >+ [%# Check if there are multiple URIs; in the single case we only use pref URLLinkText or Link to resource %] >+ [% IF ITEM_RESULT.uri.split(' \| ').size > 1 %] >+ [% FOREACH uri IN ITEM_RESULT.uri.split(' \| ') %] >+ [% IF trackclicks == 'track' || trackclicks == 'anonymous' %][% SET href_attr = "/cgi-bin/koha/tracklinks.pl?uri=" _ uri _ "&biblionumber=" _ biblio.biblionumber _ "&itemnumber=" _ ITEM_RESULT.itemnumber %] [% ELSE %][% SET href_attr = uri %][% END %] >+ <a target="[% target_attr | html %]" rel="[% rel_attr | html %]" href="[% href_attr | url %]" property="url">[% uri | html %]</a><br> > [% END %] >+ [% ELSE %] >+ [% IF trackclicks == 'track' || trackclicks == 'anonymous' %][% SET href_attr = "/cgi-bin/koha/tracklinks.pl?uri=" _ ITEM_RESULT.uri _ "&biblionumber=" _ biblio.biblionumber _ "&itemnumber=" _ ITEM_RESULT.itemnumber %] [% ELSE %][% SET href_attr = ITEM_RESULT.uri %][% END %] >+ <a target="[% target_attr | html %]" rel="[% rel_attr | html %]" href="[% href_attr | url %]" property="url">[% IF Koha.Preference('URLLinkText') %][% Koha.Preference('URLLinkText') | html %][% ELSE %]Link to resource[% END %]</a> > [% END %] >+ [% END %] > </td> > [% END %] > [% IF ( itemdata_copynumber ) %]<td class="copynumber">[% ITEM_RESULT.copynumber | html %]</td>[% END %] >-- >2.11.0
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
|
Splinter Review
Attachments on
bug 24699
:
99355
|
99468
|
102004