Bugzilla – Attachment 78551 Details for
Bug 21327
Add a Modular Koha Core design
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 21327: Add Core::Community::Circulation
Bug-21327-Add-CoreCommunityCirculation.patch (text/plain), 3.58 KB, created by
Benjamin Rokseth
on 2018-09-10 21:44:39 UTC
(
hide
)
Description:
Bug 21327: Add Core::Community::Circulation
Filename:
MIME Type:
Creator:
Benjamin Rokseth
Created:
2018-09-10 21:44:39 UTC
Size:
3.58 KB
patch
obsolete
>From 794dfed616adad1610733e37e3e19d82fa556936 Mon Sep 17 00:00:00 2001 >From: Benjamin Rokseth <benjamin.rokseth@deichman.no> >Date: Sun, 9 Sep 2018 23:18:34 +0200 >Subject: [PATCH] Bug 21327: Add Core::Community::Circulation > >This is the Community subclass of Circulation that should be run as default >to handle the basic Circulation, and should be interchangable with today's functionality. >It also adds SIP integration. > >to use, add the following in the config section of koha-conf.xml: > <core_modules> > <circulation>Core::Community::Circulation</circulation> > <sip>Core::Community::Circulation::SIP</sip> > </core_modules> > >This is also the default if not set. >--- > Core/Community/Circulation.pm | 49 +++++++++++++++++++++++++++++++++++++++ > Core/Community/Circulation/SIP.pm | 37 +++++++++++++++++++++++++++++ > 2 files changed, 86 insertions(+) > create mode 100644 Core/Community/Circulation.pm > create mode 100644 Core/Community/Circulation/SIP.pm > >diff --git a/Core/Community/Circulation.pm b/Core/Community/Circulation.pm >new file mode 100644 >index 0000000..d7c29b2 >--- /dev/null >+++ b/Core/Community/Circulation.pm >@@ -0,0 +1,49 @@ >+package Core::Community::Circulation; >+ >+use strict; >+use warnings; >+ >+use Carp; >+use Data::Dumper; >+use C4::Circulation; >+ >+use Core::Exceptions; >+use parent qw( Core::Circulation Core::Prefs ); >+ >+=head >+ legacy support for C4::Circulation::AddReturn >+=cut >+sub Checkin { >+ my ($self, $exemptFine, $dropBox, $returnDate, $dropBoxDate) = @_; >+ my ($doreturn, $messages, $iteminformation, $borrower) = >+ C4::Circulation::AddReturn( $self->{item}->barcode, $self->{library}->branchcode, $exemptFine, $dropBox, $returnDate ); >+ $doreturn or $self->{error} = Core::Exception::Circulation::CheckinError->new(); >+ >+ $self->{messages} = $messages; >+ $self->{patron} = Koha::Patrons->find($borrower->{borrowernumber}); >+ return $self; >+} >+ >+=head >+ legacy support for C4::Circulation::AddIssue >+=cut >+sub Checkout { >+ my ($self, $dateDue, $cancelReserve, $issueDate, $sipMode, $params) = @_; >+ my $issue = C4::Circulation::AddIssue( $self->{patron}->unblessed, $self->{item}->barcode, $dateDue, $cancelReserve, $issueDate, $sipMode, $params ); >+ $self->{checkout} = $issue; >+ $issue or $self->{error} = Core::Exception::Circulation::CheckoutError->new(); >+ return $self; >+} >+ >+=head >+ legacy support for C4::Circulation::AddRenewal >+=cut >+ >+sub Renew { >+ my ($self, $dateDue, $lastRenewedDate) = @_; >+ my $newDateDue = C4::Circulation::AddRenewal( $self->{patron}->borrowernumber, $self->{item}->itemnumber, $self->{library}->branchcode, $dateDue, $lastRenewedDate); >+ $newDateDue or $self->{error} = Core::Exception::Circulation::RenewError->new(); >+ return $self, $newDateDue; >+} >+ >+1; >diff --git a/Core/Community/Circulation/SIP.pm b/Core/Community/Circulation/SIP.pm >new file mode 100644 >index 0000000..d00f6c1 >--- /dev/null >+++ b/Core/Community/Circulation/SIP.pm >@@ -0,0 +1,37 @@ >+package Core::Community::Circulation::SIP; >+ >+# Deichman SIP Overrides >+# Trying to stay sane >+ >+use strict; >+use warnings; >+ >+use Data::Dumper; >+use Carp; >+use DateTime; >+use Time::HiRes; >+use Koha::Items; >+use Koha::Patrons; >+use Koha::Libraries; >+ >+use parent "Core::Community::Circulation"; >+ >+sub testOverride { >+ warn "TEST: Core::Community::Circulation overridden from Core::Community::Circulation::SIP\n"; >+} >+ >+sub Checkin { >+ my ( $self, $returnDate ) = @_; >+ $self->SUPER::Checkin($returnDate); >+ >+ # SIP Server cannot handle multiple return messages? >+ return $self; >+} >+=head >+=cut >+sub Checkout { >+ my ( $self, $dateDue ) = @_; >+ return $self->SUPER::Checkout($dateDue); >+} >+ >+1; >-- >2.1.4
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 21327
:
78544
|
78545
|
78546
|
78547
|
78549
|
78550
| 78551 |
78552