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.
<option name='action_holdings_maint' value='action_holdings_maint'>[% l('Holdings Maint.') %]</option>
<option name='action_manage_claims' value='action_manage_claims'>[% l('Claims') %]</option>
<option name='action_view_history' value='action_view_history'>[% l('View History') %]</option>
+ <option name='action_transfer_to_bib' value='action_transfer_to_bib'>[% l('Transfer To Bib Record') %]</option>
</select>
</td>
<td>
"[% l('Conjoined Item 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 =
</a>
</li>
<li role="menuitem">
+ <a ng-click="markLiTransfer()">
+ [% l('Order Lineitem Transfer') %]
+ <span class="target-record-aside" ng-if="current_litransfer_target">
+ [% l('(Currently [_1])', '{{current_litransfer_target}}') %]
+ </span>
+ </a>
+ </li>
+
+ <li role="menuitem">
<a ng-click="clearRecordMarks()">[% l('Reset Record Marks') %]</a>
</li>
</ul>
"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}"
}
);
}
+ 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) {
case 'action_view_history':
location.href = oilsBasePath + '/acq/lineitem/history/' + li.id();
break;
+ case 'action_transfer_to_bib':
+ self.transferLiToBib(li.id());
+ nodeByName("action_none", row).selected = true;
+ break;
}
};
var actUpdateBarcodes = nodeByName("action_update_barcodes", row);
$scope.current_overlay_target = egCore.hatch.getLocalItem('eg.cat.marked_overlay_record');
$scope.current_voltransfer_target = egCore.hatch.getLocalItem('eg.cat.marked_volume_transfer_record');
$scope.current_conjoined_target = egCore.hatch.getLocalItem('eg.cat.marked_conjoined_record');
+ $scope.current_litransfer_target = egCore.hatch.getLocalItem('eg.cat.marked_lineitem_transfer_record');
$scope.markConjoined = function () {
$scope.current_conjoined_target = $scope.record_id;
egCore.hatch.setLocalItem('eg.cat.marked_volume_transfer_record',$scope.record_id);
};
+ $scope.markLiTransfer = function () {
+ ngToast.create(egCore.strings.MARK_LI_TARGET);
+ $scope.current_litransfer_target = $scope.record_id;
+ // Lineitem transfer requires target data to live in localStorage
+ // and not Hatch, hence setLocalItem(). The legacy ACQ interfaces
+ // don't have access to Hatch.
+ egCore.hatch.setLocalItem(
+ 'eg.cat.marked_lineitem_transfer_record', $scope.record_id);
+ };
+
$scope.markOverlay = function () {
$scope.current_overlay_target = $scope.record_id;
egCore.hatch.setLocalItem('eg.cat.marked_overlay_record',$scope.record_id);
$scope.current_voltransfer_target = null;
$scope.current_conjoined_target = null;
$scope.current_hold_transfer_dest = null;
+ $scope.current_litransfer_target = null;
egCore.hatch.removeLocalItem('eg.cat.marked_volume_transfer_record');
egCore.hatch.removeLocalItem('eg.cat.marked_conjoined_record');
egCore.hatch.removeLocalItem('eg.cat.marked_overlay_record');
egCore.hatch.removeLocalItem('eg.circ.hold.title_transfer_target');
+ egCore.hatch.removeLocalItem('eg.cat.marked_lineitem_transfer_record');
}
$scope.stop_unload = false;