Bugzilla – Attachment 36144 Details for
Bug 12074
Filter duplicates when adding a full batch from a staged file
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 12074 - Filter duplicates when adding a full batch from a staged file
0001-Bug-12074-Filter-duplicates-when-adding-a-batch-from.patch (text/plain), 5.50 KB, created by
Koha Team University Lyon 3
on 2015-02-24 15:10:43 UTC
(
hide
)
Description:
Bug 12074 - Filter duplicates when adding a full batch from a staged file
Filename:
MIME Type:
Creator:
Koha Team University Lyon 3
Created:
2015-02-24 15:10:43 UTC
Size:
5.50 KB
patch
obsolete
>From 65d25453070c57d1e337e05d333bb383b0c464b5 Mon Sep 17 00:00:00 2001 >From: Lyon3 Team <koha@univ-lyon3.fr> >Date: Tue, 24 Feb 2015 15:50:49 +0100 >Subject: [PATCH] Bug 12074 Filter duplicates when adding a batch from a > staged file > >When adding a batch of records to a basket, duplicates are skipped and >an alert is displayed with a link to them so as they could be treated >individually. >--- > acqui/addorderiso2709.pl | 12 +++++++++++- > acqui/basket.pl | 2 ++ > .../intranet-tmpl/prog/en/modules/acqui/addorderiso2709.tt | 6 ++++++ > koha-tmpl/intranet-tmpl/prog/en/modules/acqui/basket.tt | 4 ++++ > 4 files changed, 23 insertions(+), 1 deletion(-) > >diff --git a/acqui/addorderiso2709.pl b/acqui/addorderiso2709.pl >index b4aa4d9..89e303c 100755 >--- a/acqui/addorderiso2709.pl >+++ b/acqui/addorderiso2709.pl >@@ -60,6 +60,7 @@ my ($template, $loggedinuser, $cookie, $userflags) = get_template_and_user({ > my $cgiparams = $input->Vars; > my $op = $cgiparams->{'op'} || ''; > my $booksellerid = $input->param('booksellerid'); >+my $allmatch = $input->param('allmatch'); > my $bookseller = Koha::Acquisition::Bookseller->fetch({ id => $booksellerid }); > my $data; > >@@ -123,6 +124,7 @@ if ($op eq ""){ > $template->param("batch_details" => 1, > "basketno" => $cgiparams->{'basketno'}, > loop_currencies => \@loop_currency, >+ "allmatch" => $allmatch, > ); > import_biblios_list($template, $cgiparams->{'import_batch_id'}); > if ( C4::Context->preference('AcqCreateItem') eq 'ordering' ) { >@@ -157,6 +159,8 @@ if ($op eq ""){ > # retrieve the file you want to import > my $import_batch_id = $cgiparams->{'import_batch_id'}; > my $biblios = GetImportRecordsRange($import_batch_id); >+ my $duplinbatch; >+ my $imported = 0; > my @import_record_id_selected = $input->param("import_record_id"); > my @quantities = $input->param('quantity'); > my @prices = $input->param('price'); >@@ -181,6 +185,7 @@ if ($op eq ""){ > > # 1st insert the biblio, or find it through matcher > unless ( $biblionumber ) { >+ $duplinbatch=$import_batch_id and next if FindDuplicate($marcrecord); > # add the biblio > my $bibitemnum; > >@@ -284,9 +289,14 @@ if ($op eq ""){ > } else { > SetImportRecordStatus( $biblio->{'import_record_id'}, 'imported' ); > } >+ $imported++; > } > # go to basket page >- print $input->redirect("/cgi-bin/koha/acqui/basket.pl?basketno=".$cgiparams->{'basketno'}); >+ if ( $imported ) { >+ print $input->redirect("/cgi-bin/koha/acqui/basket.pl?basketno=".$cgiparams->{'basketno'}."&duplinbatch=$duplinbatch"); >+ } else { >+ print $input->redirect("/cgi-bin/koha/acqui/addorderiso2709.pl?import_batch_id=$import_batch_id&basketno=".$cgiparams->{'basketno'}."&booksellerid=$booksellerid&allmatch=1"); >+ } > exit; > } > >diff --git a/acqui/basket.pl b/acqui/basket.pl >index 5379c37..8545d77 100755 >--- a/acqui/basket.pl >+++ b/acqui/basket.pl >@@ -68,6 +68,7 @@ the supplier this script have to display the basket. > my $query = new CGI; > our $basketno = $query->param('basketno'); > my $booksellerid = $query->param('booksellerid'); >+my $duplinbatch = $query->param('duplinbatch'); > > my ( $template, $loggedinuser, $cookie, $userflags ) = get_template_and_user( > { >@@ -431,6 +432,7 @@ if ( $op eq 'delete_confirm' ) { > grouped => $basket->{basketgroupid}, > unclosable => @orders ? 0 : 1, > has_budgets => $has_budgets, >+ duplinbatch => $duplinbatch, > ); > } > >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/addorderiso2709.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/addorderiso2709.tt >index cf03b7c..d0414cf 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/addorderiso2709.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/addorderiso2709.tt >@@ -158,6 +158,12 @@ > <div id="bd"> > <div id="yui-main"> > <div class="yui-b"> >+ [% IF ( allmatch ) %]<div class="dialog alert"> >+ <h4>No records imported</h4> >+ No record have been imported because they all match an existing record in your catalog.<br />You'll have to treat them individually. >+ </div> >+ [% END %] >+ > [% IF ( batch_details ) %] > <h1>Add orders from [% comments %] > ([% file_name %] staged on [% upload_timestamp | $KohaDates with_hours => 1 %]) >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/basket.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/basket.tt >index c00c46f..cacb011 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/basket.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/basket.tt >@@ -380,6 +380,10 @@ > </div> > </div> > [% END %] >+ [% IF ( duplinbatch ) %]<div class="dialog alert"> >+ <h4>Duplicate warning</h4> >+ <p>Some records have not been automatically added because they match an existing record in your catalog:<a href="/cgi-bin/koha/acqui/addorderiso2709.pl?import_batch_id=[% duplinbatch %]&basketno=[% basketno %]&booksellerid=[% booksellerid %]" title="Open in new window" target="_blank" class="popup" style="margin-left:10px">Display them</a></p> >+ </div>[% END %] > > [% UNLESS ( delete_confirm ) %] > <div id="acqui_basket_content" class="yui-g"> >-- >1.7.10.4 >
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 12074
:
27031
|
27032
|
27033
|
36144
|
36647
|
36948