Bug 41105: Add gender to batch patron modification

This patch adds the ability to batch-edit the gender field for patrons.

Test plan:
1.  Ensure there are a number of patrons in the database.
2.  Apply patch.
3.  Navigate to Patrons and click Search, to display a list of patrons.
4.  Select all results and click "Batch patron modification".
5.  Verify the "Gender" column is displayed.
6.  Verify the "Gender" column may be toggled under the "Columns"
    dropdown.
7.  Select a subset of the patrons for modification.
8.  Verify there is a "Gender" option beneath the table.
9.  Select "Female" as the gender, and click "Save".
10. Verify the gender of all selected patrons was set to "Female".
11. Repeat with "Male" and "Other" as the gender.
12. Repeat with clearing the gender field by ticking the checkbox next
    to the dropdown and saving. Verify the gender field is blank for
    each selected patron.

Sponsored-by: Open Fifth
Signed-off-by: Laura_Escamilla <laura.escamilla@bywatersolutions.com>
Signed-off-by: Amit Gupta <amit.gupta@informaticsglobal.ai>
Signed-off-by: Martin Renvoize <martin.renvoize@openfifth.co.uk>
Signed-off-by: Pedro Amorim <pedro.amorim@openfifth.co.uk>
This commit is contained in:
Olivia Reynolds 2026-06-10 09:45:40 +00:00 committed by Pedro Amorim
parent 662020e21b
commit 0bb26abd5a
No known key found for this signature in database
GPG Key ID: 06B75BA7F3894D55
3 changed files with 26 additions and 1 deletions

View File

@ -2649,6 +2649,8 @@ modules:
columnname: batch_patron_edit_surname
-
columnname: batch_patron_edit_firstname
-
columnname: batch_patron_edit_sex
-
columnname: batch_patron_edit_branchcode
-

View File

@ -221,6 +221,7 @@
<th data-colname="batch_patron_edit_cardnumber">Card number</th>
<th data-colname="batch_patron_edit_surname">Surname</th>
<th data-colname="batch_patron_edit_firstname">First name</th>
<th data-colname="batch_patron_edit_sex">Gender</th>
<th data-colname="batch_patron_edit_branchcode">Library</th>
<th data-colname="batch_patron_edit_categorycode">Patron category</th>
<th data-colname="batch_patron_edit_streetnumber">Street number</th>
@ -257,6 +258,15 @@
<td><a href="/cgi-bin/koha/members/moremember.pl?borrowernumber=[% borrower.borrowernumber | uri %]">[% borrower.cardnumber | html %]</a></td>
<td>[% borrower.surname | html %]</td>
<td>[% borrower.firstname | html %]</td>
<td>
[% IF borrower.sex == 'F' %]
Female
[% ELSIF borrower.sex == 'M' %]
Male
[% ELSIF borrower.sex == 'O' %]
Other
[% END %]
</td>
<td>[% Branches.GetName( borrower.branchcode ) | html %]</td>
<td>[% Categories.GetName(borrower.categorycode) | html %]</td>
<td>[% borrower.streetnumber | html %]</td>
@ -345,6 +355,8 @@
<span>Surname:</span>
[% CASE 'firstname' %]
<span>First name:</span>
[% CASE 'sex' %]
<span>Gender:</span>
[% CASE 'branchcode' %]
<span>Library:</span>
[% CASE 'categorycode' %]

View File

@ -222,6 +222,17 @@ if ( $op eq 'cud-show' || $op eq 'show' ) {
type => "text",
mandatory => ( grep /firstname/, @mandatoryFields ) ? 1 : 0,
},
{
name => "sex",
type => "select",
option => [
{ value => "", lib => "" },
{ value => "F", lib => "Female" },
{ value => "M", lib => "Male" },
{ value => "O", lib => "Other" },
],
mandatory => ( grep /sex/, @mandatoryFields ) ? 1 : 0,
},
{
name => "branchcode",
type => "select",
@ -356,7 +367,7 @@ if ( $op eq 'cud-do' ) {
my @disabled = $input->multi_param('disable_input');
my $infos;
for my $field (
qw/surname firstname branchcode categorycode streetnumber address address2 city state zipcode country email phone mobile fax sort1 sort2 dateenrolled dateexpiry password_expiration_date borrowernotes opacnote debarred debarredcomment protected/
qw/surname firstname sex branchcode categorycode streetnumber address address2 city state zipcode country email phone mobile fax sort1 sort2 dateenrolled dateexpiry password_expiration_date borrowernotes opacnote debarred debarredcomment protected/
)
{
my $value = $input->param($field);