sub handle_hold_update {
my $self = shift;
my $action = shift;
+ my $hold_ids = shift;
my $e = $self->editor;
my $url;
- my @hold_ids = $self->cgi->param('hold_id'); # for non-_all actions
+ my @hold_ids = ($hold_ids) ? @$hold_ids : $self->cgi->param('hold_id'); # for non-_all actions
@hold_ids = @{$self->fetch_user_holds(undef, 1)} if $action =~ /_all/;
my $circ = OpenSRF::AppSession->create('open-ils.circ');
my $e = $self->editor;
my $ctx = $self->ctx;
-
my $limit = $self->cgi->param('limit') || 0;
my $offset = $self->cgi->param('offset') || 0;
my $action = $self->cgi->param('action') || '';
+ my $hold_id = $self->cgi->param('id');
my $available = int($self->cgi->param('available') || 0);
my $hold_handle_result;
$hold_handle_result = $self->handle_hold_update($action) if $action;
- $ctx->{holds} = $self->fetch_user_holds(undef, 0, 1, $available, $limit, $offset);
+ $ctx->{holds} = $self->fetch_user_holds($hold_id ? [$hold_id] : undef, 0, 1, $available, $limit, $offset);
return defined($hold_handle_result) ? $hold_handle_result : Apache2::Const::OK;
}
"default/opac/parts/myopac/base.tt2";
myopac_page = "holds"; # in this case, just for tab coloring.
- hold = 0;
- FOR h IN ctx.holds;
- IF h.hold.hold.id == CGI.param('id');
- hold = h;
- ahr = hold.hold.hold;
- attrs = {marc_xml => hold.marc_xml};
- PROCESS get_marc_attrs args=attrs;
- hold.human_status = PROCESS get_hold_status hold=hold;
+ hold = ctx.holds.0;
+ ahr = hold.hold.hold;
+ attrs = {marc_xml => hold.marc_xml};
+ PROCESS get_marc_attrs args=attrs;
+ hold.human_status = PROCESS get_hold_status hold=hold;
- # Do this up front to avoid verbosity later
- expire_time = ahr.expire_time ? date.format(ctx.parse_datetime(ahr.expire_time), DATE_FORMAT) : '';
- thaw_date = ahr.thaw_date ? date.format(ctx.parse_datetime(ahr.thaw_date), DATE_FORMAT) : '';
- LAST;
- END;
- END;
+ # Do this up front to avoid verbosity later
+ expire_time = ahr.expire_time ? date.format(ctx.parse_datetime(ahr.expire_time), DATE_FORMAT) : '';
+ thaw_date = ahr.thaw_date ? date.format(ctx.parse_datetime(ahr.thaw_date), DATE_FORMAT) : '';
%]
<div class="pad-bottom-five">
<div class="header_middle">