Bugzilla – Attachment 58601 Details for
Bug 17844
Move C4::Koha::get_notforloan_label_of to Koha::AuthorisedValues
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 17844: Replace C4::Koha::get_notforloan_label_of with Koha::AuthorisedValues
Bug-17844-Replace-C4Kohagetnotforloanlabelof-with-.patch (text/plain), 4.06 KB, created by
Jonathan Druart
on 2017-01-04 20:29:30 UTC
(
hide
)
Description:
Bug 17844: Replace C4::Koha::get_notforloan_label_of with Koha::AuthorisedValues
Filename:
MIME Type:
Creator:
Jonathan Druart
Created:
2017-01-04 20:29:30 UTC
Size:
4.06 KB
patch
obsolete
>From c059756574884472407a0a26f0c15b84cfbfac67 Mon Sep 17 00:00:00 2001 >From: Jonathan Druart <jonathan.druart@bugs.koha-community.org> >Date: Wed, 4 Jan 2017 11:38:34 +0100 >Subject: [PATCH] Bug 17844: Replace C4::Koha::get_notforloan_label_of with > Koha::AuthorisedValues > >This patch is more a bugfix than a refactoring. >Indeed the C4::Koha::get_notforloan_label_of behaviors were buggy: >1/ It does not display the opac description at the OPAC, but always the >staff description >2/ It does not care of the framework of the biblio, but retrieve the >first row of the marc_subfield_structure mapped with items.notforloan > >These 2 bugs can easily be fixed using the >Koha::AuthorisedValues->search_by_koha_field > >Steps to recreate the issues: >- Create 2 authorised value categories for not for loan (NFL1 and NFL2) >with the same values. Define a different description for the OPAC. >- Define link 952$7 to NFL1 for the default framework and to NFL2 for >the BK framework >- Create 2 bibliographic records (B1 using NFL1 and B2 using NFL2) with >2 items each (1 item should have a not for loan value) >- Go to the "Place a hold" view for this record. >- In the item list, you should see the not for loan value >=> The staff description of NFL1 will always be used, even for the OPAC > >Test plan: >- Recreate the issues without this patchset >- Apply this patchset >- Recreate the steps to recreate the issues >=> The staff description of NFL2 should be displayed for the B2 item >=> The opac description of NFL2 should be displayed for the B2 item at >the OPAC >--- > opac/opac-reserve.pl | 8 ++++++-- > reserve/request.pl | 6 ++++-- > 2 files changed, 10 insertions(+), 4 deletions(-) > >diff --git a/opac/opac-reserve.pl b/opac/opac-reserve.pl >index f1fe2ff..c8495e5 100755 >--- a/opac/opac-reserve.pl >+++ b/opac/opac-reserve.pl >@@ -32,6 +32,7 @@ use C4::Context; > use C4::Members; > use C4::Overdues; > use C4::Debug; >+use Koha::AuthorisedValues; > use Koha::DateUtils; > use Koha::Libraries; > use Koha::Patrons; >@@ -367,7 +368,6 @@ unless ($noreserves) { > # and items for each biblionumber. > # > # >-my $notforloan_label_of = get_notforloan_label_of(); > > my $biblioLoop = []; > my $numBibsAvailable = 0; >@@ -389,9 +389,10 @@ foreach my $biblioNum (@biblionumbers) { > &get_out($query, $cookie, $template->output); > } > >+ my $frameworkcode = GetFrameworkCode( $biblioData->{biblionumber} ); > $biblioLoopIter{biblionumber} = $biblioData->{biblionumber}; > $biblioLoopIter{title} = $biblioData->{title}; >- $biblioLoopIter{subtitle} = GetRecordValue('subtitle', $record, GetFrameworkCode($biblioData->{biblionumber})); >+ $biblioLoopIter{subtitle} = GetRecordValue('subtitle', $record, $frameworkcode); > $biblioLoopIter{author} = $biblioData->{author}; > $biblioLoopIter{rank} = $biblioData->{rank}; > $biblioLoopIter{reservecount} = $biblioData->{reservecount}; >@@ -414,6 +415,9 @@ foreach my $biblioNum (@biblionumbers) { > } > } > >+ my @notforloan_avs = Koha::AuthorisedValues->search_by_koha_field({ kohafield => 'items.notforloan', frameworkcode => $frameworkcode }); >+ my $notforloan_label_of = { map { $_->authorised_value => $_->opac_description } @notforloan_avs }; >+ > $biblioLoopIter{itemLoop} = []; > my $numCopiesAvailable = 0; > my $numCopiesOPACAvailable = 0; >diff --git a/reserve/request.pl b/reserve/request.pl >index 3f4dba3..ff2821b 100755 >--- a/reserve/request.pl >+++ b/reserve/request.pl >@@ -321,11 +321,13 @@ foreach my $biblionumber (@biblionumbers) { > ## Should be same as biblionumber > my @biblioitemnumbers = keys %itemnumbers_of_biblioitem; > >- my $notforloan_label_of = get_notforloan_label_of(); >- > ## Hash of biblioitemnumber to 'biblioitem' table records > my $biblioiteminfos_of = GetBiblioItemInfosOf(@biblioitemnumbers); > >+ my $frameworkcode = GetFrameworkCode( $biblionumber ); >+ my @notforloan_avs = Koha::AuthorisedValues->search_by_koha_field({ kohafield => 'items.notforloan', frameworkcode => $frameworkcode }); >+ my $notforloan_label_of = { map { $_->authorised_value => $_->lib } @notforloan_avs }; >+ > my @bibitemloop; > > my @available_itemtypes; >-- >2.9.3
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 17844
:
58585
|
58586
|
58601
|
60012
|
60013
|
60980
|
60981