From 0157b46e1331e90a92407f6e8971b9c77e1b41b0 Mon Sep 17 00:00:00 2001 From: Jane Wagner Date: Fri, 9 Oct 2009 11:06:17 -0400 Subject: [PATCH] Bug 3702 add branch description as primary sort for items in staff mode The default sort order for items attached to a title in staff mode is items.dateaccessioned desc. This means that a particular library's holdings will be scattered through the list -- a special problem when it comes to serial issues. I've done a change to Items.pm that makes the sort order branch description followed by dateaccessioned. Thus, a library's holdings will be grouped together in the display. --- C4/Items.pm | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/C4/Items.pm b/C4/Items.pm index 61126d9588..d2eee3621c 100644 --- a/C4/Items.pm +++ b/C4/Items.pm @@ -1267,11 +1267,12 @@ sub GetItemsInfo { items.notforloan as itemnotforloan, itemtypes.description FROM items + LEFT JOIN branches ON items.homebranch = branches.branchcode LEFT JOIN biblio ON biblio.biblionumber = items.biblionumber LEFT JOIN biblioitems ON biblioitems.biblioitemnumber = items.biblioitemnumber LEFT JOIN itemtypes ON itemtypes.itemtype = " . (C4::Context->preference('item-level_itypes') ? 'items.itype' : 'biblioitems.itemtype'); - $query .= " WHERE items.biblionumber = ? ORDER BY items.dateaccessioned desc" ; + $query .= " WHERE items.biblionumber = ? ORDER BY branches.branchname,items.dateaccessioned desc" ; my $sth = $dbh->prepare($query); $sth->execute($biblionumber); my $i = 0; -- 2.39.5