Bug 35789: Remove Koha::Template::Plugin::Biblio::ArticleRequestsActiveCount
Can be replaced with biblio.article_requests.filter_by_current.count Test plan: Turn on article requests (syspref + circ rule) Request an article (detail page of a bib record) On the left you see "Article requests" tab with the number of current article requests. It should show the correct number (same as before this patch). Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io> Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
This commit is contained in:
parent
f108f73445
commit
ea80d2f140
|
|
@ -26,7 +26,6 @@ use Koha::Holds;
|
|||
use Koha::Biblios;
|
||||
use Koha::Database;
|
||||
use Koha::Patrons;
|
||||
use Koha::ArticleRequests;
|
||||
use Koha::Recalls;
|
||||
|
||||
# Do not use HoldsCount, it is deprecated and will be removed in a future release.
|
||||
|
|
@ -40,18 +39,6 @@ sub HoldsCount {
|
|||
return $holds->count();
|
||||
}
|
||||
|
||||
sub ArticleRequestsActiveCount {
|
||||
my ( $self, $biblionumber ) = @_;
|
||||
|
||||
my $ar = Koha::ArticleRequests->search(
|
||||
{
|
||||
biblionumber => $biblionumber
|
||||
}
|
||||
)->filter_by_current;
|
||||
|
||||
return $ar->count();
|
||||
}
|
||||
|
||||
sub CanArticleRequest {
|
||||
my ( $self, $biblionumber, $borrowernumber ) = @_;
|
||||
|
||||
|
|
|
|||
|
|
@ -86,7 +86,7 @@
|
|||
[%- ELSE -%]
|
||||
<li>
|
||||
[%- END -%]
|
||||
<a href="/cgi-bin/koha/circ/request-article.pl?biblionumber=[% IF ( object ) %][% object | uri %][% ELSE %][% biblionumber | uri %][% END %]">Article requests ([% Biblio.ArticleRequestsActiveCount( biblio_object_id ) | html %])</a>
|
||||
<a href="/cgi-bin/koha/circ/request-article.pl?biblionumber=[% IF ( object ) %][% object | uri %][% ELSE %][% biblionumber | uri %][% END %]">Article requests ([% biblio.article_requests.filter_by_current.count | html %])</a>
|
||||
</li>
|
||||
[%- END -%]
|
||||
|
||||
|
|
|
|||
|
|
@ -192,7 +192,7 @@
|
|||
</span>
|
||||
[% END %]
|
||||
|
||||
[% IF ( article_requests_count = Biblio.ArticleRequestsActiveCount( biblionumber ) ) %]
|
||||
[% IF ( article_requests_count = biblio.article_requests.filter_by_current.count ) %]
|
||||
<span class="results_summary">
|
||||
<span class="label">Article requests:</span>
|
||||
<span class="number_box">
|
||||
|
|
|
|||
Loading…
Reference in New Issue