Bugzilla – Attachment 167818 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: Add modal for linking a basket order to a different record
Bug-27063-Add-modal-for-linking-a-basket-order-to-.patch (text/plain), 11.50 KB, created by
Aleisha Amohia
on 2024-06-18 03:54:19 UTC
(
hide
)
Description:
Bug 27063: Add modal for linking a basket order to a different record
Filename:
MIME Type:
Creator:
Aleisha Amohia
Created:
2024-06-18 03:54:19 UTC
Size:
11.50 KB
patch
obsolete
>From c1b5a4c61eec4efe54b6204d34d9d59c11840a50 Mon Sep 17 00:00:00 2001 >From: Aleisha Amohia <aleishaamohia@hotmail.com> >Date: Tue, 11 Jun 2024 04:53:05 +0000 >Subject: [PATCH] Bug 27063: Add modal for linking a basket order to a > different record > >--- > catalogue/search.pl | 7 +- > .../prog/en/modules/acqui/basket.tt | 64 +++++++++++++++++++ > .../prog/en/modules/catalogue/results.tt | 4 ++ > .../prog/js/acquisitions-menu.js | 8 ++- > 4 files changed, 78 insertions(+), 5 deletions(-) > >diff --git a/catalogue/search.pl b/catalogue/search.pl >index 998484d301b..a7e7186f94d 100755 >--- a/catalogue/search.pl >+++ b/catalogue/search.pl >@@ -223,10 +223,11 @@ if($cgi->cookie("holdforclub")){ > } > > if($cgi->cookie("searchToOrder")){ >- my ( $basketno, $vendorid ) = split( /\//, $cgi->cookie("searchToOrder") ); >+ my ( $basketno, $vendorid, $ordernumber ) = split( /\//, $cgi->cookie("searchToOrder") ); > $template->param( >- searchtoorder_basketno => $basketno, >- searchtoorder_vendorid => $vendorid >+ searchtoorder_basketno => $basketno, >+ searchtoorder_vendorid => $vendorid, >+ searchtoorder_ordernumber => $ordernumber, > ); > } > >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 c815cadc757..fae6c01d890 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/basket.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/basket.tt >@@ -723,6 +723,8 @@ > <a href="neworderempty.pl?ordernumber=[% books_loo.ordernumber | uri %]&booksellerid=[% booksellerid | uri %]&basketno=[% basketno | uri %]">Modify</a> > <br /> > <a href="#" class="transfer_order" data-ordernumber="[% books_loo.ordernumber | html %]">Transfer</a> >+ <br> >+ <a href="#relinkOrder" role="button" class="relink_order" data-toggle="modal" data-ordernumber="[% books_loo.ordernumber | html %]" data-basketname="[% basket.basketname | html %]">Link to different record</a> > [% END %] > </td> > [% END %] >@@ -885,6 +887,50 @@ > </div><!-- /.modal#addtoBasket --> > [% END # /UNLESS ( closedate ) %] > >+ <!-- Modal --> >+ <div id="relinkOrder" class="modal" tabindex="-1" role="dialog" aria-labelledby="relinkOrderLabel" aria-hidden="true"> >+ <div class="modal-dialog" role="document"> >+ <div class="modal-content"> >+ <div class="modal-header"> >+ <button type="button" class="closebtn" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">×</span></button> >+ <h4 class="modal-title" id="relinkOrderLabel">Relink order in basket</h4> >+ </div> >+ <div class="modal-body"> >+ <fieldset class="acqui_basket_relink"> >+ <legend class="sr-only">Relink order in basket</legend> >+ [% IF has_budgets %] >+ <ul> >+ <li> >+ <form action="/cgi-bin/koha/catalogue/search.pl" method="get"> >+ <label>From an existing record: >+ <input type="text" name="q" size="25" /> >+ </label> >+ <input type="submit" class="submit" id="searchtoorder" data-booksellerid="[% booksellerid | html %]" data-basketno="[% basket.basketno | html %]" data-ordernumber="" value="Submit" /> >+ </form> >+ </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/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 %] >+ <li><a href="/cgi-bin/koha/acqui/addorderiso2709.pl?booksellerid=[% booksellerid | uri %]&basketno=[% basket.basketno | uri %]"> From a staged file</a></li> >+ [% IF ( CAN_user_circulate ) %]<li><a href="/cgi-bin/koha/circ/reserveratios.pl?booksellerid=[% booksellerid | uri %]&basketno=[% basket.basketno | uri %]">From titles with highest hold ratios</a></li>[% END %] >+ </ul> >+ [% ELSE %] >+ <div class="dialog alert"> >+ <p>You can't create any orders unless you first <a href="/cgi-bin/koha/admin/aqbudgetperiods.pl">define a budget and a fund</a>.</p> >+ </div> >+ [% END %] >+ </fieldset> >+ </div> >+ <div class="modal-footer"> >+ <a href="#" class="cancel" data-dismiss="modal" aria-hidden="true">Cancel</a> >+ </div> >+ </div><!-- /.modal-content --> >+ </div><!-- /.modal-dialog --> >+ </div><!-- /.modal#relinkOrder --> >+ > [% END # /IF ( delete_confirmed ) %] > [% END # /IF ( NO_BOOKSELLER ) %] > [% ELSE %] >@@ -1106,6 +1152,24 @@ > $(this).find("legend").html(legend); > $(this).find("input:text").focus(); > }); >+ >+ $(".relink_order").click(function(){ >+ var basket = $(this).data("basketname"); >+ var ordernumber = $(this).data("ordernumber"); >+ var legend = _("Relink order no. %s in basket %s").format(ordernumber, basket); >+ $("#relinkOrder").find("h4").text( legend ); >+ $("#relinkOrder").find("legend").html(legend); >+ $("#relinkOrder").find("input:text").focus(); >+ $("#relinkOrder").find("input[id='searchtoorder']").attr("data-ordernumber", ordernumber); >+ $("#relinkOrder a").each(function() { >+ var link = $(this).attr("href"); >+ if ( link.indexOf("duplicate_orders") >= 0 ) { >+ $(this).attr("href", link + "&linking_ordernumber=" + ordernumber); >+ } else { >+ $(this).attr("href", link + "&ordernumber=" + ordernumber); >+ } >+ }); >+ }); > }); > </script> > >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/results.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/results.tt >index 91db336895a..5d10b8fa67a 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/results.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/results.tt >@@ -590,7 +590,11 @@ > > [% IF ( CAN_user_acquisition_order_manage ) %] > [% IF ( searchtoorder_basketno && searchtoorder_vendorid ) %] >+ [% IF searchtoorder_ordernumber %] >+ | <a href="/cgi-bin/koha/acqui/neworderempty.pl?booksellerid=[% searchtoorder_vendorid | uri %]&basketno=[% searchtoorder_basketno | uri %]&biblionumber=[% SEARCH_RESULT.biblionumber | uri %]&ordernumber=[% searchtoorder_ordernumber | uri %]">Relink to order</a> >+ [% ELSE %] > | <a href="/cgi-bin/koha/acqui/neworderempty.pl?booksellerid=[% searchtoorder_vendorid | uri %]&basketno=[% searchtoorder_basketno | uri %]&biblionumber=[% SEARCH_RESULT.biblionumber | uri %]">Add order</a> >+ [% END %] > [% END %] > [% END %] > >diff --git a/koha-tmpl/intranet-tmpl/prog/js/acquisitions-menu.js b/koha-tmpl/intranet-tmpl/prog/js/acquisitions-menu.js >index 313ae0f5ef9..a1f5ca400cf 100644 >--- a/koha-tmpl/intranet-tmpl/prog/js/acquisitions-menu.js >+++ b/koha-tmpl/intranet-tmpl/prog/js/acquisitions-menu.js >@@ -1,8 +1,11 @@ >-function searchToOrder( basketno, vendorid ){ >+function searchToOrder( basketno, vendorid, ordernumber ){ > var date = new Date(); > var cookieData = ""; > date.setTime(date.getTime() + (10 * 60 * 1000)); > cookieData += basketno + "/" + vendorid; >+ if ( ordernumber ) { >+ cookieData += "/" + ordernumber; >+ } > Cookies.set("searchToOrder", cookieData, { path: "/", expires: date, sameSite: 'Lax' }); > } > >@@ -15,6 +18,7 @@ $(document).ready(function() { > $("body").on("click", "#searchtoorder", function(){ > var vendorid = $(this).data("booksellerid"); > var basketno = $(this).data("basketno"); >- searchToOrder( basketno, vendorid ); >+ var ordernumber = $(this).data("ordernumber"); >+ searchToOrder( basketno, vendorid, ordernumber ); > }); > }); >-- >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