1 dojo.require("dijit.form.Button");
2 dojo.require("openils.widget.XULTermLoader");
9 function fetchRecords() {
10 var data = termLoader.attr("value");
12 pager.total = data.length;
14 progressDialog.show(true);
15 fieldmapper.standardRequest(
16 ["open-ils.acq", "open-ils.acq.biblio.create_by_id"], {
18 openils.User.authtoken,
21 pager.displayOffset + pager.displayLimit
24 "flesh_cancel_reason": true,
26 "reuse_picklist": usingPl
29 "onresponse": function(r) {
30 if (r = openils.Util.readResponse(r)) {
31 if (typeof(r) != "object") {
33 } else if (r.classname && r.classname == "jub") {
35 liTable.addLineitem(r);
37 /* The ML method is buggy and sometimes responds with
38 * more objects that we don't want, hence the specific
39 * conditionals above that don't necesarily consume all
45 pager.batch_length = result_count;
46 progressDialog.hide();
49 function beginSearch() {
50 var data = termLoader.attr("value");
51 if (!data || !data.length) {
52 alert(localeStrings.LOAD_TERMS_FIRST);
57 openils.Util.hide("acq-frombib-upload-box");
58 openils.Util.show("acq-frombib-reload-box");
62 new openils.widget.XULTermLoader(
63 {"parentNode": "acq-frombib-upload"}
64 ).build(function(w) { termLoader = w; });
65 liTable = new AcqLiTable();
66 pager = new LiTablePager(fetchRecords, liTable);
68 openils.Util.show("acq-frombib-begin-holder");
71 openils.Util.addOnLoad(init);