5 if (typeof JSAN == 'undefined') { throw( "The JSAN library object is missing."); }
6 JSAN.errorLevel = "die"; // none, warn, or die
7 JSAN.addRepository('/xul/server/');
8 JSAN.use('util.error'); error = new util.error();
9 error.sdump('D_TRACE','my_init() for missing_pieces.xul');
11 JSAN.use('util.network');
12 var network = new util.network();
14 // Why the indirection of missing_pieces.xul instead of calling window.prompt in chrome/content/main/menu.js directly?
15 // So we can get free remote upgrades of the logic behind cat.util.mark_item_as_missing_pieces, since I can't call
16 // JSAN.use('cat.util'); in menu.js
17 var barcode = window.prompt(
18 $("circStrings").getString('staff.circ.missing_pieces.scan_item.prompt'),
20 $("circStrings").getString('staff.circ.missing_pieces.scan_item.title')
29 copy = network.simple_request('FM_ACP_RETRIEVE_VIA_BARCODE',[ barcode ]);
30 if (typeof copy.ilsevent != 'undefined') throw(copy);
31 if (!copy) throw(copy);
33 alert($("circStrings").getFormattedString('staff.circ.missing_pieces.scan_item.error_alert', [barcode]) + '\n');
39 cat.util.mark_item_as_missing_pieces( [ copy.id() ] );
43 try { error.standard_unexpected_error_alert('circ/missing_pieces.xul',E); } catch(F) { alert(E); }