Bugzilla – Attachment 47707 Details for
Bug 15629
Move the C4::Branch related code to Koha::Libraries - part 3
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 15629: Koha::Libraries - Remove GetBranchesInCategory (2)
Bug-15629-KohaLibraries---Remove-GetBranchesInCate.patch (text/plain), 2.17 KB, created by
Kyle M Hall (khall)
on 2016-02-05 16:22:21 UTC
(
hide
)
Description:
Bug 15629: Koha::Libraries - Remove GetBranchesInCategory (2)
Filename:
MIME Type:
Creator:
Kyle M Hall (khall)
Created:
2016-02-05 16:22:21 UTC
Size:
2.17 KB
patch
obsolete
>From 084a2f686d9690893a3bcff610b49693047d514d Mon Sep 17 00:00:00 2001 >From: Jonathan Druart <jonathan.druart@bugs.koha-community.org> >Date: Wed, 20 Jan 2016 11:22:07 +0000 >Subject: [PATCH] Bug 15629: Koha::Libraries - Remove GetBranchesInCategory (2) > >C4::Branch::GetBranchesInCategory can be replaced with >Koha::LibraryCategory->libraries > >Test plan: >1/ Define some 1+ group of libraries with 1+ libraries each >2/ Go on the advanced search (OPAC and Staff) and select a group of >libraries >3/ The result should be consistent and only include record from these >libraries > >Signed-off-by: Owen Leonard <oleonard@myacpl.org> > >Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com> >--- > catalogue/search.pl | 4 +++- > opac/opac-search.pl | 4 +++- > 2 files changed, 6 insertions(+), 2 deletions(-) > >diff --git a/catalogue/search.pl b/catalogue/search.pl >index 25b9855..dbc12d2 100755 >--- a/catalogue/search.pl >+++ b/catalogue/search.pl >@@ -423,7 +423,9 @@ my %is_nolimit = map { $_ => 1 } @nolimits; > @limits = grep { not $is_nolimit{$_} } @limits; > > if($params->{'multibranchlimit'}) { >- my $multibranch = '('.join( " or ", map { "branch: $_ " } @{ GetBranchesInCategory( $params->{'multibranchlimit'} ) } ).')'; >+ my $library_category = Koha::LibraryCategories->find( $params->{multibranchlimit} ); >+ my @libraries = $library_category->libraries; >+ my $multibranch = '('.join( " or ", map { 'branch: ' . $_->branchcode } @libraries ) .')'; > push @limits, $multibranch if ($multibranch ne '()'); > } > >diff --git a/opac/opac-search.pl b/opac/opac-search.pl >index 8157e7d..4a865da 100755 >--- a/opac/opac-search.pl >+++ b/opac/opac-search.pl >@@ -480,7 +480,9 @@ if (@searchCategories > 0) { > @limits = map { uri_unescape($_) } @limits; > > if($params->{'multibranchlimit'}) { >- my $multibranch = '('.join( " or ", map { "branch: $_ " } @{ GetBranchesInCategory( $params->{'multibranchlimit'} ) } ).')'; >+ my $library_category = Koha::LibraryCategories->find( $params->{multibranchlimit} ); >+ my @libraries = $library_category->libraries; >+ my $multibranch = '('.join( " or ", map { 'branch: ' . $_->branchcode } @libraries ) .')'; > push @limits, $multibranch if ($multibranch ne '()'); > } > >-- >2.1.4
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 15629
:
46997
|
46998
|
46999
|
47000
|
47001
|
47002
|
47518
|
47519
|
47520
|
47521
|
47522
|
47523
|
47553
|
47701
|
47706
| 47707 |
47708
|
47709
|
47710
|
47711
|
47712
|
47713