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 1351-1387 Link Here
1351
                    [% END %]
1351
                    [% END %]
1352
                    [% IF ( itemdata_uri ) %]
1352
                    [% IF ( itemdata_uri ) %]
1353
                        <td class="url">
1353
                        <td class="url">
1354
                            [% IF ITEM_RESULT.uri %]
1354
                        [% IF ITEM_RESULT.uri %]
1355
                                [% IF Koha.Preference('URLLinkText') %]
1355
                            [%# Initialize three helper vars %]
1356
                                    [% IF trackclicks == 'track' || trackclicks == 'anonymous' %]
1356
                            [% SET target_attr = ''; SET rel_attr = ''; SET href_attr = '' %]
1357
                                        [% IF Koha.Preference("OPACURLOpenInNewWindow") %]
1357
                            [% IF Koha.Preference('OPACURLOpenInNewWindow') %][% SET target_attr = '_blank'; SET rel_attr = 'noreferrer' %][% END %]
1358
                                        <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>
1358
1359
                                        [% ELSIF ITEM_RESULT.uri %]
1359
                            [%# Check if there are multiple URIs; in the single case we only use pref URLLinkText or Link to resource %]
1360
                                        <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>
1360
                            [% IF ITEM_RESULT.uri.split(' \| ').size > 1 %]
1361
                                        [% END %]
1361
                                [% FOREACH uri IN ITEM_RESULT.uri.split(' \| ') %]
1362
                                    [% ELSE %]
1362
                                    [% 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 %]
1363
                                        [% IF Koha.Preference("OPACURLOpenInNewWindow") %]
1363
                                    <a target="[% target_attr | html %]" rel="[% rel_attr | html %]" href="[% href_attr | url %]" property="url">[% uri | html %]</a><br>
1364
                                        <a target="_blank" rel="noreferrer" href="[% ITEM_RESULT.uri | url %]" property="url">[% Koha.Preference('URLLinkText') | html %]</a>
1365
                                        [% ELSIF ITEM_RESULT.uri %]
1366
                                        <a href="[% ITEM_RESULT.uri | url %]" property="url">[% Koha.Preference('URLLinkText') | html %]</a>
1367
                                        [% END %]
1368
                                    [% END %]
1369
                                [% ELSE %]
1370
                                    [% IF trackclicks == 'track' || trackclicks == 'anonymous' %]
1371
                                        [% IF Koha.Preference("OPACURLOpenInNewWindow") %]
1372
                                        <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>
1373
                                        [% ELSIF ITEM_RESULT.uri %]
1374
                                        <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>
1375
                                        [% END %]
1376
                                    [% ELSE %]
1377
                                        [% IF Koha.Preference("OPACURLOpenInNewWindow") %]
1378
                                        <a target="_blank" rel="noreferrer" href="[% ITEM_RESULT.uri | url %]" property="url">Link to resource</a>
1379
                                        [% ELSIF ITEM_RESULT.uri %]
1380
                                        <a href="[% ITEM_RESULT.uri | url %]" property="url">Link to resource</a>
1381
                                        [% END %]
1382
                                    [% END %]
1383
                                [% END %]
1364
                                [% END %]
1365
                            [% ELSE %]
1366
                                [% 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 %]
1367
                                <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>
1384
                            [% END %]
1368
                            [% END %]
1369
                        [% END %]
1385
                        </td>
1370
                        </td>
1386
                    [% END %]
1371
                    [% END %]
1387
                    [% IF ( itemdata_copynumber ) %]<td class="copynumber">[% ITEM_RESULT.copynumber | html %]</td>[% END %]
1372
                    [% IF ( itemdata_copynumber ) %]<td class="copynumber">[% ITEM_RESULT.copynumber | html %]</td>[% END %]
1388
- 

Return to bug 24699