From 9237ee80c4e6724f56999c86767477907426aac3 Mon Sep 17 00:00:00 2001 From: Jonathan Druart Date: Mon, 16 Dec 2013 11:57:15 +0100 Subject: [PATCH] Bug 11397: Remove the itemnumber list on the Acquisition detail tab The list of links to items from the acquisitions tab can be unwieldy if an order was used to purchase a lot of them, and the availability of AcqItemSetSubfieldsWhenReceived and filters on the holdings table provide alternative ways to do things like turn off on-order statuses. Test plan: - verify this patch does not introduce regression on the enhancement introduced by bug 8230. - verify the itemnumber list does not appears anymore. Signed-off-by: Nicole C. Engard The acquisitions details tab on the holdings table in the staff client no longer shows the links to the items. Tests pass. Signed-off-by: Katrin Fischer Passes all tests and QA script. In my tests the itemnumbers didn't show up on the acquisition detail tab before the patch. So the patch visually only changed the column header for me. All other acquisition related information showed up ok. Signed-off-by: Galen Charlton --- catalogue/detail.pl | 16 ++++++-------- .../prog/en/modules/catalogue/detail.tt | 21 ++++++------------- 2 files changed, 12 insertions(+), 25 deletions(-) diff --git a/catalogue/detail.pl b/catalogue/detail.pl index a3df03bb56..9cbf7f2f8a 100755 --- a/catalogue/detail.pl +++ b/catalogue/detail.pl @@ -20,7 +20,7 @@ use strict; use warnings; use CGI; -use C4::Acquisition qw( GetHistory GetItemnumbersFromOrder ); +use C4::Acquisition qw( GetHistory ); use C4::Auth; use C4::Dates qw/format_date/; use C4::Koha; @@ -167,16 +167,12 @@ foreach my $subscription (@subscriptions) { # Get acquisition details -my ( $orders, $qty, $price, $received ) = C4::Acquisition::GetHistory( biblionumber => $biblionumber, get_canceled_order => 1 ); -if ( C4::Context->preference('AcqCreateItem') eq 'ordering' ) { - for my $order ( @$orders ) { - $order->{itemnumbers} = [ C4::Acquisition::GetItemnumbersFromOrder( $order->{ordernumber} ) ]; - } +if ( C4::Context->preference('AcquisitionDetails') ) { + my ( $orders, $qty, $price, $received ) = C4::Acquisition::GetHistory( biblionumber => $biblionumber, get_canceled_order => 1 ); + $template->param( + orders => $orders, + ); } -$template->param( - orders => $orders, - AcquisitionDetails => C4::Context->preference('AcquisitionDetails'), -); if ( defined $dat->{'itemtype'} ) { $dat->{imageurl} = getitemtypeimagelocation( 'intranet', $itemtypes->{ $dat->{itemtype} }{imageurl} ); diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/detail.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/detail.tt index ceb34fe5c4..dd8487e97f 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/detail.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/detail.tt @@ -1,3 +1,4 @@ +[% USE Koha %] [% USE KohaDates %] [% USE AuthorisedValues %] [% USE KohaDates %] @@ -256,7 +257,7 @@ function verify_images() { table.before(link); deactivate_filters(id); } - [% IF AcquisitionDetails %] + [% IF Koha.Preference('AcquisitionDetails') %] $("#orders").dataTable($.extend(true, {}, dataTablesDefaults, { 'sDom': 't', 'bPaginate': false, @@ -496,7 +497,7 @@ function verify_images() { [% END %] [% IF ( MARCNOTES || notes ) %]
  • Descriptions
  • [% END %] [% IF ( subscriptionsnumber ) %]
  • Subscriptions
  • [% END %] -[% IF AcquisitionDetails %]
  • Acquisition details
  • [% END %] +[% IF Koha.Preference('AcquisitionDetails') %]
  • Acquisition details
  • [% END %] [% IF ( FRBRizeEditions ) %][% IF ( XISBNS ) %]
  • Editions
  • [% END %][% END %] [% IF ( LocalCoverImages ) %][% IF ( localimages || CAN_user_tools_upload_local_cover_images ) %]
  • Images
  • [% END %][% END %] [% IF ( HTML5MediaEnabled ) %][% IF ( HTML5MediaSets ) %]
  • Play media
  • [% END %][% END %] @@ -825,7 +826,7 @@ function verify_images() { [% END %] -[% IF AcquisitionDetails %] +[% IF Koha.Preference('AcquisitionDetails') %]
    [% IF orders %] @@ -837,7 +838,7 @@ function verify_images() { - + @@ -869,17 +870,7 @@ function verify_images() { [% CASE 'cancelled' %]Cancelled [% END %] - [% END %] -- 2.39.5
    Creation date Receive date StatusQuantity / itemsQuantity
    - [% order.quantity %] - [% IF order.itemnumbers.size > 0 && order.orderstatus != 'cancelled' %] - ( - [% FOR itemnumber IN order.itemnumbers %] - [% itemnumber %] - [%- UNLESS loop.last %],[% END %] - [% END %] - ) - [% END %] - + [% order.quantity %]