From fa22e37397f2274989105619c3dd4d1534324355 Mon Sep 17 00:00:00 2001 From: Kyle M Hall Date: Fri, 28 Feb 2020 14:45:44 -0500 Subject: [PATCH] Bug 24860: Implement reserves.volume_id Signed-off-by: Andrew Fuerste-Henry --- C4/Reserves.pm | 2 ++ Koha/REST/V1/Holds.pm | 2 ++ api/v1/swagger/definitions/hold.json | 4 ++++ api/v1/swagger/paths/holds.json | 10 ++++++++++ 4 files changed, 18 insertions(+) diff --git a/C4/Reserves.pm b/C4/Reserves.pm index 08b16893da..8a9659ef11 100644 --- a/C4/Reserves.pm +++ b/C4/Reserves.pm @@ -184,6 +184,7 @@ sub AddReserve { my $checkitem = $params->{itemnumber}; my $found = $params->{found}; my $itemtype = $params->{itemtype}; + my $volume_id = $params->{volume_id}; $resdate = output_pref( { str => dt_from_string( $resdate ), dateonly => 1, dateformat => 'iso' }) or output_pref({ dt => dt_from_string, dateonly => 1, dateformat => 'iso' }); @@ -237,6 +238,7 @@ sub AddReserve { { borrowernumber => $borrowernumber, biblionumber => $biblionumber, + volume_id => $volume_id, reservedate => $resdate, branchcode => $branch, priority => $priority, diff --git a/Koha/REST/V1/Holds.pm b/Koha/REST/V1/Holds.pm index a806d6757a..ffb4599864 100644 --- a/Koha/REST/V1/Holds.pm +++ b/Koha/REST/V1/Holds.pm @@ -78,6 +78,7 @@ sub add { my $biblio; my $biblio_id = $body->{biblio_id}; + my $volume_id = $body->{volume_id}; my $pickup_library_id = $body->{pickup_library_id}; my $item_id = $body->{item_id}; my $patron_id = $body->{patron_id}; @@ -173,6 +174,7 @@ sub add { itemnumber => $item_id, found => undef, # TODO: Why not? itemtype => $item_type, + volume_id => $volume_id, } ); diff --git a/api/v1/swagger/definitions/hold.json b/api/v1/swagger/definitions/hold.json index dda32600b3..bf21951fe7 100644 --- a/api/v1/swagger/definitions/hold.json +++ b/api/v1/swagger/definitions/hold.json @@ -18,6 +18,10 @@ "type": "integer", "description": "Internal biblio identifier" }, + "volume_id": { + "type": ["integer", "null"], + "description": "Internal volume identifier for the volume to place on hold" + }, "pickup_library_id": { "type": ["string", "null"], "description": "Internal library identifier for the pickup library" diff --git a/api/v1/swagger/paths/holds.json b/api/v1/swagger/paths/holds.json index 2bb0ed0179..89e5d72c36 100644 --- a/api/v1/swagger/paths/holds.json +++ b/api/v1/swagger/paths/holds.json @@ -31,6 +31,12 @@ "type": "integer" }, { + "name": "volume_id", + "in": "query", + "description": "Internal volume identifier for the volume to place on hold", + "type": "integer" + }, + { "name": "pickup_library_id", "in": "query", "description": "Internal library identifier for the pickup library", @@ -181,6 +187,10 @@ "description": "Internal biblio identifier", "type": [ "integer", "null" ] }, + "volume_id": { + "description": "Internal volume identifier for the volume to place on hold", + "type": [ "integer", "null" ] + }, "item_id": { "description": "Internal item identifier", "type": [ "integer", "null" ] -- 2.11.0