Bugzilla – Attachment 161042 Details for
Bug 35789
Remove Koha::Template::Plugin::Biblio::ArticleRequestsActiveCount
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 35789: Remove Koha::Template::Plugin::Biblio::ArticleRequestsActiveCount
Bug-35789-Remove-KohaTemplatePluginBiblioArticleRe.patch (text/plain), 3.27 KB, created by
Tomás Cohen Arazi
on 2024-01-15 14:00:38 UTC
(
hide
)
Description:
Bug 35789: Remove Koha::Template::Plugin::Biblio::ArticleRequestsActiveCount
Filename:
MIME Type:
Creator:
Tomás Cohen Arazi
Created:
2024-01-15 14:00:38 UTC
Size:
3.27 KB
patch
obsolete
>From 0edec64eff1dd0e17e6dc020b33d6acdcade775e Mon Sep 17 00:00:00 2001 >From: Jonathan Druart <jonathan.druart@bugs.koha-community.org> >Date: Fri, 12 Jan 2024 14:34:18 +0100 >Subject: [PATCH] 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> >--- > Koha/Template/Plugin/Biblio.pm | 13 ------------- > .../prog/en/includes/biblio-view-menu.inc | 2 +- > .../prog/en/modules/catalogue/detail.tt | 2 +- > 3 files changed, 2 insertions(+), 15 deletions(-) > >diff --git a/Koha/Template/Plugin/Biblio.pm b/Koha/Template/Plugin/Biblio.pm >index b8f38a61f4e..090fc071e09 100644 >--- a/Koha/Template/Plugin/Biblio.pm >+++ b/Koha/Template/Plugin/Biblio.pm >@@ -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 ) = @_; > >diff --git a/koha-tmpl/intranet-tmpl/prog/en/includes/biblio-view-menu.inc b/koha-tmpl/intranet-tmpl/prog/en/includes/biblio-view-menu.inc >index bac3667c3db..74008ba1176 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/includes/biblio-view-menu.inc >+++ b/koha-tmpl/intranet-tmpl/prog/en/includes/biblio-view-menu.inc >@@ -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 -%] > >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/detail.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/detail.tt >index ccdcb8ed251..32830e7d91a 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/detail.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/detail.tt >@@ -191,7 +191,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"> >-- >2.43.0
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
|
Splinter Review
Attachments on
bug 35789
:
160972
| 161042