Bugzilla – Attachment 140010 Details for
Bug 31463
(Bug 31313 follow-up) Show item order status on opac-detail
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 31463: Add order status to opac-detail.pl
Bug-31463-Add-order-status-to-opac-detailpl.patch (text/plain), 3.41 KB, created by
Joonas Kylmälä
on 2022-08-31 16:50:56 UTC
(
hide
)
Description:
Bug 31463: Add order status to opac-detail.pl
Filename:
MIME Type:
Creator:
Joonas Kylmälä
Created:
2022-08-31 16:50:56 UTC
Size:
3.41 KB
patch
obsolete
>From f73050fb543eab77ef4bcc6c3eb64ee2a56679ea Mon Sep 17 00:00:00 2001 >From: Nick Clemens <nick@bywatersolutions.com> >Date: Thu, 25 Aug 2022 13:12:19 +0000 >Subject: [PATCH] Bug 31463: Add order status to opac-detail.pl >MIME-Version: 1.0 >Content-Type: text/plain; charset=UTF-8 >Content-Transfer-Encoding: 8bit > >This adds a check for the preference OPACAcquisitionDetails and fetches >the active orders for the item if necessary > >Additionally, we simply the check for biblio orders to use object methods >and remove code that stored order information in the item_info > >To test: >1 - Enable preference: OPACAcquisitionDetails >2 - Create a basket with items created on order, add an order for a biblio, close the basket >3 - Create a second basket as above, add an order with multiple copies, leave basket open >4 - View biblio on opac >5 - You should see 1 item marked on order, and "1 items on order" below items table >6 - Close second basket >7 - Reload opac view, now 3 on order and in message >8 - Reopen first basket >9 - Reload opac view, now 2 on order and in message > >JK: Remove unused @itemnumbers_on_order variable >Signed-off-by: Joonas Kylmälä <joonas.kylmala@iki.fi> >--- > .../bootstrap/en/includes/item-status.inc | 2 +- > opac/opac-detail.pl | 17 ++--------------- > 2 files changed, 3 insertions(+), 16 deletions(-) > >diff --git a/koha-tmpl/opac-tmpl/bootstrap/en/includes/item-status.inc b/koha-tmpl/opac-tmpl/bootstrap/en/includes/item-status.inc >index 4c179ca0dd..ffa5b838b0 100644 >--- a/koha-tmpl/opac-tmpl/bootstrap/en/includes/item-status.inc >+++ b/koha-tmpl/opac-tmpl/bootstrap/en/includes/item-status.inc >@@ -103,7 +103,7 @@ > [% END %] > [% END %] > >-[% IF NOT ( item.isa('Koha::Item') ) AND item.on_order %][%# on_order is only set from opac-detail.pl %] >+[% IF Koha.Preference('OPACAcquisitionDetails') AND ( item.isa('Koha::Item') ) AND ( item.orders.filter_by_active.count ) %][%# on_order is only set from opac-detail.pl %] > [% SET itemavailable = 0 %] > <span class="item-status onorder">On order</span> > [% END %] >diff --git a/opac/opac-detail.pl b/opac/opac-detail.pl >index a7289f3d0a..ef508f8e62 100755 >--- a/opac/opac-detail.pl >+++ b/opac/opac-detail.pl >@@ -650,19 +650,10 @@ $template->param( > ); > > # Get items on order >-my ( @itemnumbers_on_order ); > if ( C4::Context->preference('OPACAcquisitionDetails' ) ) { >- my $orders = C4::Acquisition::SearchOrders({ >- biblionumber => $biblionumber, >- ordered => 1, >- }); >+ my $orders = $biblio->orders->filter_by_active; > my $total_quantity = 0; >- for my $order ( @$orders ) { >- my $order = Koha::Acquisition::Orders->find( $order->{ordernumber} ); >- my $basket = $order->basket; >- if ( $basket->effective_create_items eq 'ordering' ) { >- @itemnumbers_on_order = $order->items->get_column('itemnumber'); >- } >+ while ( my $order = $orders->next ) { > $total_quantity += $order->quantity; > } > $template->{VARS}->{acquisition_details} = { >@@ -728,10 +719,6 @@ else { > $item_info->{checkout} = $item->checkout; > $item_info->{object} = $item; > >- if ( C4::Context->preference('OPACAcquisitionDetails') ) { >- $item_info->{on_order} = 1 >- if grep { $_ eq $item->itemnumber } @itemnumbers_on_order; >- } > > if ( C4::Context->preference("OPACLocalCoverImages") == 1 ) { > $item_info->{cover_images} = $item->cover_images; >-- >2.30.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 31463
:
139796
|
139996
|
140010
|
141112
|
141113