Bugzilla – Attachment 180756 Details for
Bug 38842
Refactor modal logic in returns.tt / returns.pl
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 38842: (follow-up) Fix TT filters in modal_wrapper
Bug-38842-follow-up-Fix-TT-filters-in-modalwrapper.patch (text/plain), 9.30 KB, created by
Paul Derscheid
on 2025-04-10 08:25:56 UTC
(
hide
)
Description:
Bug 38842: (follow-up) Fix TT filters in modal_wrapper
Filename:
MIME Type:
Creator:
Paul Derscheid
Created:
2025-04-10 08:25:56 UTC
Size:
9.30 KB
patch
obsolete
>From ac52ce09c86d6c2f13108368ce369da57029197d Mon Sep 17 00:00:00 2001 >From: Emily Lamancusa <emily.lamancusa@montgomerycountymd.gov> >Date: Thu, 20 Mar 2025 08:34:25 -0400 >Subject: [PATCH] Bug 38842: (follow-up) Fix TT filters in modal_wrapper > >Use html filters for most of the parameter variables, when possible. > >The following parameters do need to be used raw, as they are expected to >contain HTML code or complete url strings: >modal_action >modal_custom_confirm >modal_print_url >modal_custom_utility_button >modal_custom_deny >modal_footer_append > >If the caller includes any inputs from elsewhere in the above >parameters, the caller must filter those inputs using the appropriate >TT filter. > >This patch also adjusts the handling of header data so that only plain >text should be passed. > >Signed-off-by: Baptiste Wojtkowski <baptiste.wojtkowski@biblibre.com> >Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de> >--- > .../prog/en/includes/html_helpers.inc | 42 ++++++++++--------- > .../prog/en/modules/circ/returns.tt | 2 +- > 2 files changed, 23 insertions(+), 21 deletions(-) > >diff --git a/koha-tmpl/intranet-tmpl/prog/en/includes/html_helpers.inc b/koha-tmpl/intranet-tmpl/prog/en/includes/html_helpers.inc >index 17863d6b0b..012d0da641 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/includes/html_helpers.inc >+++ b/koha-tmpl/intranet-tmpl/prog/en/includes/html_helpers.inc >@@ -630,28 +630,30 @@ > [% END %] > > [% BLOCK modal_wrapper %] >- <div id="[% modal_id | $raw %]" class="modal modal-lg audio-alert-action [% IF noblock %]noblock[% ELSE %]block[% END %]" [% UNLESS noblock %]data-bs-backdrop="static" data-bs-keyboard="false"[% END %]> >+ <div id="[% modal_id | html %]" class="modal modal-lg audio-alert-action [% IF noblock %]noblock[% ELSE %]block[% END %]" [% UNLESS noblock %]data-bs-backdrop="static" data-bs-keyboard="false"[% END %]> > <div class="modal-dialog"> > <div class="modal-content"> >- <form class="modal-form" method="post" action="[% modal_action | $raw %]" id="[% modal_id | $raw %]-form"> >+ <form class="modal-form" method="post" action="[% modal_action | $raw %]" id="[% modal_id | html %]-form"> > [% INCLUDE 'csrf-token.inc' %] > >- <div class="modal-header" id="[% modal_id | $raw %]-header"> [% modal_header_contents | $raw %] </div> >- <div class="modal-body" id="[% modal_id | $raw %]-body"> [% content | $raw %] </div> >- <div class="modal-footer" id="[% modal_id | $raw %]-footer"> >+ <div class="modal-header" id="[% modal_id | html %]-header"> >+ <h1 class="modal-title"> [% modal_header_text | html %] </h1> >+ </div> >+ <div class="modal-body" id="[% modal_id | html %]-body"> [% content | $raw %] </div> >+ <div class="modal-footer" id="[% modal_id | html %]-footer"> > [% footer_has_content = 0 %] > > [% IF modal_confirm_text %] > <button > type="submit" > class="btn btn-default confirm" >- id="[% modal_id | $raw %]-confirm" >- [% IF modal_confirm_name %]name="[% modal_confirm_name | $raw %]"[% END %] >- [% IF modal_confirm_val %]value="[% modal_confirm_val | $raw %]"[% END %] >- [% IF modal_confirm_accesskey %]accesskey="[% modal_confirm_accesskey | $raw %]"[% END %] >+ id="[% modal_id | html %]-confirm" >+ [% IF modal_confirm_name %]name="[% modal_confirm_name | html %]"[% END %] >+ [% IF modal_confirm_val %]value="[% modal_confirm_val | html %]"[% END %] >+ [% IF modal_confirm_accesskey %]accesskey="[% modal_confirm_accesskey | html %]"[% END %] > > > <i class="fa fa-check"></i> >- [% modal_confirm_text | $raw %] [% IF modal_confirm_accesskey %]([% modal_confirm_accesskey | $raw %])[% END %] >+ [% modal_confirm_text | html %] [% IF modal_confirm_accesskey %]([% modal_confirm_accesskey | html %])[% END %] > </button> > [% footer_has_content = 1 %] > [% END %] >@@ -664,13 +666,13 @@ > type="button" > class="btn btn-default openWin" > data-bs-dismiss="modal" >- id="[% modal_id | $raw %]-print" >- [% IF modal_print_name %]name="[% modal_print_name | $raw %]"[% END %] >+ id="[% modal_id | html %]-print" >+ [% IF modal_print_name %]name="[% modal_print_name | html %]"[% END %] > data-url="[% modal_print_url | $raw %]" >- [% IF modal_print_accesskey %]accesskey="[% modal_print_accesskey | $raw %]"[% END %] >+ [% IF modal_print_accesskey %]accesskey="[% modal_print_accesskey | html %]"[% END %] > > > <i class="fa fa-print"></i> >- [% modal_print_text | $raw %] [% IF modal_print_accesskey %]([% modal_print_accesskey | $raw %])[% END %] >+ [% modal_print_text | html %] [% IF modal_print_accesskey %]([% modal_print_accesskey | html %])[% END %] > </button> > [% footer_has_content = 1 %] > [% END %] >@@ -683,13 +685,13 @@ > [% IF modal_deny_action == "submit" %]type="submit"[% ELSE %]type="button"[% END %] > [% IF modal_deny_action == "dismiss" %]data-bs-dismiss="modal"[% END %] > class="btn btn-default deny" >- id="[% modal_id | $raw %]-deny" >- [% IF modal_deny_name %]name="[% modal_deny_name | $raw %]"[% END %] >- [% IF modal_deny_val %]value="[% modal_deny_val | $raw %]"[% END %] >- [% IF modal_deny_accesskey %]accesskey="[% modal_deny_accesskey | $raw %]"[% END %] >+ id="[% modal_id | html %]-deny" >+ [% IF modal_deny_name %]name="[% modal_deny_name | html %]"[% END %] >+ [% IF modal_deny_val %]value="[% modal_deny_val | html %]"[% END %] >+ [% IF modal_deny_accesskey %]accesskey="[% modal_deny_accesskey | html %]"[% END %] > > > <i class="fa fa-times"></i> >- [% modal_deny_text | $raw %] [% IF modal_deny_accesskey %]([% modal_deny_accesskey | $raw %])[% END %] >+ [% modal_deny_text | html %] [% IF modal_deny_accesskey %]([% modal_deny_accesskey | html %])[% END %] > </button> > [% footer_has_content = 1 %] > [% END %] >@@ -702,7 +704,7 @@ > [% footer_has_content = 1 %] > [% END %] > [% IF !footer_has_content %] >- <button type="button" data-bs-dismiss="modal" class="btn btn-default" id="[% modal_id | $raw %]-ok">[% t('OK') | html %]</button> >+ <button type="button" data-bs-dismiss="modal" class="btn btn-default" id="[% modal_id | html %]-ok">[% t('OK') | html %]</button> > [% END %] > </div> > </form> >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/circ/returns.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/circ/returns.tt >index 2598e4554a..9462baadd1 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/circ/returns.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/circ/returns.tt >@@ -857,7 +857,7 @@ > [% SET modal_print_url = reserve_id | uri %] > [% modal_print_url = "/cgi-bin/koha/circ/hold-transfer-slip.pl?reserve_id=" _ modal_print_url %] > >- [% WRAPPER modal_wrapper modal_id="hold-found-modal" modal_header_contents='<h1 class="modal-title">' _ t('Hold found') _ '</h1>' modal_confirm_text=confirm_button_text modal_confirm_accesskey="Y" modal_custom_utility_button=print_button modal_deny_text= t('Ignore') modal_deny_accesskey="I" modal_deny_action="dismiss" %] >+ [% WRAPPER modal_wrapper modal_id="hold-found-modal" modal_header_text=t('Hold found') modal_confirm_text=confirm_button_text modal_confirm_accesskey="Y" modal_custom_utility_button=print_button modal_deny_text= t('Ignore') modal_deny_accesskey="I" modal_deny_action="dismiss" %] > <h1> > <a href="/cgi-bin/koha/catalogue/detail.pl?type=intra&biblionumber=[% itembiblionumber | uri %]">[% title | html %]</a> > <div class="hold-found-barcode"> (<a href="/cgi-bin/koha/catalogue/moredetail.pl?biblionumber=[% itembiblionumber | uri %]&itemnumber=[% itemnumber | uri %]">[% item.barcode | html %]</a>) </div> >-- >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 38842
:
178875
|
179084
|
179085
|
179086
|
179087
|
179127
|
179520
|
179521
|
179523
|
179524
|
179526
|
179538
|
179539
|
179540
|
179541
|
179542
|
180752
|
180753
|
180754
|
180755
| 180756