BEGIN; SELECT evergreen.upgrade_deps_block_check('0574', :eg_version); UPDATE action_trigger.event_definition SET template = $$ [%- 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) %] [% FOR loc_data IN holds_list %] [% FOR hold_data IN loc_data.sort('callnumber') %] [% SET hold = hold_data.hold; SET copy_data = helpers.get_copy_bib_basics(hold.current_copy.id); %] [% END %] [% END %]
Title Author Shelving Location Call Number Barcode/Part Patron
[% copy_data.title | truncate %] [% copy_data.author | truncate %] [% hold.current_copy.location.name %] [% hold.current_copy.call_number.label %] [% hold.current_copy.barcode %] [% FOR part IN hold.current_copy.parts %] [% part.part.label %] [% END %] [% hold.usr.card.barcode %]
$$ WHERE id = 35; INSERT INTO action_trigger.environment ( event_def, path ) VALUES (35, 'current_copy.parts'), (35, 'current_copy.parts.part') ; COMMIT;