[open-ils-commits] r11293 - in trunk/Open-ILS/web: js/ui/default/conify/global/config templates/default/conify/global/config
svn at svn.open-ils.org
svn at svn.open-ils.org
Thu Nov 20 17:26:48 EST 2008
Author: erickson
Date: 2008-11-20 17:26:43 -0500 (Thu, 20 Nov 2008)
New Revision: 11293
Added:
trunk/Open-ILS/web/js/ui/default/conify/global/config/standing_penalty.js
trunk/Open-ILS/web/templates/default/conify/global/config/standing_penalty.tt2
Log:
initial standing penalty editor
Added: trunk/Open-ILS/web/js/ui/default/conify/global/config/standing_penalty.js
===================================================================
--- trunk/Open-ILS/web/js/ui/default/conify/global/config/standing_penalty.js (rev 0)
+++ trunk/Open-ILS/web/js/ui/default/conify/global/config/standing_penalty.js 2008-11-20 22:26:43 UTC (rev 11293)
@@ -0,0 +1,46 @@
+dojo.require('dojox.grid.DataGrid');
+dojo.require('dojo.data.ItemFileReadStore');
+dojo.require('dojox.form.CheckedMultiSelect');
+dojo.require('dijit.form.TextBox');
+
+var spList;
+
+function spBuildGrid() {
+ fieldmapper.standardRequest(
+ ['open-ils.permacrud', 'open-ils.permacrud.search.csp.atomic'],
+ { async: true,
+ params: [openils.User.authtoken, {id:{'!=':null}}],
+ oncomplete: function(r) {
+ if(spList = openils.Util.readResponse(r)) {
+ var store = new dojo.data.ItemFileReadStore({data:csp.toStoreData(spList)});
+ spGrid.setStore(store);
+ spGrid.render();
+ }
+ }
+ }
+ );
+}
+
+function spCreate(args) {
+ if(!(args.name && args.label)) return;
+
+ var penalty = new csp();
+ penalty.name(args.name);
+ penalty.label(args.label);
+ penalty.block_list(args.block_list);
+
+ fieldmapper.standardRequest(
+ ['open-ils.permacrud', 'open-ils.permacrud.create.csp'],
+ { async: true,
+ params: [openils.User.authtoken, penalty],
+ oncomplete: function(r) {
+ if(new String(openils.Util.readResponse(r)) != '0')
+ buildSPGrid();
+ }
+ }
+ );
+}
+
+openils.Util.addOnLoad(spBuildGrid);
+
+
Added: trunk/Open-ILS/web/templates/default/conify/global/config/standing_penalty.tt2
===================================================================
--- trunk/Open-ILS/web/templates/default/conify/global/config/standing_penalty.tt2 (rev 0)
+++ trunk/Open-ILS/web/templates/default/conify/global/config/standing_penalty.tt2 2008-11-20 22:26:43 UTC (rev 11293)
@@ -0,0 +1,56 @@
+[% WRAPPER default/base.tt2 %]
+<script src='[% ctx.media_prefix %]/js/ui/default/conify/global/config/standing_penalty.js'> </script>
+<style>
+ @import "[% ctx.media_prefix %]/js/dojo/dojox/form/resources/CheckedMultiSelect.css";
+</style>
+<h1>Standing Penalty Types</h1><br/>
+
+<div dojoType="dijit.form.DropDownButton">
+ <span>New Standing Penalty</span>
+ <div dojoType="dijit.TooltipDialog" execute="spCreate(arguments[0]);">
+ <table class='dijitTooltipTable'>
+ <tr>
+ <td><label for="name">Code: </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="block_list">Blocked Actions: </label></td>
+ <td>
+ <select style='overflow-y:auto;' multiple='true' dojoType="dojox.form.CheckedMultiSelect" name="block_list">
+ <option value='CIRC'>CIRC</option>
+ <option value='RENEW'>RENEW</option>
+ <option value='HOLD'>HOLD</option>
+ </select>
+ </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="spGrid" dojoType="dojox.grid.DataGrid" query="{id: '*'}" rowSelector='20px'>
+ <thead>
+ <tr>
+ <th field="id">ID</th>
+ <th field="name" width='auto'>Name</th>
+ <th field="label" width='auto'>Label</th>
+ <th field="block_list" width='auto'>Block List</th>
+ </tr>
+ </thead>
+ </table>
+ </div>
+</div>
+
+[% END %]
+
+
More information about the open-ils-commits
mailing list