1 package OpenILS::WWW::EGCatLoader;
2 use strict; use warnings;
3 use Apache2::Const -compile => qw(OK DECLINED FORBIDDEN HTTP_INTERNAL_SERVER_ERROR REDIRECT HTTP_BAD_REQUEST);
4 use OpenSRF::Utils::Logger qw/$logger/;
5 use OpenILS::Utils::CStoreEditor qw/:funcs/;
6 use OpenILS::Utils::Fieldmapper;
7 use OpenILS::Application::AppUtils;
8 use OpenSRF::Utils::JSON;
9 my $U = 'OpenILS::Application::AppUtils';
11 sub load_extended_user_info {
14 $self->ctx->{user} = $self->editor->retrieve_actor_user([
15 $self->ctx->{user}->id,
19 au => [qw/card home_ou addresses ident_type billing_address/]
23 ]) or return Apache2::Const::HTTP_INTERNAL_SERVER_ERROR;
29 # user : au object, fleshed
30 sub load_myopac_prefs {
32 return $self->load_extended_user_info || Apache2::Const::OK;
35 sub load_myopac_prefs_notify {
37 my $e = $self->editor;
39 my $user_prefs = $self->fetch_optin_prefs;
40 $user_prefs = $self->update_optin_prefs($user_prefs)
41 if $self->cgi->request_method eq 'POST';
43 $self->ctx->{opt_in_settings} = $user_prefs;
45 return Apache2::Const::OK;
48 sub fetch_optin_prefs {
50 my $e = $self->editor;
52 # fetch all of the opt-in settings the user has access to
53 # XXX: user's should in theory have options to opt-in to notices
54 # for remote locations, but that opens the door for a large
55 # set of generally un-used opt-ins.. needs discussion
56 my $opt_ins = $U->simplereq(
58 'open-ils.actor.event_def.opt_in.settings.atomic',
59 $e->authtoken, $e->requestor->home_ou);
61 # fetch user setting values for each of the opt-in settings
62 my $user_set = $U->simplereq(
64 'open-ils.actor.patron.settings.retrieve',
67 [map {$_->name} @$opt_ins]
70 return [map { {cust => $_, value => $user_set->{$_->name} } } @$opt_ins];
73 sub update_optin_prefs {
75 my $user_prefs = shift;
76 my $e = $self->editor;
77 my @settings = $self->cgi->param('setting');
80 # apply now-true settings
81 for my $applied (@settings) {
82 # see if setting is already applied to this user
83 next if grep { $_->{cust}->name eq $applied and $_->{value} } @$user_prefs;
84 $newsets{$applied} = OpenSRF::Utils::JSON->true;
87 # remove now-false settings
88 for my $pref (grep { $_->{value} } @$user_prefs) {
89 $newsets{$pref->{cust}->name} = undef
90 unless grep { $_ eq $pref->{cust}->name } @settings;
95 'open-ils.actor.patron.settings.update',
96 $e->authtoken, $e->requestor->id, \%newsets);
98 # update the local prefs to match reality
99 for my $pref (@$user_prefs) {
100 $pref->{value} = $newsets{$pref->{cust}->name}
101 if exists $newsets{$pref->{cust}->name};
107 sub load_myopac_prefs_settings {
109 return $self->load_extended_user_info || Apache2::Const::OK;
112 sub fetch_user_holds {
114 my $hold_ids = shift;
115 my $ids_only = shift;
117 my $available = shift;
121 my $e = $self->editor;
123 my $circ = OpenSRF::AppSession->create('open-ils.circ');
127 $hold_ids = $circ->request(
128 'open-ils.circ.holds.id_list.retrieve.authoritative',
133 $hold_ids = [ grep { defined $_ } @$hold_ids[$offset..($offset + $limit - 1)] ] if $limit or $offset;
137 return $hold_ids if $ids_only or @$hold_ids == 0;
140 suppress_notices => 1,
141 suppress_transits => 1,
143 suppress_patron_details => 1,
144 include_bre => $flesh ? 1 : 0
147 # ----------------------------------------------------------------
148 # Collect holds in batches of $batch_size for faster retrieval
152 my $mk_req_batch = sub {
154 my $top_idx = $batch_idx + $batch_size;
155 while($batch_idx < $top_idx) {
156 my $hold_id = $hold_ids->[$batch_idx++];
157 last unless $hold_id;
158 my $ses = OpenSRF::AppSession->create('open-ils.circ');
159 my $req = $ses->request(
160 'open-ils.circ.hold.details.retrieve',
161 $e->authtoken, $hold_id, $args);
162 push(@ses, {ses => $ses, req => $req});
168 my(@collected, @holds, @ses);
171 @ses = $mk_req_batch->() if $first;
172 last if $first and not @ses;
175 # If desired by the caller, filter any holds that are not available.
177 @collected = grep { $_->{hold}->{status} == 4 } @collected;
179 while(my $blob = pop(@collected)) {
180 $blob->{marc_xml} = XML::LibXML->new->parse_string($blob->{hold}->{bre}->marc) if $flesh;
185 for my $req_data (@ses) {
186 push(@collected, {hold => $req_data->{req}->gather(1)});
187 $req_data->{ses}->kill_me;
190 @ses = $mk_req_batch->();
191 last unless @collected or @ses;
195 # put the holds back into the original server sort order
197 for my $id (@$hold_ids) {
198 push @sorted, grep { $_->{hold}->{hold}->id == $id } @holds;
204 sub handle_hold_update {
207 my $e = $self->editor;
210 my @hold_ids = $self->cgi->param('hold_id'); # for non-_all actions
211 @hold_ids = @{$self->fetch_user_holds(undef, 1)} if $action =~ /_all/;
213 my $circ = OpenSRF::AppSession->create('open-ils.circ');
215 if($action =~ /cancel/) {
217 for my $hold_id (@hold_ids) {
218 my $resp = $circ->request(
219 'open-ils.circ.hold.cancel', $e->authtoken, $hold_id, 6 )->gather(1); # 6 == patron-cancelled-via-opac
222 } elsif ($action =~ /activate|suspend/) {
225 for my $hold_id (@hold_ids) {
226 my $vals = {id => $hold_id};
228 if($action =~ /activate/) {
229 $vals->{frozen} = 'f';
230 $vals->{thaw_date} = undef;
232 } elsif($action =~ /suspend/) {
233 $vals->{frozen} = 't';
234 # $vals->{thaw_date} = TODO;
236 push(@$vlist, $vals);
239 $circ->request('open-ils.circ.hold.update.batch.atomic', $e->authtoken, undef, $vlist)->gather(1);
240 } elsif ($action eq 'edit') {
243 my $val = {"id" => $_};
244 $val->{"frozen"} = $self->cgi->param("frozen");
245 $val->{"pickup_lib"} = $self->cgi->param("pickup_lib");
247 for my $field (qw/expire_time thaw_date/) {
248 # XXX TODO make this support other date formats, not just
250 next unless $self->cgi->param($field) =~
251 m:^(\d{2})/(\d{2})/(\d{4})$:;
252 $val->{$field} = "$3-$1-$2";
258 'open-ils.circ.hold.update.batch.atomic',
259 $e->authtoken, undef, \@vals
260 )->gather(1); # LFW XXX test for failure
261 $url = 'https://' . $self->apache->hostname . $self->ctx->{opac_root} . '/myopac/holds';
265 return defined($url) ? $self->generic_redirect($url) : undef;
268 sub load_myopac_holds {
270 my $e = $self->editor;
271 my $ctx = $self->ctx;
274 my $limit = $self->cgi->param('limit') || 0;
275 my $offset = $self->cgi->param('offset') || 0;
276 my $action = $self->cgi->param('action') || '';
277 my $available = int($self->cgi->param('available') || 0);
279 my $hold_handle_result;
280 $hold_handle_result = $self->handle_hold_update($action) if $action;
282 $ctx->{holds} = $self->fetch_user_holds(undef, 0, 1, $available, $limit, $offset);
284 return defined($hold_handle_result) ? $hold_handle_result : Apache2::Const::OK;
287 sub load_place_hold {
289 my $ctx = $self->ctx;
290 my $e = $self->editor;
291 my $cgi = $self->cgi;
292 $self->ctx->{page} = 'place_hold';
294 $ctx->{hold_target} = $cgi->param('hold_target');
295 $ctx->{hold_type} = $cgi->param('hold_type');
296 $ctx->{default_pickup_lib} = $e->requestor->home_ou; # XXX staff
298 if ($ctx->{hold_type} eq 'T') {
299 $ctx->{record} = $e->retrieve_biblio_record_entry($ctx->{hold_target});
300 } elsif ($ctx->{hold_type} eq 'I') {
301 my $iss = $e->retrieve_serial_issuance([
302 $ctx->{hold_target}, {
305 "siss" => ["subscription"], "ssub" => ["record_entry"]
309 $ctx->{record} = $iss->subscription->record_entry;
313 $ctx->{marc_xml} = XML::LibXML->new->parse_string($ctx->{record}->marc);
315 if(my $pickup_lib = $cgi->param('pickup_lib')) {
318 patronid => $e->requestor->id,
319 titleid => $ctx->{hold_target}, # XXX
320 pickup_lib => $pickup_lib,
324 my $allowed = $U->simplereq(
326 'open-ils.circ.title_hold.is_possible',
330 if($allowed->{success} == 1) {
331 my $hold = Fieldmapper::action::hold_request->new;
333 $hold->pickup_lib($pickup_lib);
334 $hold->requestor($e->requestor->id);
335 $hold->usr($e->requestor->id); # XXX staff
336 $hold->target($ctx->{hold_target});
337 $hold->hold_type($ctx->{hold_type});
338 # frozen, expired, etc..
340 my $stat = $U->simplereq(
342 'open-ils.circ.holds.create',
346 if($stat and $stat > 0) {
347 # if successful, return the user to the requesting page
348 $self->apache->log->info("Redirecting back to " . $cgi->param('redirect_to'));
349 return $self->generic_redirect;
352 $ctx->{hold_failed} = 1;
354 } else { # hold *check* failed
355 $ctx->{hold_failed} = 1; # XXX process the events, etc
356 $ctx->{hold_failed_event} = $allowed->{last_event};
360 $logger->info('hold permit result ' . OpenSRF::Utils::JSON->perl2JSON($allowed));
363 return Apache2::Const::OK;
367 sub fetch_user_circs {
369 my $flesh = shift; # flesh bib data, etc.
370 my $circ_ids = shift;
374 my $e = $self->editor;
379 @circ_ids = @$circ_ids;
383 my $circ_data = $U->simplereq(
385 'open-ils.actor.user.checked_out',
390 @circ_ids = ( @{$circ_data->{overdue}}, @{$circ_data->{out}} );
392 if($limit or $offset) {
393 @circ_ids = grep { defined $_ } @circ_ids[0..($offset + $limit - 1)];
397 return [] unless @circ_ids;
399 my $cstore = OpenSRF::AppSession->create('open-ils.cstore');
404 circ => ['target_copy'],
405 acp => ['call_number'],
411 my $circs = $e->search_action_circulation(
412 [{id => \@circ_ids}, ($flesh) ? $qflesh : {}], {substream => 1});
415 for my $circ (@$circs) {
418 marc_xml => ($flesh and $circ->target_copy->call_number->id != -1) ?
419 XML::LibXML->new->parse_string($circ->target_copy->call_number->record->marc) :
420 undef # pre-cat copy, use the dummy title/author instead
425 # make sure the final list is in the correct order
427 for my $id (@circ_ids) {
430 (grep { $_->{circ}->id == $id } @circs)
434 return \@sorted_circs;
438 sub handle_circ_renew {
441 my $ctx = $self->ctx;
443 my @renew_ids = $self->cgi->param('circ');
445 my $circs = $self->fetch_user_circs(0, ($action eq 'renew') ? [@renew_ids] : undef);
447 # TODO: fire off renewal calls in batches to speed things up
449 for my $circ (@$circs) {
451 my $evt = $U->simplereq(
453 'open-ils.circ.renew',
454 $self->editor->authtoken,
456 patron_id => $self->editor->requestor->id,
457 copy_id => $circ->{circ}->target_copy,
462 # TODO return these, then insert them into the circ data
463 # blob that is shoved into the template for each circ
464 # so the template won't have to match them
465 push(@responses, {copy => $circ->{circ}->target_copy, evt => $evt});
472 sub load_myopac_circs {
474 my $e = $self->editor;
475 my $ctx = $self->ctx;
478 my $limit = $self->cgi->param('limit') || 0; # 0 == unlimited
479 my $offset = $self->cgi->param('offset') || 0;
480 my $action = $self->cgi->param('action') || '';
482 # perform the renewal first if necessary
483 my @results = $self->handle_circ_renew($action) if $action =~ /renew/;
485 $ctx->{circs} = $self->fetch_user_circs(1, undef, $limit, $offset);
487 my $success_renewals = 0;
488 my $failed_renewals = 0;
489 for my $data (@{$ctx->{circs}}) {
490 my ($resp) = grep { $_->{copy} == $data->{circ}->target_copy->id } @results;
493 my $evt = ref($resp->{evt}) eq 'ARRAY' ? $resp->{evt}->[0] : $resp->{evt};
494 $data->{renewal_response} = $evt;
495 $success_renewals++ if $evt->{textcode} eq 'SUCCESS';
496 $failed_renewals++ if $evt->{textcode} ne 'SUCCESS';
500 $ctx->{success_renewals} = $success_renewals;
501 $ctx->{failed_renewals} = $failed_renewals;
503 return Apache2::Const::OK;
506 sub load_myopac_circ_history {
508 my $e = $self->editor;
509 my $ctx = $self->ctx;
510 my $limit = $self->cgi->param('limit') || 15;
511 my $offset = $self->cgi->param('offset') || 0;
513 $ctx->{circ_history_limit} = $limit;
514 $ctx->{circ_history_offset} = $offset;
516 my $circs = $e->json_query({
517 from => ['action.usr_visible_circs', $e->requestor->id],
518 #limit => $limit || 25,
519 #offset => $offset || 0,
522 # XXX: order-by in the json_query above appears to do nothing, so in-query
523 # paging is not reallly an option. do the sorting/paging here
525 # sort newest to oldest
526 $circs = [ sort { $b->{xact_start} cmp $a->{xact_start} } @$circs ];
527 my @ids = map { $_->{id} } @$circs;
529 # find the selected page and trim cruft
530 @ids = @ids[$offset..($offset + $limit - 1)] if $limit;
531 @ids = grep { defined $_ } @ids;
533 $ctx->{circs} = $self->fetch_user_circs(1, \@ids);
534 #$ctx->{circs} = $self->fetch_user_circs(1, [map { $_->{id} } @$circs], $limit, $offset);
536 return Apache2::Const::OK;
539 # TODO: action.usr_visible_holds does not return cancelled holds. Should it?
540 sub load_myopac_hold_history {
542 my $e = $self->editor;
543 my $ctx = $self->ctx;
544 my $limit = $self->cgi->param('limit') || 15;
545 my $offset = $self->cgi->param('offset') || 0;
546 $ctx->{hold_history_limit} = $limit;
547 $ctx->{hold_history_offset} = $offset;
550 my $holds = $e->json_query({
551 from => ['action.usr_visible_holds', $e->requestor->id],
552 limit => $limit || 25,
553 offset => $offset || 0
556 $ctx->{holds} = $self->fetch_user_holds([map { $_->{id} } @$holds], 0, 1, 0, $limit, $offset);
558 return Apache2::Const::OK;
561 sub load_myopac_payment_form {
563 my $r = $self->load_fines(undef, undef, [$self->cgi->param('xact')]);
565 return $self->load_extended_user_info || Apache2::Const::OK;
568 # TODO: add other filter options as params/configs/etc.
569 sub load_myopac_payments {
571 my $limit = $self->cgi->param('limit') || 20;
572 my $offset = $self->cgi->param('offset') || 0;
573 my $e = $self->editor;
575 $self->ctx->{payment_history_limit} = $limit;
576 $self->ctx->{payment_history_offset} = $offset;
579 $args->{limit} = $limit if $limit;
580 $args->{offset} = $offset if $offset;
582 $self->ctx->{payments} = $U->simplereq(
584 'open-ils.actor.user.payments.retrieve.atomic',
585 $e->authtoken, $e->requestor->id, $args);
587 return Apache2::Const::OK;
591 my ($self, $limit, $offset, $id_list) = @_;
593 # XXX TODO: check for failure after various network calls
595 $self->ctx->{"fines"} = {
603 my $cstore = OpenSRF::AppSession->create('open-ils.cstore');
605 # TODO: This should really be a ML call, but the existing calls
606 # return an excessive amount of data and don't offer streaming
608 my %paging = ($limit or $offset) ? (limit => $limit, offset => $offset) : ();
610 my $req = $cstore->request(
611 'open-ils.cstore.direct.money.open_billable_transaction_summary.search',
613 usr => $self->editor->requestor->id,
614 balance_owed => {'!=' => 0},
615 ($id_list && @$id_list ? ("id" => $id_list) : ()),
620 mobts => [qw/grocery circulation reservation/],
621 bresv => ['target_resource_type'],
625 circ => ['target_copy'],
626 acp => ['call_number'],
629 order_by => { mobts => 'xact_start' },
634 while(my $resp = $req->recv) {
635 my $mobts = $resp->content;
636 my $circ = $mobts->circulation;
639 if($mobts->grocery) {
640 my @billings = sort { $a->billing_ts cmp $b->billing_ts } @{$mobts->grocery->billings};
641 $last_billing = pop(@billings);
644 # XXX TODO switch to some money-safe non-fp library for math
645 $self->ctx->{"fines"}->{$_} += $mobts->$_ for (
646 qw/total_paid total_owed balance_owed/
649 my $marc_xml = undef;
650 if ($mobts->xact_type eq 'reservation' and
651 $mobts->reservation->target_resource_type->record) {
652 $marc_xml = XML::LibXML->new->parse_string(
653 $mobts->reservation->target_resource_type->record->marc
655 } elsif ($mobts->xact_type eq 'circulation' and
656 $circ->target_copy->call_number->id != -1) {
657 $marc_xml = XML::LibXML->new->parse_string(
658 $circ->target_copy->call_number->record->marc
663 @{$self->ctx->{"fines"}->{$mobts->grocery ? "grocery" : "circulation"}},
666 last_grocery_billing => $last_billing,
667 marc_xml => $marc_xml
675 sub load_myopac_main {
677 my $limit = $self->cgi->param('limit') || 0;
678 my $offset = $self->cgi->param('offset') || 0;
680 return $self->load_fines($limit, $offset) || Apache2::Const::OK;
683 sub load_myopac_update_email {
685 my $e = $self->editor;
686 my $ctx = $self->ctx;
687 my $email = $self->cgi->param('email') || '';
689 return Apache2::Const::OK
690 unless $self->cgi->request_method eq 'POST';
692 unless($email =~ /.+\@.+\..+/) { # TODO better regex?
693 $ctx->{invalid_email} = $email;
694 return Apache2::Const::OK;
697 my $stat = $U->simplereq(
699 'open-ils.actor.user.email.update',
700 $e->authtoken, $email);
702 my $url = $self->apache->unparsed_uri;
703 $url =~ s/update_email/prefs/;
705 return $self->generic_redirect($url);
708 sub load_myopac_update_username {
710 my $e = $self->editor;
711 my $ctx = $self->ctx;
712 my $username = $self->cgi->param('username') || '';
714 return Apache2::Const::OK
715 unless $self->cgi->request_method eq 'POST';
717 unless($username and $username !~ /\s/) { # any other username restrictions?
718 $ctx->{invalid_username} = $username;
719 return Apache2::Const::OK;
722 if($username ne $e->requestor->usrname) {
724 my $evt = $U->simplereq(
726 'open-ils.actor.user.username.update',
727 $e->authtoken, $username);
729 if($U->event_equals($evt, 'USERNAME_EXISTS')) {
730 $ctx->{username_exists} = $username;
731 return Apache2::Const::OK;
735 my $url = $self->apache->unparsed_uri;
736 $url =~ s/update_username/prefs/;
738 return $self->generic_redirect($url);
741 sub load_myopac_update_password {
743 my $e = $self->editor;
744 my $ctx = $self->ctx;
746 return Apache2::Const::OK
747 unless $self->cgi->request_method eq 'POST';
749 my $current_pw = $self->cgi->param('current_pw') || '';
750 my $new_pw = $self->cgi->param('new_pw') || '';
751 my $new_pw2 = $self->cgi->param('new_pw2') || '';
753 unless($new_pw eq $new_pw2) {
754 $ctx->{password_nomatch} = 1;
755 return Apache2::Const::OK;
758 my $pw_regex = $ctx->{get_org_setting}->($e->requestor->home_ou, 'global.password_regex');
760 if($pw_regex and $new_pw !~ /$pw_regex/) {
761 $ctx->{password_invalid} = 1;
762 return Apache2::Const::OK;
765 my $evt = $U->simplereq(
767 'open-ils.actor.user.password.update',
768 $e->authtoken, $new_pw, $current_pw);
771 if($U->event_equals($evt, 'INCORRECT_PASSWORD')) {
772 $ctx->{password_incorrect} = 1;
773 return Apache2::Const::OK;
776 my $url = $self->apache->unparsed_uri;
777 $url =~ s/update_password/prefs/;
779 return $self->generic_redirect($url);
782 sub load_myopac_bookbags {
784 my $e = $self->editor;
785 my $ctx = $self->ctx;
787 $e->xact_begin; # replication...
789 my $rv = $self->load_mylist;
790 unless($rv eq Apache2::Const::OK) {
796 order_by => {cbreb => 'name'},
797 limit => $self->cgi->param('limit') || 10,
798 offset => $self->cgi->param('offset') || 0
801 $ctx->{bookbags} = $e->search_container_biblio_record_entry_bucket([
802 {owner => $self->editor->requestor->id, btype => 'bookbag'},
803 # XXX what to do about the possibility of really large bookbags here?
804 {"flesh" => 1, "flesh_fields" => {"cbreb" => ["items"]}, %$args}
807 if(!$ctx->{bookbags}) {
809 return Apache2::Const::HTTP_INTERNAL_SERVER_ERROR;
812 # get unique record IDs
814 foreach my $bbag (@{$ctx->{bookbags}}) {
816 map { $_->target_biblio_record_entry } @{$bbag->items}
818 $rec_ids{$rec_id} = 1;
822 $ctx->{bookbags_marc_xml} = $self->fetch_marc_xml_by_id([keys %rec_ids]);
825 return Apache2::Const::OK;
829 # actions are create, delete, show, hide, rename, add_rec, delete_item
830 # CGI is action, list=list_id, add_rec/record=bre_id, del_item=bucket_item_id, name=new_bucket_name
831 sub load_myopac_bookbag_update {
832 my ($self, $action, $list_id) = @_;
833 my $e = $self->editor;
834 my $cgi = $self->cgi;
836 $action ||= $cgi->param('action');
837 $list_id ||= $cgi->param('list');
839 my @add_rec = $cgi->param('add_rec') || $cgi->param('record');
840 my @del_item = $cgi->param('del_item');
841 my $shared = $cgi->param('shared');
842 my $name = $cgi->param('name');
846 if($action eq 'create') {
847 $list = Fieldmapper::container::biblio_record_entry_bucket->new;
849 $list->owner($e->requestor->id);
850 $list->btype('bookbag');
851 $list->pub($shared ? 't' : 'f');
852 $success = $U->simplereq('open-ils.actor',
853 'open-ils.actor.container.create', $e->authtoken, 'biblio', $list)
857 $list = $e->retrieve_container_biblio_record_entry_bucket($list_id);
859 return Apache2::Const::HTTP_BAD_REQUEST unless
860 $list and $list->owner == $e->requestor->id;
863 if($action eq 'delete') {
864 $success = $U->simplereq('open-ils.actor',
865 'open-ils.actor.container.full_delete', $e->authtoken, 'biblio', $list_id);
867 } elsif($action eq 'show') {
868 unless($U->is_true($list->pub)) {
870 $success = $U->simplereq('open-ils.actor',
871 'open-ils.actor.container.update', $e->authtoken, 'biblio', $list);
874 } elsif($action eq 'hide') {
875 if($U->is_true($list->pub)) {
877 $success = $U->simplereq('open-ils.actor',
878 'open-ils.actor.container.update', $e->authtoken, 'biblio', $list);
881 } elsif($action eq 'rename') {
884 $success = $U->simplereq('open-ils.actor',
885 'open-ils.actor.container.update', $e->authtoken, 'biblio', $list);
888 } elsif($action eq 'add_rec') {
889 foreach my $add_rec (@add_rec) {
890 my $item = Fieldmapper::container::biblio_record_entry_bucket_item->new;
891 $item->bucket($list_id);
892 $item->target_biblio_record_entry($add_rec);
893 $success = $U->simplereq('open-ils.actor',
894 'open-ils.actor.container.item.create', $e->authtoken, 'biblio', $item);
895 last unless $success;
898 } elsif($action eq 'del_item') {
899 foreach (@del_item) {
900 $success = $U->simplereq(
902 'open-ils.actor.container.item.delete', $e->authtoken, 'biblio', $_
904 last unless $success;
908 return $self->generic_redirect if $success;
910 $self->ctx->{bucket_action} = $action;
911 $self->ctx->{bucket_action_failed} = 1;
912 return Apache2::Const::OK;