Bugzilla – Attachment 78546 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]
Add crude Core::Community::Circulation
Add-crude-CoreCommunityCirculation.patch (text/plain), 3.45 KB, created by
Benjamin Rokseth
on 2018-09-10 19:10:39 UTC
(
hide
)
Description:
Add crude Core::Community::Circulation
Filename:
MIME Type:
Creator:
Benjamin Rokseth
Created:
2018-09-10 19:10:39 UTC
Size:
3.45 KB
patch
obsolete
>From e68cde3ff9a2c1a0c03d1bf2891d8b2f1864af18 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] Add crude 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 todays >functionality. > >https://bugs.koha-community.org/show_bug.cgi?id=21327 >--- > Core/Community/Circulation.pm | 54 +++++++++++++++++++++++++++++++++++++++ > Core/Community/Circulation/SIP.pm | 37 +++++++++++++++++++++++++++ > 2 files changed, 91 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..35158a1 >--- /dev/null >+++ b/Core/Community/Circulation.pm >@@ -0,0 +1,54 @@ >+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 ); >+ unless ($doreturn) { >+ $self->{error} = Core::Exception::Circulation::CheckinError->new(); >+ } >+ $self->{messages} = $messages; # override with messages from AddReturn >+ $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; >+ unless ($issue) { >+ $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); >+ unless ($newDateDue) { >+ $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