[open-ils-commits] r10176 - in
branches/acq-experiment/Open-ILS/web/oilsweb/oilsweb:
public/oils/media/ui_js/oils/default/common
templates/oils/default/common
svn at svn.open-ils.org
svn at svn.open-ils.org
Tue Jul 29 14:25:15 EDT 2008
Author: erickson
Date: 2008-07-29 14:25:06 -0400 (Tue, 29 Jul 2008)
New Revision: 10176
Modified:
branches/acq-experiment/Open-ILS/web/oilsweb/oilsweb/public/oils/media/ui_js/oils/default/common/jubgrid.js
branches/acq-experiment/Open-ILS/web/oilsweb/oilsweb/templates/oils/default/common/jubgrid.html
Log:
added a button to mark a single item as received.
Modified: branches/acq-experiment/Open-ILS/web/oilsweb/oilsweb/public/oils/media/ui_js/oils/default/common/jubgrid.js
===================================================================
--- branches/acq-experiment/Open-ILS/web/oilsweb/oilsweb/public/oils/media/ui_js/oils/default/common/jubgrid.js 2008-07-29 18:11:42 UTC (rev 10175)
+++ branches/acq-experiment/Open-ILS/web/oilsweb/oilsweb/public/oils/media/ui_js/oils/default/common/jubgrid.js 2008-07-29 18:25:06 UTC (rev 10176)
@@ -271,6 +271,44 @@
openils.acq.Lineitem.createLID(fields, addToStore);
},
+ receiveLID: function(evt) {
+ var list =[];
+ var selected = JUBGrid.jubDetailGrid.selection.getSelected();
+ for (var idx = 0; idx < selected.length; idx++) {
+ var rowIdx = selected[idx];
+ var lid = JUBGrid.jubDetailGrid.model.getRow(rowIdx);
+ list.push(lid.id);
+ }
+ if(lid != null) { // is at least one selected?
+ JUBGrid._receiveLIDList(list, 0,
+ function() {
+ delete openils.acq.Lineitem.ModelCache[lid.lineitem];
+ openils.acq.Lineitem.loadLIDGrid(
+ JUBGrid.jubDetailGrid, lid.lineitem, JUBGrid.jubDetailGridLayout);
+ }
+ );
+ }
+ },
+
+ // loop through the list of LIDs and mark them as received
+ _receiveLIDList: function(list, idx, callback) {
+ if(idx >= list.length)
+ return callback();
+ fieldmapper.standardRequest(
+ ['open-ils.acq', 'open-ils.acq.lineitem_detail.receive'],
+ { asnync: true,
+ params: [openils.User.authtoken, list[idx++]],
+ oncomplete: function(r) {
+ var res = r.recv().content();
+ if(e = openils.Event.parse(res))
+ return alert(e);
+ JUBGrid._receiveLIDList(list, idx, callback);
+ }
+ }
+ );
+ },
+
+
// called when a lineitem is edited
onJUBSet: function (griditem, attr, oldVal,newVal) {
var item;
Modified: branches/acq-experiment/Open-ILS/web/oilsweb/oilsweb/templates/oils/default/common/jubgrid.html
===================================================================
--- branches/acq-experiment/Open-ILS/web/oilsweb/oilsweb/templates/oils/default/common/jubgrid.html 2008-07-29 18:11:42 UTC (rev 10175)
+++ branches/acq-experiment/Open-ILS/web/oilsweb/oilsweb/templates/oils/default/common/jubgrid.html 2008-07-29 18:25:06 UTC (rev 10176)
@@ -188,6 +188,9 @@
<button dojoType='dijit.form.Button' onclick='JUBGrid.deleteLID'>
${_('Delete Selected Copy')}
</button>
+ <button dojoType='dijit.form.Button' onclick='JUBGrid.receiveLID'>
+ ${_('Mark Selected Copies Received')}
+ </button>
</div>
<div structure='JUBGrid.jubDetailGridLayout' jsid="JUBGrid.jubDetailGrid" dojoType="dojox.Grid"
id='${domprefix + "-details-grid"}'>
More information about the open-ils-commits
mailing list