[open-ils-commits] r11379 - in trunk/Open-ILS: examples web/js/ui/default/conify/global/config web/templates/default/conify/global/config

svn at svn.open-ils.org svn at svn.open-ils.org
Tue Dec 2 18:57:21 EST 2008


Author: erickson
Date: 2008-12-02 18:57:21 -0500 (Tue, 02 Dec 2008)
New Revision: 11379

Added:
   trunk/Open-ILS/web/js/ui/default/conify/global/config/z3950_source.js
   trunk/Open-ILS/web/templates/default/conify/global/config/z3950_source.tt2
Modified:
   trunk/Open-ILS/examples/oils_web.xml.example
Log:
added initial z39 source config interface

Modified: trunk/Open-ILS/examples/oils_web.xml.example
===================================================================
--- trunk/Open-ILS/examples/oils_web.xml.example	2008-12-02 23:56:25 UTC (rev 11378)
+++ trunk/Open-ILS/examples/oils_web.xml.example	2008-12-02 23:57:21 UTC (rev 11379)
@@ -39,6 +39,7 @@
 
         <handler path='conify/global/config/billing_type' template='conify/global/config/billing_type.tt2'/>
         <handler path='conify/global/config/standing_penalty' template='conify/global/config/standing_penalty.tt2'/>
+        <handler path='conify/global/config/z3950_source' template='conify/global/config/z3950_source.tt2'/>
         <handler path='conify/global/permission/grp_penalty_threshold' template='conify/global/permission/grp_penalty_threshold.tt2'/>
     </handlers>
 </oils_web>

Added: trunk/Open-ILS/web/js/ui/default/conify/global/config/z3950_source.js
===================================================================
--- trunk/Open-ILS/web/js/ui/default/conify/global/config/z3950_source.js	                        (rev 0)
+++ trunk/Open-ILS/web/js/ui/default/conify/global/config/z3950_source.js	2008-12-02 23:57:21 UTC (rev 11379)
@@ -0,0 +1,53 @@
+dojo.require('dojox.grid.DataGrid');
+dojo.require('dojo.data.ItemFileReadStore');
+dojo.require('dijit.form.NumberTextBox');
+dojo.require('dijit.form.CheckBox');
+dojo.require('fieldmapper.OrgUtils');
+dojo.require('openils.widget.OrgUnitFilteringSelect');
+
+var zsList;
+
+function buildZSGrid() {
+    fieldmapper.standardRequest(
+        ['open-ils.permacrud', 'open-ils.permacrud.search.czs.atomic'],
+        {   async: true,
+            params: [openils.User.authtoken, {name:{'!=':null}}],
+            oncomplete: function(r) {
+                if(zsList = openils.Util.readResponse(r)) {
+                    var store = new dojo.data.ItemFileReadStore(
+                        {data:czs.toStoreData(zsList, 'name',{identifier:'name'})});
+                    zsGrid.setStore(store);
+                    zsGrid.render();
+                }
+            }
+        }
+    );
+}
+
+function zsCreate(args) {
+    return alert(js2JSON(args));
+    if(!args.name || args.owner == null) 
+        return;
+    if(args.default_price == '' || isNaN(args.default_price))
+        args.default_price = null;
+
+    var zsype = new czs();
+    zsype.name(args.name);
+    zsype.owner(args.owner);
+    zsype.default_price(args.default_price);
+
+    fieldmapper.standardRequest(
+        ['open-ils.permacrud', 'open-ils.permacrud.create.czs'],
+        {   async: true,
+            params: [openils.User.authtoken, zsype],
+            oncomplete: function(r) {
+                if(new String(openils.Util.readResponse(r)) != '0')
+                    buildBTGrid();
+            }
+        }
+    );
+}
+
+openils.Util.addOnLoad(buildZSGrid);
+
+

Added: trunk/Open-ILS/web/templates/default/conify/global/config/z3950_source.tt2
===================================================================
--- trunk/Open-ILS/web/templates/default/conify/global/config/z3950_source.tt2	                        (rev 0)
+++ trunk/Open-ILS/web/templates/default/conify/global/config/z3950_source.tt2	2008-12-02 23:57:21 UTC (rev 11379)
@@ -0,0 +1,71 @@
+[% WRAPPER default/base.tt2 %]
+<script src='[% ctx.media_prefix %]/js/ui/default/conify/global/config/z3950_source.js'> </script>
+<h1>Z39.50 Servers</h1><br/>
+
+<div dojoType="dijit.form.DropDownButton">
+    <span>Z39.50 Servers</span>
+    <div dojoType="dijit.TooltipDialog" execute="zsCreate(arguments[0]);">
+        <table class='dijitTooltipTable'>
+            <tr>
+                <td><label for="name">Name: </label></td>
+                <td><input dojoType="dijit.form.TextBox" name="name"/></td>
+            </tr>
+            <tr>
+                <td><label for="label">Label: </label></td>
+                <td><input dojoType="dijit.form.TextBox" name="label"/></td>
+            </tr>
+            <tr>
+                <td><label for="host">Host: </label></td>
+                <td><input dojoType="dijit.form.TextBox" name="host"/></td>
+            </tr>
+            <tr>
+                <td><label for="port">Port: </label></td>
+                <td><input dojoType="dijit.form.NumberTextBox" name="port"/></td>
+            </tr>
+            <tr>
+                <td><label for="db">Database: </label></td>
+                <td><input dojoType="dijit.form.TextBox" name="db"/></td>
+            </tr>
+            <tr>
+                <td><label for="record_format">Record Format: </label></td>
+                <td><input dojoType="dijit.form.TextBox" name="record_format"/></td>
+            </tr>
+            <tr>
+                <td><label for="transmission_format">Transmission Format: </label></td>
+                <td><input dojoType="dijit.form.TextBox" name="transmission_format"/></td>
+            </tr>
+            <tr>
+                <td><label for="auth">Requires Authentication: </label></td>
+                <td><input dojoType="dijit.form.CheckBox" name="auth"/></td>
+            </tr>
+            <tr>
+                <td colspan='2' align='center'>
+                    <button dojoType='dijit.form.Button' type="submit">Create</button>
+                </td>
+            </tr>
+        </table>
+    </div>
+</div> 
+
+<div dojoType="dijit.layout.ContentPane" layoutAlign="top">
+    <div dojoType="dijit.layout.ContentPane" layoutAlign="client" style='height:600px;'>
+        <table jsId="zsGrid" dojoType="dojox.grid.DataGrid" query="{name: '*'}" rowSelector='20px'>
+            <thead>
+                <tr>
+                    <th field="name">Name</th>
+                    <th field="label" width='auto'>Label</th>
+                    <th field="host" width='auto'>Host</th>
+                    <th field="port">Port</th>
+                    <th field="db" width='auto'>Database</th>
+                    <th field="record_format" width='auto'>Record Format</th>
+                    <th field="transmission_format" width='auto'>Transmission Format</th>
+                    <th field="auth" width='auto'>Requires Authentication</th>
+                </tr>
+            </thead>
+        </table>    
+    </div>
+</div>
+
+[% END %]
+
+



More information about the open-ils-commits mailing list