Bugzilla – Attachment 177532 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 exacpt matches for collapsed fields
Bug-39038-Grep-for-exacpt-matches-for-collapsed-fi.patch (text/plain), 6.71 KB, created by
Nick Clemens (kidclamp)
on 2025-02-05 13:10:52 UTC
(
hide
)
Description:
Bug 39038: Grep for exacpt matches for collapsed fields
Filename:
MIME Type:
Creator:
Nick Clemens (kidclamp)
Created:
2025-02-05 13:10:52 UTC
Size:
6.71 KB
patch
obsolete
>From 214af2ddea247476da89013dcd7327f1ff82a2c9 Mon Sep 17 00:00:00 2001 >From: Nick Clemens <nick@bywatersolutions.com> >Date: Wed, 5 Feb 2025 13:08:02 +0000 >Subject: [PATCH] Bug 39038: Grep for exacpt matches for collapsed fields > >This patch splits the preference into a list in TT and then uses >grep to find exact matches for each field > >To test: >1 - Edit CollapsedFieldsPatronAddForm preference and check Non-patron guarantor > and a few otehr fields, not Guarantor though >2 - Go to add a patron that can have a guarantor >3 - Note bot h guarantor fields are collapsed >4 - Apply patch, reload >5 - Note only expected fields are collapsed >6 - Confirm other fields continue to work as expected >--- > .../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 27f7d0e0f2f..d7b206b9fc0 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/members/memberentrygen.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/members/memberentrygen.tt >@@ -224,11 +224,11 @@ legend.collapsed i.fa.fa-caret-down::before { > </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> | > [% CASE 'guarantor' %] <span>Guarantor information</span> | >@@ -1802,74 +1802,74 @@ legend.collapsed i.fa.fa-caret-down::before { > 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