--- /dev/null
+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);
+
+
--- /dev/null
+[% 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 %]
+
+