Bugzilla – Attachment 194435 Details for
Bug 26355
Allow patrons to self-renew through the OPAC
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 26355: (follow-up) Allow the 'Clear' button to remove empty messages
Bug-26355-follow-up-Allow-the-Clear-button-to-remo.patch (text/plain), 3.24 KB, created by
Matt Blenkinsop
on 2026-03-04 09:19:52 UTC
(
hide
)
Description:
Bug 26355: (follow-up) Allow the 'Clear' button to remove empty messages
Filename:
MIME Type:
Creator:
Matt Blenkinsop
Created:
2026-03-04 09:19:52 UTC
Size:
3.24 KB
patch
obsolete
>From 437f8c62cf2cd337f742e15691808a2ab72d562e Mon Sep 17 00:00:00 2001 >From: Matt Blenkinsop <matt.blenkinsop@openfifth.co.uk> >Date: Wed, 4 Mar 2026 09:19:14 +0000 >Subject: [PATCH] Bug 26355: (follow-up) Allow the 'Clear' button to remove > empty messages > >--- > .../prog/en/modules/admin/categories.tt | 23 ++++++++++++++----- > 1 file changed, 17 insertions(+), 6 deletions(-) > >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/categories.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/categories.tt >index 0b2b09c5bf0..9bc040286cd 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/categories.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/categories.tt >@@ -562,7 +562,7 @@ > [% ELSE %] > <textarea type="text" name="self_renewal_information_message" id="self_renewal_information_message_[% loop.index | html %]" cols="40" rows="4"></textarea> > [% END %] >- <a href="#" class="clear_message"><i class="fa fa-fw fa-trash-can"></i> Clear</a> >+ <a href="#" class="clear_message" data-clear-target="[% loop.index | html %]"><i class="fa fa-fw fa-trash-can"></i> Clear</a> > <a href="#" class="clone_message"><i class="fa fa-fw fa-plus"></i> New</a> > </li> > [% END %] >@@ -931,14 +931,19 @@ > <script> > var table_settings = [% TablesSettings.GetTableSettings( 'admin', 'categories', 'patron_categories', 'json' ) | $raw %]; > $(document).ready(function () { >+ function getTextareaFromParent(el) { >+ return $(el).children("textarea").eq(0); >+ }; > $("#category_form").on( > "click", > ".clone_message", > function (e) { > e.preventDefault(); >- var original = $(this).parent(); >- var clone = $(this).parent().clone(); >- $(clone).children("div.hint").remove() >+ const original = $(this).parent(); >+ const indexToIncrement = parseInt(getTextareaFromParent(original).prop("id").match(/\d+/g)); >+ const clone = $(this).parent().clone(); >+ $(clone).children("div.hint").remove(); >+ getTextareaFromParent(clone).prop("id", "self_renewal_information_message_" + (indexToIncrement + 1)); > $(original).after(clone); > return false; > } >@@ -948,8 +953,14 @@ > ".clear_message", > function (e) { > e.preventDefault(); >- var original = $(this).parent(); >- $("input", original).val(""); >+ const messageCount = $("textarea[name=self_renewal_information_message]").length >+ if(messageCount === 1) { >+ const original = $(this).parent(); >+ $("textarea", original).val(""); >+ } else { >+ const original = $(this).parent(); >+ $(original).remove(); >+ } > } > ); > }); >-- >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 26355
:
191781
|
191782
|
191783
|
191784
|
191785
|
191786
|
191787
|
191788
|
191789
|
192440
|
192441
|
192442
|
192443
|
192444
|
192445
|
192446
|
192447
|
192448
|
193065
|
193066
|
193067
|
193068
|
193069
|
193070
|
193071
|
193072
|
193073
|
193074
|
193249
|
193250
|
193251
|
193252
|
193253
|
193521
|
193522
|
193523
|
193524
|
193525
|
193526
|
193527
|
193528
|
193529
|
193581
|
193635
|
193654
|
193699
|
193756
|
193757
|
193758
|
193759
|
193760
|
193761
|
193762
|
193763
|
193764
|
193765
|
193921
|
194435
|
194464
|
194465
|
194466
|
194467
|
194468
|
194469
|
194470
|
194471
|
194472
|
194473
|
194474