[open-ils-commits] [GIT] Evergreen ILS branch master updated. aa2cbcf1dd8d073838edddb58d3a0b2832a8ea4d

Evergreen Git git at git.evergreen-ils.org
Wed Jul 11 18:48:10 EDT 2012


This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "Evergreen ILS".

The branch, master has been updated
       via  aa2cbcf1dd8d073838edddb58d3a0b2832a8ea4d (commit)
       via  b825315fcffce55bccae770e5421d30d83377919 (commit)
       via  d4e67fa909be91c5918bf08a96566e7e6d1040dd (commit)
      from  8f04f89529a97c065675803bceda275704d9d1b9 (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
commit aa2cbcf1dd8d073838edddb58d3a0b2832a8ea4d
Author: Dan Scott <dan at coffeecode.net>
Date:   Wed Jul 11 18:41:55 2012 -0400

    Get Z39.50 source names to be linked as expected
    
    The direct thead/th approach appeared to be interfering with the JS
    event that was supposed to link the Z39.50 source names; adding the
    expected tr layer resolved that.
    
    Signed-off-by: Dan Scott <dan at coffeecode.net>

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 271dca8..1ec8c6a 100644
--- a/Open-ILS/src/templates/conify/global/config/z3950_source.tt2
+++ b/Open-ILS/src/templates/conify/global/config/z3950_source.tt2
@@ -69,7 +69,7 @@
             fmClass='czs'
             editOnEnter='true'>
         <thead>
-            <th field='name' formatter='formatSourceName'/>
+            <tr><th field='name' formatter='formatSourceName'/></tr>
         </thead>
     </table>
 

commit b825315fcffce55bccae770e5421d30d83377919
Author: Bill Erickson <berick at esilibrary.com>
Date:   Tue Jun 19 10:23:22 2012 -0400

    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 <berick at esilibrary.com>
    Signed-off-by: Dan Scott <dan at coffeecode.net>

diff --git a/Open-ILS/examples/fm_IDL.xml b/Open-ILS/examples/fm_IDL.xml
index 88b1b71..6d0ad62 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
         </permacrud>
     </class>
 
-    <class id="cza" controller="open-ils.cstore" oils_obj:fieldmapper="config::z3950_attr" oils_persist:tablename="config.z3950_attr" reporter:label="Z39.50 Attribute">
+    <class id="cza" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="config::z3950_attr" oils_persist:tablename="config.z3950_attr" reporter:label="Z39.50 Attribute">
         <fields oils_persist:primary="id" oils_persist:sequence="config.z3950_attr_id_seq">
             <field reporter:label="Z39.50 Attribute ID" name="id" reporter:datatype="id"/>
             <field reporter:label="Z39.50 Source" name="source" reporter:datatype="link"/>
@@ -870,6 +870,14 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA
         <links>
             <link field="source" reltype="has_a" key="name" map="" class="czs"/>
         </links>
+        <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
+            <actions>
+                <create permission="ADMIN_Z3950_SOURCE" global_required="true"/>
+                <retrieve/>
+                <update permission="ADMIN_Z3950_SOURCE" global_required="true"/>
+                <delete permission="ADMIN_Z3950_SOURCE" global_required="true"/>
+            </actions>
+        </permacrud>
     </class>
 
 	<class id="ateo" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="action_trigger::event_output" oils_persist:tablename="action_trigger.event_output" reporter:label="Event Output">
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 cf32681..271dca8 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 @@
 
 <div dojoType="dijit.layout.ContentPane" layoutAlign="client">
 
+[%  source_code = ctx.page_args.0; 
+    IF source_code %]
+
+    <div dojoType="dijit.layout.ContentPane" layoutAlign="top" class='oils-header-panel'>
+        <div>[% l('Z39.50 Attributes for [_1]', source_code) | html %]</div>
+        <div>
+            <button dojoType='dijit.form.Button' onClick='zaGrid.showCreateDialog()'>[% l('New') %]</button>
+            <button dojoType='dijit.form.Button' onClick='zaGrid.deleteSelected()'>[% l('Delete Selected') %]</button>
+            <button dojoType='dijit.form.Button' onClick='showAttrCloneDialog()'>[% l('Clone Attributes From Source') %]</button>
+        </div>
+    </div>
+    <div>
+        <button onClick="location.href = location.href.replace(/\/[^\/]+$/, '')">[% l('Return to Sources') %]</button>
+    </div>
+    <br/>
+
+    <table
+        id="zaGrid"
+        jsid="zaGrid"
+        dojoType="openils.widget.FlattenerGrid"
+        columnPersistKey='"conify.config.z3950_attr"'
+        autoHeight="true"
+        editOnEnter="true"
+        editStyle="pane"
+        showLoadFilter="true"
+        fmClass="'cza'"
+        defaultSort="['code']"
+        query="{'source': ['[% source_code %]']}">
+        <thead>
+            <tr>
+                <th field="source" fpath="source" ffilter="true"/>
+                <th field="name" fpath="name" ffilter="true"/>
+                <th field="label" fpath="label" ffilter="true"/>
+                <th field="code" fpath="code" ffilter="true"/>
+                <th field="format" fpath="format" ffilter="true"/>
+                <th field="truncation" fpath="truncation" ffilter="true"/>
+            </tr>
+        </thead>
+    </table>
+
+    <div jsId="attrCloneDialog" dojoType="dijit.Dialog">
+        <span>[% l('Select a source to clone') %]</span>
+        <span><div id='attr-clone-source'></div></span>
+        <span><button onClick='cloneFromSource()'>[% l('Apply') %]</button></span>
+    </div>
+
+[% ELSE %]
+
     <div dojoType="dijit.layout.ContentPane" layoutAlign="top" class='oils-header-panel'>
         <div>Z39.50 Servers</div>
         <div>
@@ -20,9 +68,16 @@
             defaultCellWidth='"auto"'
             fmClass='czs'
             editOnEnter='true'>
+        <thead>
+            <th field='name' formatter='formatSourceName'/>
+        </thead>
     </table>
-</div>
 
 [% END %]
 
+</div>
+
+<script>var sourceCode = '[% source_code %]';</script>
+
+[% 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 ff2de10..23998e5 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 '<a href="' + location.href + '/' + escape(val) + '">' + val + '</a>';
+}
+
+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 0000000..7ad7102
--- /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.
+

commit d4e67fa909be91c5918bf08a96566e7e6d1040dd
Author: Bill Erickson <berick at esilibrary.com>
Date:   Tue Jun 19 10:18:44 2012 -0400

    Flattener grid defines override args in constructor
    
    ...instead of the seconday load handler.  Otherwise, the
    grid.overrideEditWidget, etc. containers may be undefined at page load
    time.
    
    Signed-off-by: Bill Erickson <berick at esilibrary.com>
    Signed-off-by: Dan Scott <dan at coffeecode.net>

diff --git a/Open-ILS/web/js/dojo/openils/widget/FlattenerGrid.js b/Open-ILS/web/js/dojo/openils/widget/FlattenerGrid.js
index 0b1914e..7691789 100644
--- a/Open-ILS/web/js/dojo/openils/widget/FlattenerGrid.js
+++ b/Open-ILS/web/js/dojo/openils/widget/FlattenerGrid.js
@@ -379,6 +379,10 @@ if (!dojo._hasResource["openils.widget.FlattenerGrid"]) {
 
                 this.fmIdentifier = this.fmIdentifier ||
                     fieldmapper.IDL.fmclasses[this.fmClass].pkey;
+
+                this.overrideEditWidgets = {};
+                this.overrideEditWidgetClass = {};
+                this.overrideWidgetArgs = {};
             },
 
             "startup": function() {
@@ -459,10 +463,6 @@ if (!dojo._hasResource["openils.widget.FlattenerGrid"]) {
 
                 this._showing_create_pane = false;
 
-                this.overrideEditWidgets = {};
-                this.overrideEditWidgetClass = {};
-                this.overrideWidgetArgs = {};
-
                 if (this.editOnEnter)
                     this._applyEditOnEnter();
                 else if (this.singleEditStyle)

-----------------------------------------------------------------------

Summary of changes:
 Open-ILS/examples/fm_IDL.xml                       |   10 +++-
 .../conify/global/config/z3950_source.tt2          |   57 +++++++++++++++++-
 .../web/js/dojo/openils/widget/FlattenerGrid.js    |    8 +-
 .../default/conify/global/config/z3950_source.js   |   65 +++++++++++++++++++-
 docs/RELEASE_NOTES_NEXT/z3950-attr-admin-ui.txt    |   16 +++++
 5 files changed, 149 insertions(+), 7 deletions(-)
 create mode 100644 docs/RELEASE_NOTES_NEXT/z3950-attr-admin-ui.txt


hooks/post-receive
-- 
Evergreen ILS


More information about the open-ils-commits mailing list