From 67b1878c543cfd58c2dea1f96dc64d617ea4c503 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 --- C4/Reserves.pm | 4 +++- Koha/REST/V1/Holds.pm | 4 +++- api/v1/swagger/definitions/hold.json | 4 ++++ api/v1/swagger/paths/holds.json | 10 ++++++++++ 4 files changed, 20 insertions(+), 2 deletions(-) diff --git a/C4/Reserves.pm b/C4/Reserves.pm index 8e6dca8a39..c6f06f8c4f 100644 --- a/C4/Reserves.pm +++ b/C4/Reserves.pm @@ -160,7 +160,8 @@ sub AddReserve { my ( $branch, $borrowernumber, $biblionumber, $bibitems, $priority, $resdate, $expdate, $notes, - $title, $checkitem, $found, $itemtype + $title, $checkitem, $found, $itemtype, + $volume_id ) = @_; $resdate = output_pref( { str => dt_from_string( $resdate ), dateonly => 1, dateformat => 'iso' }) @@ -215,6 +216,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 7d181b927d..b5e47ad2b6 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}; @@ -172,7 +173,8 @@ sub add { $biblio->title, $item_id, undef, # TODO: Why not? - $item_type + $item_type, + $volume_id, ); unless ($hold_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 @@ -30,6 +30,12 @@ "description": "Internal biblio identifier", "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", @@ -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.21.1 (Apple Git-122.3)