Bugzilla – Attachment 141824 Details for
Bug 31775
Show opac_info of single library
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 31775: Show single library
Bug-31775-Show-single-library.patch (text/plain), 1.81 KB, created by
Marcel de Rooy
on 2022-10-13 14:21:46 UTC
(
hide
)
Description:
Bug 31775: Show single library
Filename:
MIME Type:
Creator:
Marcel de Rooy
Created:
2022-10-13 14:21:46 UTC
Size:
1.81 KB
patch
obsolete
>From a87a2e3d849284410988c81b21d0123a9ad4dcf6 Mon Sep 17 00:00:00 2001 >From: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> >Date: Thu, 13 Oct 2022 14:49:31 +0200 >Subject: [PATCH] Bug 31775: Show single library >Content-Type: text/plain; charset=utf-8 > >Test plan: >Check both cases: one library (public accessible) and more >libraries (public accessible). In the latter case click on >one of these libraries too. > >Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> >--- > opac/opac-library.pl | 20 ++++++++++---------- > 1 file changed, 10 insertions(+), 10 deletions(-) > >diff --git a/opac/opac-library.pl b/opac/opac-library.pl >index fda1956278..24611a1980 100755 >--- a/opac/opac-library.pl >+++ b/opac/opac-library.pl >@@ -21,6 +21,7 @@ use Modern::Perl; > > use CGI qw ( -utf8 ); > use C4::Auth qw( get_template_and_user ); >+use C4::Context; > use C4::Output qw( output_html_with_http_headers ); > use Koha::Libraries; > >@@ -37,21 +38,20 @@ my ( $template, $borrowernumber, $cookie ) = get_template_and_user( > } > ); > >-my $found; >-if ($branchcode) { >- my $library = Koha::Libraries->find($branchcode); >- if ( $library && $library->public ) { >- $found++; >- $template->param( library => $library ); >- } >+my $library; >+if( $template->{VARS}->{singleBranchMode} ) { >+ $library = Koha::Libraries->search({ public => 1 })->next; >+} elsif( $branchcode ) { >+ $library = Koha::Libraries->search({ branchcode => $branchcode, public => 1 })->next; > } > >-unless ($found) { >+if( $library ) { >+ $template->param( library => $library ); >+} else { > my $libraries = Koha::Libraries->search( { public => 1 }, { order_by => ['branchname'] } ); >- > $template->param( > libraries => $libraries, >- branchcode => $branchcode, >+ branchcode => C4::Context->userenv ? C4::Context->userenv->{branch} : q{}, > ); > } > >-- >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 31775
:
141824
|
141825
|
141871
|
141872
|
141933
|
141934