Bugzilla – Attachment 178385 Details for
Bug 32051
Rename 'Library' page link to 'Contact' for single library
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 32051: Rename Library to Contact for one public library
Bug-32051-Rename-Library-to-Contact-for-one-public.patch (text/plain), 4.04 KB, created by
Marcel de Rooy
on 2025-02-20 09:30:39 UTC
(
hide
)
Description:
Bug 32051: Rename Library to Contact for one public library
Filename:
MIME Type:
Creator:
Marcel de Rooy
Created:
2025-02-20 09:30:39 UTC
Size:
4.04 KB
patch
obsolete
>From 23850f8e35550a4583c4c09c6d9d9215f2d9e1b7 Mon Sep 17 00:00:00 2001 >From: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> >Date: Thu, 20 Feb 2025 08:14:22 +0000 >Subject: [PATCH] Bug 32051: Rename Library to Contact for one public library >Content-Type: text/plain; charset=utf-8 > >Note: >I am using $rs in the script to prevent searching branches again >unneeded. And pass public_count to opac-library.tt to prevent >another call of Branches.all (for bread crumbs), like masthead >already does btw. > >Test plan: >[1] Have two (or more) public libraries. >Verify that you see Libraries on the OPAC home page and that when >clicking Libraries, you first have the library list. Are the bread >crumbs as expected? >Click a library on that list. Do you get its details? Are the bread >crumbs as expected? > >[2] Now have only one public library. >Verify that you see Contact on the home page. >And that when clicking Contact you go directly to the library details >without the intermediate library list. Are the bread crumbs still >as expected (with Contact instead of Libraries)? > >Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> >--- > koha-tmpl/opac-tmpl/bootstrap/en/includes/masthead.inc | 2 +- > koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-library.tt | 6 +++++- > opac/opac-library.pl | 9 +++++---- > 3 files changed, 11 insertions(+), 6 deletions(-) > >diff --git a/koha-tmpl/opac-tmpl/bootstrap/en/includes/masthead.inc b/koha-tmpl/opac-tmpl/bootstrap/en/includes/masthead.inc >index e624134bf5..911c774de6 100644 >--- a/koha-tmpl/opac-tmpl/bootstrap/en/includes/masthead.inc >+++ b/koha-tmpl/opac-tmpl/bootstrap/en/includes/masthead.inc >@@ -427,7 +427,7 @@ > <li class="nav-item"> > <a id="library_page" href="/cgi-bin/koha/opac-library.pl"> > [% IF ( singleBranchMode || AllPublicBranches.size == 1 ) %] >- <span>Library</span> >+ <span>Contact</span> > [% ELSE %] > <span>Libraries</span> > [% END %] >diff --git a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-library.tt b/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-library.tt >index 5eb981e67c..13bf3234d6 100644 >--- a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-library.tt >+++ b/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-library.tt >@@ -62,7 +62,11 @@ > [% WRAPPER breadcrumbs %] > [% IF ( library ) %] > [% WRAPPER breadcrumb_item %] >- <a href="/cgi-bin/koha/opac-library.pl">Libraries</a> >+ [% IF public_count > 1 %] >+ <a href="/cgi-bin/koha/opac-library.pl">Libraries</a> >+ [% ELSE %] >+ <a href="/cgi-bin/koha/opac-library.pl">Contact</a> >+ [% END %] > [% END %] > [% WRAPPER breadcrumb_item bc_active= 1 %] > [% library.branchname | html %] >diff --git a/opac/opac-library.pl b/opac/opac-library.pl >index ff3c079845..46833dff89 100755 >--- a/opac/opac-library.pl >+++ b/opac/opac-library.pl >@@ -45,16 +45,17 @@ my ( $template, $borrowernumber, $cookie ) = get_template_and_user( > ); > > my $library; >-if ( $template->{VARS}->{singleBranchMode} ) { >- $library = Koha::Libraries->search( { public => 1 } )->next; >+my $libraries = Koha::Libraries->search( { public => 1 }, { order_by => ['branchname'] } ); >+$template->param( public_count => $libraries->count ); >+if ( $template->{VARS}->{singleBranchMode} || $libraries->count == 1 ) { >+ $library = $libraries->next; > } elsif ($branchcode) { >- $library = Koha::Libraries->search( { branchcode => $branchcode, public => 1 } )->next; >+ $library = $libraries->search( { branchcode => $branchcode } )->next; > } > > if ($library) { > $template->param( library => $library ); > } else { >- my $libraries = Koha::Libraries->search( { public => 1 }, { order_by => ['branchname'] } ); > $template->param( > libraries => $libraries, > branchcode => C4::Context->userenv ? C4::Context->userenv->{branch} : q{}, >-- >2.39.5
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 32051
:
178385
|
178403
|
178404
|
179051
|
179052