From 417e76d7e087be4f4d29a95fcaaaf43c19a812d3 Mon Sep 17 00:00:00 2001 From: David Roberts Date: Mon, 13 Jan 2020 22:43:46 +0000 Subject: [PATCH] Bug 19793: Add a field for email in batch patron modification This adds the email field to the patron batch modification tool. To test: 1) Install patch 2) Open Batch Patron Modification tool, and input a borrowernumber to edit 3) Add some data (e.g. test@foobar.com) into the Email address field, and click Save 4) The Primary Email address in the user record should now contain your email address 5) Test that running the tool again with the option to delete the data clears the field correctly 6) Repeat steps 1-5 with a file of user borrowernumbers Sponsored-by: PTFS Europe Signed-off-by: Sal Signed-off-by: Katrin Fischer Signed-off-by: Martin Renvoize --- .../intranet-tmpl/prog/en/modules/tools/modborrowers.tt | 4 ++++ tools/modborrowers.pl | 8 +++++++- 2 files changed, 11 insertions(+), 1 deletion(-) 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 7a9333432e..0d5a8be4da 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/tools/modborrowers.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/tools/modborrowers.tt @@ -149,6 +149,7 @@ Expiry date Circulation note OPAC note + Email address Restriction expiration Restriction comment [% FOREACH attrh IN attributes_header %] @@ -175,6 +176,7 @@ [% borrower.dateexpiry | $KohaDates %] [% borrower.borrowernotes | html %] [% borrower.opacnote | html %] + [% borrower.email | html %] [% borrower.debarred | $KohaDates %] [% borrower.debarredcomment | html %] [% FOREACH pa IN borrower.patron_attributes %] @@ -233,6 +235,8 @@ Circulation note: [% CASE 'opacnote' %] OPAC note: + [% CASE 'email' %] + Email address: [% CASE 'debarred' %] Restriction expiration: [% CASE 'debarredcomment' %] diff --git a/tools/modborrowers.pl b/tools/modborrowers.pl index 5843c73d98..4809362fa4 100755 --- a/tools/modborrowers.pl +++ b/tools/modborrowers.pl @@ -264,6 +264,12 @@ if ( $op eq 'show' ) { mandatory => ( grep /opacnote/, @mandatoryFields ) ? 1 : 0, } , + { + name => "email", + type => "text", + mandatory => ( grep /email/, @mandatoryFields ) ? 1 : 0, + } + , { name => "debarred", type => "date", @@ -288,7 +294,7 @@ if ( $op eq 'do' ) { my @disabled = $input->multi_param('disable_input'); my $infos; - for my $field ( qw/surname firstname branchcode categorycode city state zipcode country sort1 sort2 dateenrolled dateexpiry borrowernotes opacnote debarred debarredcomment/ ) { + for my $field ( qw/surname firstname branchcode categorycode city state zipcode country sort1 sort2 dateenrolled dateexpiry borrowernotes opacnote email/ ) { my $value = $input->param($field); $infos->{$field} = $value if $value; $infos->{$field} = "" if grep { /^$field$/ } @disabled; -- 2.39.5