Bug 19793: Add a field for email in batch patron modification
authorDavid Roberts <david.roberts@ptfs-europe.com>
Mon, 13 Jan 2020 22:43:46 +0000 (22:43 +0000)
committerMartin Renvoize <martin.renvoize@ptfs-europe.com>
Tue, 21 Jan 2020 11:37:15 +0000 (11:37 +0000)
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>

koha-tmpl/intranet-tmpl/prog/en/modules/tools/modborrowers.tt
tools/modborrowers.pl

index 7a93334..0d5a8be 100644 (file)
                                                 <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 %]
                                                     <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 %]
                                                 Circulation note:
                                                 [% CASE 'opacnote' %]
                                                 OPAC note:
+                                                [% CASE 'email' %]
+                                                Email address:
                                                 [% CASE 'debarred' %]
                                                 Restriction expiration:
                                                 [% CASE 'debarredcomment' %]
index 5843c73..4809362 100755 (executable)
@@ -265,6 +265,12 @@ if ( $op eq 'show' ) {
         }
         ,
         {
+            name => "email",
+            type => "text",
+            mandatory => ( grep /email/, @mandatoryFields ) ? 1 : 0,
+        }
+        ,
+        {
             name => "debarred",
             type => "date",
             mandatory => ( grep /debarred/, @mandatoryFields ) ? 1 : 0,
@@ -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;