</td>
<td>
<select name='actions'>
- <option name='action_none'>[% l('-- Actions --') %]</option>
- <option name='action_mark_recv' disabled='disabled'>Mark Received</option>
- <option name='action_mark_unrecv' disabled='disabled'>Un-Receive</option>
- <option name='action_update_barcodes'>[% l('Update Barcodes') %]</option>
- <option name='action_holdings_maint'>[% l('Holdings Maint.') %]</option>
- <option name='action_manage_claims'>[% l('Claims') %]</option>
- <option name='action_view_history'>[% l('View History') %]</option>
+ <option name='action_none' value='action_none'>[% l('-- Actions --') %]</option>
+ <option name='action_mark_recv' value='action_mark_recv' disabled='disabled'>Mark Received</option>
+ <option name='action_mark_unrecv' value='action_mark_unrecv' disabled='disabled'>Un-Receive</option>
+ <option name='action_update_barcodes' value='action_update_barcodes'>[% l('Update Barcodes') %]</option>
+ <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>
);
}
+ 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;
+
+ // 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);
} 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);