[open-ils-commits] r9624 - in
branches/acq-experiment/Open-ILS/web/oilsweb/oilsweb:
public/oils/media/ui_js/oils/default/acq/picklist
templates/oils/default/acq/picklist
svn at svn.open-ils.org
svn at svn.open-ils.org
Thu May 15 15:45:31 EDT 2008
Author: erickson
Date: 2008-05-15 15:45:28 -0400 (Thu, 15 May 2008)
New Revision: 9624
Modified:
branches/acq-experiment/Open-ILS/web/oilsweb/oilsweb/public/oils/media/ui_js/oils/default/acq/picklist/bib_search.js
branches/acq-experiment/Open-ILS/web/oilsweb/oilsweb/templates/oils/default/acq/picklist/bib_search.html
Log:
using new ml search aggregator method
Modified: branches/acq-experiment/Open-ILS/web/oilsweb/oilsweb/public/oils/media/ui_js/oils/default/acq/picklist/bib_search.js
===================================================================
--- branches/acq-experiment/Open-ILS/web/oilsweb/oilsweb/public/oils/media/ui_js/oils/default/acq/picklist/bib_search.js 2008-05-15 19:32:08 UTC (rev 9623)
+++ branches/acq-experiment/Open-ILS/web/oilsweb/oilsweb/public/oils/media/ui_js/oils/default/acq/picklist/bib_search.js 2008-05-15 19:45:28 UTC (rev 9624)
@@ -38,7 +38,6 @@
}
);
- //alert(dojo.query('[name=label]', 'oils-acq-search-fields-template'));
var tbody = dojo.byId('oils-acq-search-fields-tbody');
var tmpl = tbody.removeChild(dojo.byId('oils-acq-search-fields-template'));
@@ -83,63 +82,19 @@
}
fieldmapper.standardRequest(
- ['open-ils.search', 'open-ils.search.z3950.search_class'],
+ ['open-ils.acq', 'open-ils.acq.picklist.search.z3950'],
{ async: true,
params: [user.authtoken, search],
onresponse: handleResult,
- oncomplete: viewPicklist
}
);
}
function handleResult(r) {
var result = r.recv().content();
- if(!resultPicklist)
- createResultPicklist();
-
- searchProgress.update({maximum: sourceCount*searchLimit+1, progress: ++recvCount});
-
- for(var idx in result.records) {
- searchProgress.update({progress: ++recvCount});
- var rec = result.records[idx];
- var lineitem = new jub()
-
- lineitem.picklist(resultPicklist.id());
- lineitem.source_label(result.service)
- lineitem.marc(rec.marcxml)
- lineitem.eg_bib_id(rec.bibid)
-
- var id = fieldmapper.standardRequest(
- ['open-ils.acq', 'open-ils.acq.lineitem.create'],
- [user.authtoken, lineitem]
- );
- }
+ if(result.complete)
+ return viewPicklist(result.picklist_id);
+ searchProgress.update({maximum: result.total, progress: result.progress});
}
-function createResultPicklist() {
- resultPicklist = new acqpl();
- resultPicklist.name('');
- resultPicklist.owner(user.user.id());
-
- /* delete the old picklist with name = '' */
- var pl = fieldmapper.standardRequest(
- ['open-ils.acq', 'open-ils.acq.picklist.name.retrieve'],
- [user.authtoken, '']
- );
-
- if(pl) {
- fieldmapper.standardRequest(
- ['open-ils.acq', 'open-ils.acq.picklist.delete'],
- [user.authtoken, pl.id()]
- );
- }
-
- resultPicklist.id(
- fieldmapper.standardRequest(
- ['open-ils.acq', 'open-ils.acq.picklist.create'],
- [user.authtoken, resultPicklist]
- )
- );
-}
-
dojo.addOnLoad(drawForm);
Modified: branches/acq-experiment/Open-ILS/web/oilsweb/oilsweb/templates/oils/default/acq/picklist/bib_search.html
===================================================================
--- branches/acq-experiment/Open-ILS/web/oilsweb/oilsweb/templates/oils/default/acq/picklist/bib_search.html 2008-05-15 19:32:08 UTC (rev 9623)
+++ branches/acq-experiment/Open-ILS/web/oilsweb/oilsweb/templates/oils/default/acq/picklist/bib_search.html 2008-05-15 19:45:28 UTC (rev 9624)
@@ -12,8 +12,8 @@
<script>
var searchLimit = ${c.oils.acq.limit.value} || 10;
var searchOffset = ${c.oils.acq.offset.value} || 0;
- function viewPicklist() {
- location.href = '${c.oils.acq.prefix.value}/picklist/view/' + resultPicklist.id();
+ function viewPicklist(id) {
+ location.href = '${c.oils.acq.prefix.value}/picklist/view/' + id;
}
</script>
More information about the open-ils-commits
mailing list