Bug 35248: Drop ->place_booking
These methods were introduced and used in an earlier iteration of the
code, they are no longer called from anywhere (the code in
Koha::Booking->store handles all cases instead) and thus I choose to
remove them rather than add unit tests for them.. They are simple
methods that could be re-introduced as required at a future date.
Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit 6b8c52104c)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
This commit is contained in:
parent
f0993713a5
commit
3f75be70b3
|
|
@ -321,46 +321,6 @@ sub assign_item_for_booking {
|
|||
return $bookable_items->single->itemnumber;
|
||||
}
|
||||
|
||||
=head3 place_booking
|
||||
|
||||
my $booking = $biblio->place_booking(
|
||||
{
|
||||
patron => $patron,
|
||||
start_date => $datetime,
|
||||
end_date => $datetime
|
||||
}
|
||||
);
|
||||
|
||||
Add a booking for this item for the dates passed.
|
||||
|
||||
Returns the Koha::Booking object or throws an exception if the item cannot be booked for the given dates.
|
||||
|
||||
=cut
|
||||
|
||||
sub place_booking {
|
||||
my ( $self, $params ) = @_;
|
||||
|
||||
# check for mandatory params
|
||||
my @mandatory = ( 'start_date', 'end_date', 'patron' );
|
||||
for my $param (@mandatory) {
|
||||
unless ( defined( $params->{$param} ) ) {
|
||||
Koha::Exceptions::MissingParameter->throw( error => "The $param parameter is mandatory" );
|
||||
}
|
||||
}
|
||||
my $patron = $params->{patron};
|
||||
|
||||
# New booking object
|
||||
my $booking = Koha::Booking->new(
|
||||
{
|
||||
start_date => $params->{start_date},
|
||||
end_date => $params->{end_date},
|
||||
patron_id => $patron->borrowernumber,
|
||||
biblio_id => $self->biblionumber
|
||||
}
|
||||
)->store();
|
||||
return $booking;
|
||||
}
|
||||
|
||||
=head3 can_be_transferred
|
||||
|
||||
$biblio->can_be_transferred({ to => $to_library, from => $from_library })
|
||||
|
|
|
|||
43
Koha/Item.pm
43
Koha/Item.pm
|
|
@ -535,7 +535,7 @@ Find the first booking that would conflict with the passed checkout dates for th
|
|||
FIXME: This can be simplified, it was originally intended to iterate all biblio level bookings
|
||||
to catch cases where this item may be the last available to satisfy a biblio level only booking.
|
||||
However, we dropped the biblio level functionality prior to push as bugs were found in it's
|
||||
implimentation.
|
||||
implementation.
|
||||
|
||||
=cut
|
||||
|
||||
|
|
@ -662,47 +662,6 @@ sub check_booking {
|
|||
return $bookings_count ? 0 : 1;
|
||||
}
|
||||
|
||||
=head3 place_booking
|
||||
|
||||
my $booking = $item->place_booking(
|
||||
{
|
||||
patron => $patron,
|
||||
start_date => $datetime,
|
||||
end_date => $datetime
|
||||
}
|
||||
);
|
||||
|
||||
Add a booking for this item for the dates passed.
|
||||
|
||||
Returns the Koha::Booking object or throws an exception if the item cannot be booked for the given dates.
|
||||
|
||||
=cut
|
||||
|
||||
sub place_booking {
|
||||
my ( $self, $params ) = @_;
|
||||
|
||||
# check for mandatory params
|
||||
my @mandatory = ( 'start_date', 'end_date', 'patron' );
|
||||
for my $param (@mandatory) {
|
||||
unless ( defined( $params->{$param} ) ) {
|
||||
Koha::Exceptions::MissingParameter->throw( error => "The $param parameter is mandatory" );
|
||||
}
|
||||
}
|
||||
my $patron = $params->{patron};
|
||||
|
||||
# New booking object
|
||||
my $booking = Koha::Booking->new(
|
||||
{
|
||||
start_date => $params->{start_date},
|
||||
end_date => $params->{end_date},
|
||||
patron_id => $patron->borrowernumber,
|
||||
biblio_id => $self->biblionumber,
|
||||
item_id => $self->itemnumber,
|
||||
}
|
||||
)->store();
|
||||
return $booking;
|
||||
}
|
||||
|
||||
=head3 request_transfer
|
||||
|
||||
my $transfer = $item->request_transfer(
|
||||
|
|
|
|||
Loading…
Reference in New Issue