Bugzilla – Attachment 167784 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), 11.79 KB, created by
Aleisha Amohia
on 2024-06-17 05:44:33 UTC
(
hide
)
Description:
Bug 27063: [WIP] Link different record to order from existing records
Filename:
MIME Type:
Creator:
Aleisha Amohia
Created:
2024-06-17 05:44:33 UTC
Size:
11.79 KB
patch
obsolete
>From 79eaddbfd44735671d91dcde2f007f5baadb5076 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 >* from a subscription >--- > acqui/neworderempty.pl | 22 +++++++++++++++++++ > acqui/newordersubscription.pl | 2 ++ > acqui/newordersuggestion.pl | 16 ++++++++------ > .../prog/en/includes/subscriptions-search.inc | 3 +++ > .../prog/en/modules/acqui/basket.tt | 2 +- > .../en/modules/acqui/newordersubscription.tt | 4 ++++ > .../en/modules/acqui/newordersuggestion.tt | 12 ++++++++-- > 7 files changed, 51 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/newordersubscription.pl b/acqui/newordersubscription.pl >index e8d776598bf..f6be8009e7f 100755 >--- a/acqui/newordersubscription.pl >+++ b/acqui/newordersubscription.pl >@@ -37,6 +37,7 @@ my $branch = $query->param('branch_filter'); > my $routing = $query->param('routing') || C4::Context->preference("RoutingSerials"); > my $searched = $query->param('searched'); > my $biblionumber = $query->param('biblionumber'); >+my $ordernumber = $query->param('ordernumber'); > > my $basketno = $query->param('basketno'); > my $booksellerid = $query->param('booksellerid'); >@@ -88,5 +89,6 @@ $template->param( > basketno => $basket->{basketno}, > basketname => $basket->{basketname}, > booksellername => $bookseller->name, >+ ordernumber => $ordernumber, > ); > output_html_with_http_headers $query, $cookie, $template->output; >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/includes/subscriptions-search.inc b/koha-tmpl/intranet-tmpl/prog/en/includes/subscriptions-search.inc >index 5e1275d249c..362133cf4c2 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/includes/subscriptions-search.inc >+++ b/koha-tmpl/intranet-tmpl/prog/en/includes/subscriptions-search.inc >@@ -43,6 +43,9 @@ > [% IF (basketno) %] > <input type="hidden" name="basketno" value="[% basketno | html %]" /> > [% END %] >+ [% IF ordernumber %] >+ <input type="hidden" name="ordernumber" value="[% ordernumber | html %]" /> >+ [% END %] > </div> > </fieldset> > <fieldset class="action"> >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 fae6c01d890..84aa26e399d 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/newordersubscription.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/newordersubscription.tt >index b164248092e..d40bb8f7848 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/newordersubscription.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/newordersubscription.tt >@@ -91,7 +91,11 @@ > Outstanding order > [% END %] > [% IF not sub.aqbooksellerid || booksellerid == sub.aqbooksellerid %] >+ [% IF ordernumber %] >+ <a href="/cgi-bin/koha/acqui/neworderempty.pl?booksellerid=[% booksellerid | uri %]&basketno=[% basketno | uri %]&biblionumber=[% sub.biblionumber | uri %]&from_subscriptionid=[% sub.subscriptionid | uri %]&ordernumber=[% ordernumber | uri %]" title="Order this one" class="btn btn-default btn-xs"> >+ [% ELSE %] > <a href="/cgi-bin/koha/acqui/neworderempty.pl?booksellerid=[% booksellerid | uri %]&basketno=[% basketno | uri %]&biblionumber=[% sub.biblionumber | uri %]&from_subscriptionid=[% sub.subscriptionid | uri %]" title="Order this one" class="btn btn-default btn-xs"> >+ [% END %] > <i class="fa fa-plus"></i> [% tp('verb', 'Order') | html %] > </a> > [% ELSE %] >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