View | Details | Raw Unified | Return to bug 24699
Collapse All | Expand All

(-)a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-detail.tt (-30 / +14 lines)
Lines 1259-1295 Link Here
1259
                    [% END %]
1259
                    [% END %]
1260
                    [% IF ( itemdata_uri ) %]
1260
                    [% IF ( itemdata_uri ) %]
1261
                        <td class="url">
1261
                        <td class="url">
1262
                            [% IF ITEM_RESULT.uri %]
1262
                        [% IF ITEM_RESULT.uri %]
1263
                                [% IF Koha.Preference('URLLinkText') %]
1263
                            [%# Initialize three helper vars %]
1264
                                    [% IF trackclicks == 'track' || trackclicks == 'anonymous' %]
1264
                            [% SET target_attr = ''; SET rel_attr = ''; SET href_attr = '' %]
1265
                                        [% IF Koha.Preference("OPACURLOpenInNewWindow") %]
1265
                            [% IF Koha.Preference('OPACURLOpenInNewWindow') %][% SET target_attr = '_blank'; SET rel_attr = 'noreferrer' %][% END %]
1266
                                        <a target="_blank" rel="noreferrer" href="/cgi-bin/koha/tracklinks.pl?uri=[% ITEM_RESULT.uri | uri %]&amp;biblionumber=[% biblio.biblionumber | html %]&amp;itemnumber=[% ITEM_RESULT.itemnumber | url %]" property="url">[% Koha.Preference('URLLinkText') | html %]</a>
1266
1267
                                        [% ELSIF ITEM_RESULT.uri %]
1267
                            [%# Check if there are multiple URIs; in the single case we only use pref URLLinkText or Link to resource %]
1268
                                        <a href="/cgi-bin/koha/tracklinks.pl?uri=[% ITEM_RESULT.uri | uri %]&amp;biblionumber=[% biblio.biblionumber | uri %]&amp;itemnumber=[% ITEM_RESULT.itemnumber | url %]" property="url">[% Koha.Preference('URLLinkText') | html %]</a>
1268
                            [% IF ITEM_RESULT.uri.split(' \| ').size > 1 %]
1269
                                        [% END %]
1269
                                [% FOREACH uri IN ITEM_RESULT.uri.split(' \| ') %]
1270
                                    [% ELSE %]
1270
                                    [% IF trackclicks == 'track' || trackclicks == 'anonymous' %][% SET href_attr = "/cgi-bin/koha/tracklinks.pl?uri=" _ uri _ "&amp;biblionumber=" _ biblio.biblionumber _ "&amp;itemnumber=" _ ITEM_RESULT.itemnumber %] [% ELSE %][% SET href_attr = uri %][% END %]
1271
                                        [% IF Koha.Preference("OPACURLOpenInNewWindow") %]
1271
                                    <a target="[% target_attr | html %]" rel="[% rel_attr | html %]" href="[% href_attr | url %]" property="url">[% uri | html %]</a><br>
1272
                                        <a target="_blank" rel="noreferrer" href="[% ITEM_RESULT.uri | url %]" property="url">[% Koha.Preference('URLLinkText') | html %]</a>
1273
                                        [% ELSIF ITEM_RESULT.uri %]
1274
                                        <a href="[% ITEM_RESULT.uri | url %]" property="url">[% Koha.Preference('URLLinkText') | html %]</a>
1275
                                        [% END %]
1276
                                    [% END %]
1277
                                [% ELSE %]
1278
                                    [% IF trackclicks == 'track' || trackclicks == 'anonymous' %]
1279
                                        [% IF Koha.Preference("OPACURLOpenInNewWindow") %]
1280
                                        <a target="_blank" rel="noreferrer" href="/cgi-bin/koha/tracklinks.pl?uri=[% ITEM_RESULT.uri | uri %]&amp;biblionumber=[% biblio.biblionumber | html %]&amp;itemnumber=[% ITEM_RESULT.itemnumber | url %]" property="url">Link to resource</a>
1281
                                        [% ELSIF ITEM_RESULT.uri %]
1282
                                        <a href="/cgi-bin/koha/tracklinks.pl?uri=[% ITEM_RESULT.uri | uri %]&amp;biblionumber=[% biblio.biblionumber | uri %]&amp;itemnumber=[% ITEM_RESULT.itemnumber | url %]" property="url">Link to resource</a>
1283
                                        [% END %]
1284
                                    [% ELSE %]
1285
                                        [% IF Koha.Preference("OPACURLOpenInNewWindow") %]
1286
                                        <a target="_blank" rel="noreferrer" href="[% ITEM_RESULT.uri | url %]" property="url">Link to resource</a>
1287
                                        [% ELSIF ITEM_RESULT.uri %]
1288
                                        <a href="[% ITEM_RESULT.uri | url %]" property="url">Link to resource</a>
1289
                                        [% END %]
1290
                                    [% END %]
1291
                                [% END %]
1272
                                [% END %]
1273
                            [% ELSE %]
1274
                                [% IF trackclicks == 'track' || trackclicks == 'anonymous' %][% SET href_attr = "/cgi-bin/koha/tracklinks.pl?uri=" _ ITEM_RESULT.uri _ "&amp;biblionumber=" _ biblio.biblionumber _ "&amp;itemnumber=" _ ITEM_RESULT.itemnumber %] [% ELSE %][% SET href_attr = ITEM_RESULT.uri %][% END %]
1275
                                <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>
1292
                            [% END %]
1276
                            [% END %]
1277
                        [% END %]
1293
                        </td>
1278
                        </td>
1294
                    [% END %]
1279
                    [% END %]
1295
                    [% IF ( itemdata_copynumber ) %]<td class="copynumber">[% ITEM_RESULT.copynumber | html %]</td>[% END %]
1280
                    [% IF ( itemdata_copynumber ) %]<td class="copynumber">[% ITEM_RESULT.copynumber | html %]</td>[% END %]
1296
- 

Return to bug 24699