Koha/koha-tmpl/opac-tmpl/bootstrap/en/includes/html_helpers.inc
Jonathan Druart 051dd6bf0b Bug 29609: Centralized code to build the link to a biblio detail page
There are 2 prefs that control the default view of biblio detail pages:
IntranetBiblioDefaultView for staff and BiblioDefaultView for OPAC.
There are as well viewISBD, viewLabeledMARC and viewMARC to allow/don't
allow access to those page for staff members.

This code need to be in a single place to avoid discrepancy.

Test plan:
Play with BiblioDefaultView and IntranetBiblioDefaultView and confirm
that the links of biblio point to the correct view.

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2022-04-08 15:49:16 +02:00

35 lines
1.4 KiB
PHP

[% BLOCK options_for_libraries %]
[% FOREACH l IN libraries %]
[% IF l.selected %]
<option value="[% l.branchcode | html %]" selected="selected">[% l.branchname | html %]</option>
[% ELSE %]
<option value="[% l.branchcode | html %]">[% l.branchname | html %]</option>
[% END%]
[% END %]
[% END %]
[% BLOCK koha_news_block %]
[% IF ( news.content && news.content.count > 0 ) %]
<div id="[% news.location | html %]">
[% FOREACH n IN news.content %]
<div class="[% n.lang | html %]_item">
[% IF ( n.title && news.blocktitle ) %]
<h4 class="[% n.lang | html %]_header">[% n.title | html %]</h4>
[% END %]
<div class="[% n.lang | html %]_body">[% n.content | $raw %]</div>
</div>
[% END %]
</div>
[% END %]
[% END %]
[% BLOCK biblio_a_href -%]
[%- IF Koha.Preference('BiblioDefaultView') == 'marc' -%]
[%- SET this_biblio_href = "/cgi-bin/koha/opac-MARCdetail.pl?biblionumber=" -%]
[%- ELSIF Koha.Preference('BiblioDefaultView') == 'isbd' -%]
[%- SET this_biblio_href = "/cgi-bin/koha/opac-ISBDdetail.pl?biblionumber=" -%]
[%- ELSE -%]
[%- SET this_biblio_href = "/cgi-bin/koha/opac-detail.pl?biblionumber=" -%]
[%- END -%]
[%- this_biblio_href | url %][% biblionumber | url -%]
[%- END %]