From 8e4ebf9f36d97e03fca393ffecf8a486bc1fa9cf Mon Sep 17 00:00:00 2001 From: Jake Deery Date: Fri, 4 Oct 2024 11:35:40 +0000 Subject: [PATCH] Bug 37360: (follow-up) added bool type to modborrowers This follow-up patch adds a bool type to modborrowers, so that the options can be translated within the template files. Signed-off-by: Brendan Lawlor --- .../intranet-tmpl/prog/en/modules/tools/modborrowers.tt | 7 +++++++ tools/modborrowers.pl | 6 +----- 2 files changed, 8 insertions(+), 5 deletions(-) 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 431cf9ea41..8c60882dbe 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/tools/modborrowers.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/tools/modborrowers.tt @@ -392,6 +392,13 @@ There is no value defined for [% field.name | html %] [% END %] [% END %] + [% IF ( field.type == 'bool' ) %] + + [% END %] [% IF ( field.type == 'date' ) %] Clear diff --git a/tools/modborrowers.pl b/tools/modborrowers.pl index 99f33f788c..f27e554aab 100755 --- a/tools/modborrowers.pl +++ b/tools/modborrowers.pl @@ -180,10 +180,6 @@ if ( $op eq 'cud-show' || $op eq 'show' ) { my @categories_option; push @categories_option, { value => $_->categorycode, lib => $_->description } for @patron_categories; unshift @categories_option, { value => "", lib => "" }; - my @protected_option; - push @protected_option, { value => 1, lib => "Yes" }; - push @protected_option, { value => 0, lib => "No" }; - unshift @protected_option, { value => "", lib => "" }; my $bsort1 = GetAuthorisedValues("Bsort1"); my @sort1_option; push @sort1_option, { value => $_->{authorised_value}, lib => $_->{lib} } for @$bsort1; @@ -343,7 +339,7 @@ if ( $op eq 'cud-show' || $op eq 'show' ) { if ($logged_in_user->is_superlibrarian) { push @fields, { name => "password_expiration_date", type => "date" } ; - push @fields, { name => "protected", type => "select", option => \@protected_option }; + push @fields, { name => "protected", type => "bool" }; } $template->param('patron_attributes_codes', \@patron_attributes_codes); -- 2.39.5