sub load_print_record {
my $self = shift;
- my $rec_id = $self->ctx->{page_args}->[0]
+ my $rec_or_list_id = $self->ctx->{page_args}->[0]
or return Apache2::Const::HTTP_BAD_REQUEST;
- $self->{ctx}->{bre_id} = $rec_id;
+ my $is_list = $self->cgi->param('is_list');
+ my $list;
+ if ($is_list) {
+
+ $list = $U->simplereq(
+ 'open-ils.actor',
+ 'open-ils.actor.anon_cache.get_value',
+ $rec_or_list_id, (ref $self)->ANON_CACHE_MYLIST);
+
+ if(!$list) {
+ $list = [];
+ }
+
+ { # sanitize
+ no warnings qw/numeric/;
+ $list = [map { int $_ } @$list];
+ $list = [grep { $_ > 0} @$list];
+ };
+ } else {
+ $list = $rec_or_list_id;
+ $self->{ctx}->{bre_id} = $rec_or_list_id;
+ }
+
$self->{ctx}->{printable_record} = $U->simplereq(
'open-ils.search',
- 'open-ils.search.biblio.record.print', $rec_id);
+ 'open-ils.search.biblio.record.print', $list);
return Apache2::Const::OK;
}