1 dojo.require("dijit.form.Button");
2 dojo.require("openils.widget.XULTermLoader");
9 function fetchRecords() {
10 var data = openils.Util.uniqueElements(termLoader.attr("value"));
12 // Don't show a total for now... This total is the total number of
13 // search terms, but a user would take it to mean the total number of
14 // results, which we don't have a straightfoward way of getting without
15 // doing the search more that once.
17 // pager.total = data.length;
19 progressDialog.show(true);
20 fieldmapper.standardRequest(
21 ["open-ils.acq", "open-ils.acq.biblio.create_by_id"], {
23 openils.User.authtoken,
26 pager.displayOffset + pager.displayLimit
29 "flesh_cancel_reason": true,
31 "reuse_picklist": usingPl
34 "onresponse": function(r) {
35 if (r = openils.Util.readResponse(r)) {
36 if (typeof(r) != "object") {
38 } else if (r.classname && r.classname == "jub") {
40 liTable.addLineitem(r);
42 /* The ML method is buggy and sometimes responds with
43 * more objects that we don't want, hence the specific
44 * conditionals above that don't necesarily consume all
50 pager.batch_length = result_count;
51 progressDialog.hide();
54 function beginSearch() {
55 var data = termLoader.attr("value");
56 if (!data || !data.length) {
57 alert(localeStrings.LOAD_TERMS_FIRST);
62 openils.Util.hide("acq-frombib-upload-box");
63 openils.Util.show("acq-frombib-reload-box");
67 new openils.widget.XULTermLoader(
68 {"parentNode": "acq-frombib-upload", "parseCSV": true}
69 ).build(function(w) { termLoader = w; });
71 liTable = new AcqLiTable();
72 liTable.enableActionsDropdownOptions("vp");
74 pager = new LiTablePager(fetchRecords, liTable);
76 openils.Util.show("acq-frombib-begin-holder");
79 openils.Util.addOnLoad(init);