[open-ils-commits] r9911 - in
branches/acq-experiment/Open-ILS/web/oilsweb/oilsweb:
public/oils/media/ui_js/oils/default/acq/po
templates/oils/default/acq/po
svn at svn.open-ils.org
svn at svn.open-ils.org
Sun Jun 22 22:58:52 EDT 2008
Author: erickson
Date: 2008-06-22 22:58:50 -0400 (Sun, 22 Jun 2008)
New Revision: 9911
Modified:
branches/acq-experiment/Open-ILS/web/oilsweb/oilsweb/public/oils/media/ui_js/oils/default/acq/po/li_search.js
branches/acq-experiment/Open-ILS/web/oilsweb/oilsweb/templates/oils/default/acq/po/li_search.html
Log:
changed PO create button to only create POs on selected titles
Modified: branches/acq-experiment/Open-ILS/web/oilsweb/oilsweb/public/oils/media/ui_js/oils/default/acq/po/li_search.js
===================================================================
--- branches/acq-experiment/Open-ILS/web/oilsweb/oilsweb/public/oils/media/ui_js/oils/default/acq/po/li_search.js 2008-06-23 02:35:46 UTC (rev 9910)
+++ branches/acq-experiment/Open-ILS/web/oilsweb/oilsweb/public/oils/media/ui_js/oils/default/acq/po/li_search.js 2008-06-23 02:58:50 UTC (rev 9911)
@@ -80,25 +80,40 @@
function createPOFromLineitems() {
var po = new acqpo()
po.provider(newPOProviderSelector.getValue());
+
+ // find the selected lineitems
+ var selected = liGrid.selection.getSelected();
+ var selList = [];
+ for(var idx = 0; idx < selected.length; idx++) {
+ var rowIdx = selected[idx];
+ var id = liGrid.model.getRow(rowIdx).id;
+ for(var i = 0; i < lineitems.length; i++) {
+ if(lineitems[i].id() == id)
+ selList.push(lineitems[i]);
+ }
+ }
+
openils.acq.PO.create(po,
function(poId) {
- updateLiList(poId);
+ updateLiList(poId, selList);
}
);
}
-function updateLiList(poId) {
- _updateLiList(poId, 0);
+function updateLiList(poId, selList) {
+ _updateLiList(poId, selList, 0);
}
-function _updateLiList(poId, idx) {
- if(idx >= lineitems.length)
+function _updateLiList(poId, selList, idx) {
+ if(idx >= selList.length)
return location.href = 'view/' + poId;
- var li = lineitems[idx];
+ var li = selList[idx];
+ if(li.purchase_order())
+ return _updateLiList(poId, selList, ++idx);
li.purchase_order(poId);
new openils.acq.Lineitems({lineitem:li}).update(
function(stat) {
- _updateLiList(poId, ++idx);
+ _updateLiList(poId, selList, ++idx);
}
);
}
Modified: branches/acq-experiment/Open-ILS/web/oilsweb/oilsweb/templates/oils/default/acq/po/li_search.html
===================================================================
--- branches/acq-experiment/Open-ILS/web/oilsweb/oilsweb/templates/oils/default/acq/po/li_search.html 2008-06-23 02:35:46 UTC (rev 9910)
+++ branches/acq-experiment/Open-ILS/web/oilsweb/oilsweb/templates/oils/default/acq/po/li_search.html 2008-06-23 02:58:50 UTC (rev 9911)
@@ -50,7 +50,7 @@
<script>dojo.style('searchProgress', 'visibility', 'hidden');</script>
<div dojoType="dijit.form.DropDownButton" id='oils-acq-li-search-po-create'>
- <span>${('Create PO')}</span>
+ <span>${('Create PO From Selected Titles')}</span>
<div dojoType="dijit.TooltipDialog" execute="createPOFromLineitems(arguments[0]);">
<script type='dojo/connect' event='onOpen'>
buildProviderSelect(newPOProviderSelector,
More information about the open-ils-commits
mailing list