});
}
+__PACKAGE__->register_method(
+ method => "pub_fleshed_serial_issuance_retrieve_batch",
+ api_name => "open-ils.serial.issuance.pub_fleshed.batch.retrieve",
+ signature => {
+ desc => q/
+ Public (i.e. OPAC) call for getting at the sub and
+ ultimately the record entry from an issuance
+ /,
+ params => [{name => 'ids', desc => 'Array of IDs', type => 'array'}],
+ return => {
+ desc => q/
+ issuance objects, fleshed with subscriptions
+ /,
+ class => 'siss'
+ }
+ }
+);
+sub pub_fleshed_serial_issuance_retrieve_batch {
+ my( $self, $client, $ids ) = @_;
+ return [] unless $ids and @$ids;
+ return new_editor()->search_serial_issuance([
+ { id => $ids },
+ {
+ flesh => 1,
+ flesh_fields => {siss => [ qw/subscription/ ]}
+ }
+ ]);
+}
+
##########################################################################
# unit methods
<!ENTITY common.isbn.label "ISBN:">
<!ENTITY common.issn.label "ISSN:">
<!ENTITY common.copy.barcode.label "Copy Barcode:">
+<!ENTITY common.issuance_label.label "Issuance Label:">
<!ENTITY common.hold.place "Place hold for my account">
<!ENTITY common.hold.check "Checking for possibility of hold fulfillment...">
<!ENTITY common.hold.create "Create / Edit a Hold">
<!ENTITY common.hold.type.label "Hold Type:">
<!ENTITY common.hold.volume "Volume Hold">
<!ENTITY common.hold.copy "Copy Hold">
+<!ENTITY common.hold.issuance "Issuance Hold">
<!ENTITY common.hold.advanced "Advanced Hold Options">
<!ENTITY common.hold.delivery "Please select a physical location where your hold can be delivered.">
<!ENTITY common.hold.checked_out "This item is already checked out.">
var noEmailMessage;
var noEmailMessageXUL;
+var holdTargetTypeMap = {
+ M : 'metarecord',
+ T : 'record',
+ V : 'volume',
+ I : 'issuance',
+ C : 'copy'
+};
+
+
+
function holdsHandleStaff() {
// if we know the recipient's barcode, use it
var args = (oargs) ? oargs : {};
args.type = hold.hold_type();
var target = hold.target();
-
- switch(args.type) {
- case 'M':
- args.metarecord = target;
- break;
- case 'T':
- args.record = target;
- break;
- case 'V':
- args.volume = target;
- break;
- case 'C':
- args.copy = target;
- break;
- }
+ args[holdTargetTypeMap[args.type]] = target;
return args;
}
if( type == 'V' ) {
_h_set_vol(args, doneCallback);
+ } else if( type == 'I' ) {
+ _h_set_issuance(args, doneCallback);
+
} else {
if( type == 'T' ) {
_h_set_rec(args, doneCallback);
}
}
+function _h_set_issuance(args, doneCallback) {
+
+ if( args.issuanceObject ) {
+ args.issuance = args.issuanceObject.id();
+ args.record = args.issuanceObject.subscription().record_entry();
+ _h_set_rec(args, doneCallback);
+
+ } else {
+
+ var vreq = new Request(FETCH_ISSUANCE, [args.issuance]);
+ vreq.callback(
+ function(r) {
+ var issuance = r.getResultObject()[0];
+ args.issuanceObject = issuance;
+ args.record = issuance.subscription().record_entry();
+ _h_set_rec(args, doneCallback);
+ }
+ );
+ vreq.send();
+ }
+}
+
function _h_set_rec(args, doneCallback) {
if(args.recordObject)
appendClear($('holds_title'), text(rec.title()));
appendClear($('holds_author'), text(rec.author()));
- if( holdArgs.type == 'V' || holdArgs.type == 'C' ) {
+ if( holdArgs.type == 'I' ) {
+ unHideMe($('holds_type_row'));
+ unHideMe($('holds_is_issuance'));
+ unHideMe($('holds_issuance_row'));
+ appendClear($('holds_issuance_label'), text(holdArgs.issuanceObject.label()));
+
+ } else if( holdArgs.type == 'V' || holdArgs.type == 'C' ) {
unHideMe($('holds_type_row'));
unHideMe($('holds_cn_row'));
hideMe($('holds_type_row'));
hideMe($('holds_copy_row'));
hideMe($('holds_cn_row'));
+ hideMe($('holds_issuance_row'));
}
removeChildren($('holds_format'));
else
hold.email_notify(0);
- var target;
-
- switch(holdArgs.type) {
- case 'M':
- target = holdArgs.metarecord; break;
- case 'T':
- target = holdArgs.record; break;
- case 'V':
- target = holdArgs.volume; break;
- case 'C':
- target = holdArgs.copy; break;
- }
-
-
+ var target = holdArgs[holdTargetTypeMap[holdArgs.type]];
hold.pickup_lib(org);
//hold.request_lib(org);
<td class='holds_cell'><b id='holds_copy'/> </td>
</tr>
+ <tr class='hide_me' id='holds_issuance_row'>
+ <td class='holds_cell'>&common.issuance_label.label;</td>
+ <td class='holds_cell'><b id='holds_issuance_label'/> </td>
+ </tr>
+
<tr class='hide_me' id='holds_type_row'>
<td class='holds_cell'>&common.hold.type.label;</td>
<td class='holds_cell hide_me' id='holds_is_cn'><b>&common.hold.volume;</b></td>
<td class='holds_cell hide_me' id='holds_is_copy'><b>&common.hold.copy;</b></td>
+ <td class='holds_cell hide_me' id='holds_is_issuance'><b>&common.hold.issuance;</b></td>
</tr>
<tr>