From 3645d2b26b65dc41efa8cebbd9156333e845e4e6 Mon Sep 17 00:00:00 2001
From: Marion Durand
Date: Fri, 24 Sep 2021 09:15:37 +0200
Subject: [PATCH] Bug 28238: (follow-up) Add itemcallnumber to ILS-DI
GetAvailability output for unavailable items
Providing the call number for ILS-DI GetAvailability output is useful
for libraries that use discovery tools. Patrons often don't check
further for the call number, and then they don't have it when they look
for the item. It could also be use full to have this call number when
the item isn't available (to make a request for it for instance).
Test plan:
1. Enable the ILS-DI system preference
2. Locate a record with multiple items and make sure they have call
numbers for each item and that some are unavailable
3. Test these URLs:
[OPACBASEURL]/cgi-bin/koha/ilsdi.pl?service=GetAvailability&id=[BIBLIONUMBER]&id_type=biblio
and
[OPACBASEURL]/cgi-bin/koha/ilsdi.pl?service=GetAvailability&id=[ITEMNUMBER]&id_type=item
(Where the [OPACBASEURL] is the OPAC URL of your test instance,
[BIBLIONUMBER] and [ITEMNUMBER] are a record number and item number of
your choice.)
4. Apply the patch
5. Run the queries from step 3 again - all the results should now have
the tag itemcallnumber (not only the available's ones)
Example: 840.08 COR R
Sponsored-by: University Lyon 3
https://bugs.koha-community.org/show_bug.cgi?id=28238
Signed-off-by: David Nind
Signed-off-by: Katrin Fischer
Signed-off-by: Tomas Cohen Arazi
Signed-off-by: Fridolin Somers
---
C4/ILSDI/Services.pm | 10 +++++-----
koha-tmpl/opac-tmpl/bootstrap/en/modules/ilsdi.tt | 4 +++-
2 files changed, 8 insertions(+), 6 deletions(-)
diff --git a/C4/ILSDI/Services.pm b/C4/ILSDI/Services.pm
index 43986779c2..c7714dcd52 100644
--- a/C4/ILSDI/Services.pm
+++ b/C4/ILSDI/Services.pm
@@ -966,15 +966,15 @@ sub _availability {
my $itemcallnumber = $item->itemcallnumber;
if ( $item->notforloan ) {
- return ( $biblionumber, 'not available', 'Not for loan', $location );
+ return ( $biblionumber, 'not available', 'Not for loan', $location, $itemcallnumber );
} elsif ( $item->onloan ) {
- return ( $biblionumber, 'not available', 'Checked out', $location );
+ return ( $biblionumber, 'not available', 'Checked out', $location, $itemcallnumber );
} elsif ( $item->itemlost ) {
- return ( $biblionumber, 'not available', 'Item lost', $location );
+ return ( $biblionumber, 'not available', 'Item lost', $location, $itemcallnumber );
} elsif ( $item->withdrawn ) {
- return ( $biblionumber, 'not available', 'Item withdrawn', $location );
+ return ( $biblionumber, 'not available', 'Item withdrawn', $location, $itemcallnumber );
} elsif ( $item->damaged ) {
- return ( $biblionumber, 'not available', 'Item damaged', $location );
+ return ( $biblionumber, 'not available', 'Item damaged', $location, $itemcallnumber );
} else {
return ( $biblionumber, 'available', undef, $location, $itemcallnumber );
}
diff --git a/koha-tmpl/opac-tmpl/bootstrap/en/modules/ilsdi.tt b/koha-tmpl/opac-tmpl/bootstrap/en/modules/ilsdi.tt
index 1349ff6994..35a22f10c5 100644
--- a/koha-tmpl/opac-tmpl/bootstrap/en/modules/ilsdi.tt
+++ b/koha-tmpl/opac-tmpl/bootstrap/en/modules/ilsdi.tt
@@ -102,7 +102,7 @@
GetAvailability
Given a set of bibliographic or item identifiers, returns a
- list with availability of the items associated with the identifiers.
+ list with availability and call number of the items associated with the identifiers.
Parameters
@@ -146,6 +146,7 @@
<dlf:identifier>1</dlf:identifier>
<dlf:availabilitystatus>available</dlf:availabilitystatus>
<dlf:location>Bibliothèque Jean Prunier</dlf:location>
+ <dlf:itemcallnumber>iPR 8923 W6 L36 1990 c.1</dlf:itemcallnumber>
</dlf:simpleavailability>
</dlf:item>
</dlf:items>
@@ -158,6 +159,7 @@
<dlf:identifier>2</dlf:identifier>
<dlf:availabilitystatus>available</dlf:availabilitystatus>
<dlf:location>Bibliothèque Jean Prunier</dlf:location>
+ <dlf:itemcallnumber>iPR 8923 W6 L36 1990 c.2</dlf:itemcallnumber>
</dlf:simpleavailability>
</dlf:item>
</dlf:items>
--
2.20.1