From cf35d4f7048fa0501a32d43b2288ad07eec8f9e3 Mon Sep 17 00:00:00 2001 From: dbs Date: Fri, 20 Aug 2010 14:01:26 +0000 Subject: [PATCH] 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" git-svn-id: svn://svn.open-ils.org/ILS/trunk@17282 dcc99617-32d9-48b4-a31d-7c20da2025e4 --- Open-ILS/web/js/ui/default/cat/authority/list.js | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/Open-ILS/web/js/ui/default/cat/authority/list.js b/Open-ILS/web/js/ui/default/cat/authority/list.js index b09cbf021..51462b522 100644 --- a/Open-ILS/web/js/ui/default/cat/authority/list.js +++ b/Open-ILS/web/js/ui/default/cat/authority/list.js @@ -7,8 +7,8 @@ dojo.require('dijit.form.TextBox'); 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 @@ function mergeRecords() { 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(); + } + } + ); } -- 2.11.0