2 expand_path = CGI.param('sepath') || [];
3 expand_path = expand_path.list; # sic
5 seoffset_list = CGI.param('seoffset') || [];
6 seoffset_list = seoffset_list.list; # sic
8 IF expand_path.size == 0 AND seoffset_list.size == 0;
9 seoffset_list = [0,0]; # compensate for $auto_expand_first; see ML
12 selimit = CGI.param('selimit') || 10;
16 VIEW grouped_holding_tree;
18 '<div class="rdetail-holding-group">';
19 prev_seoffset_list = seoffset_list.slice(0, ght_depth);
20 next_seoffset_list = seoffset_list.slice(0, ght_depth);
22 prev_seoffset_list.$ght_depth = prev_seoffset_list.$ght_depth - selimit;
23 IF prev_seoffset_list.$ght_depth < 0;
24 prev_seoffset_list.$ght_depth = 0;
27 next_seoffset_list.$ght_depth = next_seoffset_list.$ght_depth + selimit;
29 INCLUDE "opac/parts/record/copy_table.tt2" serial_holdings=item;
40 ght_sepath.push(node.value);
41 new_seoffsets = seoffset_list.slice(0, ght_depth);
42 new_seoffsets.push(0);
45 '', {'sepath' => ght_sepath, 'seoffset' => new_seoffsets},
49 collapse_sepath = ght_sepath.slice(0, -2);
50 IF collapse_sepath.size == 0;
51 collapse_clear_params = ['sepath'];
53 collapse_clear_params = 0;
56 collapse_link = mkurl(
58 'sepath' => collapse_sepath,
59 'seoffset' => new_seoffsets.slice(0, -2)
60 }, collapse_clear_params, 'issues'
63 "<div class='rdetail-holding-group'>";
64 IF node.children.size;
65 # TODO: make images or figure out a CSS trick or
66 # something. I doubt we can count on all OPAC clients
67 # having adequate fonts to cover these Unicode glyphs.
68 "▼ <a href='"; collapse_link;
70 "► <a href='"; expand_link;
72 "'>"; node.label; "</a></div>";
74 IF node.children.size;
75 ght_depth = ght_depth + 1;
76 view.print(node.children);
77 ght_depth = ght_depth - 1;
80 waste = ght_sepath.pop;
82 "<div class='rdetail-holding-group'>"; node.label; "</div>";
83 # XXX Hold placement link here? Maybe not if no units.
88 new_sepath_end = ght_depth - 1;
89 IF new_sepath_end < 0;
90 to_clear = ['sepath'];
93 new_sepath = expand_path.slice(0, ght_depth - 1);
97 '<a class="paging" href="';
98 mkurl('',{seoffset => next_seoffset_list, sepath => new_sepath},to_clear,'issues');
99 '">« '; l('Earlier holdings'); '</a>';
101 IF seoffset_list.$ght_depth > 0;
102 '<a class="paging" href="';
103 mkurl('',{seoffset => prev_seoffset_list, sepath => new_sepath},to_clear,'issues');
104 '">'; l('Later holdings'); ' »</a> ';
111 VIEW holding_summary_tree;
113 '<div class="rdetail-holding-group">';
114 ctx.get_aou(item.org_unit).name; "<br />";
115 FOREACH summary IN item.holding_summaries;
117 twisty = '▼ ';
120 ['sid','stype','selimit','sepath','seoffset'], 'issues'
122 link_title = l('Collapse');
124 twisty = '► ';
126 '', {sid => summary.id, stype => summary.summary_type},
127 ['selimit','sepath','seoffset'], 'issues'
129 link_title = l('Expand');
132 '<a href="' _ link _ '" title="' _ link_title _ '">';
133 summary.generated_coverage.join(", ");
136 grouped_holding_tree.print(summary.holdings);
139 FOREACH child IN item.children;
145 <div class="holding-summary-tree">
146 [% holding_summary_tree.print(ctx.holding_summary_tree) %]
148 <div class="holding-summary-tree-pager">
149 [% slimit = CGI.param('slimit') || 10;
150 soffset = CGI.param('soffset') || 0;
151 soffset_prev = soffset - slimit;
152 IF soffset_prev < 0; soffset_prev = 0; END;
153 soffset_next = soffset + slimit;
156 <a href="[% mkurl('', {soffset => soffset_prev}, ['sid','stype','sepath','selimit','seoffset'], 'issues') %]>[% l('Previous') %]</a>
158 [% IF ctx.holding_summary_tree.more %]
159 <a href="[% mkurl('', {soffset => soffset_next}, ['sid','stype','sepath','selimit','seoffset'], 'issues') %]">[% l('Next') %]</a>