Browse Source

Bug 20615: Add the link of number of times the authority are used in edit mode

Currently when show an authority record you can see the count of records linked
with that authority, but when edit that authority record the that detail is
dissapeared.
Applying this patch will have that information also on edit mode of authority.

Test plan:
1) Search for an authority that is already connected with at least one record
2) On detail view of an authority you can check that authority is linked with
   x records.
3) Edit that authority and the information about in how many records that
   authority is linked is missing.
4) Apply this patch
5) Edit again that authrity and you can find now the count in how many records
   is used that authority

Signed-off-by: Marjorie Barry-Vila <marjorie.barry-vila@collecto.ca>
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
master
George Veranis 3 months ago
committed by Fridolin Somers
parent
commit
594adf2190
  1. 5
      authorities/authorities.pl
  2. 8
      koha-tmpl/intranet-tmpl/prog/en/modules/authorities/authorities.tt

5
authorities/authorities.pl

@ -557,13 +557,16 @@ if(!$authtypecode) {
$authtypecode = $authid ? Koha::Authorities->find($authid)->authtypecode : '';
}
my $authobj = Koha::Authorities->find($authid);
my $count = $authobj ? $authobj->get_usage_count : 0;
my ($template, $loggedinuser, $cookie)
= get_template_and_user({template_name => "authorities/authorities.tt",
query => $input,
type => "intranet",
flagsrequired => {editauthorities => 1},
});
$template->param(nonav => $nonav,index=>$myindex,authtypecode=>$authtypecode,breedingid=>$breedingid);
$template->param(nonav => $nonav,index=>$myindex,authtypecode=>$authtypecode,breedingid=>$breedingid, count=>$count);
$tagslib = GetTagsLabels(1,$authtypecode);
$mandatory_z3950 = GetMandatoryFieldZ3950($authtypecode);

8
koha-tmpl/intranet-tmpl/prog/en/modules/authorities/authorities.tt

@ -352,7 +352,13 @@
</ul>
</div>
</div> <!-- /#toolbar -->
<div id="action">
[% IF count %]
Used in <a href="/cgi-bin/koha/catalogue/search.pl?type=intranet&amp;op=do_search&amp;q=an=[% authid | uri %]">[% count | html %] record(s)</a>
[% ELSE %]
This authority is not used in any records.
[% END %]
</div>
<div id="authoritytabs" class="toptabs numbered">
<ul>
[% FOREACH BIG_LOO IN BIG_LOOP %]

Loading…
Cancel
Save