Bugzilla – Attachment 178097 Details for
Bug 39038
CollapseFieldsPatronAddForm - Collapsing "Non-patron guarantor" section also collapses the "Patron guarantor" section
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 39038: Grep for exact matches for collapsed fields
Bug-39038-Grep-for-exact-matches-for-collapsed-fie.patch (text/plain), 6.62 KB, created by
Nick Clemens (kidclamp)
on 2025-02-14 14:41:57 UTC
(
hide
)
Description:
Bug 39038: Grep for exact matches for collapsed fields
Filename:
MIME Type:
Creator:
Nick Clemens (kidclamp)
Created:
2025-02-14 14:41:57 UTC
Size:
6.62 KB
patch
obsolete
>From 5fb30e3b12894e3912a891a046816950e9b6402a Mon Sep 17 00:00:00 2001 >From: Nick Clemens <nick@bywatersolutions.com> >Date: Fri, 14 Feb 2025 14:41:24 +0000 >Subject: [PATCH] Bug 39038: Grep for exact matches for collapsed fields > >This patch splits the CollapseFieldsPatronAddForm system preference >into a list in the template and then uses grep to find exact matches >for each field. > >Test plan: >1. Edit CollapseFieldsPatronAddForm system preference and > check the Non-patron guarantor and a few other fields, but > not Guarantor. >2. Go to add a patron that can have a guarantor. >3. Note both guarantor fields are collapsed. >4. Apply patch, reload/ >5. Note only expected fields are collapsed. >6. Confirm other fields continue to work as expected. > >Signed-off-by: David Nind <david@davidnind.com> >--- > .../prog/en/modules/members/memberentrygen.tt | 34 +++++++++---------- > 1 file changed, 17 insertions(+), 17 deletions(-) > >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/members/memberentrygen.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/members/memberentrygen.tt >index a4f415881b8..621fe2783d0 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/members/memberentrygen.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/members/memberentrygen.tt >@@ -235,11 +235,11 @@ > </div> > [% END %] > >- [% SET fieldstohide = Koha.Preference('CollapseFieldsPatronAddForm') %] >+ [% SET fieldstohide = Koha.Preference('CollapseFieldsPatronAddForm').split(',') %] > [% IF Koha.Preference('CollapseFieldsPatronAddForm') %][% UNLESS step %] > <p id="selections"> > <label><input type="checkbox" id="toggle_hidden_fields" title="These fields are collapsed by default by the CollapseFieldsPatronAddForm system preference" /><strong>Show collapsed fields:</strong></label> >- [% FOREACH field IN fieldstohide.split(',') %] >+ [% FOREACH field IN fieldstohide %] > [% SWITCH field %] > [% CASE 'identity' %] > <span>Patron identity</span> | >@@ -1696,74 +1696,74 @@ > function showHideFields(){ > $("#messaging_prefs_loading, #guarantor_template").hide(); > [% UNLESS step == 1 %] >- [% IF fieldstohide.match('identity') %] >+ [% IF fieldstohide.grep('^identity$').size %] > togglePanel( $("#identity_lgd") ); > [% END %] > [% IF show_guarantor || guarantor %] >- [% IF fieldstohide.match('guarantor') %] >+ [% IF fieldstohide.grep('^guarantor$').size %] > togglePanel( $("#patron_guarantor_lgd") ); > [% END %] >- [% IF fieldstohide.match('nonpatron_guarantor') %] >+ [% IF fieldstohide.grep('^nonpatron_guarantor$').size %] > togglePanel( $("#non_patron_guarantor_lgd") ); > [% END %] > [% END %] >- [% IF fieldstohide.match('primary_address') %] >+ [% IF fieldstohide.grep('^primary_address$').size %] > togglePanel( $("#main_address_lgd") ); > [% END %] >- [% IF fieldstohide.match('primary_contact') %] >+ [% IF fieldstohide.grep('^primary_contact$').size %] > togglePanel( $("#contact_lgd") ); > [% END %] > [% END %] > [% UNLESS step == 6 %] >- [% IF fieldstohide.match('alt_address') %] >+ [% IF fieldstohide.grep('^alt_address$').size %] > togglePanel( $("#alt_address_lgd") ); > [% END %] > [% END %] > [% UNLESS step == 2 %] >- [% IF fieldstohide.match('alt_contact') %] >+ [% IF fieldstohide.grep('^alt_contact$').size %] > togglePanel( $("#alt_contact_lgd") ); > [% END %] > [% END %] > [% UNLESS step == 3 %] >- [% IF fieldstohide.match('lib_mgmt') %] >+ [% IF fieldstohide.grep('^lib_mgmt$').size %] > togglePanel( $("#library_management_lgd") ); > [% END %] > [% UNLESS nodateenrolled && noopacnote && noborrowernotes %] >- [% IF fieldstohide.match('lib_setup') %] >+ [% IF fieldstohide.grep('^lib_setup$').size %] > togglePanel( $("#library_setup_lgd") ); > [% END %] > [% END %] > [% UNLESS nouserid && nopassword %] >- [% IF fieldstohide.match('login') %] >+ [% IF fieldstohide.grep('^login$').size %] > togglePanel( $("#opac_staff_login_lgd") ); > [% END %] > [% END %] > [% UNLESS ( op == 'add_form' || op == 'duplicate' ) %] >- [% IF fieldstohide.match('flags') %] >+ [% IF fieldstohide.grep('^flags$').size %] > togglePanel( $("#account_flags_lgd") ); > [% END %] > [% END %] >- [% IF fieldstohide.match('debarments') %] >+ [% IF fieldstohide.grep('^debarments$').size %] > togglePanel( $("#restrictions_lgd") ); > [% END %] > [% END %] > [% UNLESS step == 7 %] > [% IF Koha.Preference('HouseboundModule') %] >- [% IF fieldstohide.match('housebound') %] >+ [% IF fieldstohide.grep('^housebound$').size %] > togglePanel( $("#housebound_roles") ); > [% END %] > [% END %] > [% END %] > [% UNLESS step == 4 %] > [% IF Koha.Preference('ExtendedPatronAttributes') %] >- [% IF fieldstohide.match('additional') %] >+ [% IF fieldstohide.grep('^additional$').size %] > togglePanel( $("#patron_attributes_lgd") ); > [% END %] > [% END %] > [% END %] > [% UNLESS step == 5 %] > [% IF Koha.Preference('EnhancedMessagingPreferences') %] >- [% IF fieldstohide.match('messaging') %] >+ [% IF fieldstohide.grep('^messaging$').size %] > togglePanel( $("#patron_messaging_prefs_lgd") ); > $("#messaging_prefs_loading").toggle(); > [% END %] >-- >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 39038
:
177532
|
177554
|
178097
|
178446