Bugzilla – Attachment 188396 Details for
Bug 41086
Add a helper method to C4/Scrubber to be able to pass allowed tags back to the template
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 41086: Add way to get allowed tags from C4/Scrubber
Bug-41086-Add-way-to-get-allowed-tags-from-C4Scrub.patch (text/plain), 3.13 KB, created by
Lucas Gass (lukeg)
on 2025-10-23 21:12:02 UTC
(
hide
)
Description:
Bug 41086: Add way to get allowed tags from C4/Scrubber
Filename:
MIME Type:
Creator:
Lucas Gass (lukeg)
Created:
2025-10-23 21:12:02 UTC
Size:
3.13 KB
patch
obsolete
>From d12cacda1a0a860c0df947c91686de941a5c1fb1 Mon Sep 17 00:00:00 2001 >From: Lucas Gass <lucas@bywatersolutions.com> >Date: Thu, 23 Oct 2025 21:10:30 +0000 >Subject: [PATCH] Bug 41086: Add way to get allowed tags from C4/Scrubber > >--- > C4/Scrubber.pm | 6 ++++++ > .../intranet-tmpl/prog/en/modules/tools/letter.tt | 12 ++++++++++++ > tools/letter.pl | 14 +++++++++++--- > 3 files changed, 29 insertions(+), 3 deletions(-) > >diff --git a/C4/Scrubber.pm b/C4/Scrubber.pm >index 8086c43ad9d..8acc3a61639 100644 >--- a/C4/Scrubber.pm >+++ b/C4/Scrubber.pm >@@ -142,6 +142,12 @@ sub new { > return $scrubber; > } > >+sub get_allowed_list { >+ my ( $self, $profile ) = @_; >+ my $rules = $scrubbertypes{$profile}; >+ return $rules->{allow}; >+} >+ > 1; > __END__ > >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/tools/letter.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/tools/letter.tt >index 6ec0ce10799..2f4e2b50895 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/tools/letter.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/tools/letter.tt >@@ -519,6 +519,18 @@ > <input type="text" id="name" name="name" size="60" value="[% letter_name | html %]" required="required" /> > <span class="required">Required</span> > </li> >+ [% IF code == "VIRTUALCARD" && allowed_html %] >+ <li> >+ <label for="allowed_html">Allowed HTML:</label> >+ <div id="allowed_html"> >+ <div> >+ [% FOREACH allowed IN allowed_html %] >+ <code>[% allowed | html %]</code> >+ [% END %] >+ </div> >+ </div> >+ </li> >+ [% END %] > [% IF code and preview_is_available %] > <li> > <label for="name">Data for preview:</label> >diff --git a/tools/letter.pl b/tools/letter.pl >index 631cfa2646d..84d9eb49b11 100755 >--- a/tools/letter.pl >+++ b/tools/letter.pl >@@ -46,9 +46,10 @@ use Try::Tiny; > > use C4::Auth qw( get_template_and_user ); > use C4::Context; >-use C4::Output qw( output_html_with_http_headers ); >-use C4::Letters qw( GetMessageTransportTypes ); >-use C4::Log qw( logaction ); >+use C4::Output qw( output_html_with_http_headers ); >+use C4::Letters qw( GetMessageTransportTypes ); >+use C4::Log qw( logaction ); >+use C4::Scrubber qw( get_allowed_list ); > use Koha::Notice::Templates; > use Koha::Patron::Attribute::Types; > >@@ -304,6 +305,13 @@ sub add_form { > $preview_is_available = grep { $_ eq $code } qw( CHECKIN CHECKOUT HOLD_SLIP ); > } > >+ if ( $code && $code eq 'VIRTUALCARD' ) { >+ my $allowed_html = C4::Scrubber->get_allowed_list('opac'); >+ $template->param( >+ allowed_html => $allowed_html, >+ ); >+ } >+ > $template->param( > module => $module, > SQLfieldnames => $field_selection, >-- >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 41086
: 188396