From 0cdd62600b85721f6f1704138fdf56b94ba15d52 Mon Sep 17 00:00:00 2001 From: David Roberts Date: Fri, 24 Jan 2020 02:15:46 +0000 Subject: [PATCH] Bug 20847: Add more fields to the Batch Patron Modification tool This patch adds streetnumber, address, address2, phone and mobile to the Batch Patron Modify form, also moves Primary email to a more logical place on the page To test: 1) Install patch 2) Open Batch Patron Modification tool, and input a borrowernumber to edit 3) Add some data into the streetnumber, address, address2, phone and mobile fields and click Save 4) These fields in the user record should now contain your data 5) Test that running the tool again with the option to delete the data clears the fields correctly 6) Repeat steps 1-5 with a file of user borrowernumbers Signed-off-by: Daniel J Signed-off-by: Jonathan Druart Signed-off-by: Martin Renvoize --- .../prog/en/modules/tools/modborrowers.tt | 28 ++++++++++-- tools/modborrowers.pl | 44 ++++++++++++++++--- 2 files changed, 61 insertions(+), 11 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 63ad371456..adcb860fb3 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/tools/modborrowers.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/tools/modborrowers.tt @@ -141,15 +141,20 @@ First name Library Patron category + Street number + Address + Address 2 City State ZIP/Postal code Country + Primary email + Phone + Mobile Registration date Expiry date Circulation note OPAC note - Primary email Restriction expiration Restriction comment [% FOREACH attrh IN attributes_header %] @@ -168,15 +173,20 @@ [% borrower.firstname | html %] [% Branches.GetName( borrower.branchcode ) | html %] [% Categories.GetName(borrower.categorycode) | html %] + [% borrower.streetnumber | html %] + [% borrower.address | html %] + [% borrower.address2 | html %] [% borrower.city | html %] [% borrower.state | html %] [% borrower.zipcode | html %] [% borrower.country | html %] + [% borrower.email | html %] + [% borrower.phone | html %] + [% borrower.mobile | html %] [% borrower.dateenrolled | $KohaDates %] [% borrower.dateexpiry | $KohaDates %] [% borrower.borrowernotes | html %] [% borrower.opacnote | html %] - [% borrower.email | html %] [% borrower.debarred | $KohaDates %] [% borrower.debarredcomment | html %] [% FOREACH pa IN borrower.patron_attributes %] @@ -215,6 +225,12 @@ Library: [% CASE 'categorycode' %] Patron category: + [% CASE 'streetnumber' %] + Street number: + [% CASE 'address' %] + Address: + [% CASE 'address2' %] + Address 2: [% CASE 'city' %] City: [% CASE 'state' %] @@ -223,6 +239,12 @@ ZIP/Postal code: [% CASE 'country' %] Country: + [% CASE 'email' %] + Primary email: + [% CASE 'phone' %] + Phone: + [% CASE 'mobile' %] + Mobile: [% CASE 'sort1' %] Sort 1: [% CASE 'sort2' %] @@ -235,8 +257,6 @@ Circulation note: [% CASE 'opacnote' %] OPAC note: - [% CASE 'email' %] - Primary email: [% CASE 'debarred' %] Restriction expiration: [% CASE 'debarredcomment' %] diff --git a/tools/modborrowers.pl b/tools/modborrowers.pl index 4809362fa4..be9852a10b 100755 --- a/tools/modborrowers.pl +++ b/tools/modborrowers.pl @@ -202,6 +202,24 @@ if ( $op eq 'show' ) { mandatory => ( grep /categorycode/, @mandatoryFields ) ? 1 : 0, } , + { + name => "streetnumber", + type => "text", + mandatory => ( grep /streetnumber/, @mandatoryFields ) ? 1 : 0, + } + , + { + name => "address", + type => "text", + mandatory => ( grep /address/, @mandatoryFields ) ? 1 : 0, + } + , + { + name => "address2", + type => "text", + mandatory => ( grep /address2/, @mandatoryFields ) ? 1 : 0, + } + , { name => "city", type => "text", @@ -226,6 +244,24 @@ if ( $op eq 'show' ) { mandatory => ( grep /country/, @mandatoryFields ) ? 1 : 0, } , + { + name => "email", + type => "text", + mandatory => ( grep /email/, @mandatoryFields ) ? 1 : 0, + } + , + { + name => "phone", + type => "text", + mandatory => ( grep /phone/, @mandatoryFields ) ? 1 : 0, + } + , + { + name => "mobile", + type => "text", + mandatory => ( grep /mobile/, @mandatoryFields ) ? 1 : 0, + } + , { name => "sort1", type => @sort1_option ? "select" : "text", @@ -264,12 +300,6 @@ if ( $op eq 'show' ) { mandatory => ( grep /opacnote/, @mandatoryFields ) ? 1 : 0, } , - { - name => "email", - type => "text", - mandatory => ( grep /email/, @mandatoryFields ) ? 1 : 0, - } - , { name => "debarred", type => "date", @@ -294,7 +324,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 email/ ) { + for my $field ( qw/surname firstname branchcode categorycode streetnumber address address2 city state zipcode country email phone mobile sort1 sort2 dateenrolled dateexpiry borrowernotes opacnote/ ) { my $value = $input->param($field); $infos->{$field} = $value if $value; $infos->{$field} = "" if grep { /^$field$/ } @disabled; -- 2.39.5