9 if (typeof JSAN == 'undefined') { throw( "The JSAN library object is missing."); }
10 JSAN.errorLevel = "die"; // none, warn, or die
11 JSAN.addRepository('/xul/server/');
12 JSAN.use('util.error'); error = new util.error();
13 error.sdump('D_TRACE','my_init() for alternate_copy_summary.xul');
15 JSAN.use('util.network'); network = new util.network();
16 JSAN.use('OpenILS.data'); data = new OpenILS.data(); data.stash_retrieve();
17 JSAN.use('util.date');
20 var x = document.getElementById('patron_name');
25 var usr = ev.target.getAttribute('data');
26 if (usr) { window.xulG.new_patron_tab( {}, { 'id' : usr } ); }
31 var y = document.getElementById('prev_patron_name');
36 var usr = ev.target.getAttribute('data');
37 if (usr) { window.xulG.new_patron_tab( {}, { 'id' : usr } ); }
43 JSAN.use('circ.util');
44 JSAN.use('util.list');
46 var columns = circ.util.transit_columns({});
47 transit_list = new util.list('transit');
48 transit_list.init( { 'columns' : columns });
50 var columns = circ.util.hold_columns(
53 'request_time' : { 'hidden' : true },
54 'pickup_lib_shortname' : { 'hidden' : false },
55 'hold_type' : { 'hidden' : false },
56 'current_copy' : { 'hidden' : true },
57 'capture_time' : { 'hidden' : true },
58 'email_notify' : { 'hidden' : false },
59 'phone_notify' : { 'hidden' : false },
63 hold_list = new util.list('hold');
64 hold_list.init( { 'columns' : columns });
66 // timeout so xulG gets a chance to get pushed in
68 function () { xulG.from_item_details_new = false; load_item(); },
73 try { error.standard_unexpected_error_alert('main/test.xul',E); } catch(F) { alert(E); }
77 function set(name,value,data) {
78 if (typeof value == 'undefined' || typeof value == 'null') { return; }
79 var nodes = document.getElementsByAttribute('name',name);
80 for (var i = 0; i < nodes.length; i++) {
81 if (nodes[i].nodeName == 'button') {
82 nodes[i].setAttribute('label',value);
84 nodes[i].setAttribute('data',data);
86 nodes[i].setAttribute('data','');
89 nodes[i].setAttribute('value',value);
91 nodes[i].value = value;
95 function set_tooltip(name,value) {
96 if (typeof value == 'undefined' || typeof value == 'null') { return; }
97 var nodes = document.getElementsByAttribute('name',name);
98 for (var i = 0; i < nodes.length; i++) {
99 nodes[i].setAttribute('tooltiptext',value);
103 function renewal_composite_kludge(circ) {
104 // Only a corrupt database could give us a situation where more
105 // than one of these were true at a time, right?
106 if (circ.desk_renewal() == "t")
107 return document.getElementById('circStrings').getString(
108 'staff.circ.copy_details.desk_renewal'
110 else if (circ.opac_renewal() == "t")
111 return document.getElementById('circStrings').getString(
112 'staff.circ.copy_details.opac_renewal'
114 else if (circ.phone_renewal() == "t")
115 return document.getElementById('circStrings').getString(
116 'staff.circ.copy_details.phone_renewal'
121 function load_item() {
123 if (! xulG.barcode) return;
125 if (xulG.fetched_copy_details && xulG.fetched_copy_details[xulG.barcode]) {
126 var details = xulG.fetched_copy_details[xulG.barcode];
127 // We don't want to use these details more than once (i.e., we
128 // don't want cached data after things have potentially changed).
129 delete xulG.fetched_copy_details[xulG.barcode];
131 var details = network.simple_request('FM_ACP_DETAILS_VIA_BARCODE.authoritative', [ ses(), xulG.barcode ]);
132 // Should get back .mvr, .copy, .volume, .transit, .circ, .hold
135 if (typeof dynamic_grid_replacement == 'function') {
136 dynamic_grid_replacement('alternate_copy_summary');
138 if (typeof bib_brief_overlay == 'function') {
145 set("stat_cat_entries", '');
146 set("age_protect", '');
147 set("alert_message", '');
149 set("call_number", '');
150 set("circ_as_type", '');
151 set("copy_circ_lib" , '');
152 set_tooltip("copy_circ_lib" , '');
153 set("circ_modifier", '');
154 set("circulate", '');
156 set("copy_number", '');
157 set("copy_create_date", '');
158 set("copy_active_date", '');
159 set("status_changed_time", '');
160 set("copy_creator", '');
163 set("deposit_amount", '');
164 set("dummy_author", '');
165 set("dummy_title", '');
166 set("copy_edit_date", '');
167 set("copy_editor", '');
168 set("fine_level", '');
171 set("loan_duration", '');
173 set_tooltip("location", '');
174 set("renewal_type", '');
175 set("opac_visible", '');
177 set_tooltip("price", '');
179 set_tooltip("cost", '');
181 set("copy_status", '');
182 set_tooltip("copy_status", '');
184 set("stat_cat_entry_copy_maps", '');
185 set("circulations", '');
186 set("total_circ_count", '');
187 set_tooltip("total_circ_count", '');
188 set("total_circ_count_prev_year", '');
189 set("total_circ_count_curr_year", '');
193 set("stat_cat_entries", details.copy.stat_cat_entries());
194 var ap = details.copy.age_protect();
195 if (typeof data.hash.crahp[ap] != 'undefined') {
196 set("age_protect", data.lookup('crahp',details.copy.age_protect()).name());
198 set("age_protect","");
200 set("alert_message", details.copy.alert_message());
201 set("barcode", details.copy.barcode());
202 if (typeof details.copy.call_number() == 'object') {
203 set("call_number", details.copy.call_number().label());
205 network.simple_request('FM_ACN_RETRIEVE.authoritative',[details.copy.call_number()], function(req) {
206 var acn_obj = req.getResultObject();
207 set("call_number", acn_obj.label());
210 set("circ_as_type", details.copy.circ_as_type() != null && details.copy.circ_as_type() == 'object'
211 ? details.copy.circ_as_type()
212 : ( typeof data.hash.citm[ details.copy.circ_as_type() ] != 'undefined'
213 ? data.hash.citm[ details.copy.circ_as_type() ].value
217 set("copy_circ_lib" , typeof details.copy.circ_lib() == 'object' ? details.copy.circ_lib().shortname() : data.hash.aou[ details.copy.circ_lib() ].shortname());
218 set_tooltip("copy_circ_lib" , typeof details.copy.circ_lib() == 'object' ? details.copy.circ_lib().name() : data.hash.aou[ details.copy.circ_lib() ].name());
219 var cm = details.copy.circ_modifier();
220 if (typeof data.hash.ccm[cm] != 'undefined') {
221 set("circ_modifier", document.getElementById('commonStrings').getFormattedString('staff.circ_modifier.display',[cm,data.hash.ccm[cm].name(),data.hash.ccm[cm].description()]));
223 set("circ_modifier","");
225 set("circulate", get_localized_bool( details.copy.circulate() ));
226 set("floating", (details.copy.floating() && typeof details.copy.floating() == 'object' ? details.copy.floating().name() : get_localized_bool( details.copy.floating() )));
227 set("copy_number", details.copy.copy_number());
228 set("copy_create_date", util.date.formatted_date( details.copy.create_date(), '%{localized}' ));
229 set("copy_active_date", util.date.formatted_date( details.copy.active_date(), '%{localized}' ));
230 set("status_changed_time", util.date.formatted_date( details.copy.status_changed_time(), '%{localized}' ));
231 set("copy_creator", details.copy.creator());
232 set("deleted", details.copy.deleted());
233 set("deposit", details.copy.deposit());
234 set("deposit_amount", details.copy.deposit_amount());
235 set("dummy_author", details.copy.dummy_author());
236 set("dummy_title", details.copy.dummy_title());
237 set("copy_edit_date", util.date.formatted_date( details.copy.edit_date(), '%{localized}' ));
238 set("copy_editor", details.copy.editor());
239 set("fine_level", cat.util.render_fine_level( details.copy.fine_level() ));
240 set("holdable", get_localized_bool( details.copy.holdable() ));
241 set("copy_id", details.copy.id());
242 set("loan_duration", cat.util.render_loan_duration( details.copy.loan_duration() ));
243 var copy_location = typeof details.copy.location() == 'object' ? details.copy.location() : data.lookup('acpl',details.copy.location());
244 set("location", copy_location.name());
245 set_tooltip("location", document.getElementById('circStrings').getFormattedString(
246 'staff.circ.copy_details.location_tooltip',
248 get_localized_bool( copy_location.circulate() ),
249 get_localized_bool( copy_location.holdable() ),
250 get_localized_bool( copy_location.hold_verify() ),
251 get_localized_bool( copy_location.opac_visible() )
254 set("opac_visible", get_localized_bool( details.copy.opac_visible() ));
255 set("price", details.copy.price());
256 set_tooltip("price" , "Replacement Amount charged to Patron");
257 set("cost", details.copy.cost());
258 set_tooltip("cost" , "Acquisition Amount paid by Library");
259 set("ref", get_localized_bool( details.copy.ref() ));
260 var copy_status = typeof details.copy.status() == 'object' ? details.copy.status() : data.hash.ccs[ details.copy.status() ];
261 set("copy_status", copy_status.name() );
262 set_tooltip("copy_status", document.getElementById('circStrings').getFormattedString(
263 'staff.circ.copy_details.copy_status_tooltip',
265 get_localized_bool( copy_status.opac_visible() ),
266 get_localized_bool( copy_status.holdable() )
269 set("notes", details.copy.notes());
270 set("stat_cat_entry_copy_maps", details.copy.stat_cat_entry_copy_maps());
271 set("circulations", details.copy.circulations());
272 set("holds", details.copy.holds());
274 network.simple_request('FM_CIRC_IMPROVED_COUNT_VIA_COPY', [ses(), { 'copy' : details.copy.id() } ], function(req) {
275 var r = req.getResultObject();
276 var total = 0; var tooltip = ''; var year = {};
277 for (var i = 0; i < r.length; i++) {
278 total += Number( r[i].count() );
279 if (typeof year[ r[i].year() ] == 'undefined') year[ r[i].year() ] = 0;
280 year[ r[i].year() ] += Number( r[i].count() ); // Add original circs and renewals together
282 set( 'total_circ_count', total );
283 var curr_year = (new Date()).getFullYear();
284 var prev_year = curr_year - 1;
285 set( 'total_circ_count_curr_year', year[ curr_year ] || 0 );
286 set( 'total_circ_count_prev_year', year[ prev_year ] || 0 );
287 var keys = []; for (var i in year) { keys.push( i ); }; keys.sort();
288 for (var i = 0; i < keys.length; i++) {
289 tooltip += document.getElementById('circStrings').getFormattedString(
290 'staff.circ.copy_details.circ_count_by_year', [
291 keys[i] == -1 ? document.getElementById('circStrings').getString('staff.circ.copy_details.circ_count_by_year.legacy_label') : keys[i],
296 set_tooltip( 'total_circ_count', tooltip );
301 set("volume_create_date", '');
302 set("volume_creator", '');
304 set("volume_edit_date", '');
305 set("volume_editor", '');
306 set("volume_id", '');
308 set("owning_lib" , '');
309 set_tooltip("owning_lib" , '');
315 if (details.volume) {
316 set("copies", details.volume.copies());
317 set("volume_create_date", util.date.formatted_date( details.volume.create_date(), '%{localized}' ));
318 set("volume_creator", details.volume.creator());
319 set("deleted", details.volume.deleted());
320 set("volume_edit_date", util.date.formatted_date( details.volume.edit_date(), '%{localized}' ));
321 set("volume_editor", details.volume.editor());
322 set("volume_id", details.volume.id());
323 set("label", details.volume.label());
324 set("owning_lib" , typeof details.volume.owning_lib() == 'object' ? details.volume.owning_lib().shortname() : data.hash.aou[ details.volume.owning_lib() ].shortname());
325 set_tooltip("owning_lib" , typeof details.volume.owning_lib() == 'object' ? details.volume.owning_lib().name() : data.hash.aou[ details.volume.owning_lib() ].name());
326 set("record", details.volume.record());
327 set("notes", details.volume.notes());
328 set("uri_maps", details.volume.uri_maps());
329 set("uris", details.volume.uris());
332 set("transit_copy_status", '');
333 set_tooltip("transit_copy_status", '');
335 set("dest_recv_time", '');
336 set("transit_id", '');
337 set("persistant_transfer", '');
340 set("source_send_time", '');
341 set("target_copy", '');
342 set("hold_transit_copy", '');
344 if (details.transit) {
346 transit_list.clear();
347 transit_list.append( { 'row' : { 'my' : { 'atc' : details.transit, } } });
349 var transit_copy_status = typeof details.transit.copy_status() == 'object' ? details.transit.copy_status() : data.hash.ccs[ details.transit.copy_status() ];
350 set("transit_copy_status", transit_copy_status.name() );
351 set_tooltip("transit_copy_status", document.getElementById('circStrings').getFormattedString(
352 'staff.circ.copy_details.copy_status_tooltip',
354 get_localized_bool( transit_copy_status.opac_visible() ),
355 get_localized_bool( transit_copy_status.holdable() )
358 set("dest", details.transit.dest());
359 set("dest_recv_time", util.date.formatted_date( details.transit.dest_recv_time(), '%{localized}' ));
360 set("transit_id", details.transit.id());
361 set("persistant_transfer", details.transit.persistant_transfer());
362 set("prev_hop", details.transit.prev_hop());
363 set("source", details.transit.source());
364 set("source_send_time", util.date.formatted_date( details.transit.source_send_time(), '%{localized}' ));
365 set("target_copy", details.transit.target_copy());
366 set("hold_transit_copy", details.transit.hold_transit_copy());
368 $('transit_caption').setAttribute('label', $('circStrings').getString('staff.circ.copy_details.not_transit'));
371 set("checkin_lib", '');
372 set_tooltip("checkin_lib", '');
373 set("checkin_workstation","");
374 set("checkin_staff", '');
375 set("checkin_time", '');
376 set("checkin_scan_time", '');
377 set("circ_circ_lib" , '');
378 set_tooltip("circ_circ_lib" , '');
379 set("circ_staff", '');
380 set("desk_renewal", '');
383 set("duration_rule", '');
384 set("fine_interval", '');
387 set("max_fine_rule", '');
388 set("opac_renewal", '');
389 set("phone_renewal", '');
390 set("recurring_fine", '');
391 set("recurring_fine_rule", '');
392 set("renewal_remaining", '');
393 set("stop_fines", '');
394 set("stop_fines_time", '');
395 set("target_copy", '');
397 set("xact_finish", '');
398 set("xact_start", '');
399 set("create_time", '');
400 set("workstation", '');
401 set("renewal_workstation", '');
402 set("checkout_workstation", '');
405 set("billable_transaction", '');
406 set("circ_type", '');
407 set("billing_total", '');
408 set("payment_total", '');
409 set("patron_name", '');
410 set("prev_patron_name", '');
411 set("prev_num_circs", '');
412 set("prev_num_renewals", '');
413 set("prev_xact_start", '');
414 set("prev_checkout_workstation", '');
415 set("prev_renewal_time", '');
416 set("prev_stop_fines", '');
417 set("prev_stop_fines_time", '');
418 set("prev_renewal_workstation", '');
419 set("prev_checkin_workstation", '');
420 set("prev_last_checkin_time", '');
421 set("prev_last_checkin_scan_time", '');
424 try { set("checkin_lib", typeof details.circ.checkin_lib() == 'object' ? details.circ.checkin_lib().shortname() : data.hash.aou[ details.circ.checkin_lib() ].shortname() ); } catch(E) {};
425 try { set_tooltip("checkin_lib", typeof details.circ.checkin_lib() == 'object' ? details.circ.checkin_lib().name() : data.hash.aou[ details.circ.checkin_lib() ].name() ); } catch(E) {};
426 if (details.circ.checkin_workstation()) {
427 set("checkin_workstation", details.circ.checkin_workstation().name());
429 set("checkin_staff", details.circ.checkin_staff());
430 set("checkin_time", util.date.formatted_date( details.circ.checkin_time(), '%{localized}' ));
431 set("last_checkin_time", util.date.formatted_date( details.circ.checkin_time(), '%{localized}' ));
432 set("checkin_scan_time", util.date.formatted_date( details.circ.checkin_scan_time(), '%{localized}' ));
433 set("last_checkin_scan_time", util.date.formatted_date( details.circ.checkin_scan_time(), '%{localized}' ));
434 try { set("circ_circ_lib" , typeof details.circ.circ_lib() == 'object' ? details.circ.circ_lib().shortname() : data.hash.aou[ details.circ.circ_lib() ].shortname() ); } catch(E) {};
435 try { set_tooltip("circ_circ_lib" , typeof details.circ.circ_lib() == 'object' ? details.circ.circ_lib().name() : data.hash.aou[ details.circ.circ_lib() ].name() ); } catch(E) {};
436 set("circ_staff", details.circ.circ_staff());
437 set("desk_renewal", details.circ.desk_renewal());
438 set("due_date", util.date.formatted_date( details.circ.due_date(), '%{localized}' ));
439 set("duration", details.circ.duration());
440 set("fine_interval", details.circ.fine_interval());
441 set("circ_id", details.circ.id());
442 set("max_fine", details.circ.max_fine());
443 set("opac_renewal", details.circ.opac_renewal());
444 set("phone_renewal", details.circ.phone_renewal());
445 set("renewal_type", renewal_composite_kludge(details.circ));
446 set("recurring_fine", details.circ.recurring_fine());
447 set("renewal_remaining", details.circ.renewal_remaining());
448 set("stop_fines", details.circ.stop_fines());
449 set("stop_fines_time", util.date.formatted_date( details.circ.stop_fines_time(), '%{localized}' ));
450 set("target_copy", details.circ.target_copy());
452 if (details.circ.usr()) {
453 set("circ_usr", details.circ.usr());
454 network.simple_request('FM_AU_FLESHED_RETRIEVE_VIA_ID',
455 [ ses(), details.circ.usr() ], function(preq) {
456 var r_au = preq.getResultObject();
457 JSAN.use('patron.util');
460 patron.util.format_name( r_au ) + ' : ' + r_au.card().barcode(),
463 set_tooltip('patron_name','circ id ' + details.circ.id());
467 set('patron_name', document.getElementById(
468 'circStrings').getString('staff.circ.aged_circ'));
469 set_tooltip('patron_name','circ id ' + details.circ.id());
471 set("xact_finish", util.date.formatted_date( details.circ.xact_finish(), '%{localized}' ));
472 set("xact_start", util.date.formatted_date( details.circ.xact_start(), '%{localized}' ));
473 set("create_time", util.date.formatted_date( details.circ.create_time(), '%{localized}' ));
474 set("workstation", details.circ.workstation());
475 if (get_bool(details.circ.opac_renewal())||get_bool(details.circ.phone_renewal())||get_bool(details.circ.desk_renewal())) {
476 set("renewal_workstation", (typeof details.circ.workstation() == 'object' && details.circ.workstation() != null) ? details.circ.workstation().name() : details.circ.workstation() );
477 network.simple_request('FM_CIRC_CHAIN_SUMMARY', [ses(), details.circ.id() ], function(req) {
479 var summary = req.getResultObject();
480 set("num_circs", summary.num_circs());
481 set("num_renewals", Number(summary.num_circs()) - 1);
482 set("xact_start", util.date.formatted_date( summary.start_time(), '%{localized}' ));
483 set("checkout_workstation", summary.checkout_workstation());
484 set("renewal_time", util.date.formatted_date( summary.last_renewal_time(), '%{localized}' ));
485 set("stop_fines", summary.last_stop_fines());
486 set("stop_fines_time", util.date.formatted_date( summary.last_stop_fines_time(), '%{localized}' ));
487 set("renewal_workstation", summary.last_renewal_workstation());
488 set("checkin_workstation", summary.last_checkin_workstation());
489 set("last_checkin_time", util.date.formatted_date( summary.last_checkin_time(), '%{localized}' ));
490 set("last_checkin_scan_time", util.date.formatted_date( summary.last_checkin_scan_time(), '%{localized}' ));
492 alert('Error in alternate_copy_summary.js, FM_CIRC_CHAIN: ' + E);
496 set("checkout_workstation", (typeof details.circ.workstation() == 'object' && details.circ.workstation() != null) ? details.circ.workstation().name() : details.circ.workstation() );
498 network.simple_request('FM_CIRC_PREV_CHAIN_SUMMARY', [ses(), details.circ.id() ], function(req) {
500 var robj = req.getResultObject();
501 if (!robj || typeof robj == 'null') { return; }
502 var summary = robj['summary'];
504 network.simple_request('FM_AU_FLESHED_RETRIEVE_VIA_ID',[ ses(), robj['usr'] ], function(preq) {
505 var r_au = preq.getResultObject();
506 JSAN.use('patron.util');
509 patron.util.format_name( r_au ) + ' : ' + r_au.card().barcode(),
512 set_tooltip('prev_patron_name','circ chain prior to circ id ' + details.circ.id());
515 set('prev_patron_name', document.getElementById(
516 'circStrings').getString('staff.circ.aged_circ'));
517 set_tooltip('prev_patron_name','circ chain prior to circ id ' + details.circ.id());
519 set("prev_num_circs", summary.num_circs());
520 set("prev_num_renewals", Number(summary.num_circs()) - 1);
521 set("prev_xact_start", util.date.formatted_date( summary.start_time(), '%{localized}' ));
522 set("prev_checkout_workstation", summary.checkout_workstation());
523 set("prev_renewal_time", util.date.formatted_date( summary.last_renewal_time(), '%{localized}' ));
524 set("prev_stop_fines", summary.last_stop_fines());
525 set("prev_stop_fines_time", util.date.formatted_date( summary.last_stop_fines_time(), '%{localized}' ));
526 set("prev_renewal_workstation", summary.last_renewal_workstation());
527 set("prev_checkin_workstation", summary.last_checkin_workstation());
528 set("prev_last_checkin_time", util.date.formatted_date( summary.last_checkin_time(), '%{localized}' ));
529 set("prev_last_checkin_scan_time", util.date.formatted_date( summary.last_checkin_scan_time(), '%{localized}' ));
531 alert('Error in alternate_copy_summary.js, FM_CIRC_PREV_CHAIN: ' + E);
534 set("billings", details.circ.billings());
535 set("payments", details.circ.payments());
536 set("billable_transaction", details.circ.billable_transaction());
537 set("circ_type", details.circ.circ_type());
538 set("billing_total", details.circ.billing_total());
539 set("payment_total", details.circ.payment_total());
540 if (! details.circ.checkin_time() ) {
541 set("recurring_fine_rule", document.getElementById('circStrings').getFormattedString(
542 'staff.circ.copy_details.recurring_fine_rule_format',
544 details.circ.recurring_fine_rule().name(),
545 details.circ.recurring_fine_rule().id(),
546 details.circ.recurring_fine_rule().low(),
547 details.circ.recurring_fine_rule().normal(),
548 details.circ.recurring_fine_rule().high(),
549 details.circ.recurring_fine_rule().recurrence_interval()
552 set_tooltip("recurring_fine_rule", document.getElementById('circStrings').getFormattedString(
553 'staff.circ.copy_details.recurring_fine_rule_tooltip_format',
555 details.circ.recurring_fine_rule().name(),
556 details.circ.recurring_fine_rule().id(),
557 details.circ.recurring_fine_rule().low(),
558 details.circ.recurring_fine_rule().normal(),
559 details.circ.recurring_fine_rule().high(),
560 details.circ.recurring_fine_rule().recurrence_interval()
563 set("duration_rule", document.getElementById('circStrings').getFormattedString(
564 'staff.circ.copy_details.duration_rule_format',
566 details.circ.duration_rule().name(),
567 details.circ.duration_rule().id(),
568 details.circ.duration_rule().shrt(),
569 details.circ.duration_rule().normal(),
570 details.circ.duration_rule().extended(),
571 details.circ.duration_rule().max_renewals()
574 set_tooltip("duration_rule", document.getElementById('circStrings').getFormattedString(
575 'staff.circ.copy_details.duration_rule_tooltip_format',
577 details.circ.duration_rule().name(),
578 details.circ.duration_rule().id(),
579 details.circ.duration_rule().shrt(),
580 details.circ.duration_rule().normal(),
581 details.circ.duration_rule().extended(),
582 details.circ.duration_rule().max_renewals()
585 set("max_fine_rule", document.getElementById('circStrings').getFormattedString(
586 'staff.circ.copy_details.max_fine_rule_format',
588 details.circ.max_fine_rule().name(),
589 details.circ.max_fine_rule().id(),
590 details.circ.max_fine_rule().amount(),
591 details.circ.max_fine_rule().is_percent()
594 set_tooltip("max_fine_rule", document.getElementById('circStrings').getFormattedString(
595 'staff.circ.copy_details.max_fine_rule_tooltip_format',
597 details.circ.max_fine_rule().name(),
598 details.circ.max_fine_rule().id(),
599 details.circ.max_fine_rule().amount(),
600 details.circ.max_fine_rule().is_percent()
606 set("hold_status", '');
608 set("capture_time", '');
609 set("current_copy", '');
610 set("email_notify", '');
611 set("expire_time", '');
612 set("fulfillment_lib", '');
613 set_tooltip("fulfillment_lib", '');
614 set("fulfillment_staff", '');
615 set("fulfillment_time", '');
616 set("hold_type", '');
617 set("holdable_formats", '');
619 set("phone_notify", '');
620 set("pickup_lib", '');
621 set_tooltip("pickup_lib", '');
622 set("prev_check_time", '');
623 set("request_lib", '');
624 set_tooltip("request_lib", '');
625 set("request_time", '');
626 set("requestor", '');
627 set("selection_depth", '');
628 set("selection_ou", '');
629 set_tooltip("selection_ou", '');
632 set("hold_patron_name", '');
633 set("cancel_time", '');
634 set("notify_time", '');
635 set("notify_count", '');
636 set("notifications", '');
638 set("eligible_copies", '');
640 set("thaw_date", '');
641 set("shelf_time", '');
642 set("cancel_cause", '');
643 set("cancel_note", '');
647 var better_fleshed_hold_blob = network.simple_request('FM_AHR_BLOB_RETRIEVE.authoritative',[ ses(), details.hold.id() ]);
648 var status_robj = better_fleshed_hold_blob.status;
649 JSAN.use('circ.util');
652 hold_list.append( { 'row' : { 'my' : { 'ahr' : better_fleshed_hold_blob.hold, 'acp' : details.copy, 'status' : status_robj, } } });
654 JSAN.use('patron.util');
655 var au_obj = patron.util.retrieve_fleshed_au_via_id( ses(), details.hold.usr() );
656 $('hold_patron_name').setAttribute('value', $('circStrings').getFormattedString('staff.circ.copy_details.user_details', [au_obj.family_name(), au_obj.first_given_name(), au_obj.card().barcode()]) );
657 $('hold_patron_name').onclick = function(e) {
659 window.xulG.new_patron_tab( {}, { 'id' : au_obj.id() } );
662 copy_to_clipboard(au_obj.card().barcode());
665 set("hold_status", details.hold.status());
666 set("transit", details.hold.transit());
667 set("capture_time", util.date.formatted_date( details.hold.capture_time(), '%{localized}' ));
668 set("current_copy", details.hold.current_copy());
669 set("email_notify", details.hold.email_notify());
670 set("expire_time", util.date.formatted_date( details.hold.expire_time(), '%{localized}' ));
671 try { set("fulfillment_lib" , typeof details.hold.fulfillment_lib() == 'object' ? details.hold.fulfillment_lib().shortname() : data.hash.aou[ details.hold.fulfillment_lib() ].shortname() ); } catch(E) {}
672 try { set_tooltip("fulfillment_lib" , typeof details.hold.fulfillment_lib() == 'object' ? details.hold.fulfillment_lib().name() : data.hash.aou[ details.hold.fulfillment_lib() ].name() ); } catch(E) {}
673 set("fulfillment_staff", details.hold.fulfillment_staff());
674 set("fulfillment_time", util.date.formatted_date( details.hold.fulfillment_time(), '%{localized}' ));
675 set("hold_type", details.hold.hold_type());
676 set("holdable_formats", details.hold.holdable_formats());
677 set("hold_id", details.hold.id());
678 set("phone_notify", details.hold.phone_notify());
679 try { set("pickup_lib" , typeof details.hold.pickup_lib() == 'object' ? details.hold.pickup_lib().shortname() : data.hash.aou[ details.hold.pickup_lib() ].shortname() ); } catch(E) {}
680 try { set_tooltip("pickup_lib" , typeof details.hold.pickup_lib() == 'object' ? details.hold.pickup_lib().name() : data.hash.aou[ details.hold.pickup_lib() ].name() ); } catch(E) {}
681 set("prev_check_time", util.date.formatted_date( details.hold.prev_check_time(), '%{localized}' ));
682 try { set("request_lib" , typeof details.hold.request_lib() == 'object' ? details.hold.request_lib().shortname() : data.hash.aou[ details.hold.request_lib() ].shortname() ); } catch(E) {}
683 try { set_tooltip("request_lib" , typeof details.hold.request_lib() == 'object' ? details.hold.request_lib().name() : data.hash.aou[ details.hold.request_lib() ].name() ); } catch(E) {}
684 set("request_time", util.date.formatted_date( details.hold.request_time(), '%{localized}' ));
685 set("requestor", details.hold.requestor());
686 set("selection_depth", details.hold.selection_depth());
687 set("selection_ou" , typeof details.hold.selection_ou() == 'object' ? details.hold.selection_ou().shortname() : data.hash.aou[ details.hold.selection_ou() ].shortname() );
688 set_tooltip("selection_ou" , typeof details.hold.selection_ou() == 'object' ? details.hold.selection_ou().name() : data.hash.aou[ details.hold.selection_ou() ].name() );
689 set("target", details.hold.target());
690 set("hold_usr", details.hold.usr());
691 set("cancel_time", util.date.formatted_date( details.hold.cancel_time(), '%{localized}' ));
692 set("notify_time", util.date.formatted_date( details.hold.notify_time(), '%{localized}' ));
693 set("notify_count", details.hold.notify_count());
694 set("notifications", details.hold.notifications());
695 set("bib_rec", details.hold.bib_rec());
696 set("eligible_copies", details.hold.eligible_copies());
697 set("frozen", details.hold.frozen());
698 set("thaw_date", util.date.formatted_date( details.hold.thaw_date(), '%{localized}' ));
699 set("shelf_time", util.date.formatted_date( details.hold.shelf_time(), '%{localized}' ));
700 set("cancel_cause", details.hold.cancel_cause());
701 set("cancel_note", details.hold.cancel_note());
702 set("notes", details.hold.notes());
704 if (details.copy.status() == 8 /* ON HOLDS SHELF */) {
705 $('hold_caption').setAttribute('label', $('circStrings').getString('staff.circ.copy_details.bad_hold_status'));
707 $('hold_caption').setAttribute('label', $('circStrings').getString('staff.circ.copy_details.no_hold'));
711 var x = document.getElementById('cat_deck');
713 JSAN.use('util.deck');
714 var d = new util.deck('cat_deck');
715 d.reset_iframe( urls.XUL_MARC_VIEW, {}, { 'docid' : details.mvr ? details.mvr.doc_id() : -1 } );