diff --git a/acqui/neworderempty.pl b/acqui/neworderempty.pl index ab95f16147..f41e598861 100755 --- a/acqui/neworderempty.pl +++ b/acqui/neworderempty.pl @@ -255,7 +255,6 @@ if ( not $ordernumber ) { # create order } else { #modify order $data = GetOrder($ordernumber); - $biblionumber = $data->{'biblionumber'}; $budget_id = $data->{'budget_id'}; $template->param( @@ -272,6 +271,7 @@ else { #modify order push @order_users, $order_patron if $order_patron; } } +$biblionumber = $data->{biblionumber}; # We can have: # - no ordernumber but a biblionumber: from a subscription, from an existing record diff --git a/koha-tmpl/opac-tmpl/bootstrap/en/includes/opac-detail-sidebar.inc b/koha-tmpl/opac-tmpl/bootstrap/en/includes/opac-detail-sidebar.inc index bc4d926c62..f0dce164ce 100644 --- a/koha-tmpl/opac-tmpl/bootstrap/en/includes/opac-detail-sidebar.inc +++ b/koha-tmpl/opac-tmpl/bootstrap/en/includes/opac-detail-sidebar.inc @@ -33,6 +33,10 @@ [% END %] [% END %] + [% IF Koha.Preference('suggestion') %] +
  • New purchase suggestion for this title
  • + [% END %] + [% IF ( OpacHighlightedWords && query_desc ) %]
  • Unhighlight diff --git a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-suggestions.tt b/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-suggestions.tt index db6d7ce420..bc76338626 100644 --- a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-suggestions.tt +++ b/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-suggestions.tt @@ -204,10 +204,15 @@
    - - [% IF ( need_confirm ) %] - - [% ELSE %] + [% IF need_confirm # Confirm that we want a duplicate %] + + + [% ELSIF biblionumber # Create from an existing title %] + + + + [% ELSE # Not created from an existing title, search for possible duplicate %] + [% END %] Cancel diff --git a/opac/opac-suggestions.pl b/opac/opac-suggestions.pl index 91eaebe90b..b502e92737 100755 --- a/opac/opac-suggestions.pl +++ b/opac/opac-suggestions.pl @@ -37,6 +37,7 @@ use Koha::DateUtils qw( dt_from_string ); my $input = new CGI; my $op = $input->param('op'); +my $biblionumber = $input->param('biblionumber'); my $suggestion = $input->Vars; my $negcaptcha = $input->param('negcap'); my $suggested_by_anyone = $input->param('suggested_by_anyone') || 0; @@ -116,7 +117,7 @@ if ( $op eq 'else' ) { } } -if ( $op eq "add_validate" ) { +if ( $op eq "add_validate" && not $biblionumber ) { # If we are creating the suggestion from an existing record we do not want to search for duplicates $op = 'add_confirm'; my $biblio = MarcRecordFromNewSuggestion($suggestion); if ( my ($duplicatebiblionumber, $duplicatetitle) = FindDuplicate($biblio) ) { @@ -229,6 +230,19 @@ my @mandatoryfields; foreach (@mandatoryfields) { $template->param( $_."_required" => 1); } + if ( $biblionumber ) { + my $biblio = Koha::Biblios->find($biblionumber); + $template->param( + biblionumber => $biblio->biblionumber, + title => $biblio->title, + author => $biblio->author, + copyrightdate => $biblio->copyrightdate, + isbn => $biblio->biblioitem->isbn, + publishercode => $biblio->biblioitem->publishercode, + collectiontitle => $biblio->biblioitem->collectiontitle, + place => $biblio->biblioitem->place, + ); + } } $template->param(