[%-
# If being used in serial mode, flatten list of units so that they can be
# used like one long list of copies without changing so much code below.
IF serial_holdings;
copies = [];
FOREACH h IN serial_holdings;
units = h.units.slice(0); # copy
FOREACH unit IN units;
unit.holding_label = h.label;
END;
copies = copies.merge(units);
END;
END;
FOREACH copy_info IN copies;
IF copy_info.call_number_label != '##URI##';
has_copies = 'true';
END;
IF copy_info.part_label != '';
has_parts = 'true';
END;
IF has_parts && has_copies;
LAST;
END;
END;
-%]
[%-
IF has_copies or ctx.foreign_copies;
depth = CGI.param('copy_depth').defined ? CGI.param('copy_depth') : CGI.param('depth').defined ? CGI.param('depth') : ctx.copy_summary.last.depth;
total_copies = ctx.copy_summary.$depth.count;
%]
[% use_courses = (ctx.get_org_setting(ctx.aou_tree.id, 'circ.course_materials_opt_in') == 1) ? 1 : 0 %]
[% IF ctx.geo_sort %]