19f9673a3b
EDIT: Fixing typo: records(s) -> record(s) On details page, if authority is not used in any records, the page will display a more used friendly message: "This authority is not used in any records." To test: 1) Do an authority search on authorities-home.pl. Notice that authorities not used in any records have a clickable link (under 'Used in:' column) which redirects to a catalog search with no results 2) Go back to your authority search results on authorities-home.pl and click 'Details'. Notice that under the auth name, there is a 'Used in X records' link that again returns a catalog search with no results. 3) Apply patch 4) Repeat steps 1, 2. Authorities not used in any records should no longer have clickable links and links to authorities which are used in records should work as expected. 5) Confirm it now says record(s) instead of records(s) 6) Confirm that on detail page for an authority which is not used by any records, it now says more friendly message. Sponsored-by: Catalyst IT Signed-off-by: Nick Clemens <nick@bywatersolutions.com> Signed-off-by: Marc Véron <veron@veron.ch> Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org> Signed-off-by: Brendan A Gallagher <brendan@bywatersolutions.com>
146 lines
4.8 KiB
Text
146 lines
4.8 KiB
Text
[% PROCESS 'authorities.inc' %]
|
|
[% INCLUDE 'doc-head-open.inc' %]
|
|
<title>Koha › Authorities ›
|
|
[% IF ( unknownauthid ) %]
|
|
Unknown authority record
|
|
[% ELSE %]
|
|
Details for authority #[% authid %] ([% authtypetext %])
|
|
[% END %]
|
|
</title>
|
|
[% INCLUDE 'doc-head-close.inc' %]
|
|
[% IF ( displayhierarchy ) %]
|
|
<script type="text/javascript" src="/intranet-tmpl/lib/jquery/plugins/jquery.jstree.js"></script>
|
|
[% END %]
|
|
<script type="text/javascript">
|
|
|
|
//<![CDATA[
|
|
|
|
$(document).ready(function() {
|
|
$('#authoritiestabs').tabs();
|
|
[% IF ( displayhierarchy ) %]
|
|
var current_nodes = [];
|
|
$('.currentauth').each(function() {
|
|
current_nodes.push('#' + $(this).parent().parents('li:first').attr('id'));
|
|
});
|
|
$('#hierarchies').jstree({
|
|
"plugins": [ "themes", "html_data"],
|
|
"themes": { "theme": "classic",
|
|
"icons": false },
|
|
"core": { "initially_open": current_nodes }
|
|
});
|
|
[% END %]
|
|
});
|
|
|
|
function confirm_deletion() {
|
|
var is_confirmed = confirm(_("Are you sure you want to delete this authority?"));
|
|
if (is_confirmed) {
|
|
window.location="authorities-home.pl?op=delete&authid=[% authid %]";
|
|
}
|
|
}
|
|
function Dopop(link) {
|
|
newin=window.open(link,'width=500,height=400,toolbar=false,scrollbars=yes');
|
|
}
|
|
//]]>
|
|
</script>
|
|
<script type="text/javascript">
|
|
function Help() {
|
|
newin=window.open("/cgi-bin/koha/help.pl","KohaHelp",'width=600,height=600,toolbar=false,scrollbars=yes');
|
|
}
|
|
|
|
function addauthority() {
|
|
X = document.forms[0].authtype.value;
|
|
window.location="/cgi-bin/koha/authorities/authorities.pl?authtypecode="+X;
|
|
}
|
|
function searchauthority() {
|
|
X = document.forms[0].authtype2.value;
|
|
Y = document.forms[0].value.value;
|
|
window.location="/cgi-bin/koha/authorities/authorities-home.pl?op=do_search&type=intranet&authtypecode="+X+"&value="+Y+"&marclist=&and_or=and&excluding=&operator=contains";
|
|
}
|
|
</script>
|
|
</head>
|
|
<body id="auth_detail" class="auth">
|
|
[% INCLUDE 'header.inc' %]
|
|
[% INCLUDE 'authorities-search.inc' %]
|
|
<div id="breadcrumbs"><a href="/cgi-bin/koha/mainpage.pl">Home</a> › <a href="/cgi-bin/koha/authorities/authorities-home.pl">Authorities</a> ›
|
|
[% IF ( unknownauthid ) %]
|
|
Unknown authority record
|
|
[% ELSE %]
|
|
Details for authority #[% authid %] ([% authtypetext %])
|
|
[% END %]
|
|
</div>
|
|
|
|
<div id="doc" class="yui-t7">
|
|
|
|
<div id="bd">
|
|
<div id="yui-main">
|
|
<div class="yui-g">
|
|
|
|
[% INCLUDE 'authorities-toolbar.inc' %]
|
|
|
|
[% IF ( displayhierarchy ) %]
|
|
<div id="hierarchies">
|
|
[% PROCESS showhierarchy trees = loophierarchies %]
|
|
</div>
|
|
[% END %]
|
|
|
|
|
|
[% IF ( unknownauthid ) %]
|
|
<div class="dialog message">The authority record you requested does not exist ([% errauthid %]).</div>
|
|
[% ELSE %]
|
|
<h1>Authority #[% authid %] ([% authtypetext %])</h1>
|
|
|
|
<div id="action">
|
|
[% IF count > 0 %]
|
|
Used in <a href="/cgi-bin/koha/catalogue/search.pl?type=intranet&op=do_search&q=an=[% authid %]">[% count %] record(s)</a>
|
|
[% ELSE %]
|
|
This authority is not used in any records.
|
|
[% END %]
|
|
</div>
|
|
|
|
<div id="authoritiestabs" class="toptabs numbered">
|
|
<ul>
|
|
[% FOREACH BIG_LOO IN BIG_LOOP %]
|
|
<li>
|
|
<a href="#tab[% BIG_LOO.number %]XX">[% BIG_LOO.number %]</a>
|
|
</li>
|
|
[% END %]
|
|
</ul>
|
|
|
|
[% FOREACH BIG_LOO IN BIG_LOOP %]
|
|
<div id="tab[% BIG_LOO.number %]XX">
|
|
[% FOREACH innerloo IN BIG_LOO.innerloop %]
|
|
[% IF ( innerloo.tag ) %]
|
|
<div class="tag">
|
|
<div class="tag_title">
|
|
[% innerloo.tag %]
|
|
</div>
|
|
[% ELSE %]
|
|
<div class="tag">
|
|
[% END %]
|
|
[% FOREACH subfiel IN innerloo.subfield %]
|
|
<p>
|
|
<label class="labelsubfield">
|
|
[% UNLESS ( subfiel.hide_marc ) %]<b>[% subfiel.marc_subfield %]</b>[% END %]
|
|
<span title="[% subfiel.long_desc %]">[% subfiel.short_desc %]</span></label>
|
|
[% subfiel.marc_value %]
|
|
[% IF ( subfiel.link ) %]
|
|
<a href="/cgi-bin/koha/catalogue/search.pl?op=do_search&marclist=[% subfiel.link %]&operator==&type=intranet&value=[% subfiel.marc_value |url %]">
|
|
<img border="0" src="[% interface %]/[% theme %]/images/filefind.png" height="15" title="Search on [% subfiel.marc_value %]">
|
|
</a>
|
|
[% END %]
|
|
[% IF ( subfiel.authority ) %]
|
|
<a href="/cgi-bin/koha/authorities/detail.pl?authid=[% subfiel.authority %]" class="button">Auth</a>
|
|
[% END %]
|
|
</p>
|
|
[% END %]
|
|
</div>
|
|
[% END %]
|
|
</div>
|
|
[% END %]
|
|
</div>
|
|
</div>
|
|
</div>
|
|
[% END %]
|
|
</div>
|
|
|
|
[% INCLUDE 'intranet-bottom.inc' %]
|