[Patches] [PATCH] [SIGND-OFF] Bug 6916: follow up

koha-patchbot at kohaaloha.com koha-patchbot at kohaaloha.com
Mon Nov 28 15:20:12 NZDT 2011


From: Marcel de Rooy <m.de.rooy at rijksmuseum.nl>
Date: Thu, 24 Nov 2011 10:07:33 +0100
Subject: [PATCH] [SIGND-OFF] Bug 6916: follow up

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.

Signed-off-by: Katrin Fischer <Katrin.Fischer.83 at web.de>
Checked that acquisition date is correctly linked for items created
with AcqCreateItem set to 'on order' and 'on receive'.
As items cataloged with 'in cataloguing' are not linked to acquisitions,
there is no link for that settings.
---
 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 7127f24..8b841b1 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 @@
             <div class="listgroup"><h4>History</h4>
             <ol class="bibliodetails">
 
-                <li><span class="label">
+                <li><span class="label">Accession Date:</span>
                 [% IF ( CAN_user_editcatalogue_edit_catalogue ) %]
-
-                    Accession Date:</span>
                     [% IF ( ITEM_DAT.basketno ) %]
-                    <a href="/cgi-bin/koha/acqui/parcel.pl?supplierid=[% ITEM_DAT.booksellerid %]&invoice=[% ITEM_DAT.booksellerinvoicenumber %]&datereceived=[% ITEM_DAT.datereceived %]">[% ITEM_DAT.dateaccessioned %]</a>
+                        <a href="/cgi-bin/koha/acqui/parcel.pl?supplierid=[% ITEM_DAT.booksellerid %]&invoice=[% ITEM_DAT.booksellerinvoicenumber %]&datereceived=[% ITEM_DAT.datereceived %]">[% ITEM_DAT.dateaccessioned %]</a>
                     [% ELSE %]
-                    [% ITEM_DAT.dateaccessioned %]
+                        [% ITEM_DAT.dateaccessioned %]
                     [% END %]
                 [% ELSE %]
                     [% ITEM_DAT.dateaccessioned %]
-                [% END %] </li>
+                [% END %]  </li>
 
-                
                 <li><span class="label">Total Checkouts:</span>[% IF ( ITEM_DAT.issues ) %][% ITEM_DAT.issues %][% ELSE %]0[% END %]  (<a href="/cgi-bin/koha/circ/bookcount.pl?&biblionumber=[% ITEM_DAT.biblionumber %]&bi=[% ITEM_DAT.biblioitemnumber %]&itm=[% ITEM_DAT.itemnumber %]">View item's checkout history</a>)</li>
 
                 <li><span class="label">Last seen:</span> [% ITEM_DAT.datelastseen %] </li>
-- 
1.7.5.4


More information about the Patches mailing list