Bugzilla – Attachment 167679 Details for
Bug 27063
Allow changing which record an order is linked to
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 27063: [WIP] Link different record to order from existing records
Bug-27063-WIP-Link-different-record-to-order-from-.patch (text/plain), 8.43 KB, created by
Aleisha Amohia
on 2024-06-13 01:43:45 UTC
(
hide
)
Description:
Bug 27063: [WIP] Link different record to order from existing records
Filename:
MIME Type:
Creator:
Aleisha Amohia
Created:
2024-06-13 01:43:45 UTC
Size:
8.43 KB
patch
obsolete
>From 1d618ab747e4be84e8d8c96763c78c0525151d1a Mon Sep 17 00:00:00 2001 >From: Aleisha Amohia <aleishaamohia@hotmail.com> >Date: Thu, 13 Jun 2024 00:14:57 +0000 >Subject: [PATCH] Bug 27063: [WIP] Link different record to order from existing > records > >So far this works for >* from an existing record >* from a suggestion >* from a new (empty) record >--- > acqui/neworderempty.pl | 22 +++++++++++++++++++ > acqui/newordersuggestion.pl | 16 ++++++++------ > .../prog/en/modules/acqui/basket.tt | 2 +- > .../en/modules/acqui/newordersuggestion.tt | 12 ++++++++-- > 4 files changed, 42 insertions(+), 10 deletions(-) > >diff --git a/acqui/neworderempty.pl b/acqui/neworderempty.pl >index 95c31d9aa85..f4b1566491c 100755 >--- a/acqui/neworderempty.pl >+++ b/acqui/neworderempty.pl >@@ -146,6 +146,28 @@ $booksellerid = $basket->{booksellerid} unless $booksellerid; > my $bookseller = Koha::Acquisition::Booksellers->find($booksellerid); > $data = GetOrder($ordernumber) if $ordernumber; > >+my $newdata; >+ >+# re-linking order to a different record >+if ( $biblionumber and $biblionumber != $data->{biblionumber} ) { >+ $newdata = GetBiblioData($biblionumber); >+} elsif ( $suggestionid and $ordernumber ) { >+ $newdata = GetSuggestion($suggestionid); >+} elsif ( $ordernumber and $input->param('relink') ) { >+ $newdata = {}; >+} >+if ($newdata) { >+ $data->{biblionumber} = $biblionumber; >+ $data->{title} = $newdata->{title} || ""; >+ $data->{author} = $newdata->{author} || ""; >+ $data->{publishercode} = $newdata->{publishercode} || ""; >+ $data->{editionstatement} = $newdata->{editionstatement} || ""; >+ $data->{publicationyear} = $newdata->{publicationyear} || ""; >+ $data->{isbn} = $newdata->{isbn} || ""; >+ $data->{seriestitle} = $newdata->{seriestitle} || ""; >+ $data->{copyrightdate} = $newdata->{copyrightdate} || ""; >+} >+ > output_and_exit( $input, $cookie, $template, 'unknown_basket') unless $basketobj; > output_and_exit( $input, $cookie, $template, 'unknown_vendor') unless $bookseller; > >diff --git a/acqui/newordersuggestion.pl b/acqui/newordersuggestion.pl >index 9d35ec48def..964b88c0181 100755 >--- a/acqui/newordersuggestion.pl >+++ b/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 $ordernumber = $input->param('ordernumber') || undef; > > $op = 'else' unless $op; > >@@ -140,11 +141,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, >+ ordernumber => $ordernumber, > ); > > output_html_with_http_headers $input, $cookie, $template->output; >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/basket.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/basket.tt >index f10b7a0d1de..046135b7902 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/basket.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/basket.tt >@@ -910,7 +910,7 @@ > </li> > <li><a href="/cgi-bin/koha/acqui/newordersuggestion.pl?booksellerid=[% booksellerid | uri %]&basketno=[% basket.basketno | uri %]">From a suggestion</a></li> > <li><a href="/cgi-bin/koha/acqui/newordersubscription.pl?booksellerid=[% booksellerid | uri %]&basketno=[% basket.basketno | uri %]">From a subscription</a></li> >- <li><a href="/cgi-bin/koha/acqui/neworderempty.pl?booksellerid=[% booksellerid | uri %]&basketno=[% basket.basketno | uri %]">From a new (empty) record</a></li> >+ <li><a href="/cgi-bin/koha/acqui/neworderempty.pl?booksellerid=[% booksellerid | uri %]&basketno=[% basket.basketno | uri %]&relink=1">From a new (empty) record</a></li> > <li><a href="/cgi-bin/koha/acqui/duplicate_orders.pl?basketno=[% basket.basketno | uri %]">From existing orders (copy)</a></li> > <li><a href="/cgi-bin/koha/acqui/z3950_search.pl?booksellerid=[% booksellerid | uri %]&basketno=[% basket.basketno | uri %]">From an external source</a></li> > [% IF ( CAN_user_tools_stage_marc_import ) %]<li><a href="/cgi-bin/koha/tools/stage-marc-import.pl?basketno=[% basket.basketno | uri %]&booksellerid=[% booksellerid | uri %]"> From a new file</a></li>[% END %] >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/newordersuggestion.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/newordersuggestion.tt >index 0a0b968b57a..1d1b37e0399 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/newordersuggestion.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/newordersuggestion.tt >@@ -101,9 +101,17 @@ > </td> > <td class="actions"> > [% IF ( suggestion.biblionumber ) %] >- <a href="neworderempty.pl?booksellerid=[% booksellerid | uri %]&basketno=[% basketno | uri %]&suggestionid=[% suggestion.suggestionid | uri %]&biblio=[% suggestion.biblionumber | uri %]" class="btn btn-default btn-xs"><i class="fa fa-plus"></i> [% tp('verb', 'Order') | html %]</a> >+ [% IF ordernumber %] >+ <a href="neworderempty.pl?booksellerid=[% booksellerid | uri %]&basketno=[% basketno | uri %]&suggestionid=[% suggestion.suggestionid | uri %]&biblio=[% suggestion.biblionumber | uri %]&ordernumber=[% ordernumber | uri %]" class="btn btn-default btn-xs"><i class="fa fa-plus"></i> [% tp('verb', 'Order') | html %]</a> >+ [% ELSE %] >+ <a href="neworderempty.pl?booksellerid=[% booksellerid | uri %]&basketno=[% basketno | uri %]&suggestionid=[% suggestion.suggestionid | uri %]&biblio=[% suggestion.biblionumber | uri %]" class="btn btn-default btn-xs"><i class="fa fa-plus"></i> [% tp('verb', 'Order') | html %]</a> >+ [% END %] > [% ELSE %] >- <a href="neworderempty.pl?booksellerid=[% booksellerid | uri %]&basketno=[% basketno | uri %]&suggestionid=[% suggestion.suggestionid | uri %]" class="btn btn-default btn-xs"><i class="fa fa-plus"></i> [% tp('verb', 'Order') | html %]</a> >+ [% IF ordernumber %] >+ <a href="neworderempty.pl?booksellerid=[% booksellerid | uri %]&basketno=[% basketno | uri %]&suggestionid=[% suggestion.suggestionid | uri %]&ordernumber=[% ordernumber | uri %]" class="btn btn-default btn-xs"><i class="fa fa-plus"></i> [% tp('verb', 'Order') | html %]</a> >+ [% ELSE %] >+ <a href="neworderempty.pl?booksellerid=[% booksellerid | uri %]&basketno=[% basketno | uri %]&suggestionid=[% suggestion.suggestionid | uri %]" class="btn btn-default btn-xs"><i class="fa fa-plus"></i> [% tp('verb', 'Order') | html %]</a> >+ [% END %] > [% END %] > </td> > </tr> >-- >2.39.2
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 27063
:
167619
|
167678
|
167679
|
167783
|
167784
|
167818
|
167819
|
168049
|
168050
|
168571
|
168572
|
170123
|
170166
|
170487
|
170488
|
170692
|
170693
|
170694
|
170695
|
170696
|
174648
|
174649