LP1125567 - Staff client doesn't sort patron's checked out items user/paxed/lp1125567-sort_checked_out-2-signoff
authorKyle Tomita <tomitakyle@gmail.com>
Tue, 18 Jun 2013 23:14:49 +0000 (16:14 -0700)
committerPasi Kallinen <pasi.kallinen@pttk.fi>
Tue, 2 Jul 2013 16:00:55 +0000 (19:00 +0300)
For the solution, the sorting is handled in a fm_IDL.xml function,
action::open_circ_list.  The idea is to sort the action.circulation
table as a subquery before the array of ids is generated.  The items
out are sorted by due_date with ones due earliest on top.

Signed-off-by: Kyle Tomita <tomitakyle@gmail.com>
Signed-off-by: Pasi Kallinen <pasi.kallinen@pttk.fi>
Open-ILS/examples/fm_IDL.xml

index b4614ee..e25b71b 100644 (file)
@@ -3679,8 +3679,10 @@ SELECT  usr,
         ARRAY_TO_STRING(ARRAY_ACCUM( CASE WHEN (xact_finish IS NULL AND stop_fines = 'LOST') THEN id ELSE 0 END),',') AS lost,
         ARRAY_TO_STRING(ARRAY_ACCUM( CASE WHEN (xact_finish IS NULL AND stop_fines = 'CLAIMSRETURNED') THEN id ELSE 0 END),',') AS claims_returned,
         ARRAY_TO_STRING(ARRAY_ACCUM( CASE WHEN (xact_finish IS NULL AND stop_fines = 'LONGOVERDUE') THEN id ELSE 0 END),',') AS long_overdue
-  FROM  action.circulation
-  WHERE checkin_time IS NULL
+  FROM (SELECT usr, fine_interval, due_date, stop_fines, xact_finish, id, checkin_time
+        FROM action.circulation
+        WHERE checkin_time IS NULL
+        ORDER BY due_date ASC) AS sorted_ac
   GROUP BY 1
         </oils_persist:source_definition>
         <fields oils_persist:primary="usr">