BEGIN; INSERT INTO config.upgrade_log (version) VALUES ('0384'); INSERT INTO action_trigger.hook (key,core_type,description,passive) VALUES ( 'ahr.format.pull_list', 'ahr', oils_i18n_gettext( 'ahr.format.pull_list', 'Format holds pull list for printing', 'ath', 'description' ), FALSE ); INSERT INTO action_trigger.event_definition ( id, active, owner, name, hook, validator, reactor, group_field, granularity, template ) VALUES ( 35, TRUE, 1, 'Holds Pull List', 'ahr.format.pull_list', 'NOOP_True', 'ProcessTemplate', 'pickup_lib', 'print-on-demand', $$ [%- USE date -%] [% # Sort the holds into copy-location buckets # In the main print loop, sort each bucket by callnumber before printing SET holds_list = []; SET loc_data = []; SET current_location = target.0.current_copy.location.id; FOR hold IN target; IF current_location != hold.current_copy.location.id; SET current_location = hold.current_copy.location.id; holds_list.push(loc_data); SET loc_data = []; END; SET hold_data = { 'hold' => hold, 'callnumber' => hold.current_copy.call_number.label }; loc_data.push(hold_data); END; holds_list.push(loc_data) %]
Title | Author | Shelving Location | Call Number | Barcode | Patron |
---|---|---|---|---|---|
[% copy_data.title | truncate %] | [% copy_data.author | truncate %] | [% hold.current_copy.location.name %] | [% hold.current_copy.call_number.label %] | [% hold.current_copy.barcode %] | [% hold.usr.card.barcode %] |