@@ -, +, @@
article_requests_current
->article_requests->filter_by_current.
$ kshell
k$ prove t/db_dependent/Koha/Biblio.t
---
Koha/Biblio.pm | 28 ------
.../prog/en/modules/circ/request-article.tt | 6 +-
t/db_dependent/Koha/Biblio.t | 88 +------------------
3 files changed, 5 insertions(+), 117 deletions(-)
--- a/Koha/Biblio.pm
+++ a/Koha/Biblio.pm
@@ -354,34 +354,6 @@ sub article_requests {
return Koha::ArticleRequests->_new_from_dbic( scalar $self->_result->article_requests );
}
-=head3 article_requests_current
-
- my $current_article_requests = $biblio->article_requests_current
-
-Returns the article requests associated with this biblio that are incomplete
-
-=cut
-
-sub article_requests_current {
- my ( $self ) = @_;
-
- return $self->article_requests->filter_by_current;
-}
-
-=head3 article_requests_finished
-
- my $finished_article_requests = $biblio->article_requests_finished
-
-Returns the article requests associated with this biblio that are completed
-
-=cut
-
-sub article_requests_finished {
- my ( $self, $borrower ) = @_;
-
- return $self->article_requests->filter_by_finished;
-}
-
=head3 items
my $items = $biblio->items();
--- a/koha-tmpl/intranet-tmpl/prog/en/modules/circ/request-article.tt
+++ a/koha-tmpl/intranet-tmpl/prog/en/modules/circ/request-article.tt
@@ -1,5 +1,6 @@
[% USE raw %]
[% USE Asset %]
+[% USE Context %]
[% USE KohaDates %]
[% USE Branches %]
[% USE ItemTypes %]
@@ -284,7 +285,8 @@
[% END %]
- [% IF biblio.article_requests_current && !patron %]
+ [% SET biblio_current_article_requests = Context.Scalar( Context.Scalar( biblio, 'article_requests' ), 'filter_by_current' ) %]
+ [% IF biblio_current_article_requests.count > 0 && !patron %]