Bugzilla – Attachment 10023 Details for
Bug 5771
Better error handling for import borrowers - Provide a download file of errors
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 5771 - Follow up MT2894 Adds a download link for big error reports to import_borrowers
Bug-5771---Follow-up-MT2894-Adds-a-download-link-f.patch (text/plain), 3.04 KB, created by
Alex Arnaud
on 2012-06-09 13:17:41 UTC
(
hide
)
Description:
Bug 5771 - Follow up MT2894 Adds a download link for big error reports to import_borrowers
Filename:
MIME Type:
Creator:
Alex Arnaud
Created:
2012-06-09 13:17:41 UTC
Size:
3.04 KB
patch
obsolete
>From ad58bc4223e1c33178627ab40a86fcc320631afb Mon Sep 17 00:00:00 2001 >From: Alex Arnaud <alex.arnaud@biblibre.com> >Date: Sat, 9 Jun 2012 15:17:04 +0200 >Subject: [PATCH] Bug 5771 - Follow up MT2894 Adds a download link for big error reports to import_borrowers > >--- > .../prog/en/modules/tools/import_borrowers.tt | 2 +- > tools/import_borrowers.pl | 9 +++++++-- > 2 files changed, 8 insertions(+), 3 deletions(-) > >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/tools/import_borrowers.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/tools/import_borrowers.tt >index 1a0b509..0b736a0 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/tools/import_borrowers.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/tools/import_borrowers.tt >@@ -53,7 +53,7 @@ > <h5>Error analysis:</h5> > [% IF download_errors %] > <form method="post"> >- <input type="hidden" name="errors_filename" value="<!-- TMPL_VAR NAME="errors_filename" -->" /> >+ <input type="hidden" name="errors_filename" value="[% errors_filename %]" /> > <input type="hidden" name="report" value="report" /> > <input type="submit" value="Download report" /> > </form> >diff --git a/tools/import_borrowers.pl b/tools/import_borrowers.pl >index 1f40b69..f10d741 100755 >--- a/tools/import_borrowers.pl >+++ b/tools/import_borrowers.pl >@@ -57,6 +57,7 @@ use Text::CSV; > use CGI; > # use encoding 'utf8'; # don't do this > >+my $commandline = @ARGV ? 1 : 0; > my (@errors, @feedback); > my $extended = C4::Context->preference('ExtendedPatronAttributes'); > my $set_messaging_prefs = C4::Context->preference('EnhancedMessagingPreferences'); >@@ -156,6 +157,8 @@ if ( $uploadborrowers && length($uploadborrowers) > 0 ) { > my @bad_dates; # I've had a few. > my $date_re = C4::Dates->new->regexp('syspref'); > my $iso_re = C4::Dates->new->regexp('iso'); >+ my $lastalreadyindb; >+ my $lastinvalid; > LINE: while ( my $borrowerline = <$handle> ) { > my %borrower; > my @missing_criticals; >@@ -254,7 +257,8 @@ if ( $uploadborrowers && length($uploadborrowers) > 0 ) { > # borrower exists > unless ($overwrite_cardnumber) { > $alreadyindb++; >- $template->param('lastalreadyindb'=>$borrower{'surname'}.' / '.$borrowernumber); >+ $lastalreadyindb = $borrower{'surname'}.' / '.$borrowernumber; >+ $template->param('lastalreadyindb'=>$lastalreadyindb); > next LINE; > } > $borrower{'borrowernumber'} = $borrowernumber; >@@ -273,7 +277,8 @@ if ( $uploadborrowers && length($uploadborrowers) > 0 ) { > $invalid++; > # untill we have better error trapping, we have no way of knowing why ModMember errored out... > push @errors, {unknown_error => 1}; >- $template->param('lastinvalid'=>$borrower{'surname'}.' / '.$borrowernumber); >+ $lastinvalid = $borrower{'surname'}.' / '.$borrowernumber; >+ $template->param('lastinvalid'=>$lastinvalid); > next LINE; > } > if ($extended) { >-- >1.7.4.1
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
|
Splinter Review
Attachments on
bug 5771
:
3177
|
4589
|
10023
|
19263
|
24858
|
25004
|
25019
|
26204
|
27278
|
27405