From 0bb26abd5aee68d2a925925f98fce1ba6879ea67 Mon Sep 17 00:00:00 2001 From: Olivia Reynolds Date: Wed, 10 Jun 2026 09:45:40 +0000 Subject: [PATCH] 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 Signed-off-by: Amit Gupta Signed-off-by: Martin Renvoize Signed-off-by: Pedro Amorim --- admin/columns_settings.yml | 2 ++ .../prog/en/modules/tools/modborrowers.tt | 12 ++++++++++++ tools/modborrowers.pl | 13 ++++++++++++- 3 files changed, 26 insertions(+), 1 deletion(-) diff --git a/admin/columns_settings.yml b/admin/columns_settings.yml index 8c5edc210c..a06bbfbd9c 100644 --- a/admin/columns_settings.yml +++ b/admin/columns_settings.yml @@ -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 - diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/tools/modborrowers.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/tools/modborrowers.tt index 07999fc2b5..8a7c87fdc0 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/tools/modborrowers.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/tools/modborrowers.tt @@ -221,6 +221,7 @@ Card number Surname First name + Gender Library Patron category Street number @@ -257,6 +258,15 @@ [% borrower.cardnumber | html %] [% borrower.surname | html %] [% borrower.firstname | html %] + + [% IF borrower.sex == 'F' %] + Female + [% ELSIF borrower.sex == 'M' %] + Male + [% ELSIF borrower.sex == 'O' %] + Other + [% END %] + [% Branches.GetName( borrower.branchcode ) | html %] [% Categories.GetName(borrower.categorycode) | html %] [% borrower.streetnumber | html %] @@ -345,6 +355,8 @@ Surname: [% CASE 'firstname' %] First name: + [% CASE 'sex' %] + Gender: [% CASE 'branchcode' %] Library: [% CASE 'categorycode' %] diff --git a/tools/modborrowers.pl b/tools/modborrowers.pl index b09a41d343..04323caa30 100755 --- a/tools/modborrowers.pl +++ b/tools/modborrowers.pl @@ -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);