@@ -, +, @@ --- acqui/newordersuggestion.pl | 23 +++++++++++++------ .../prog/en/modules/acqui/basket.tt | 4 ++++ .../en/modules/acqui/newordersuggestion.tt | 4 +++- 3 files changed, 23 insertions(+), 8 deletions(-) --- a/acqui/newordersuggestion.pl +++ a/acqui/newordersuggestion.pl @@ -103,14 +103,15 @@ my $input = CGI->new; # getting the CGI params my $basketno = $input->param('basketno'); -my $booksellerid = $input->param('booksellerid'); +my $booksellerid = $input->param('booksellerid'); my $author = $input->param('author'); my $title = $input->param('title'); my $publishercode = $input->param('publishercode'); my $op = $input->param('op'); my $suggestionid = $input->param('suggestionid'); my $duplicateNumber = $input->param('duplicateNumber'); -my $uncertainprice = $input->param('uncertainprice'); +my $uncertainprice = $input->param('uncertainprice'); +my $link_order = $input->param('link_order'); $op = 'else' unless $op; @@ -128,6 +129,13 @@ if ( $op eq 'connectDuplicate' ) { ConnectSuggestionAndBiblio( $suggestionid, $duplicateNumber ); } +if ( $op eq 'link_order' and $link_order ) { + my $order = Koha::Acquisition::Orders->find($link_order); + my $suggestion = Koha::Suggestions->find($suggestionid); + $suggestion->update( { biblionumber => $order->biblionumber } ) if $order->biblionumber; + print $input->redirect( "/cgi-bin/koha/acqui/basket.pl?basketno=" . $basketno ); +} + my $suggestions = [ Koha::Suggestions->search_limited( { ( $author ? ( author => $author ) : () ), @@ -140,11 +148,12 @@ my $suggestions = [ Koha::Suggestions->search_limited( my $vendor = Koha::Acquisition::Booksellers->find( $booksellerid ); $template->param( - suggestions => $suggestions, - basketno => $basketno, - booksellerid => $booksellerid, - name => $vendor->name, - "op_$op" => 1, + suggestions => $suggestions, + basketno => $basketno, + booksellerid => $booksellerid, + name => $vendor->name, + "op_$op" => 1, + link_order => $link_order, ); output_html_with_http_headers $input, $cookie, $template->output; --- a/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/basket.tt +++ a/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/basket.tt @@ -723,6 +723,10 @@ Modify
Transfer +
+ [% END %] + [% UNLESS ( books_loo.suggestionid ) %] + Search for suggestion to link [% END %] [% END %] --- a/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/newordersuggestion.tt +++ a/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/newordersuggestion.tt @@ -100,7 +100,9 @@ [% suggestion.total | $Price %] - [% IF ( suggestion.biblionumber ) %] + [% IF link_order %] + [% tp('verb', 'Link suggestion') | html %] + [% ELSIF ( suggestion.biblionumber ) %] [% tp('verb', 'Order') | html %] [% ELSE %] [% tp('verb', 'Order') | html %] --