[open-ils-commits] r10039 -
branches/acq-experiment/Open-ILS/web/oilsweb/oilsweb/public/oils/media/ui_js/oils/default/acq/picklist
svn at svn.open-ils.org
svn at svn.open-ils.org
Mon Jul 14 21:32:37 EDT 2008
Author: erickson
Date: 2008-07-14 21:32:36 -0400 (Mon, 14 Jul 2008)
New Revision: 10039
Modified:
branches/acq-experiment/Open-ILS/web/oilsweb/oilsweb/public/oils/media/ui_js/oils/default/acq/picklist/bib_search.js
Log:
finished implementing the save-selected-as-new-picklist functionality
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-07-15 01:05:57 UTC (rev 10038)
+++ branches/acq-experiment/Open-ILS/web/oilsweb/oilsweb/public/oils/media/ui_js/oils/default/acq/picklist/bib_search.js 2008-07-15 01:32:36 UTC (rev 10039)
@@ -164,20 +164,26 @@
}
if(values.new_name && values.new_name != '') {
- // XXX create a new PL and copy LIs over
- /*
+ // save selected lineitems to a new picklist
if(values.which = 'selected') {
- resultPicklist = new acqpl();
- resultPicklist.owner(user.user.id())
- }
- */
- resultPicklist.name(values.new_name);
- openils.acq.Picklist.update(resultPicklist,
- function(stat) {
- location.href = 'view/' + resultPicklist.id();
- }
- );
+ openils.acq.Picklist.create(
+ {name: values.new_name},
+ function(id) {
+ updateLiList(id, selectedLIs, 0,
+ function(){location.href = 'view/' + id});
+ }
+ );
+ } else {
+ // save all == change the name of the results picklist
+ resultPicklist.name(values.new_name);
+ openils.acq.Picklist.update(resultPicklist,
+ function(stat) {
+ location.href = 'view/' + resultPicklist.id();
+ }
+ );
+ }
} else if(values.existing_pl) {
+ // update lineitems to use an existing picklist
updateLiList(values.existing_pl, selectedLIs, 0,
function(){location.href = 'view/' + values.existing_pl});
}
More information about the open-ils-commits
mailing list