[open-ils-commits] r13238 - in trunk/Open-ILS/web: js/ui/default/conify/global/config templates/default/conify/global/config (erickson)
svn at svn.open-ils.org
svn at svn.open-ils.org
Tue May 26 16:52:03 EDT 2009
Author: erickson
Date: 2009-05-26 16:51:59 -0400 (Tue, 26 May 2009)
New Revision: 13238
Added:
trunk/Open-ILS/web/js/ui/default/conify/global/config/circ_matrix_matchpoint.js
Modified:
trunk/Open-ILS/web/templates/default/conify/global/config/circ_matrix_matchpoint.tt2
Log:
started plugging in the abiliy to define circ mod groups for a circ matrix test. just wireframe now. more later
Added: trunk/Open-ILS/web/js/ui/default/conify/global/config/circ_matrix_matchpoint.js
===================================================================
--- trunk/Open-ILS/web/js/ui/default/conify/global/config/circ_matrix_matchpoint.js (rev 0)
+++ trunk/Open-ILS/web/js/ui/default/conify/global/config/circ_matrix_matchpoint.js 2009-05-26 20:51:59 UTC (rev 13238)
@@ -0,0 +1,72 @@
+dojo.require('dijit.layout.ContentPane');
+dojo.require('dijit.form.Button');
+dojo.require('openils.widget.AutoGrid');
+dojo.require('openils.widget.AutoFieldWidget');
+dojo.require('openils.PermaCrud');
+
+var circModEditor = null;
+
+function load(){
+ cmGrid.loadAll({order_by:{ccmm:'circ_modifier'}});
+ cmGrid.onEditPane = buildEditPaneAdditions;
+ circModEditor = dojo.byId('circ-mod-editor').parentNode.removeChild(dojo.byId('circ-mod-editor'));
+}
+
+function byName(name, ctxt) {
+ return dojo.query('[name=' + name + ']', ctxt)[0];
+}
+
+function buildEditPaneAdditions(editPane) {
+ var node = circModEditor.cloneNode(true);
+ var tableTmpl = node.removeChild(byName('circ-mod-group-table', node));
+
+ byName('add-circ-mod-group', node).onclick = function() {
+ addCircModGroup(node, tableTmpl)
+ }
+
+ var group = null;
+ if(editPane.mode == 'update') {
+ //group =
+ }
+
+ editPane.domNode.appendChild(node);
+}
+
+function addCircModGroup(node, tableTmpl, group) {
+
+ var table = tableTmpl.cloneNode(true);
+ var circModRowTmpl = byName('circ-mod-entry-tbody', table).removeChild(byName('circ-mod-entry-row', table));
+
+ // loop over mods
+ //
+
+ function addMod(mod) {
+ var row = circModRowTmpl.cloneNode(true);
+ byName('circ-mod', row).innerHTML = mod;
+ byName('circ-mod-entry-tbody', table).appendChild(row);
+ }
+
+ new openils.widget.AutoFieldWidget({
+ fmClass : 'ccmcmt',
+ fmField : 'items_out',
+ fmObject : group,
+ parentNode : byName('circ-mod-count', table)
+ }).build();
+
+ var selector = new openils.widget.AutoFieldWidget({
+ fmClass : 'ccmcmtm',
+ fmField : 'circ_mod',
+ parentNode : byName('circ-mod-selector', table)
+ });
+ selector.build();
+
+ byName('add-circ-mod', table).onclick = function() {
+ addMod(selector.widget.attr('value'));
+ }
+
+ node.insertBefore(table, byName('add-circ-mod-group', node));
+ node.insertBefore(dojo.create('hr'), byName('add-circ-mod-group', node));
+}
+
+openils.Util.addOnLoad(load);
+
Modified: trunk/Open-ILS/web/templates/default/conify/global/config/circ_matrix_matchpoint.tt2
===================================================================
--- trunk/Open-ILS/web/templates/default/conify/global/config/circ_matrix_matchpoint.tt2 2009-05-26 20:23:16 UTC (rev 13237)
+++ trunk/Open-ILS/web/templates/default/conify/global/config/circ_matrix_matchpoint.tt2 2009-05-26 20:51:59 UTC (rev 13238)
@@ -1,15 +1,6 @@
[% ctc.page_title = 'Circulation Policy Configuration' %]
[% WRAPPER default/base.tt2 %]
-<script>
- dojo.require('dijit.layout.ContentPane');
- dojo.require('dijit.form.Button');
- dojo.require('openils.widget.AutoGrid');
- openils.Util.addOnLoad(
- function(){
- cmGrid.loadAll({order_by:{ccmm:'circ_modifier'}});
- }
- );
-</script>
+<script src='[% ctx.media_prefix %]/js/ui/default/conify/global/config/circ_matrix_matchpoint.js'> </script>
<div dojoType="dijit.layout.ContentPane" layoutAlign="top" class='oils-header-panel'>
<div>Circulation Policy Configuration</div>
<div><button dojoType='dijit.form.Button' onClick='cmGrid.showCreatePane()'>New</button></div>
@@ -28,5 +19,31 @@
showColumnPicker='true'
columnPickerPrefix='"conify.config.circ_matrix_matchpoint"'>
</table>
- </div>
+</div>
+
+<div class='hidden'>
+ <div id='circ-mod-editor' style='border:1px solid #aaa'>
+ <h3>Circ Mod Count Groups</h3>
+ <table class='oils-generic-table' name='circ-mod-group-table'>
+ <tbody><tr>
+ <td>Total items out</td>
+ <td><div name='circ-mod-count'></div></td>
+ </tr><tbody>
+ <tbody name='circ-mod-entry-tbody'>
+ <tr name='circ-mod-entry-row'>
+ <td colspan='2' name='circ-mod'/>
+ </tr>
+ </tbody>
+ <tbody>
+ <tr>
+ <td><div name='circ-mod-selector'></div></td>
+ <td><a href='javascript:void(0);' name='add-circ-mod'>Add</a></td>
+ </tr>
+ </tbody>
+ </table>
+ <a href='javascript:void(0);' name='add-circ-mod-group'>Create New Group</a>
+ </div>
+</div>
+
[% END %]
+
More information about the open-ils-commits
mailing list