From: Jane Wagner Date: Fri, 9 Oct 2009 15:06:17 +0000 (-0400) Subject: Bug 3702 add branch description as primary sort for items in staff mode X-Git-Tag: v3.02.00-alpha~54^2~76 X-Git-Url: http://git.rot13.org/?a=commitdiff_plain;h=0157b46e1331e90a92407f6e8971b9c77e1b41b0;p=koha.git 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. --- 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;