From: Bill Erickson Date: Fri, 17 Mar 2017 19:36:35 +0000 (-0400) Subject: LP#1619703 Transfer ACQ lineitem browser UI X-Git-Url: https://old-git.evergreen-ils.org/?a=commitdiff_plain;h=7b3b7f36d24be1dfac20aaa4ade4c47d35f84603;p=working%2FEvergreen.git LP#1619703 Transfer ACQ lineitem browser UI Supports marking a bib record as a lineitem transfer destination in the web staff bib record detail interface. Found in the 'Mark For:' selector menu. Supports inititiating the transfer from the embedded ACQ purchase order interface. ACQ action is found in the Actions selector for each lineitem. Signed-off-by: Bill Erickson --- diff --git a/Open-ILS/src/perlmods/lib/OpenILS/Application/Acq/Order.pm b/Open-ILS/src/perlmods/lib/OpenILS/Application/Acq/Order.pm index 93668dc2da..99610743fa 100644 --- a/Open-ILS/src/perlmods/lib/OpenILS/Application/Acq/Order.pm +++ b/Open-ILS/src/perlmods/lib/OpenILS/Application/Acq/Order.pm @@ -4492,12 +4492,10 @@ sub transfer_lineitem { where => {lineitem => $li_id} }); - # TODO: Transfer monograph parts. + if (@$acp_ids) { - my $copies = $e->search_asset_copy( - {id => [map {$_->{eg_copy_id}} @$acp_ids]}); - - if (@$copies) { + my $copies = $e->search_asset_copy( + {id => [map {$_->{eg_copy_id}} @$acp_ids]}); # Group copies into call number batches so each call number can # be assessed and processed once. diff --git a/Open-ILS/src/templates/acq/common/li_table.tt2 b/Open-ILS/src/templates/acq/common/li_table.tt2 index eafd398853..dd4c058031 100644 --- a/Open-ILS/src/templates/acq/common/li_table.tt2 +++ b/Open-ILS/src/templates/acq/common/li_table.tt2 @@ -248,13 +248,14 @@ diff --git a/Open-ILS/src/templates/staff/cat/catalog/index.tt2 b/Open-ILS/src/templates/staff/cat/catalog/index.tt2 index ddb6a8c847..f2eff0ba91 100644 --- a/Open-ILS/src/templates/staff/cat/catalog/index.tt2 +++ b/Open-ILS/src/templates/staff/cat/catalog/index.tt2 @@ -49,6 +49,12 @@ s.MARK_CONJ_TARGET = "[% l('Conjoined Item Target set') %]"; s.MARK_HOLDINGS_TARGET = "[% l('Holdings transfer target set') %]"; + s.MARK_VOL_TARGET = + "[% l('Volume Transfer Target set') %]"; + s.MARK_LI_TARGET = + "[% l('Lineitem Transfer Target set') %]"; + s.MARK_ITEM_TARGET = + "[% l('Item Transfer Target set') %]"; s.MARK_OVERLAY_TARGET = "[% l('Record Overlay Target set') %]"; diff --git a/Open-ILS/web/js/dojo/openils/acq/nls/acq.js b/Open-ILS/web/js/dojo/openils/acq/nls/acq.js index 2fca11d6a7..b00d42265d 100644 --- a/Open-ILS/web/js/dojo/openils/acq/nls/acq.js +++ b/Open-ILS/web/js/dojo/openils/acq/nls/acq.js @@ -113,5 +113,7 @@ "ACTIVATE_BIBS_PROCESSED" : "Bib Records Merged/Imported: ${0}", "ACTIVATE_LID_PROCESSED" : "ACQ Copies Processed: ${0}", "ACTIVATE_DEBITS_ACCRUED_PROCESSED" : "Debits Encumbered: ${0}", - "ACTIVATE_COPIES_PROCESSED" : "Real Copies Processed: ${0}" + "ACTIVATE_COPIES_PROCESSED" : "Real Copies Processed: ${0}", + "LI_TRANSFER_NO_TARGET" : "No transfer destination selected", + "LI_TRANSFER_CONFIRM" : "Transfer lineitem #${0} to bib record ID ${1}?\n\nTitle: ${2}" } diff --git a/Open-ILS/web/js/ui/default/acq/common/li_table.js b/Open-ILS/web/js/ui/default/acq/common/li_table.js index b41cc0f2c0..3e4c502cb6 100644 --- a/Open-ILS/web/js/ui/default/acq/common/li_table.js +++ b/Open-ILS/web/js/ui/default/acq/common/li_table.js @@ -747,6 +747,46 @@ function AcqLiTable() { ); } + this.transferLiToBib = function(li_id) { + var self = this; + var target = openils.XUL.localStorage().getItem( + 'eg.cat.marked_lineitem_transfer_record'); + + if (!target) { + alert(localeStrings.LI_TRANSFER_NO_TARGET); + return; + } + + // Data stored by the browser client are JSON-encoded. + target = JSON2js(target); + + self.pcrud.retrieve('rmsr', target, { + async : true, + oncomplete : function(r) { + var rec = openils.Util.readResponse(r); + + if (!confirm(dojo.string.substitute( + localeStrings.LI_TRANSFER_CONFIRM, + [li_id, target, rec.title()]))) return; + + console.debug('Transfering lineitem ' + + li_id + ' to bib ' + target); + + fieldmapper.standardRequest( + ['open-ils.acq', + 'open-ils.acq.lineitem.transfer_to_bib'], + { params : [self.authtoken, li_id, target], + oncomplete : function(r) { + var li = openils.Util.readResponse(r); + // no events fired, reload the page. + location.href = location.href; + } + } + ); + } + }); + } + // fetch an updated copy of the lineitem // and add it back to the lineitem table this.refreshLineitem = function(li, focus) { @@ -1398,8 +1438,25 @@ function AcqLiTable() { case 'action_view_history': location.href = oilsBasePath + '/acq/lineitem/history/' + li.id(); break; + + // KCLS CUSTOM / LP#1619703 + case 'action_transfer_to_bib': + self.transferLiToBib(li.id()); + nodeByName("action_none", row).selected = true; + break; + + // KCLS CUSTOM + case 'action_mark_recv': + if (self.checkLiAlerts(li.id())) + self.issueReceive(li); + break; + case 'action_mark_unrecv': + if (confirm(localeStrings.UNRECEIVE_LI)) + self.issueReceive(li, /* rollback */ true); + break; } }; + var actUpdateBarcodes = nodeByName("action_update_barcodes", row); var actHoldingsMaint = nodeByName("action_holdings_maint", row); @@ -1480,23 +1537,11 @@ function AcqLiTable() { } else if (li.state() == 'on-order') { // KCLS CUSTOM -- activate LI receive action - actReceive.disabled = false; - actReceive.onclick = function() { - if (self.checkLiAlerts(li.id())) - self.issueReceive(li); - nodeByName("action_none", row).selected = true; - }; } else if (li.state() == 'received') { // KCLS CUSTOM -- activate LI un-receive action - actUnRecv.disabled = false; - actUnRecv.onclick = function() { - if (confirm(localeStrings.UNRECEIVE_LI)) - self.issueReceive(li, /* rollback */ true); - nodeByName("action_none", row).selected = true; - }; } openils.Util.show(state_cell);