Bugzilla – Attachment 142858 Details for
Bug 31562
Patron 'flags' don't respect unwanted fields
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 31562: [22.05.x] Treat flags as other borrower fields
Bug-31562-2205x-Treat-flags-as-other-borrower-fiel.patch (text/plain), 13.45 KB, created by
Nick Clemens (kidclamp)
on 2022-11-01 11:21:08 UTC
(
hide
)
Description:
Bug 31562: [22.05.x] Treat flags as other borrower fields
Filename:
MIME Type:
Creator:
Nick Clemens (kidclamp)
Created:
2022-11-01 11:21:08 UTC
Size:
13.45 KB
patch
obsolete
>From 3c54d646d84a29c779198ce52eee34d496089215 Mon Sep 17 00:00:00 2001 >From: Nick Clemens <nick@bywatersolutions.com> >Date: Wed, 14 Sep 2022 11:27:03 +0000 >Subject: [PATCH] Bug 31562: [22.05.x] Treat flags as other borrower fields > >Rather than generate a custom hash for these fields, we should treat them as other borrower data fields > >To test: > 1 - Edit a patron, note the 'Lost card' and 'Gone no address' fields > 2 - Edit syspref BorrowerunwantedField > 3 - Set gonenoaddress and lost as unwanted > 4 - Edit patron, the fields remain > 5 - Apply patch > 6 - Edit a patron, fields are hidden > 7 - Unhide one of the fields > 8 - Edit a patron and confirm it shows and saves correctly > 9 - Unhide the other field >10 - Confirm it can be edited and saved > >Signed-off-by: David Nind <david@davidnind.com> >Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> > >Bug 31562: Remove gonenoaddress and lost from OPAC borrower field preferences > >These are not shown, so cannot be unwanted or mandatory > >Signed-off-by: David Nind <david@davidnind.com> >Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> > >Bug 31562: Respect mandatory fields pref > >To test: >1 - Set gonenoaddress and lost in BorrowerMandatoryField >2 - Edit a patron, confirm fields are required > >Signed-off-by: David Nind <david@davidnind.com> >Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> >--- > .../en/modules/admin/preferences/opac.pref | 8 +-- > .../prog/en/modules/members/memberentrygen.tt | 71 +++++++++++++++---- > members/memberentry.pl | 24 ------- > 3 files changed, 60 insertions(+), 43 deletions(-) > >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/opac.pref b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/opac.pref >index cd7e2836f0..808516ce7c 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/opac.pref >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/opac.pref >@@ -802,25 +802,25 @@ OPAC: > - pref: PatronSelfModificationMandatoryField > type: modalselect > source: borrowers >- exclusions: password|cardnumber|dateexpiry|categorycode|sort1|sort2|opacnote|borrowernotes >+ exclusions: password|cardnumber|dateexpiry|categorycode|sort1|sort2|opacnote|borrowernotes|gonenoaddress|lost > - > - "The following <a href='http://schema.koha-community.org/__VERSION__/tables/borrowers.html' target='blank'>database columns</a> must be filled in on the patron entry screen:" > - pref: PatronSelfRegistrationBorrowerMandatoryField > type: modalselect > source: borrowers >- exclusions: sort1|sort2|opacnote|borrowernotes >+ exclusions: sort1|sort2|opacnote|borrowernotes|gonenoaddress|lost > - > - "The following <a href='http://schema.koha-community.org/__VERSION__/tables/borrowers.html' target='blank'>database columns</a> will not appear on the patron self-registration screen:" > - pref: PatronSelfRegistrationBorrowerUnwantedField > type: modalselect > source: borrowers >- exclusions: branchcode|sort1|sort2 >+ exclusions: branchcode|sort1|sort2|gonenoaddress|lost > - > - "The following <a href='http://schema.koha-community.org/__VERSION__/tables/borrowers.html' target='blank'>database columns</a> will not appear on the patron self-modification screen:" > - pref: PatronSelfModificationBorrowerUnwantedField > type: modalselect > source: borrowers >- exclusions: sort1|sort2 >+ exclusions: sort1|sort2|gonenoaddress|lost > - > - "Display the following additional instructions for patrons who self register via the OPAC ( HTML is allowed ):" > - pref: PatronSelfRegistrationAdditionalInstructions >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 7da8ffc685..1d4d09b84a 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/members/memberentrygen.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/members/memberentrygen.tt >@@ -1288,38 +1288,79 @@ legend:hover { > [% END # UNLESS nouserid && nopassword && !CanUpdatePasswordExpiration %] > > <!--this zones are not necessary in modif mode --> >- [% UNLESS ( opadd || opduplicate ) %] >+ [% UNLESS ( opadd || opduplicate || ( nogonenoaddress && nolost ) ) %] > <fieldset class="rows" id="memberentry_account_flags"> > <legend id="account_flags_lgd">Patron account flags</legend> > <ol class="radio"> >- [% FOREACH flagloo IN flagloop %] >+ [% UNLESS nogonenoaddress %] > <li> >- <label class="radio" for="yes[% flagloo.name | html %]"> >- [% IF ( flagloo.key == 'gonenoaddress' ) %]Gone no address:[% END %] >- [% IF ( flagloo.key == 'lost' ) %]Lost card:[% END %] >+ [% IF mandatorygonenoaddress %] >+ <label class="radio required" for="yesgonenoaddress"> >+ [% ELSE %] >+ <label class="radio" for="yesgonenoaddress"> >+ [% END %] >+ Gone no address: > </label> > [% IF CAN_user_circulate_manage_restrictions %] >- <label for="yes[% flagloo.name | html %]"> >- [% IF ( flagloo.yes ) %] >- <input type="radio" id="yes[% flagloo.name | html %]" name="[% flagloo.name | html %]" value="1" checked="checked" /> >+ <label for="yesgonenoaddress"> >+ [% IF ( borrower_data.gonenoaddress ) %] >+ <input type="radio" id="yesgonenoaddress" name="gonenoaddress" value="1" checked="checked" /> > [% ELSE %] >- <input type="radio" id="yes[% flagloo.name | html %]" name="[% flagloo.name | html %]" value="1" /> >+ <input type="radio" id="yesgonenoaddress" name="gonenoaddress" value="1" /> > [% END %] > Yes > </label> >- <label for="no[% flagloo.name | html %]"> >- [% IF ( flagloo.no ) %] >- <input type="radio" id="no[% flagloo.name | html %]" name="[% flagloo.name | html %]" value="0" checked="checked"/> >+ <label for="nogonenoaddress"> >+ [% IF ( borrower_data.gonenoaddress ) %] >+ <input type="radio" id="nogonenoaddress" name="gonenoaddress" value="0" /> > [% ELSE %] >- <input type="radio" id="no[% flagloo.name | html %]" name="[% flagloo.name | html %]" value="0" /> >+ <input type="radio" id="nogonenoaddress" name="gonenoaddress" value="0" checked="checked"/> > [% END %] > No > </label> > [% ELSE %] >- [% IF flagloo.yes %]<span>Yes</span>[% ELSE %]<span>No</span>[% END %] >+ [% IF borrower_data.gonenoaddress %]<span>Yes</span>[% ELSE %]<span>No</span>[% END %] > [% END # /IF CAN_user_circulate_manage_restrictions %] >+ [% IF mandatorygonenoaddress %] >+ <span class="required">Required</span> >+ [% END %] >+ </li> >+ >+ [% END # /UNLESS nogonenoaddress %] >+ [% UNLESS nolost %] >+ <li> >+ [% IF mandatorylost %] >+ <label class="radio required" for="yeslost"> >+ [% ELSE %] >+ <label class="radio" for="yeslost"> >+ [% END %] >+ Lost card: >+ </label> >+ [% IF CAN_user_circulate_manage_restrictions %] >+ <label for="yeslost"> >+ [% IF ( borrower_data.lost ) %] >+ <input type="radio" id="yeslost" name="lost" value="1" checked="checked" /> >+ [% ELSE %] >+ <input type="radio" id="yeslost" name="lost" value="1" /> >+ [% END %] >+ Yes >+ </label> >+ <label for="nolost"> >+ [% IF ( borrower_data.lost ) %] >+ <input type="radio" id="nolost" name="lost" value="0" /> >+ [% ELSE %] >+ <input type="radio" id="nolost" name="lost" value="0" checked="checked"/> >+ [% END %] >+ No >+ </label> >+ [% ELSE %] >+ [% IF borrower_data.lost %]<span>Yes</span>[% ELSE %]<span>No</span>[% END %] >+ [% END # /IF CAN_user_circulate_manage_restrictions %] >+ [% IF mandatorylost %] >+ <span class="required">Required</span> >+ [% END %] > </li> >- [% END # /FOREACH flagloo %] >+ [% END # /UNLESS nogonenoaddress %] > </ol> > </fieldset> <!-- /#memberentry_account_flags --> > >diff --git a/members/memberentry.pl b/members/memberentry.pl >index 9118a0b508..344be77070 100755 >--- a/members/memberentry.pl >+++ b/members/memberentry.pl >@@ -724,29 +724,6 @@ while (@relationships) { > push(@relshipdata, \%row); > } > >-my %flags = ( >- 'gonenoaddress' => ['gonenoaddress'], >- 'lost' => ['lost'] >-); >- >-my @flagdata; >-foreach ( keys(%flags) ) { >- my $key = $_; >- my %row = ( >- 'key' => $key, >- 'name' => $flags{$key}[0] >- ); >- if ( $data{$key} ) { >- $row{'yes'} = ' checked'; >- $row{'no'} = ''; >- } >- else { >- $row{'yes'} = ''; >- $row{'no'} = ' checked'; >- } >- push @flagdata, \%row; >-} >- > # get Branch Loop > # in modify mod: userbranch value comes from borrowers table > # in add mod: userbranch value comes from branches table (ip correspondence) >@@ -839,7 +816,6 @@ $template->param( > borrowernumber => $borrowernumber, #register number > relshiploop => \@relshipdata, > btitle=> $default_borrowertitle, >- flagloop => \@flagdata, > category_type =>$category_type, > modify => $modify, > nok => $nok,#flag to know if an error >-- >2.30.2
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 31562
:
140621
|
140622
|
140623
|
140624
|
140625
|
140626
|
140638
|
140639
|
140640
|
140655
|
140656
|
140657
| 142858