[open-ils-commits] r17282 - trunk/Open-ILS/web/js/ui/default/cat/authority (dbs)

svn at svn.open-ils.org svn at svn.open-ils.org
Fri Aug 20 10:01:28 EDT 2010


Author: dbs
Date: 2010-08-20 10:01:26 -0400 (Fri, 20 Aug 2010)
New Revision: 17282

Modified:
   trunk/Open-ILS/web/js/ui/default/cat/authority/list.js
Log:
Hook up the authority management interface to the middle layer

For now, uses the first record in the list as the master; we either
need to give users the ability to select the master record at merge
time, or to select it prior to clicking "Merge"


Modified: trunk/Open-ILS/web/js/ui/default/cat/authority/list.js
===================================================================
--- trunk/Open-ILS/web/js/ui/default/cat/authority/list.js	2010-08-20 13:22:30 UTC (rev 17281)
+++ trunk/Open-ILS/web/js/ui/default/cat/authority/list.js	2010-08-20 14:01:26 UTC (rev 17282)
@@ -7,8 +7,8 @@
 dojo.require("dijit.Menu");
 dojo.require("dijit.MenuItem");
 dojo.require('dojox.xml.parser');
+dojo.require("fieldmapper.Fieldmapper");
 dojo.require('openils.CGI');
-dojo.require('dojo.dnd.Source');
 dojo.require('openils.PermaCrud');
 dojo.require('openils.XUL');
 dojo.require('openils.widget.OrgUnitFilteringSelect');
@@ -189,5 +189,17 @@
     dojo.forEach(records, function(item, idx) {
         records[idx] = parseInt(item.slice(item.lastIndexOf('_') + 1));
     });
-    alert('TODO: actually merge the gathered records: ' + dojo.toJson(records));
+
+    /* Take the first record in the list and use that as the master */
+    fieldmapper.standardRequest(
+        ['open-ils.cat', 'open-ils.cat.authority.records.merge'],
+        {   async: false,
+            params: [openils.User.authtoken, records.shift(), records],
+            oncomplete : function(r) {
+                alert("Record merge is complete.");
+                clearMergeRecords();
+                displayRecords();
+            }
+        }
+    );
 }



More information about the open-ils-commits mailing list