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 <sally.healey@cheshiresharedservices.gov.uk>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
This commit is contained in:
David Roberts 2020-01-13 22:43:46 +00:00 committed by Martin Renvoize
parent 5733398a59
commit 417e76d7e0
No known key found for this signature in database
GPG Key ID: 422B469130441A0F
2 changed files with 11 additions and 1 deletions

View File

@ -149,6 +149,7 @@
<th class="title-string">Expiry date</th>
<th>Circulation note</th>
<th>OPAC note</th>
<th>Email address</th>
<th>Restriction expiration</th>
<th>Restriction comment</th>
[% FOREACH attrh IN attributes_header %]
@ -175,6 +176,7 @@
<td><span title="[% borrower.dateexpiry | html %]">[% borrower.dateexpiry | $KohaDates %]</span></td>
<td>[% borrower.borrowernotes | html %]</td>
<td>[% borrower.opacnote | html %]</td>
<td>[% borrower.email | html %]</td>
<td><span title="[% borrower.debarred | html %]">[% borrower.debarred | $KohaDates %]</span></td>
<td>[% borrower.debarredcomment | html %]</td>
[% 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' %]

View File

@ -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;