Bugzilla – Attachment 176616 Details for
Bug 37054
Allow for custom library colors in the staff interface
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 37054: Replace the TT plugin method with a more generic one
Bug-37054-Replace-the-TT-plugin-method-with-a-more.patch (text/plain), 2.01 KB, created by
Jonathan Druart
on 2025-01-16 10:13:45 UTC
(
hide
)
Description:
Bug 37054: Replace the TT plugin method with a more generic one
Filename:
MIME Type:
Creator:
Jonathan Druart
Created:
2025-01-16 10:13:45 UTC
Size:
2.01 KB
patch
obsolete
>From 0d1828e554cdaa2ec8c968804d632a3f65da6b65 Mon Sep 17 00:00:00 2001 >From: Jonathan Druart <jonathan.druart@bugs.koha-community.org> >Date: Thu, 16 Jan 2025 11:12:00 +0100 >Subject: [PATCH] Bug 37054: Replace the TT plugin method with a more generic > one > >Let's return the whole Koha::Library object so that it can be reusable >for another attribute. > >Keeping the CamelCase to be consistent with the rest of the other >methods in this file. >--- > Koha/Template/Plugin/Branches.pm | 16 +++++----------- > .../prog/en/includes/doc-head-close.inc | 2 +- > 2 files changed, 6 insertions(+), 12 deletions(-) > >diff --git a/Koha/Template/Plugin/Branches.pm b/Koha/Template/Plugin/Branches.pm >index 566faedfc2c..32429bbb00a 100644 >--- a/Koha/Template/Plugin/Branches.pm >+++ b/Koha/Template/Plugin/Branches.pm >@@ -45,6 +45,11 @@ sub GetName { > return $branchname; > } > >+sub GetLoggedInBranch { >+ my ($self) = @_; >+ return Koha::Libraries->find( $self->GetLoggedInBranchcode ); >+} >+ > sub GetLoggedInBranchcode { > my ($self) = @_; > >@@ -191,15 +196,4 @@ sub GetBranchSpecificCSS { > return $opacusercss; > } > >-sub get_library_color { >- my ( $self, $branchcode ) = @_; >- >- return q{} unless defined $branchcode; >- >- my $library = Koha::Libraries->find($branchcode); >- my $library_color = $library ? $library->library_color : q{}; >- >- return $library_color; >-} >- > 1; >diff --git a/koha-tmpl/intranet-tmpl/prog/en/includes/doc-head-close.inc b/koha-tmpl/intranet-tmpl/prog/en/includes/doc-head-close.inc >index 5d213da393e..03cc44c4811 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/includes/doc-head-close.inc >+++ b/koha-tmpl/intranet-tmpl/prog/en/includes/doc-head-close.inc >@@ -51,7 +51,7 @@ var Koha = {}; > [% IF ( login ) %] > [% Asset.css("css/login.css") | $raw %] > [% END %] >-[% SET library_color = Branches.get_library_color( Branches.GetLoggedInBranchcode() ) %] >+[% SET library_color = Branches.GetLoggedInBranch.library_color %] > [% IF library_color %] > <style> > #header_search, >-- >2.34.1
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 37054
:
167577
|
167578
|
167579
|
167590
|
167595
|
167596
|
167597
|
167598
|
167609
|
167612
|
167613
|
167614
|
167615
|
167616
|
167618
|
167625
|
171221
|
171222
|
171223
|
171224
|
171225
|
171226
|
175991
|
175992
|
175993
|
175994
|
175995
|
175996
|
176014
|
176015
|
176016
|
176615
|
176616
|
180329
|
180330
|
180331
|
180332
|
180333
|
180334