Bugzilla – Attachment 3188 Details for
Bug 5782
Add warning when ordering a duplicate record from external source
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Patch
patch.txt (text/plain), 5.62 KB, created by
Marcel de Rooy
on 2011-02-21 13:31:27 UTC
(
hide
)
Description:
Patch
Filename:
MIME Type:
Creator:
Marcel de Rooy
Created:
2011-02-21 13:31:27 UTC
Size:
5.62 KB
patch
obsolete
>From 3efc30c379f04f292b25cd0e2fa672b270b71414 Mon Sep 17 00:00:00 2001 >From: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> >Date: Mon, 21 Feb 2011 13:59:48 +0100 >Subject: [PATCH] Bug 5782: Add warning when ordering a duplicate record from external source >Content-Type: text/plain; charset="utf-8" > >Enhancement for Acquisitions/ordering from external source. >Koha already checked for duplicates, but this patch warns the user. Offers the choice to use existing record, use new record or return without making an order. >The new template is added for this interaction with the user. >--- > 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 > >diff --git a/acqui/neworderempty.pl b/acqui/neworderempty.pl >index 84fc81e..6af057d 100755 >--- a/acqui/neworderempty.pl >+++ b/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; >+} >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/neworderempty_duplicate.tmpl b/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/neworderempty_duplicate.tmpl >new file mode 100644 >index 0000000..c85f40f >--- /dev/null >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/neworderempty_duplicate.tmpl >@@ -0,0 +1,43 @@ >+<!-- TMPL_INCLUDE NAME="doc-head-open.inc" --> >+<title>Koha › Acquisitions › Basket <!-- TMPL_VAR NAME="basketno" --> › Duplicate warning</title> >+<!-- TMPL_INCLUDE NAME="doc-head-close.inc" --> >+ >+<script type="text/javascript" src="<!-- TMPL_VAR NAME='themelang' -->/js/acq.js"></script> >+<script type="text/javascript" src="<!-- TMPL_VAR NAME='themelang' -->/js/additem.js"></script> >+<script type="text/javascript"> >+</script> >+</head> >+<body> >+ >+<!-- TMPL_INCLUDE NAME="header.inc" --> >+<!-- TMPL_INCLUDE NAME="acquisitions-search.inc" --> >+ >+<div id="breadcrumbs"><a href="/cgi-bin/koha/mainpage.pl">Home</a> › <a href="/cgi-bin/koha/acqui/acqui-home.pl">Acquisitions</a> › <a href="/cgi-bin/koha/acqui/basket.pl?basketno=<!-- TMPL_VAR NAME="basketno" -->">Basket <!-- TMPL_VAR NAME="basketno" --></a> › Duplicate warning</div> >+ >+<div id="doc3" class="yui-t2"> >+ >+<div id="bd"> >+ <div id="yui-main"> >+ <div class="yui-b"> >+ >+<h2>Duplicate warning</h2> >+ >+<p>You selected a record from an external source that matches an existing record in your catalog!</p> >+<p>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.</p> >+<p>The existing catalog record can be viewed in a new window by clicking <a target="_blank" href="/cgi-bin/koha/catalogue/MARCdetail.pl?biblionumber=<!-- TMPL_VAR NAME="biblionumber" -->"><!-- TMPL_VAR NAME="duplicatetitle" --></a> >+ >+<form action="/cgi-bin/koha/acqui/addorder.pl" method="post" id="Aform"> >+ <fieldset class="action"> >+ <input type="button" value="Use Existing" onclick="window.location='/cgi-bin/koha/acqui/neworderempty.pl?booksellerid=<!-- TMPL_VAR NAME="booksellerid" -->&basketno=<!-- TMPL_VAR NAME="basketno" -->&biblionumber=<!-- TMPL_VAR NAME="biblionumber" -->'" /> >+ <input type="button" value="Create New" onclick="window.location='/cgi-bin/koha/acqui/neworderempty.pl?booksellerid=<!-- TMPL_VAR NAME="booksellerid" -->&basketno=<!-- TMPL_VAR NAME="basketno" -->&breedingid=<!-- TMPL_VAR NAME="breedingid" -->&use_external_source=1'" /> >+ <input type="button" value="Cancel" onclick="window.location='/cgi-bin/koha/acqui/basket.pl?basketno=<!-- TMPL_VAR NAME="basketno" -->'" /> >+ </fieldset> >+</form> >+ >+</div> >+</div> >+<div class="yui-b"> >+<!-- TMPL_INCLUDE NAME="acquisitions-menu.inc" --> >+</div> >+</div> >+<!-- TMPL_INCLUDE NAME="intranet-bottom.inc" --> >-- >1.6.0.6 >
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 5782
:
3187
| 3188