View | Details | Raw Unified | Return to bug 5782
Collapse All | Expand All

(-)a/acqui/neworderempty.pl (-2 / +31 lines)
Lines 134-140 if ( $ordernumber eq '' and defined $params->{'breedingid'}){ Link Here
134
134
135
    my $duplicatetitle;
135
    my $duplicatetitle;
136
#look for duplicates
136
#look for duplicates
137
    if (! (($biblionumber,$duplicatetitle) = FindDuplicate($marcrecord))){
137
    ($biblionumber,$duplicatetitle) = FindDuplicate($marcrecord);
138
    if($biblionumber && !$input->param('use_external_source')) {
139
	#if duplicate record found and user did not decide yet, first warn user
140
	#and let him choose between using new record or existing record
141
	Load_Duplicate($duplicatetitle);
142
	exit;
143
    }
144
    #from this point: add a new record
138
        if (C4::Context->preference("BiblioAddsAuthorities")){
145
        if (C4::Context->preference("BiblioAddsAuthorities")){
139
            my ($countlinked,$countcreated)=BiblioAddAuthorities($marcrecord, $params->{'frameworkcode'});
146
            my ($countlinked,$countcreated)=BiblioAddAuthorities($marcrecord, $params->{'frameworkcode'});
140
        }
147
        }
Lines 163-169 if ( $ordernumber eq '' and defined $params->{'breedingid'}){ Link Here
163
            }
170
            }
164
        }
171
        }
165
        SetImportRecordStatus($params->{'breedingid'}, 'imported');
172
        SetImportRecordStatus($params->{'breedingid'}, 'imported');
166
    }
167
}
173
}
168
174
169
175
Lines 471-473 sub MARCfindbreeding { Link Here
471
    return -1;
477
    return -1;
472
}
478
}
473
479
480
sub Load_Duplicate {
481
  my ($duplicatetitle)= @_;
482
  ($template, $loggedinuser, $cookie) = get_template_and_user(
483
    {
484
        template_name   => "acqui/neworderempty_duplicate.tmpl",
485
        query           => $input,
486
        type            => "intranet",
487
        authnotrequired => 0,
488
        flagsrequired   => { acquisition => 'order_manage' },
489
#        debug           => 1,
490
    }
491
  );
492
493
  $template->param(
494
    biblionumber        => $biblionumber,
495
    basketno            => $basketno,
496
    booksellerid        => $basket->{'booksellerid'},
497
    breedingid          => $params->{'breedingid'},
498
    duplicatetitle      => $duplicatetitle,
499
  );
500
501
  output_html_with_http_headers $input, $cookie, $template->output;
502
}
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/neworderempty_duplicate.tmpl (-1 / +43 lines)
Line 0 Link Here
0
- 
1
<!-- TMPL_INCLUDE NAME="doc-head-open.inc" -->
2
<title>Koha &rsaquo; Acquisitions &rsaquo; Basket <!-- TMPL_VAR NAME="basketno" --> &rsaquo; Duplicate warning</title>
3
<!-- TMPL_INCLUDE NAME="doc-head-close.inc" -->
4
5
<script type="text/javascript" src="<!-- TMPL_VAR NAME='themelang' -->/js/acq.js"></script>
6
<script type="text/javascript" src="<!-- TMPL_VAR NAME='themelang' -->/js/additem.js"></script>
7
<script type="text/javascript">
8
</script>
9
</head>
10
<body>
11
12
<!-- TMPL_INCLUDE NAME="header.inc" -->
13
<!-- TMPL_INCLUDE NAME="acquisitions-search.inc" -->
14
15
<div id="breadcrumbs"><a href="/cgi-bin/koha/mainpage.pl">Home</a> &rsaquo; <a href="/cgi-bin/koha/acqui/acqui-home.pl">Acquisitions</a> &rsaquo; <a href="/cgi-bin/koha/acqui/basket.pl?basketno=<!-- TMPL_VAR NAME="basketno" -->">Basket <!-- TMPL_VAR NAME="basketno" --></a> &rsaquo; Duplicate warning</div>
16
17
<div id="doc3" class="yui-t2">
18
19
<div id="bd">
20
    <div id="yui-main">
21
    <div class="yui-b">
22
23
<h2>Duplicate warning</h2>
24
25
<p>You selected a record from an external source that matches an existing record in your catalog!</p>
26
<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>
27
<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>
28
29
<form action="/cgi-bin/koha/acqui/addorder.pl" method="post" id="Aform">
30
    <fieldset class="action">
31
        <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" -->'" />
32
        <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'" />
33
        <input type="button" value="Cancel" onclick="window.location='/cgi-bin/koha/acqui/basket.pl?basketno=<!-- TMPL_VAR NAME="basketno" -->'" />
34
    </fieldset>
35
</form>
36
37
</div>
38
</div>
39
<div class="yui-b">
40
<!-- TMPL_INCLUDE NAME="acquisitions-menu.inc" -->
41
</div>
42
</div>
43
<!-- TMPL_INCLUDE NAME="intranet-bottom.inc" -->

Return to bug 5782