]> git.evergreen-ils.org Git - Evergreen.git/blob - Open-ILS/web/js/ui/default/booking/return.js
webstaff: final Booking menu entry
[Evergreen.git] / Open-ILS / web / js / ui / default / booking / return.js
1 dojo.requireLocalization("openils.booking", "pickup_and_return");
2 var localeStrings = dojo.i18n.getLocalization(
3     "openils.booking", "pickup_and_return"
4 );
5 var p;
6
7 function react_to_pass_in(opts) {
8     if (opts && opts.patron_barcode) {
9         p.populate({"patron": opts.patron_barcode});
10
11         hide_dom_element(
12             document.getElementById("contains_barcode_control")
13         );
14
15         document.getElementById("barcode").value = opts.patron_barcode;
16         var barcode_type = document.getElementById("barcode_type");
17         for (var i in barcode_type.options) {
18             if (barcode_type.options[i].value == "patron") {
19                 barcode_type.selectedIndex = i;
20                 break;
21             }
22         }
23
24         p._extra_resetting = function() {
25             reveal_dom_element(
26                 document.getElementById("contains_barcode_control")
27             );
28         };
29     }
30 }
31
32 function my_init() {
33     p = new Populator({
34         "out": out_bresv,
35         "in": in_bresv,
36         "patron": document.getElementById("patron_info")
37     }, document.getElementById("barcode"));
38     init_auto_l10n(document.getElementById("auto_l10n_start_here"));
39
40     setTimeout(
41         function() { react_to_pass_in(xulG.bresv_interface_opts); }, 0
42     );
43 }