Bugzilla – Attachment 191194 Details for
Bug 39142
Add debug permission to allow user to toggle JS and CSS customizations on/off
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 39142: Remove Koha::Template::Plugin::debug_flag
Bug-39142-Remove-KohaTemplatePlugindebugflag.patch (text/plain), 2.80 KB, created by
Lucas Gass (lukeg)
on 2026-01-09 16:00:38 UTC
(
hide
)
Description:
Bug 39142: Remove Koha::Template::Plugin::debug_flag
Filename:
MIME Type:
Creator:
Lucas Gass (lukeg)
Created:
2026-01-09 16:00:38 UTC
Size:
2.80 KB
patch
obsolete
>From a809d8acb37498336cf273bece47f66fdfd49bdd Mon Sep 17 00:00:00 2001 >From: Jonathan Druart <jonathan.druart@bugs.koha-community.org> >Date: Fri, 9 Jan 2026 16:48:17 +0100 >Subject: [PATCH] Bug 39142: Remove Koha::Template::Plugin::debug_flag > >Signed-off-by: Lucas Gass <lucas@bywatersolutions.com> >--- > Koha/Template/Plugin/Koha.pm | 20 ------------------- > .../intranet-tmpl/prog/en/includes/header.inc | 2 +- > .../prog/en/includes/intranet-bottom.inc | 2 +- > 3 files changed, 2 insertions(+), 22 deletions(-) > >diff --git a/Koha/Template/Plugin/Koha.pm b/Koha/Template/Plugin/Koha.pm >index 992b1974ecc..11ed0cecf37 100644 >--- a/Koha/Template/Plugin/Koha.pm >+++ b/Koha/Template/Plugin/Koha.pm >@@ -87,26 +87,6 @@ sub MultivaluePreference { > return C4::Context->multivalue_preference($pref); > } > >-=head3 debug_flag >- >-This method checks if the currently logged in user is allowed >-access to the new debug ui permission. It should return >-0 if no one is logged in or context is unavailable for some other reason >- or they do not have the permission >-1 if they are a superlibrarian >-1<<32 if they do have the permission >- >-=cut >- >-sub debug_flag { >- return 0 unless C4::Context->userenv(); >- return 1 if C4::Context->IsSuperLibrarian(); >- my $flags = C4::Context->userenv()->{'flags'}; >- my $mask = 1 << 32; >- return $flags & $mask; >- >-} >- > =head3 CSVDelimiter > > The delimiter option 'tabs' is stored in the DB as 'tabulation' to avoid issues >diff --git a/koha-tmpl/intranet-tmpl/prog/en/includes/header.inc b/koha-tmpl/intranet-tmpl/prog/en/includes/header.inc >index 5b00a098c0d..089e8d6c05a 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/includes/header.inc >+++ b/koha-tmpl/intranet-tmpl/prog/en/includes/header.inc >@@ -248,7 +248,7 @@ > </li> > </ul> > </li> >- [% IF Koha.debug_flag %] >+ [% IF logged_in_user.has_permission({debug => 1}) %] > <li class="nav-item dropdown" id="debug-controls-dropdown"> > <a id="debug-controls-menu" href="#" class="nav-link dropdown-toggle" role="button" data-bs-toggle="dropdown" aria-expanded="false" title="Debug controls"> > <i id="debug-icon" class="fa fa-bug"></i> >diff --git a/koha-tmpl/intranet-tmpl/prog/en/includes/intranet-bottom.inc b/koha-tmpl/intranet-tmpl/prog/en/includes/intranet-bottom.inc >index 0ce745868b3..b093bfc8125 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/includes/intranet-bottom.inc >+++ b/koha-tmpl/intranet-tmpl/prog/en/includes/intranet-bottom.inc >@@ -186,7 +186,7 @@ > [% END %] > [% END %] > >-[% IF Koha.debug_flag %] >+[% IF logged_in_user.has_permission({debug => 1}) %] > <script> > (function () { > function getURLParams() { >-- >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 39142
:
178123
|
178294
|
178481
|
178482
|
183392
|
183393
|
186913
|
186914
|
186915
|
186916
|
187061
|
189754
|
189755
|
189756
|
189757
|
189758
|
189759
|
191081
|
191193
| 191194