From 1aa2fd7599a0f25f61fcd9802a52a31eb842baec Mon Sep 17 00:00:00 2001 From: Marcel de Rooy Date: Thu, 24 Nov 2011 10:07:33 +0100 Subject: [PATCH] 6916 follow up Content-Type: text/plain; charset="utf-8" Changed the SQL statement in GetOrderFromItemnumber so that it works also if syspref AcqCreateItem is not equal to placing an order. Returned hash now only includes fields from aqorders. This function is used in moredetail.pl and Items.pm (function MoveItemFromBiblio). Modified moredetail template so that label is shown always. Added nbsp to prevent mixup of columns when date is null. Test this by checking Items tab in normal view staff and by attaching an item in normal view staff (actually moving an item). Check moredetail again while changing syspref AcqCreateItem. --- C4/Acquisition.pm | 17 +++++++---------- .../prog/en/modules/catalogue/moredetail.tt | 11 ++++------- 2 files changed, 11 insertions(+), 17 deletions(-) diff --git a/C4/Acquisition.pm b/C4/Acquisition.pm index a0dda42..3d16438 100644 --- a/C4/Acquisition.pm +++ b/C4/Acquisition.pm @@ -72,20 +72,17 @@ sub GetOrderFromItemnumber { my ($itemnumber) = @_; my $dbh = C4::Context->dbh; my $query = qq| - - SELECT * from aqorders LEFT JOIN aqorders_items - ON ( aqorders.ordernumber = aqorders_items.ordernumber ) - WHERE itemnumber = ? |; + SELECT ord.* from aqorders ord + LEFT JOIN items it ON it.biblionumber=ord.biblionumber + WHERE it.itemnumber=?|; + #Bugzilla 6916: query used join with aqorders_items, but this only + #worked if syspref AcqCreateItems == placing an order. Now we use items. + #It is not needed to return columns from tables other than aqorders. my $sth = $dbh->prepare($query); - -# $sth->trace(3); - $sth->execute($itemnumber); - my $order = $sth->fetchrow_hashref; - return ( $order ); - + return $order; } # Returns the itemnumber(s) associated with the ordernumber given in parameter diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/moredetail.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/moredetail.tt index 36e7149..5f30209 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/moredetail.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/moredetail.tt @@ -151,20 +151,17 @@

History

    -
  1. +
  2. Accession Date: [% IF ( CAN_user_editcatalogue_edit_catalogue ) %] - - Accession Date: [% IF ( ITEM_DAT.basketno ) %] - [% ITEM_DAT.dateaccessioned %] + [% ITEM_DAT.dateaccessioned %] [% ELSE %] - [% ITEM_DAT.dateaccessioned %] + [% ITEM_DAT.dateaccessioned %] [% END %] [% ELSE %] [% ITEM_DAT.dateaccessioned %] - [% END %]
  3. + [% END %]   -
  4. Total Checkouts:[% IF ( ITEM_DAT.issues ) %][% ITEM_DAT.issues %][% ELSE %]0[% END %] (View item's checkout history)
  5. Last seen: [% ITEM_DAT.datelastseen %] 
  6. -- 1.6.0.6