Bugzilla – Attachment 126974 Details for
Bug 29288
Add current_checkouts and old_checkouts methods to Koha::Biblio
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 29288: Add current_checkouts and old_checkouts methods to Koha::Biblio
Bug-29288-Add-currentcheckouts-and-oldcheckouts-me.patch (text/plain), 2.07 KB, created by
Tomás Cohen Arazi (tcohen)
on 2021-10-27 11:46:12 UTC
(
hide
)
Description:
Bug 29288: Add current_checkouts and old_checkouts methods to Koha::Biblio
Filename:
MIME Type:
Creator:
Tomás Cohen Arazi (tcohen)
Created:
2021-10-27 11:46:12 UTC
Size:
2.07 KB
patch
obsolete
>From 257fd11d72d191d270d662c77b2aae8a861952b6 Mon Sep 17 00:00:00 2001 >From: Tomas Cohen Arazi <tomascohen@theke.io> >Date: Wed, 20 Oct 2021 18:02:01 -0300 >Subject: [PATCH] Bug 29288: Add current_checkouts and old_checkouts methods to > Koha::Biblio > >This patch adds helper methods for accessing current and past checkouts >for a given Koha::Biblio object. > >To test: >1. Apply the unit tests >2. Run: > $ kshell > k$ prove t/db_dependent/Koha/Biblio.t >=> FAIL: Methods are not implemented >3. Apply this patch >4. Repeat 2 >=> SUCCESS: Tests pass! >5. Sign off :-D > >Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io> >Signed-off-by: David Nind <david@davidnind.com> >Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> >--- > Koha/Biblio.pm | 32 ++++++++++++++++++++++++++++++++ > 1 file changed, 32 insertions(+) > >diff --git a/Koha/Biblio.pm b/Koha/Biblio.pm >index 29ba22d502..c4c12128af 100644 >--- a/Koha/Biblio.pm >+++ b/Koha/Biblio.pm >@@ -35,10 +35,12 @@ use Koha::Acquisition::Orders; > use Koha::ArticleRequests; > use Koha::Biblio::Metadatas; > use Koha::Biblioitems; >+use Koha::Checkouts; > use Koha::CirculationRules; > use Koha::Item::Transfer::Limits; > use Koha::Items; > use Koha::Libraries; >+use Koha::Old::Checkouts; > use Koha::Suggestions; > use Koha::Subscriptions; > use Koha::SearchEngine; >@@ -356,6 +358,36 @@ sub article_requests { > return Koha::ArticleRequests->_new_from_dbic( scalar $self->_result->article_requests ); > } > >+=head3 current_checkouts >+ >+ my $current_checkouts = $biblio->current_checkouts >+ >+Returns the current checkouts associated with this biblio >+ >+=cut >+ >+sub current_checkouts { >+ my ($self) = @_; >+ >+ return Koha::Checkouts->search( { "item.biblionumber" => $self->id }, >+ { join => 'item' } ); >+} >+ >+=head3 old_checkouts >+ >+ my $old_checkouts = $biblio->old_checkouts >+ >+Returns the past checkouts associated with this biblio >+ >+=cut >+ >+sub old_checkouts { >+ my ( $self ) = @_; >+ >+ return Koha::Old::Checkouts->search( { "item.biblionumber" => $self->id }, >+ { join => 'item' } ); >+} >+ > =head3 items > > my $items = $biblio->items(); >-- >2.32.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 29288
:
126614
|
126615
|
126629
|
126630
|
126642
|
126643
|
126973
| 126974