[open-ils-commits] r11604 - 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
Wed Dec 17 12:34:41 EST 2008
Author: erickson
Date: 2008-12-17 12:34:39 -0500 (Wed, 17 Dec 2008)
New Revision: 11604
Modified:
trunk/Open-ILS/web/js/ui/default/conify/global/config/circ_modifier.js
trunk/Open-ILS/web/templates/default/conify/global/config/circ_modifier.tt2
Log:
implemented create
Modified: trunk/Open-ILS/web/js/ui/default/conify/global/config/circ_modifier.js
===================================================================
--- trunk/Open-ILS/web/js/ui/default/conify/global/config/circ_modifier.js 2008-12-17 17:24:28 UTC (rev 11603)
+++ trunk/Open-ILS/web/js/ui/default/conify/global/config/circ_modifier.js 2008-12-17 17:34:39 UTC (rev 11604)
@@ -1,6 +1,7 @@
dojo.require('dojox.grid.DataGrid');
dojo.require('dojo.data.ItemFileWriteStore');
dojo.require('dijit.form.CheckBox');
+dojo.require('dijit.form.FilteringSelect');
function buildCMGrid() {
var store = new dojo.data.ItemFileWriteStore({data:ccm.initStoreData('code', {identifier:'code'})})
@@ -12,8 +13,8 @@
{ async: true,
params: [openils.User.authtoken, {code:{'!=':null}}],
onresponse: function (r) {
- if(obj = openils.Util.readResponse(r)) {
- store.newItem(ccm.itemToStoreData(obj));
+ if(obj = openils.Util.readResponse(r)) {
+ store.newItem(ccm.itemToStoreData(obj));
}
}
@@ -29,6 +30,32 @@
return "<span style='color:red;'>✗</span>";
}
+function cmCreate(args) {
+ if(! (args.code && args.name && args.description && args.sip2_media_type))
+ return;
+
+ var cmod = new ccm();
+ cmod.code(args.code);
+ cmod.name(args.name);
+ cmod.description(args.description);
+ cmod.sip2_media_type(args.sip2_media_type);
+ if(args.magnetic_media[0] == 'on')
+ cmod.magnetic_media('t')
+ else
+ cmod.magnetic_media('f');
+
+ fieldmapper.standardRequest(
+ ['open-ils.permacrud', 'open-ils.permacrud.create.ccm'],
+ { async: true,
+ params: [openils.User.authtoken, cmod],
+ oncomplete: function(r) {
+ if(cm = openils.Util.readResponse(r))
+ cmGrid.store.newItem(ccm.itemToStoreData(cm));
+ }
+ }
+ );
+}
+
openils.Util.addOnLoad(buildCMGrid);
Modified: trunk/Open-ILS/web/templates/default/conify/global/config/circ_modifier.tt2
===================================================================
--- trunk/Open-ILS/web/templates/default/conify/global/config/circ_modifier.tt2 2008-12-17 17:24:28 UTC (rev 11603)
+++ trunk/Open-ILS/web/templates/default/conify/global/config/circ_modifier.tt2 2008-12-17 17:34:39 UTC (rev 11604)
@@ -3,6 +3,53 @@
<h1>Circulation Modifier</h1> <br/>
<div dojoType="dijit.layout.ContentPane" layoutAlign="top">
+ <div dojoType="dijit.form.DropDownButton">
+ <span>New Circulation Modifier</span>
+ <div dojoType="dijit.TooltipDialog" execute="cmCreate(arguments[0]);">
+ <table class='dijitTooltipTable'>
+ <tr>
+ <td><label for="code">Code: </label></td>
+ <td><input dojoType="dijit.form.TextBox" name="code"/></td>
+ </tr>
+ <tr>
+ <td><label for="name">Name: </label></td>
+ <td><input dojoType="dijit.form.TextBox" name="name"/></td>
+ </tr>
+ <tr>
+ <td><label for="description">Description: </label></td>
+ <td><input dojoType="dijit.form.TextBox" name="description"/></td>
+ </tr>
+ <tr>
+ <td><label for="sip2_media_type">SIP2 Media Type: </label></td>
+ <td>
+ <select dojoType="dijit.form.FilteringSelect" name="sip2_media_type">
+ <option value='000'>Other</option>
+ <option value='001'>Book</option>
+ <option value='002'>Magazine</option>
+ <option value='003'>Bound Journal</option>
+ <option value='004'>Audio Tape</option>
+ <option value='005'>Video Tape</option>
+ <option value='006'>CD/CDROM</option>
+ <option value='007'>Diskette</option>
+ <option value='008'>Book with diskette</option>
+ <option value='009'>Book with CD</option>
+ <option value='010'>Book with audio tape</option>
+ </select>
+ </td>
+ </tr>
+ <tr>
+ <td><label for="magnetic_media">Magnetic Media: </label></td>
+ <td><input dojoType="dijit.form.CheckBox" name="magnetic_media"/>
+ </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="client" style='height:600px;'>
<table jsId="cmGrid" dojoType="dojox.grid.DataGrid" query="{name: '*'}" rowSelector='20px'>
<thead>
More information about the open-ils-commits
mailing list