From: Bill Erickson Date: Tue, 19 Jun 2012 14:23:22 +0000 (-0400) Subject: Z39.50 attributes management interface X-Git-Url: https://old-git.evergreen-ils.org/?a=commitdiff_plain;h=b825315fcffce55bccae770e5421d30d83377919;p=contrib%2FConifer.git Z39.50 attributes management interface From the release notes: There is a new interface for managing Z39.50 attributes on a Z39.50 source. The interface is linked from each source name in the Z39.50 Source administrative interface. Cloning ~~~~~~ In addition to attribute creation, deletion, and editing, it's also possible to clone a set of attributes from one source into another. When cloning, any attributes present in the cloned source that are not present in the destination source are copied into the destination source. Signed-off-by: Bill Erickson Signed-off-by: Dan Scott --- diff --git a/Open-ILS/examples/fm_IDL.xml b/Open-ILS/examples/fm_IDL.xml index 88b1b71310..6d0ad622ff 100644 --- a/Open-ILS/examples/fm_IDL.xml +++ b/Open-ILS/examples/fm_IDL.xml @@ -857,7 +857,7 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA - + @@ -870,6 +870,14 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA + + + + + + + + diff --git a/Open-ILS/src/templates/conify/global/config/z3950_source.tt2 b/Open-ILS/src/templates/conify/global/config/z3950_source.tt2 index cf32681bc7..271dca818b 100644 --- a/Open-ILS/src/templates/conify/global/config/z3950_source.tt2 +++ b/Open-ILS/src/templates/conify/global/config/z3950_source.tt2 @@ -4,6 +4,54 @@
+[% source_code = ctx.page_args.0; + IF source_code %] + +
+
[% l('Z39.50 Attributes for [_1]', source_code) | html %]
+
+ + + +
+
+
+ +
+
+ + + + + + +
+ + + + + +
+ +
+ [% l('Select a source to clone') %] +
+ +
+ +[% ELSE %] +
Z39.50 Servers
@@ -20,9 +68,16 @@ defaultCellWidth='"auto"' fmClass='czs' editOnEnter='true'> + + + -
[% END %] +
+ + + +[% END %] diff --git a/Open-ILS/web/js/ui/default/conify/global/config/z3950_source.js b/Open-ILS/web/js/ui/default/conify/global/config/z3950_source.js index ff2de109a0..23998e5449 100644 --- a/Open-ILS/web/js/ui/default/conify/global/config/z3950_source.js +++ b/Open-ILS/web/js/ui/default/conify/global/config/z3950_source.js @@ -2,13 +2,76 @@ dojo.require('dojox.grid.DataGrid'); dojo.require('dojo.data.ItemFileReadStore'); dojo.require('dijit.form.NumberTextBox'); dojo.require('dijit.form.CheckBox'); +dojo.require('dijit.Dialog'); dojo.require('fieldmapper.OrgUtils'); dojo.require('openils.widget.OrgUnitFilteringSelect'); dojo.require('openils.widget.AutoGrid'); +dojo.require('openils.widget.FlattenerGrid'); +dojo.require('openils.widget.AutoFieldWidget'); +dojo.require('openils.User'); +dojo.require('openils.PermaCrud'); var zsList; function buildZSGrid() { - zsGrid.loadAll({order_by:{czs : 'name'}}); + + if (sourceCode) { + + zaGrid.overrideWidgetArgs.source = { + widgetValue : sourceCode, + readOnly : true + }; + + } else { + + zsGrid.loadAll({order_by:{czs : 'name'}}); + } +} + +function formatSourceName(val) { + return '' + val + ''; +} + +var cloneSourceSelector; +function showAttrCloneDialog() { + attrCloneDialog.show(); + if (!cloneSourceSelector) { + cloneSourceSelector = new openils.widget.AutoFieldWidget({ + fmClass : 'czs', + fmField : 'name', + selfReference : true, + parentNode : 'attr-clone-source' + }); + cloneSourceSelector.build(); + } +} + +function cloneFromSource() { + var pcrud = new openils.PermaCrud({authtoken : openils.User.authtoken}); + var remoteAttrs = pcrud.search('cza', {source : cloneSourceSelector.widget.attr('value')}); + var myAttrs = pcrud.search('cza', {source : sourceCode}); + var newAttrs = []; + + dojo.forEach(remoteAttrs, + function(rattr) { + + // if this source already has an attribute with the same name, don't clobber it + if (myAttrs.filter(function(a) { return (a.name() == rattr.name()) })[0]) + return; + + var newAttr = rattr.clone(); + newAttr.id(null); + newAttr.isnew(true); + newAttr.source(sourceCode); + newAttrs.push(newAttr); + } + ); + + if (newAttrs.length) { + pcrud.create(newAttrs, + {oncomplete : function() { zaGrid.refresh() }}); + } + + attrCloneDialog.hide(); } openils.Util.addOnLoad(buildZSGrid); diff --git a/docs/RELEASE_NOTES_NEXT/z3950-attr-admin-ui.txt b/docs/RELEASE_NOTES_NEXT/z3950-attr-admin-ui.txt new file mode 100644 index 0000000000..7ad71029cb --- /dev/null +++ b/docs/RELEASE_NOTES_NEXT/z3950-attr-admin-ui.txt @@ -0,0 +1,16 @@ +Z39.50 Source Attributes Management Interface +--------------------------------------------- + +There is a new interface for managing Z39.50 attributes on a Z39.50 +source. The interface is linked from each source name in the Z39.50 +Source administrative interface. + +Cloning +~~~~~~~ + +In addition to attribute creation, deletion, and editing, it's also +possible to clone a set of attributes from one source into another. +When cloning, any attributes present in the cloned source that are +not present in the destination source are copied into the destination +source. +