Bugzilla – Attachment 140431 Details for
Bug 31550
ILS-DI: Add OPAC description for some item fields
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 31552: Add fields to get opac description on ILSDI web service
Bug-31552-Add-fields-to-get-opac-description-on-IL.patch (text/plain), 2.17 KB, created by
Thibaud Guillot (thibaud_g)
on 2022-09-12 09:28:39 UTC
(
hide
)
Description:
Bug 31552: Add fields to get opac description on ILSDI web service
Filename:
MIME Type:
Creator:
Thibaud Guillot (thibaud_g)
Created:
2022-09-12 09:28:39 UTC
Size:
2.17 KB
patch
obsolete
>From e618b742c79ba17b4418685c229e27dd1de244c0 Mon Sep 17 00:00:00 2001 >From: Thibaud Guillot <thibaud.guillot@biblibre.com> >Date: Mon, 12 Sep 2022 11:04:07 +0200 >Subject: [PATCH] Bug 31552: Add fields to get opac description on ILSDI web > service > >Test plan > >1) Active your ILS-DI syspref >2) Have some authorised values linked to one or more concern >fields >3) Choose an item and go to 'cgi-bin/koha/opac/ilsdi.pl?service=GetRecords&id=<itemId>' >4) The XML file contains item fields with some of them the code associated to the authorized values. >5) Apply this patch >6) Repeat step 3 and see the new fields with specific "_description" >suffix added and contains opac description from authorized values > >https://bugs.koha-community.org/show_bug.cgi?id=31550 >--- > C4/ILSDI/Services.pm | 13 +++++++++---- > 1 file changed, 9 insertions(+), 4 deletions(-) > >diff --git a/C4/ILSDI/Services.pm b/C4/ILSDI/Services.pm >index f6bf6bcc14..b8e23c4a5b 100644 >--- a/C4/ILSDI/Services.pm >+++ b/C4/ILSDI/Services.pm >@@ -253,10 +253,15 @@ sub GetRecords { > $item{'homebranchname'} = $home_library ? $home_library->branchname : ''; > $item{'holdingbranchname'} = $holding_library ? $holding_library->branchname : ''; > >- if ($item->location) { >- my $authorised_value = Koha::AuthorisedValues->find_by_koha_field({ kohafield => 'items.location', authorised_value => $item->location }); >- if ($authorised_value) { >- $item{location_description} = $authorised_value->opac_description; >+ my @item_fields_description = ( 'location', 'ccode', 'permanent_location', 'notforloan', 'itemlost', 'withdrawn', 'damaged', 'restricted' ); >+ >+ foreach (@item_fields_description) { >+ >+ if ( $item->$_ ) { >+ my $authorised_value = Koha::AuthorisedValues->find_by_koha_field( { kohafield => 'items.' . $_, authorised_value => $item->$_ } ); >+ if ($authorised_value) { >+ $item{ $_ . _description } = $authorised_value->opac_description; >+ } > } > } > >-- >2.25.1
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 31550
:
140431
|
140432
|
144979
|
145041
|
145042
|
154370
|
154371
|
154372
|
154373
|
154374
|
154858
|
154859
|
154860