[open-ils-commits] r11635 - trunk/Open-ILS/web/js/ui/default/conify/global/config
svn at svn.open-ils.org
svn at svn.open-ils.org
Fri Dec 19 16:09:32 EST 2008
Author: erickson
Date: 2008-12-19 16:09:28 -0500 (Fri, 19 Dec 2008)
New Revision: 11635
Modified:
trunk/Open-ILS/web/js/ui/default/conify/global/config/circ_modifier.js
Log:
implemented save
Modified: trunk/Open-ILS/web/js/ui/default/conify/global/config/circ_modifier.js
===================================================================
--- trunk/Open-ILS/web/js/ui/default/conify/global/config/circ_modifier.js 2008-12-19 20:22:45 UTC (rev 11634)
+++ trunk/Open-ILS/web/js/ui/default/conify/global/config/circ_modifier.js 2008-12-19 21:09:28 UTC (rev 11635)
@@ -33,12 +33,38 @@
cm.ischanged(true);
cmSaveButton.setDisabled(false);
}
-
function saveChanges() {
- cmGrid.doclick(0); // force still-focused changes
- /* loop through the changed objects in cmCache and update them in the DB */
+ cmGrid.doclick(0);
+ var changedObjects = [];
+ for(var i in cmCache){
+ var cm = cmCache[i];
+ if(cm.ischanged())
+ changedObjects.push(cm);
+ }
+ _saveChanges(changedObjects, 0);
}
+function _saveChanges(changedObjects, idx) {
+
+ if(idx >= changedObjects.length) {
+ // we've made it through the list
+ cmSaveButton.setDisabled(true);
+ return;
+ }
+ var item = changedObjects[idx];
+
+ fieldmapper.standardRequest(
+ ['open-ils.permacrud', 'open-ils.permacrud.update.ccm'],
+ { async: true,
+ params: [openils.User.authtoken, item],
+ oncomplete: function(r) {
+ if(stat = openils.Util.readResponse(r)) {
+ _saveChanges(changedObjects, ++idx);
+ }
+ }
+ }
+ );
+}
function formatMagneticMedia(inDatum) {
switch (inDatum) {
case 't':
More information about the open-ils-commits
mailing list