Advertisement
chrissharp123

Untitled

Mar 20th, 2020
1,020
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Perl 1.44 KB | None | 0 0
  1.         # Now see if any empty records need to be deleted after all of this
  2.         my $keep_on_empty = $U->ou_ancestor_setting_value($e->requestor->ws_ou, 'cat.bib.keep_on_empty', $e);
  3.         unless ($U->is_true($keep_on_empty)) {
  4.             for (@rec_ids) {
  5.                 $logger->debug("merge: seeing if we should delete record $_...");
  6.                 if (OpenILS::Application::Cat::BibCommon->title_is_empty($e, $_)) {
  7.                     # Retarget any active title holds to the new bib record
  8.                     # before we blow it away
  9.                     my $retarget_holds = ();
  10.                     my $title_holds = $e->search_action_hold_request(
  11.                         {
  12.                             fulfillment_time => undef,
  13.                             cancel_time      => undef,
  14.                             hold_type        => 'T',
  15.                             target           => $_
  16.                         });
  17.                     foreach my $hold (@$title_holds) {
  18.                         push (@$retarget_holds, $hold->id);
  19.                         $hold->target = $rec;
  20.                         return $e->die_event unless($e->update_action_hold_request($hold));
  21.                     }
  22.                     reset_hold_list($auth, $retarget_holds);
  23.                     $evt = OpenILS::Application::Cat::BibCommon->delete_rec($e, $_);
  24.                     return $evt if $evt;
  25.                 }
  26.             }
  27.         }
  28.     }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement