@@ -, +, @@ --- acqui/neworderempty.pl | 33 ++++++++++++++- .../en/modules/acqui/neworderempty_duplicate.tmpl | 43 ++++++++++++++++++++ 2 files changed, 74 insertions(+), 2 deletions(-) create mode 100644 koha-tmpl/intranet-tmpl/prog/en/modules/acqui/neworderempty_duplicate.tmpl --- a/acqui/neworderempty.pl +++ a/acqui/neworderempty.pl @@ -134,7 +134,14 @@ if ( $ordernumber eq '' and defined $params->{'breedingid'}){ my $duplicatetitle; #look for duplicates - if (! (($biblionumber,$duplicatetitle) = FindDuplicate($marcrecord))){ + ($biblionumber,$duplicatetitle) = FindDuplicate($marcrecord); + if($biblionumber && !$input->param('use_external_source')) { + #if duplicate record found and user did not decide yet, first warn user + #and let him choose between using new record or existing record + Load_Duplicate($duplicatetitle); + exit; + } + #from this point: add a new record if (C4::Context->preference("BiblioAddsAuthorities")){ my ($countlinked,$countcreated)=BiblioAddAuthorities($marcrecord, $params->{'frameworkcode'}); } @@ -163,7 +170,6 @@ if ( $ordernumber eq '' and defined $params->{'breedingid'}){ } } SetImportRecordStatus($params->{'breedingid'}, 'imported'); - } } @@ -471,3 +477,26 @@ sub MARCfindbreeding { return -1; } +sub Load_Duplicate { + my ($duplicatetitle)= @_; + ($template, $loggedinuser, $cookie) = get_template_and_user( + { + template_name => "acqui/neworderempty_duplicate.tmpl", + query => $input, + type => "intranet", + authnotrequired => 0, + flagsrequired => { acquisition => 'order_manage' }, +# debug => 1, + } + ); + + $template->param( + biblionumber => $biblionumber, + basketno => $basketno, + booksellerid => $basket->{'booksellerid'}, + breedingid => $params->{'breedingid'}, + duplicatetitle => $duplicatetitle, + ); + + output_html_with_http_headers $input, $cookie, $template->output; +} --- a/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/neworderempty_duplicate.tmpl +++ a/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/neworderempty_duplicate.tmpl @@ -0,0 +1,43 @@ + +Koha › Acquisitions › Basket <!-- TMPL_VAR NAME="basketno" --> › Duplicate warning + + + + + + + + + + + + + +
+ +
+
+
+ +

Duplicate warning

+ +

You selected a record from an external source that matches an existing record in your catalog!

+

Click Use Existing if you do not want to create a duplicate record, but you want to add an order from the existing record in your catalog. Click Create New if you still want to create a new record by importing the external (duplicate) record. Click Cancel to return to the basket without making a new order.

+

The existing catalog record can be viewed in a new window by clicking "> + +

+
+ &basketno=&biblionumber='" /> + &basketno=&breedingid=&use_external_source=1'" /> + '" /> +
+
+ +
+
+
+ +
+
+ --