Bug 3521 - Items table in catalogue/detail.pl and cataloguing/additem.pl is sorted... origin/new/bug_3521
authorKyle M Hall <kyle@bywatersolutions.com>
Thu, 29 Mar 2012 13:54:38 +0000 (09:54 -0400)
committerPaul Poulain <paul.poulain@biblibre.com>
Tue, 22 May 2012 21:18:40 +0000 (23:18 +0200)
commitf9352e89ac202eb84b235c3460f7d633db88ca14
treeeaf018e254f2e473d11f655afc2c52ab3977c0ef
parent0cdd38a5ae77d9cb084e46a8a7ca377b6f0cfaac
Bug 3521 - Items table in catalogue/detail.pl and cataloguing/additem.pl is sorted nonsensically

Based on patch submitted by Ian Walls

Items were sorted by branch, then date accessioned, in GetItemsInfo.  While this can be
helpful in some circumstances, more often it is useful for items to be sorted first by
their enumchron (volume/issue, if applicable) then by their copy number.  This patch changes the
sort on GetItemsInfo to branch, enumcrhon, copynumber then date accessioned.

As sorting on copynumber will be incorrect based on standard sorting ( e.g. 1, 10, 2, 20 ),
the copynumber is now padded with leading zeros to correct the sorting ( e.g. 01, 02, 10 20 ).
This function appears to be a standard SQL function and not a mysql-ism. I have verfified
that is available in MySQL, Postgres, and Oracle.

Signed-off-by: Liz Rea <wizzyrea@gmail.com>
Passed t xt

Item sorts appear to be correct to me based on the rubric of branch, enumchron, copynumber, then date accessioned.

Signed-off-by: Paul Poulain <paul.poulain@biblibre.com>
C4/Items.pm