Bugzilla – Attachment 102004 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.22 KB, created by
Kyle M Hall (khall)
on 2020-03-27 14:51:41 UTC
(
hide
)
Description:
Bug 24699: Split items.uri in OPAC detail view
Filename:
MIME Type:
Creator:
Kyle M Hall (khall)
Created:
2020-03-27 14:51:41 UTC
Size:
6.22 KB
patch
obsolete
>From 5f0895e08cd667121d88bf2005a6d8f43b622f3e 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 > >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: Bernardo Gonzalez Kriegel <bgkriegel@gmail.com> >Work as described, no errors. > >Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com> >--- > .../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 197672c124..b34c369295 100644 >--- a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-detail.tt >+++ b/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-detail.tt >@@ -1259,37 +1259,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.21.1 (Apple Git-122.3)
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