From: erickson Date: Mon, 10 Jan 2011 16:27:53 +0000 (+0000) Subject: removed deprecated, unused code X-Git-Url: https://old-git.evergreen-ils.org/?a=commitdiff_plain;h=725fb0ae3cf1d6cfb86119b7148b815fe8425c73;p=contrib%2FConifer.git removed deprecated, unused code git-svn-id: svn://svn.open-ils.org/ILS/trunk@19145 dcc99617-32d9-48b4-a31d-7c20da2025e4 --- diff --git a/Open-ILS/src/perlmods/OpenILS/Application/Acq/Lineitem.pm b/Open-ILS/src/perlmods/OpenILS/Application/Acq/Lineitem.pm index 2232a75b54..85ab54b501 100644 --- a/Open-ILS/src/perlmods/OpenILS/Application/Acq/Lineitem.pm +++ b/Open-ILS/src/perlmods/OpenILS/Application/Acq/Lineitem.pm @@ -623,106 +623,6 @@ sub lineitem_search_ident { } - - -# this call duplicates a call in Order.pm and makes references to subs that don't exist. -# TODO: Verify then remove. -__PACKAGE__->register_method( - method => 'lineitem_detail_CUD_batch', - api_name => 'open-ils.acq.lineitem_detail.cud.batch_', - stream => 1, - signature => { - desc => q/Creates a new purchase order line item detail. - Additionally creates the associated fund_debit/, - params => [ - {desc => 'Authentication token', type => 'string'}, - {desc => 'List of lineitem_details to create', type => 'array'}, - ], - return => {desc => 'Streaming response of current position in the array'} - } -); - -sub lineitem_detail_CUD_batch { - my($self, $conn, $auth, $li_details, $options) = @_; - my $e = new_editor(xact=>1, authtoken=>$auth); - return $e->die_event unless $e->checkauth; - my $pos = 0; - my $total = scalar(@$li_details); - for my $li_detail (@$li_details) { - my $res; - - use Data::Dumper; - $logger->info(Dumper($li_detail)); - $logger->info('lid id ' . $li_detail->id); - $logger->info('lineitem ' . $li_detail->lineitem); - - if($li_detail->isnew) { - $res = create_lineitem_detail_impl($self, $conn, $e, $li_detail, $options); - } elsif($li_detail->ischanged) { - $res = update_lineitem_detail_impl($self, $conn, $e, $li_detail); - } elsif($li_detail->isdeleted) { - $res = delete_lineitem_detail_impl($self, $conn, $e, $li_detail->id); - } - return $e->event if $e->died; - $conn->respond({maximum => $total, progress => $pos++, li => $res}); - } - $e->commit; - return {complete => 1}; -} - - -sub create_lineitem_detail_impl { - my($self, $conn, $e, $li_detail, $options) = @_; - $options ||= {}; - - my $li = $e->retrieve_acq_lineitem($li_detail->lineitem) - or return $e->die_event; - - my $evt = update_li_edit_time($e, $li); - return $evt if $evt; - - # XXX check lineitem provider perms - - if($li_detail->fund) { - my $fund = $e->retrieve_acq_fund($li_detail->fund) or return $e->die_event; - return $e->die_event unless - $e->allowed('MANAGE_FUND', $fund->org, $fund); - } - - $e->create_acq_lineitem_detail($li_detail) or return $e->die_event; - - unless($li_detail->barcode) { - my $pfx = $U->ou_ancestor_setting_value($li_detail->owning_lib, 'acq.tmp_barcode_prefix') || 'ACQ'; - $li_detail->barcode($pfx.$li_detail->id); - } - unless($li_detail->cn_label) { - my $pfx = $U->ou_ancestor_setting_value($li_detail->owning_lib, 'acq.tmp_callnumber_prefix') || 'ACQ'; - $li_detail->cn_label($pfx.$li_detail->id); - } - - if(my $loc = $U->ou_ancestor_setting_value($li_detail->owning_lib, 'acq.default_copy_location')) { - $li_detail->location($loc); - } - - $e->update_acq_lineitem_detail($li_detail) or return $e->die_event; - - return $li_detail if $$options{return_obj}; - return $li_detail->id -} - - -sub update_li_edit_time { - my ($e, $li) = @_; - # some lineitem edits are allowed after approval time... -# return OpenILS::Event->new('ACQ_LINEITEM_APPROVED', payload => $li->id) -# if $li->state eq 'approved'; - $li->edit_time('now'); - $li->editor($e->requestor->id); - $e->update_acq_lineitem($li) or return $e->die_event; - return undef; -} - - __PACKAGE__->register_method( method => 'retrieve_lineitem_detail', api_name => 'open-ils.acq.lineitem_detail.retrieve',