[open-ils-commits] r10053 - 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 15 10:50:36 EDT 2008
Author: erickson
Date: 2008-07-15 10:50:34 -0400 (Tue, 15 Jul 2008)
New Revision: 10053
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 jub delete button
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-15 04:46:15 UTC (rev 10052)
+++ branches/acq-experiment/Open-ILS/web/oilsweb/oilsweb/public/oils/media/ui_js/oils/default/common/jubgrid.js 2008-07-15 14:50:34 UTC (rev 10053)
@@ -147,6 +147,51 @@
}
},
+ removeSelectedJUBs: function(evt) {
+
+ function deleteList(list, idx, oncomplete) {
+ if(idx >= list.length)
+ return oncomplete();
+ fieldmapper.standardRequest([
+ 'open-ils.acq',
+ 'open-ils.acq.lineitem.delete'],
+ { async: true,
+ params: [openils.User.authtoken, list[idx].id()],
+ oncomplete: function(e) {
+ deleteList(list, ++idx, oncomplete);
+ }
+ }
+ );
+ }
+
+ var lineitems = JUBGrid.lineitems;
+ var deleteMe = [];
+ var keepMe = [];
+ var selected = JUBGrid.jubGrid.selection.getSelected();
+
+ for(var id in lineitems) {
+ var deleted = false;
+ for(var i = 0; i < selected.length; i++) {
+ var rowIdx = selected[i];
+ var jubid = JUBGrid.jubGrid.model.getRow(rowIdx).id;
+ if(jubid == id) {
+ deleteMe.push(lineitems[id]);
+ deleted = true;
+ }
+ }
+ if(!deleted)
+ keepMe.push(lineitems[id]);
+ }
+
+ JUBGrid.lineitems = keepMe;
+ deleteList(deleteMe, 0, function(){
+ JUBGrid.jubGrid.model.store =
+ new dojo.data.ItemFileReadStore({data:jub.toStoreData(keepMe)});
+ JUBGrid.jubGrid.model.refresh();
+ JUBGrid.jubGrid.update();
+ });
+ },
+
deleteLID: function(evt) {
var list =[];
var selected = JUBGrid.jubDetailGrid.selection.getSelected();
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-15 04:46:15 UTC (rev 10052)
+++ branches/acq-experiment/Open-ILS/web/oilsweb/oilsweb/templates/oils/default/common/jubgrid.html 2008-07-15 14:50:34 UTC (rev 10053)
@@ -118,6 +118,9 @@
<button dojoType="dijit.form.Button" onclick="JUBGrid.approveJUB">
${_('Approve Selected Titles')}
</button>
+ <button dojoType="dijit.form.Button" onclick="JUBGrid.removeSelectedJUBs">
+ ${_('Remove Selected Titles')}
+ </button>
</div>
% endif
<div structure='JUBGrid.jubGridLayout' jsid='${grid_jsid}'
More information about the open-ils-commits
mailing list