Bugzilla – Attachment 132861 Details for
Bug 22347
Translatability of ILSDI results for getavaibility
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 22347: Translatability of ILSDI GetAvailability
Bug-22347-Translatability-of-ILSDI-GetAvailability.patch (text/plain), 5.20 KB, created by
Kyle M Hall (khall)
on 2022-04-01 12:49:15 UTC
(
hide
)
Description:
Bug 22347: Translatability of ILSDI GetAvailability
Filename:
MIME Type:
Creator:
Kyle M Hall (khall)
Created:
2022-04-01 12:49:15 UTC
Size:
5.20 KB
patch
obsolete
>From 67d9ed0408068eeede81ffdbc567ed8e000be90c Mon Sep 17 00:00:00 2001 >From: Marion Durand <marion.durand@biblibre.com> >Date: Wed, 29 Sep 2021 10:04:23 +0200 >Subject: [PATCH] Bug 22347: Translatability of ILSDI GetAvailability > >Some discovery tools can't translate ISL-DI results, it would be useful >if we can get ISL-DI output already translate. > >This patch add an optional parameter language to GetAvailability, and >make GetAvailability results translatable. >If no parameter is given the output language is the language of the >cookies is present or the first language in the opac language list. > >Test plan: >1. Enable the ILS-DI system preference >2. Locate a record >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. Test these URLs: > [OPACBASEURL]/cgi-bin/koha/ilsdi.pl?service=GetAvailability&id=[BIBLIONUMBER]&id_type=biblio&language=[LANGUAGE] > and > [OPACBASEURL]/cgi-bin/koha/ilsdi.pl?service=GetAvailability&id=[ITEMNUMBER]&id_type=item&language=[LANGUAGE] > (Where the [OPACBASEURL] is the OPAC URL of your test instance, > [BIBLIONUMBER] and [ITEMNUMBER] are a record number and item number of > your choice, [LANGUAGE] is a language code ex: 'en' or 'fr-FR') >6. The results should now be in the requested langugage > >Sponsored-by: University Lyon 3 > >Signed-off-by: Sonia <sonia.bouis@univ-lyon3.fr> >--- > C4/ILSDI/Services.pm | 16 +++++++++------- > .../opac-tmpl/bootstrap/en/modules/ilsdi.tt | 2 ++ > opac/ilsdi.pl | 2 +- > 3 files changed, 12 insertions(+), 8 deletions(-) > >diff --git a/C4/ILSDI/Services.pm b/C4/ILSDI/Services.pm >index 52585ac2dd..76632283c6 100644 >--- a/C4/ILSDI/Services.pm >+++ b/C4/ILSDI/Services.pm >@@ -956,8 +956,10 @@ sub _availability { > my ($itemnumber) = @_; > my $item = Koha::Items->find($itemnumber); > >+ use Koha::I18N; >+ > unless ( $item ) { >- return ( undef, 'unknown', 'Error: could not retrieve availability for this ID', undef ); >+ return ( undef, __('unknown'), __('Error: could not retrieve availability for this ID'), undef ); > } > > my $biblionumber = $item->biblioitemnumber; >@@ -966,17 +968,17 @@ sub _availability { > my $itemcallnumber = $item->itemcallnumber; > > if ( $item->notforloan ) { >- return ( $biblionumber, 'not available', 'Not for loan', $location, $itemcallnumber ); >+ return ( $biblionumber, __('not available'), __('Not for loan'), $location, $itemcallnumber ); > } elsif ( $item->onloan ) { >- return ( $biblionumber, 'not available', 'Checked out', $location, $itemcallnumber ); >+ return ( $biblionumber, __('not available'), __('Checked out'), $location, $itemcallnumber ); > } elsif ( $item->itemlost ) { >- return ( $biblionumber, 'not available', 'Item lost', $location, $itemcallnumber ); >+ return ( $biblionumber, __('not available'), __('Item lost'), $location, $itemcallnumber ); > } elsif ( $item->withdrawn ) { >- return ( $biblionumber, 'not available', 'Item withdrawn', $location, $itemcallnumber ); >+ return ( $biblionumber, __('not available'), __('Item withdrawn'), $location, $itemcallnumber ); > } elsif ( $item->damaged ) { >- return ( $biblionumber, 'not available', 'Item damaged', $location, $itemcallnumber ); >+ return ( $biblionumber, __('not available'), __('Item damaged'), $location, $itemcallnumber ); > } else { >- return ( $biblionumber, 'available', undef, $location, $itemcallnumber ); >+ 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 506617749e..5af7fdf14f 100644 >--- a/koha-tmpl/opac-tmpl/bootstrap/en/modules/ilsdi.tt >+++ b/koha-tmpl/opac-tmpl/bootstrap/en/modules/ilsdi.tt >@@ -124,6 +124,8 @@ > </dd> > <dt><strong>return_fmt</strong> (Optional)</dt> > <dd>requests a particular format or set of formats in reporting availability</dd> >+ <dt><strong>language (Optional)</strong></dt> >+ <dd>requests a particular language for the output, default is the opac cookie language if set, the first language in opac language list or english</dd> > </dl> > > <h3>Example call</h3> >diff --git a/opac/ilsdi.pl b/opac/ilsdi.pl >index 8613ac1267..5b105246fa 100755 >--- a/opac/ilsdi.pl >+++ b/opac/ilsdi.pl >@@ -100,7 +100,7 @@ my %required = ( > # List of optional arguments > my %optional = ( > 'Describe' => [], >- 'GetAvailability' => [ 'return_type', 'return_fmt' ], >+ 'GetAvailability' => [ 'return_type', 'return_fmt', 'language' ], > 'GetRecords' => ['schema'], > 'GetAuthorityRecords' => ['schema'], > 'LookupPatron' => ['id_type'], >-- >2.30.2
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 22347
:
126910
|
132545
|
132550
| 132861