LP #1092921: Display of/sorting by CN affixes in Simplified Hold Pull List
authorLebbeous Fogle-Weekley <lebbeous@esilibrary.com>
Wed, 2 Jan 2013 17:33:36 +0000 (12:33 -0500)
committerBen Shum <bshum@biblio.org>
Wed, 6 Feb 2013 03:30:13 +0000 (22:30 -0500)
In the Simplified Hold Pull List interface, the "Call Number Label" column
displays the call number of the copy targeted by the hold in each row,
and it does so by combining affixes with the actual label field.
Sorting of this column actually uses the call number sortkey generated
in-database for this purpose.

Sometimes this means that sorting order doesn't match what you'd
expect to see with this column.  Opinions differ on desired behavior, so
now you can explicity add columns to the table for call number prefix
and suffix, and sort on either of those (potentially in combination with
other columns).

Amended from an earlier version of this commit that still didn't sort
CN prefix and suffix columns quite right.

Signed-off-by: Lebbeous Fogle-Weekley <lebbeous@esilibrary.com>
Signed-off-by: Kathy Lussier <klussier@masslnc.org>
Signed-off-by: Ben Shum <bshum@biblio.org>
Open-ILS/src/templates/circ/hold_pull_list.tt2

index 67056a8..0b744df 100644 (file)
             "path": "current_copy.circ_lib",
             "filter": true
         },
             "path": "current_copy.circ_lib",
             "filter": true
         },
+        "call_number_prefix_sort_key": {
+            "path": "current_copy.call_number.prefix.label_sortkey",
+            "sort": true
+        },
+        "call_number_suffix_sort_key": {
+            "path": "current_copy.call_number.suffix.label_sortkey",
+            "sort": true
+        },
         "call_number_sort_key": {
             "path": "current_copy.call_number.label_sortkey",
         "call_number_sort_key": {
             "path": "current_copy.call_number.label_sortkey",
-            "sort" :true
+            "sort"true
         }
     };
 
         }
     };
 
@@ -84,7 +92,7 @@
         defaultSort="['copy_location_order_position','call_number_sort_key']"
         mapExtras="map_extras"
         suppressFilterFields="['copy_circ_lib']"
         defaultSort="['copy_location_order_position','call_number_sort_key']"
         mapExtras="map_extras"
         suppressFilterFields="['copy_circ_lib']"
-        sortFieldReMap="{call_number_label:'call_number_sort_key',shelving_loc:'copy_location_order_position'}"
+        sortFieldReMap="{call_number_label:'call_number_sort_key',cn_prefix:'call_number_prefix_sort_key',cn_suffix:'call_number_suffix_sort_key',shelving_loc:'copy_location_order_position'}"
         fetchLock="true"
         query="{}">
         <thead>
         fetchLock="true"
         query="{}">
         <thead>
                 <th field="request_lib_shortname" fpath="request_lib.shortname" _visible="false" ffilter="true">[% l('Request Library (Shortname)') %]</th>
                 <th field="selection_ou" fpath="selection_ou.shortname" _visible="false" ffilter="true">[% l('Selection Locus') %]</th>
                 <th field="sms_carrier_name" fpath="sms_carrier.name" _visible="false" ffilter="true">[% l('SMS Carrier') %]</th>
                 <th field="request_lib_shortname" fpath="request_lib.shortname" _visible="false" ffilter="true">[% l('Request Library (Shortname)') %]</th>
                 <th field="selection_ou" fpath="selection_ou.shortname" _visible="false" ffilter="true">[% l('Selection Locus') %]</th>
                 <th field="sms_carrier_name" fpath="sms_carrier.name" _visible="false" ffilter="true">[% l('SMS Carrier') %]</th>
+                <th field="cn_prefix" fpath="current_copy.call_number.prefix.label" _visible="false" ffilter="true" fsort="true">[% l('Call Number Prefix') %]</th>
+                <th field="cn_suffix" fpath="current_copy.call_number.suffix.label" _visible="false" ffilter="true" fsort="true">[% l('Call Number Suffix') %]</th>
             </tr>
         </thead>
     </table>
             </tr>
         </thead>
     </table>