Koha/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-auth-detail.tt
Owen Leonard 44aff60fa2
Bug 34852: Use template wrapper for breadcrumbs: OPAC part 2
This patch updates several OPAC templates so that they
use a new WRAPPER for displaying breadcrumbs.

Apply the patch and log in to the OPAC. Test each of the following pages
and their variations. Breadcrumbs should look correct, and each link
should be correct:

- Navigate to /cgi-bin/koha/ilsdi.pl
  - Check a variety of links in the list
- Advanced search
  - Locate a bibliographic record and view the ISBD detail page
  - View the MARC detail page
- Locate a serial record which has a patron notification notice defined
  in its subscription details
  - On the detail view under the "Subscriptions" tab, click the
    "Subscribe to email notification on new issues" button.
    - Confirm the subscription, then when you return to the detail page,
      click "Cancel email notification" to check that view as well.
- Authority search
  - Perform a search which will return results
    - Click the "Details" link on one of the results
      - Also view the "MARC view" tab (note that I didn't address the
        breadcrumb inconsistency between the normal and MARC view in
        this patch).
- Try to view a bibliographic record which is suppressed in the
  OPAC. Requires OpacSuppression enabled and OpacSuppressionRedirect set
  to "An explanatory page"
  - Set the value of 942$n to 1 to suppress it in the OPAC.
- In a system with ElasticSearch enabled, go to "Browse search" (or
  navigate directly to /cgi-bin/koha/opac-browse.pl
- With  OpacBrowser enabled, go to "Browse by hierarchy."

Signed-off-by: Philip Orr <philip.orr@lmscloud.de>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2023-10-18 10:25:58 -03:00

227 lines
13 KiB
Text

[% USE raw %]
[% USE Asset %]
[% USE Koha %]
[% USE AdditionalContents %]
[% PROCESS 'opac-authorities.inc' %]
[% SET OpacNav = AdditionalContents.get( location => "OpacNav", lang => lang, library => logged_in_user.branchcode || default_branch, blocktitle => 0 ) %]
[% SET OpacNavBottom = AdditionalContents.get( location => "OpacNavBottom", lang => lang, library => logged_in_user.branchcode || default_branch, blocktitle => 0 ) %]
[% INCLUDE 'doc-head-open.inc' %]
<title>[% summary.mainentry | html %][% IF authtypetext %] ([% authtypetext | html %])[% END %] &rsaquo; Authority search &rsaquo; [% IF ( LibraryNameTitle ) %][% LibraryNameTitle | html %][% ELSE %]Koha online[% END %] catalog</title>
[% INCLUDE 'doc-head-close.inc' %]
[% BLOCK cssinclude %]
[% IF ( displayhierarchy ) %]
[% Asset.css("lib/jquery/plugins/jstree/themes/default/style.min.css") | $raw %]
[% END %]
[% END %]
[%# FIXME authid is modified when passed authheadingdisplay %]
[%# It's then wrong in the JS %]
[% SET original_authid = authid %]
</head>
[% INCLUDE 'bodytag.inc' bodyid='opac-authoritiesdetail' bodyclass='scrollto' %]
[% INCLUDE 'masthead.inc' %]
<div class="main">
[% WRAPPER breadcrumbs %]
[% WRAPPER breadcrumb_item %]
<a href="/cgi-bin/koha/opac-authorities-home.pl">Authority search</a>
[% END %]
[% WRAPPER breadcrumb_item bc_active= 1 %]
[% summary.mainentry | html %][% IF authtypetext %] ([% authtypetext | html %])[% END %]
[% END %]
[% END #/ WRAPPER breadcrumbs %]
<div class="container-fluid">
<div class="row">
[% IF ( OpacNav || OpacNavBottom ) %]
<div class="col col-lg-2 order-2 order-lg-1">
<div id="navigation">
[% INCLUDE 'navigation.inc' %]
</div>
</div>
[% IF Koha.Preference( 'OPACAuthorIdentifiers' ) && author_identifiers.size %]
<div class="col-lg-5 order-first order-md-first order-lg-2">
[% ELSE %]
<div class="col-lg-10 order-first order-md-first order-lg-2">
[% END %]
[% ELSIF Koha.Preference( 'OPACAuthorIdentifiers' ) && author_identifiers.size %]
<div class="col-lg-6 order-first order-md-first order-lg-2">
[% ELSE %]
<div class="col order-first order-md-first order-lg-2">
[% END %]
<div id="userauthdetails" class="maincontent">
<div id="views">
<span class="view">
<span id="Normalview">Normal view</span>
</span>
<span class="view">
<a id="MARCview" href="/cgi-bin/koha/opac-authoritiesdetail.pl?authid=[% authid | html %]&amp;marc=1">MARC view</a>
</span>
</div>
[% IF ( displayhierarchy ) %]
<div id="hierarchies">
[% PROCESS showhierarchy trees = loophierarchies %]
</div>
[% END %]
<h1>[% summary.mainentry | html %][% IF authtypetext %] ([% authtypetext | html %])[% END %]</h1>
<div class="usedin">
[% IF count %]<a href="/cgi-bin/koha/opac-search.pl?type=opac&amp;q=[% authid | uri %]&amp;idx=an,phr">Number of records used in: [% count | html %]</a>[% ELSE %]This authority is not used in any records.[% END %]
</div>
[% IF html %]
[% html | $raw %]
[% ELSE %]
<div class="authstanza">
[% FOREACH authorize IN summary.authorized %]
<div class="heading authorized auth[% seefro.field | html %]">
<span class="label">Preferred form: </span>
<span class="authorized">[% authorize.heading | html %]</span>
</div>
[% END %]
[% PROCESS otherscript headings=summary.otherscript wantcategory='preferred' %]
</div>
[% IF summary.seefrom.size %]
<div class="authstanza seefrom">
<div class="authstanzaheading">Used for/see from:</div>
<ul class="seefrom">
[% FOREACH seefro IN summary.seefrom %]
<li class="heading seefrom auth[% seefro.field | html %]">
[% IF seefro.type && seefro.type != 'seefrom' %]
<span class="label">[% PROCESS authtypelabel type=seefro.type | trim %]:</span>
[% END %]
<span class="seefrom">[% PROCESS authheadingdisplay heading=seefro.heading search=seefrosearch authid=seefro.authid %]</span>
</li>
[% END %]
[% PROCESS otherscript headings=summary.otherscript wantcategory='seefrom' %]
</ul>
</div>
[% END %]
[% IF summary.seealso.size %]
<div class="authstanza seealso">
<div class="authstanzaheading">See also:</div>
<ul class="seelso">
[% FOREACH seeals IN summary.seealso %]
<li class="heading seealso auth[% seeals.field | html %]">
[% IF seeals.type && seeals.type != 'seealso' %]
<span class="label">[% PROCESS authtypelabel type=seeals.type | trim %]:</span>
[% END %]
<span class="seealso">[% PROCESS authheadingdisplay heading=seeals.heading search=seeals.search authid=seeals.authid %]</span>
</li>
[% END %]
[% PROCESS otherscript headings=summary.otherscript wantcategory='seealso' %]
</ul>
</div>
[% END %]
[% IF marcflavour == 'UNIMARC' && summary.otherscript %]
<div class="authstanza">
<div class="authstanzaheading">Other forms:</div>
<ul>
[% FOREACH otherscrip IN summary.otherscript %]
<li>
[% PROCESS language lang=otherscrip.lang | trim %]:
<span class="otherscript">[% otherscrip.term | html %]</span>
</li>
[% END %]
</ul>
</div>
[% END %]
[% IF ( MARCURLS ) %]
<div class="authstanza online_resources">
<span class="label">Online resources:</span>
<ul>
[% FOREACH MARCurl IN MARCURLS %]
<li>[% IF ( MARCurl.part ) %][% MARCurl.part | html %]<br />[% END %]
[% IF ( Koha.Preference('OPACURLOpenInNewWindow') ) %]
<a href="[% MARCurl.MARCURL | url %]" title="[% MARCurl.MARCURL | html %]" target="_blank" rel="noreferrer">
[% ELSE %]
<a href="[% MARCurl.MARCURL | url %]" title="[% MARCurl.MARCURL | html %]">
[% END %]
[% MARCurl.linktext | html %]</a>
[% IF ( MARCurl.notes ) %]
<ul>
[% FOREACH note IN MARCurl.notes %]
<li>[% note.note | html %]</li>
[% END %]
</ul>
[% END %]
</li>
[% END # /FOREACH MARCURLS %]
</ul>
</div>
[% END # / IF MARCURLS %]
[% END %]
[% WRAPPER tabs id= "authdescriptions" %]
[% WRAPPER tabs_nav %]
[% WRAPPER tab_item tabname= "tab_descriptions" bt_active= 1 %]
<span>Notes</span>
[% END %]
[% END # /WRAPPER tabs_nav %]
[% WRAPPER tab_panels %]
[% WRAPPER tab_panel tabname="tab_descriptions" bt_active= 1 %]
<div class="content_set">
[% FOREACH note IN summary.notes %]
<p class="note auth[% note.field | html %]">[% note.note | html %]</p>
[% END %]
</div>
[% END # /tab_panel# %]
[% END # /WRAPPER tab_panels %]
[% END # /WRAPPER tabs#authdescriptions %]
</div> <!-- / .#userauthdetails -->
</div> <!-- / .col-lg-10/12 -->
[% IF Koha.Preference( 'OPACAuthorIdentifiers' ) && author_identifiers.size %]
[% IF ( OpacNav || OpacNavBottom ) %]
<div class="col-lg-5 order-lg-3">
[% ELSE %]
<div class="col-lg-6 order-lg-3">
[% END %]
<div class="author_identifier">
<span>Identifiers</span>
<ul>
[% FOR identifier IN author_identifiers %]
[% PROCESS "authority-identifiers.inc" identifier => identifier %]
[% END %]
</ul>
</div>
</div>
[% END %]
</div> <!-- / .row -->
</div> <!-- / .container-fluid -->
</div> <!-- / .main -->
[% INCLUDE 'opac-bottom.inc' %]
[% BLOCK jsinclude %]
[% IF ( displayhierarchy ) %]
[% Asset.js("lib/jquery/plugins/jstree/jstree-3.3.12.min.js") | $raw %]
[% END %]
<script>
$(document).ready(function() {
[% IF ( displayhierarchy ) %]
$('#hierarchies').jstree({
"types" : {
"default" : {
"icon" : "fa-solid fa-file"
}
},
"plugins" : [ "types" ]
}).on('ready.jstree', function(){
$(this).jstree('open_all');
$("#hier"+[% original_authid | html %]+"_anchor").on("click",
function(e){e.preventDefault(); return false;}
).css("text-decoration", "none").css("color", "#333");
$(".currentauth").css("text-decoration", "none").css("color", "#333");
}).bind("select_node.jstree", function (e, data) {
e.preventDefault();
document.location.href = data.node.a_attr.href;
});
[% END %]
});
</script>
[% END %]