if ($holdings and ref $holdings eq "ARRAY") {
$self->place_holdings_with_summary(
$tree, $holdings, $summary_id, $summary_type
+ ) or $self->apache->log->warn(
+ "could not place holdings within summary tree"
);
-# or $self->apache->log->warn(
-# "could not place holdings within summary tree"
-# );
} else {
$self->apache_log_if_event(
$holdings, "getting holdings grouped by summary $summary_id"
}
foreach my $child (@{$tree->{children}}) {
- return if $self->place_holdings_with_summary(
+ return 1 if $self->place_holdings_with_summary(
$child, $holdings, $sid, $stype
);
}
<div class='rdetail_extras_div'>[%
+expand_path = CGI.param('sepath') || [];
+seoffset_list = CGI.param('seoffset') || [];
+IF expand_path.size == 0 AND seoffset_list.size == 0;
+ seoffset_list = [0,0]; # compensate for $auto_expand_first; see ML
+END;
+
+selimit = CGI.param('selimit') || 10;
+ght_sepath = [];
+ght_depth = 0;
+
VIEW grouped_holding_tree;
BLOCK list;
'<ul class="rdetail-holding-group">';
- has_more = 0;
+ prev_seoffset_list = seoffset_list.slice(0, ght_depth + 1);
+ next_seoffset_list = seoffset_list.slice(0, ght_depth + 1);
+
+ prev_seoffset_list.$ght_depth = prev_seoffset_list.$ght_depth - selimit;
+ IF prev_seoffset_list.$ght_depth < 0;
+ prev_seoffset_list.$ght_depth = 0;
+ END;
+
+ next_seoffset_list.$ght_depth = next_seoffset_list.$ght_depth + selimit;
FOREACH node IN item;
IF NOT node.label;
has_more = 1;
LAST;
END;
- "<li>"; node.label; "</li>";
- IF node.children;
- view.print(node.children);
+
+ IF node.value;
+ ght_sepath.push(node.value);
+ all_balls = [];
+ FOREACH i IN [-1 .. ght_depth]; # aka [0 .. ght_depth+1]
+ all_balls.push(0);
+ END;
+
+ expand_link = mkurl(
+ '', {'sepath' => ght_sepath, 'seoffset' => all_balls},
+ 0, 'issues'
+ );
+
+ collapse_sepath = ght_sepath.slice(0, -2);
+ IF collapse_sepath.size == 0;
+ collapse_clear_params = ['sepath'];
+ ELSE;
+ collapse_clear_params = 0;
+ END;
+
+ collapse_link = mkurl(
+ '', {
+ 'sepath' => collapse_sepath,
+ 'seoffset' => all_balls.slice(0, -2)
+ }, collapse_clear_params, 'issues'
+ );
+
+ "<li><a href='";
+ IF node.children.size;
+ collapse_link;
+ ELSE;
+ expand_link;
+ END;
+ "'>"; node.label; "</a></li>";
+
+ IF node.children.size;
+ ght_depth = ght_depth + 1;
+ view.print(node.children);
+ ght_depth = ght_depth - 1;
+ END;
+
+ waste = ght_sepath.pop;
+ ELSE;
+ "<li>"; node.label; "</li>"; # XXX hold placement link here
END;
END;
+ IF seoffset_list.$ght_depth > 0;
+ '<a href="';
+ mkurl('', {seoffset => prev_seoffset_list}, 0, 'issues');
+ '">'; l('Previous'); '</a>';
+ END;
+ IF has_more;
+ '<a href="';
+ mkurl('', {seoffset => next_seoffset_list}, 0, 'issues');
+ '">'; l('Next'); '</a>';
+ END;
'</ul>';
END;
END;