[open-ils-commits] r10088 - in trunk/Open-ILS/web/conify/global:
config permission
svn at svn.open-ils.org
svn at svn.open-ils.org
Tue Jul 22 16:42:09 EDT 2008
Author: miker
Date: 2008-07-22 16:42:00 -0400 (Tue, 22 Jul 2008)
New Revision: 10088
Modified:
trunk/Open-ILS/web/conify/global/config/copy_status.html
trunk/Open-ILS/web/conify/global/config/marc_code_maps.html
trunk/Open-ILS/web/conify/global/config/marc_code_maps.js
trunk/Open-ILS/web/conify/global/permission/perm_list.html
trunk/Open-ILS/web/conify/global/permission/perm_list.js
Log:
configuration interfaces
Modified: trunk/Open-ILS/web/conify/global/config/copy_status.html
===================================================================
--- trunk/Open-ILS/web/conify/global/config/copy_status.html 2008-07-22 20:41:29 UTC (rev 10087)
+++ trunk/Open-ILS/web/conify/global/config/copy_status.html 2008-07-22 20:42:00 UTC (rev 10088)
@@ -192,13 +192,10 @@
setTimeout(
'dojo.query(".status_grid_trans_cell_' + row + '").'+
'instantiate(openils.widget.TranslatorPopup,{field:"name",'+
- 'unique:window.status_rows['+row+'].id(),'+
'targetObject:"window.status_rows['+row+']"});'+
'status_grid.rowHeightChanged('+row+')',
0
);
- var oldnode = dojo.byId('name_translation_' + row);
- if (oldnode) dijit.byNode(oldnode).destroyRecursive();
return '<span class="status_grid_trans_cell_'+row+'"></span>';
}
return '';
Modified: trunk/Open-ILS/web/conify/global/config/marc_code_maps.html
===================================================================
--- trunk/Open-ILS/web/conify/global/config/marc_code_maps.html 2008-07-22 20:41:29 UTC (rev 10087)
+++ trunk/Open-ILS/web/conify/global/config/marc_code_maps.html 2008-07-22 20:42:00 UTC (rev 10088)
@@ -14,7 +14,7 @@
-->
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
- <title>Confiy :: Global :: Permission :: Permission List</title>
+ <title>Confiy :: Global :: Config :: MARC Code Maps</title>
<style type="text/css">
@import url("/js/dojo/dojox/grid/_grid/tundraGrid.css");
@@ -41,7 +41,6 @@
.grid_container {
width: 100%;
height: 100%;
- overflow: scroll;
}
</style>
@@ -61,6 +60,8 @@
var grid_row_object_cache = {};
var layouts = {};
+ console.log('create the special layout for cam');
+
layouts.cam = [
{ cells : [
[
@@ -81,7 +82,6 @@
'dojo.query(".cam_value_' + row + '").'+
'instantiate('+
'openils.widget.TranslatorPopup,{field:"value",'+
- 'unique:"cam_'+row+'",'+
'targetObject:"grid_row_object_cache.cam['+row+']"}'+
');'+
'cam_grid.rowHeightChanged('+row+');',
@@ -106,7 +106,6 @@
'dojo.query(".cam_description_' + row + '").'+
'instantiate('+
'openils.widget.TranslatorPopup,{field:"description",'+
- 'unique:"cam_'+row+'",'+
'targetObject:"grid_row_object_cache.cam['+row+']"}'+
');'+
'cam_grid.rowHeightChanged('+row+');',
@@ -124,10 +123,13 @@
}
];
- var codelist = ['cam','cblvl','cifm','citm','clm','clfm','cvrfm'];
+ var codelist = ['cam','cblvl','cifm','citm','clm','clfm'];//,'cvrfm'];
var hashes = {};
var objects = {};
var models = {};
+
+ console.log('about to loop over codelist: ' + codelist);
+
for (var i in codelist) {
var classname = codelist[i];
@@ -136,6 +138,8 @@
[ { query : { code : { '!=' : null } } } ]
);
+ console.log('created hashes for ' + classname);
+
if (!hashes[classname]) continue;
objects[classname] = dojo.map(
@@ -143,18 +147,20 @@
new Function('x', 'return new fieldmapper.' + classname + '().fromHash( x );')
);
+ console.log('created objects for ' + classname);
+
stores[classname] = new dojo.data.ItemFileWriteStore(
{ data : fieldmapper[classname].toStoreData( objects[classname], 'value' ) }
);
+ console.log('create store for ' + classname);
+
if (classname != 'cam') {
layouts[classname] = [
{ cells : [
[
{ name : "Code", field : "code", width : "5em", editor : dojox.grid.editors.Dijit, rowSpan : "2" },
- { name : "Value", field : "value", width : "auto", editor : dojox.grid.editors.Editor, style : "minHeight:1em;" }
- ],
- [
+ { name : "Value", field : "value", width : "auto", editor : dojox.grid.editors.Editor, style : "minHeight:1em;" },
{ name : "Translation",
width : "10em",
height : "2em",
@@ -167,14 +173,11 @@
'dojo.query(".'+classname+'_value_' + row + '").'+
'instantiate('+
'openils.widget.TranslatorPopup,{field:"value",'+
- 'unique:"'+classname+'_'+row+'",'+
'targetObject:"grid_row_object_cache.'+classname+'['+row+']"}'+
');'+
classname+'_grid.rowHeightChanged('+row+');',
0
);
- var oldnode = dojo.byId('value_translation_'+classname+'_' + row);
- if (oldnode) dijit.byNode(oldnode).destroyRecursive();
return '<span class="'+classname+'_value_'+row+'"></span>';
}
return '';
@@ -193,57 +196,197 @@
<body class="tundra" id='pagebody'>
- <div dojoType="dijit.layout.TabContainer" class="grid_container" orientation="vertical">
+ <div dojoType="dijit.layout.TabContainer" id="grid_container" class="grid_container" style="margin: 5px;" orientation="vertical" layoutAlign="top">
- <div dojoType="dijit.layout.ContentPane" class="grid_container" orientation="vertical" label="Audience Map">
+ <div dojoType="dijit.layout.ContentPane" class="grid_container" orientation="vertical" title="Audience Map">
+ <script type="dojo/connect" event="onShow">
+ cam_model.refresh();
+ cam_grid.refresh();
+ </script>
<div dojoType="dijit.layout.LayoutContainer" class="grid_container" orientation="vertical">
- <div dojoType="dijit.form.Form" orientation="horizontal" style="margin-top: 5px;" layoutAlign="top" onSubmit="create_marc_code">
+ <div dojoType="dijit.form.Form" orientation="horizontal" style="margin: 5px;" layoutAlign="top" onSubmit="create_marc_code">
<div>New Audience Map:</div>
<input type="hidden" name="classname" value="cam"/>
<label for="code">New Code</label><input dojoType="dijit.form.TextBox" name="code" title="New Code"/>
<label for="value">New Value</label><input dojoType="dijit.form.TextBox" name="value" title="New Value"/>
<label for="description">Description</label><input dojoType="dijit.form.TextBox" name="description" title="Description"/>
<button type="submit" dojoType="dijit.form.Button" label="Add"></button>
+ <button style="margin-left:10px" layoutAlign="bottom" jsId="delete_cam_button" dojoType="dijit.form.Button" label="Delete Selected" onclick="delete_grid_selection('cam',cam_grid)"></button>
+ <button style="margin-left:20px" layoutAlign="bottom" jsId="save_button" dojoType="dijit.form.Button" label="Save Changes" onClick="save_them_all()"></button>
</div>
- <div dojoType="dijit.layout.ContentPane" style="width:100%; height:100%;" layoutAlign="client">
+ <div dojoType="dijit.layout.ContentPane" layoutAlign="client">
<div dojoType="dojox.grid.data.DojoData" jsId="cam_model"store="stores.cam" query="{ code : '*' }"></div>
<div dojoType="dojox.Grid" jsId="cam_grid" model="cam_model" structure="layouts.cam"></div>
- <button jsId="delete_cam_button" dojoType="dijit.form.Button" label="Delete Selected" onclick="delete_grid_selection('cam',cam_grid)"></button>
</div>
</div>
</div>
- <div dojoType="dijit.layout.ContentPane" class="grid_container" orientation="vertical">
-
+ <div dojoType="dijit.layout.ContentPane" class="grid_container" orientation="vertical" title="Bib Level Map">
+ <script type="dojo/connect" event="onShow">
+ cblvl_model.refresh();
+ cblvl_grid.refresh();
+ </script>
<div dojoType="dijit.layout.LayoutContainer" class="grid_container" orientation="vertical">
- <div dojoType="dijit.form.Form" orientation="horizontal" style="margin-top: 5px;" layoutAlign="top" onSubmit="create_marc_code">
+ <div dojoType="dijit.form.Form" orientation="horizontal" style="margin: 5px;" layoutAlign="top" onSubmit="create_marc_code">
<div>New Bib Level:</div>
<input type="hidden" name="classname" value="cblvl"/>
<label for="code">New Code</label><input dojoType="dijit.form.TextBox" name="code" title="New Code"/>
<label for="value">New Value</label><input dojoType="dijit.form.TextBox" name="value" title="New Value"/>
<button type="submit" dojoType="dijit.form.Button" label="Add"></button>
+ <button style="margin-left:20px" layoutAlign="bottom" jsId="delete_cblvl_button" dojoType="dijit.form.Button" label="Delete Selected" onclick="delete_grid_selection('cblvl',cblvl_grid)"></button>
+ <button style="margin-left:20px" layoutAlign="bottom" jsId="save_button" dojoType="dijit.form.Button" label="Save Changes" onClick="save_them_all()"></button>
</div>
- <div dojoType="dijit.layout.ContentPane" style="width:100%; height:100%;" layoutAlign="client">
+ <div dojoType="dijit.layout.ContentPane" layoutAlign="client">
<div dojoType="dojox.grid.data.DojoData" jsId="cblvl_model"store="stores.cblvl" query="{ code : '*' }"></div>
<div dojoType="dojox.Grid" jsId="cblvl_grid" model="cblvl_model" structure="layouts.cblvl"></div>
- <button jsId="delete_cblvl_button" dojoType="dijit.form.Button" label="Delete Selected" onclick="delete_grid_selection('cblvl',cblvl_grid)"></button>
</div>
</div>
</div>
+ <div dojoType="dijit.layout.ContentPane" class="grid_container" orientation="vertical" title="Item Form Map">
+ <script type="dojo/connect" event="onShow">
+ cifm_model.refresh();
+ cifm_grid.refresh();
+ </script>
+
+ <div dojoType="dijit.layout.LayoutContainer" class="grid_container" orientation="vertical">
+
+ <div dojoType="dijit.form.Form" orientation="horizontal" style="margin: 5px;" layoutAlign="top" onSubmit="create_marc_code">
+ <div>New Item Form:</div>
+ <input type="hidden" name="classname" value="cifm"/>
+ <label for="code">New Code</label><input dojoType="dijit.form.TextBox" name="code" title="New Code"/>
+ <label for="value">New Value</label><input dojoType="dijit.form.TextBox" name="value" title="New Value"/>
+ <button type="submit" dojoType="dijit.form.Button" label="Add"></button>
+ <button style="margin-left:20px" layoutAlign="bottom" jsId="delete_cifm_button" dojoType="dijit.form.Button" label="Delete Selected" onclick="delete_grid_selection('cifm',cifm_grid)"></button>
+ <button style="margin-left:20px" layoutAlign="bottom" jsId="save_button" dojoType="dijit.form.Button" label="Save Changes" onClick="save_them_all()"></button>
+ </div>
+
+ <div dojoType="dijit.layout.ContentPane" layoutAlign="client">
+ <div dojoType="dojox.grid.data.DojoData" jsId="cifm_model"store="stores.cifm" query="{ code : '*' }"></div>
+ <div dojoType="dojox.Grid" jsId="cifm_grid" model="cifm_model" structure="layouts.cifm"></div>
+ </div>
+
+ </div>
+
+ </div>
+
+ <div dojoType="dijit.layout.ContentPane" class="grid_container" orientation="vertical" title="Item Type Map">
+ <script type="dojo/connect" event="onShow">
+ citm_model.refresh();
+ citm_grid.refresh();
+ </script>
+
+ <div dojoType="dijit.layout.LayoutContainer" class="grid_container" orientation="vertical">
+
+ <div dojoType="dijit.form.Form" orientation="horizontal" style="margin: 5px;" layoutAlign="top" onSubmit="create_marc_code">
+ <div>New Item Type:</div>
+ <input type="hidden" name="classname" value="citm"/>
+ <label for="code">New Code</label><input dojoType="dijit.form.TextBox" name="code" title="New Code"/>
+ <label for="value">New Value</label><input dojoType="dijit.form.TextBox" name="value" title="New Value"/>
+ <button type="submit" dojoType="dijit.form.Button" label="Add"></button>
+ <button style="margin-left:20px" layoutAlign="bottom" jsId="delete_citm_button" dojoType="dijit.form.Button" label="Delete Selected" onclick="delete_grid_selection('citm',citm_grid)"></button>
+ <button style="margin-left:20px" layoutAlign="bottom" jsId="save_button" dojoType="dijit.form.Button" label="Save Changes" onClick="save_them_all()"></button>
+ </div>
+
+ <div dojoType="dijit.layout.ContentPane" layoutAlign="client">
+ <div dojoType="dojox.grid.data.DojoData" jsId="citm_model"store="stores.citm" query="{ code : '*' }"></div>
+ <div dojoType="dojox.Grid" jsId="citm_grid" model="citm_model" structure="layouts.citm"></div>
+ </div>
+
+ </div>
+
+ </div>
+
+ <div dojoType="dijit.layout.ContentPane" class="grid_container" orientation="vertical" title="Language Map">
+ <script type="dojo/connect" event="onShow">
+ clm_model.refresh();
+ clm_grid.refresh();
+ </script>
+
+ <div dojoType="dijit.layout.LayoutContainer" class="grid_container" orientation="vertical">
+
+ <div dojoType="dijit.form.Form" orientation="horizontal" style="margin: 5px;" layoutAlign="top" onSubmit="create_marc_code">
+ <div>New Language:</div>
+ <input type="hidden" name="classname" value="clm"/>
+ <label for="code">New Code</label><input dojoType="dijit.form.TextBox" name="code" title="New Code"/>
+ <label for="value">New Value</label><input dojoType="dijit.form.TextBox" name="value" title="New Value"/>
+ <button type="submit" dojoType="dijit.form.Button" label="Add"></button>
+ <button style="margin-left:20px" layoutAlign="bottom" jsId="delete_clm_button" dojoType="dijit.form.Button" label="Delete Selected" onclick="delete_grid_selection('clm',clm_grid)"></button>
+ <button style="margin-left:20px" layoutAlign="bottom" jsId="save_button" dojoType="dijit.form.Button" label="Save Changes" onClick="save_them_all()"></button>
+ </div>
+
+ <div dojoType="dijit.layout.ContentPane" layoutAlign="client">
+ <div dojoType="dojox.grid.data.DojoData" jsId="clm_model"store="stores.clm" query="{ code : '*' }"></div>
+ <div dojoType="dojox.Grid" jsId="clm_grid" model="clm_model" structure="layouts.clm"></div>
+ </div>
+
+ </div>
+
+ </div>
+
+ <div dojoType="dijit.layout.ContentPane" class="grid_container" orientation="vertical" title="Literary Form Map">
+ <script type="dojo/connect" event="onShow">
+ clfm_model.refresh();
+ clfm_grid.refresh();
+ </script>
+
+ <div dojoType="dijit.layout.LayoutContainer" class="grid_container" orientation="vertical">
+
+ <div dojoType="dijit.form.Form" orientation="horizontal" style="margin: 5px;" layoutAlign="top" onSubmit="create_marc_code">
+ <div>New Literary Form:</div>
+ <input type="hidden" name="classname" value="clfm"/>
+ <label for="code">New Code</label><input dojoType="dijit.form.TextBox" name="code" title="New Code"/>
+ <label for="value">New Value</label><input dojoType="dijit.form.TextBox" name="value" title="New Value"/>
+ <button type="submit" dojoType="dijit.form.Button" label="Add"></button>
+ <button style="margin-left:20px" layoutAlign="bottom" jsId="delete_clfm_button" dojoType="dijit.form.Button" label="Delete Selected" onclick="delete_grid_selection('clfm',clfm_grid)"></button>
+ <button style="margin-left:20px" layoutAlign="bottom" jsId="save_button" dojoType="dijit.form.Button" label="Save Changes" onClick="save_them_all()"></button>
+ </div>
+
+ <div dojoType="dijit.layout.ContentPane" layoutAlign="client">
+ <div dojoType="dojox.grid.data.DojoData" jsId="clfm_model"store="stores.clfm" query="{ code : '*' }"></div>
+ <div dojoType="dojox.Grid" jsId="clfm_grid" model="clfm_model" structure="layouts.clfm"></div>
+ </div>
+
+ </div>
+
+ </div>
+
+ <div dojoType="dijit.layout.ContentPane" class="grid_container" orientation="vertical" title="Vidoe Recording Format Map">
+ <script type="dojo/connect" event="onShow">
+ cvrfm_model.refresh();
+ cvrfm_grid.refresh();
+ </script>
+
+ <div dojoType="dijit.layout.LayoutContainer" class="grid_container" orientation="vertical">
+
+ <div dojoType="dijit.form.Form" orientation="horizontal" style="margin: 5px;" layoutAlign="top" onSubmit="create_marc_code">
+ <div>New Video Recording Format:</div>
+ <input type="hidden" name="classname" value="cvrfm"/>
+ <label for="code">New Code</label><input dojoType="dijit.form.TextBox" name="code" title="New Code"/>
+ <label for="value">New Value</label><input dojoType="dijit.form.TextBox" name="value" title="New Value"/>
+ <button type="submit" dojoType="dijit.form.Button" label="Add"></button>
+ <button style="margin-left:20px" layoutAlign="bottom" jsId="delete_cvrfm_button" dojoType="dijit.form.Button" label="Delete Selected" onclick="delete_grid_selection('cvrfm',cvrfm_grid)"></button>
+ <button style="margin-left:20px" layoutAlign="bottom" jsId="save_button" dojoType="dijit.form.Button" label="Save Changes" onClick="save_them_all()"></button>
+ </div>
+
+ <div dojoType="dijit.layout.ContentPane" layoutAlign="client">
+ <div dojoType="dojox.grid.data.DojoData" jsId="cvrfm_model"store="stores.cvrfm" query="{ code : '*' }"></div>
+ <div dojoType="dojox.Grid" jsId="cvrfm_grid" model="cvrfm_model" structure="layouts.cvrfm"></div>
+ </div>
+
+ </div>
+
</div>
- <div dojoType="dijit.layout.ContentPane" orientation="horizontal" style="margin-bottom: 5px;" layoutAlign="bottom">
- <button jsId="save_button" dojoType="dijit.form.Button" label="Save Changes" onClick="save_them_all()"></button>
</div>
</body>
Modified: trunk/Open-ILS/web/conify/global/config/marc_code_maps.js
===================================================================
--- trunk/Open-ILS/web/conify/global/config/marc_code_maps.js 2008-07-22 20:41:29 UTC (rev 10087)
+++ trunk/Open-ILS/web/conify/global/config/marc_code_maps.js 2008-07-22 20:42:00 UTC (rev 10088)
@@ -34,24 +34,36 @@
dojo.require('dojox.grid._data.model');
dojo.require("dojox.grid.editors");
+
+console.log('loading marc_code_maps.js');
+
// some handy globals
var cgi = new CGI();
var ses = dojo.cookie('ses') || cgi.param('ses');
var pCRUD = new OpenSRF.ClientSession('open-ils.permacrud');
+console.log('initialized pcrud session');
+
var stores = {};
var current_item = {};
+
+/*
var highlighter = {
green : dojox.fx.highlight( { color : '#B4FFB4', node : 'grid_container', duration : 500 } ),
red : dojox.fx.highlight( { color : '#FF2018', node : 'grid_container', duration : 500 } )
};
+console.log('highlighters set up');
+*/
+
var dirtyStore = [];
function status_update (markup) {
if (parent !== window && parent.status_update) parent.status_update( markup );
}
+console.log('local status function built');
+
function save_code (classname) {
var item = current_item[classname];
@@ -68,17 +80,17 @@
timeout : 10,
params : [ ses, modified_ppl ],
onerror : function (r) {
- highlighter.red.play();
+ //highlighter.red.play();
status_update( 'Problem saving data for ' + classname + ' ' + obj.code() );
},
oncomplete : function (r) {
var res = r.recv();
if ( res && res.content() ) {
stores[classname].setValue( current_item, 'ischanged', 0 );
- highlighter.green.play();
+ //highlighter.green.play();
status_update( 'Saved changes to ' + stores[classname].getValue( item, 'code' ) );
} else {
- highlighter.red.play();
+ //highlighter.red.play();
status_update( 'Problem saving data for ' + classname + ' ' + stores[classname].getValue( item, 'code' ) );
}
},
@@ -147,7 +159,7 @@
timeout : 10,
params : [ ses, obj ],
onerror : function (r) {
- highlighter.red.play();
+ //highlighter.red.play();
status_update( 'Problem deleting ' + grid.model.store.getValue( item, 'value' ) );
},
oncomplete : function (r) {
@@ -161,10 +173,10 @@
scope : grid.model.store
});
- highlighter.green.play();
+ //highlighter.green.play();
status_update( old_name + ' deleted' );
} else {
- highlighter.red.play();
+ //highlighter.red.play();
status_update( 'Problem deleting ' + old_name );
}
}
@@ -196,7 +208,7 @@
timeout : 10,
params : [ ses, new_fm_obj ],
onerror : function (r) {
- highlighter.red.play();
+ //highlighter.red.play();
status_update( 'Problem calling method to create new ' + cl );
err = true;
},
@@ -206,9 +218,9 @@
var new_item_hash = res.content().toHash();
stores[cl].newItem( new_item_hash );
status_update( 'New ' + new_item_hash.code + ' ' + cl + ' created' );
- highlighter.green.play();
+ //highlighter.green.play();
} else {
- highlighter.red.play();
+ //highlighter.red.play();
status_update( 'Problem creating new Permission' );
err = true;
}
Modified: trunk/Open-ILS/web/conify/global/permission/perm_list.html
===================================================================
--- trunk/Open-ILS/web/conify/global/permission/perm_list.html 2008-07-22 20:41:29 UTC (rev 10087)
+++ trunk/Open-ILS/web/conify/global/permission/perm_list.html 2008-07-22 20:42:00 UTC (rev 10088)
@@ -62,9 +62,12 @@
<div dojoType="dijit.layout.LayoutContainer" id="grid_container" jsId="grid_container" orientation="vertical">
<script type="dojo/method">
+ window.highlighter= {};
window.highlighter.green = dojox.fx.highlight( { color : '#B4FFB4', node : 'grid_container', duration : 500 } );
window.highlighter.red = dojox.fx.highlight( { color : '#FF2018', node : 'grid_container', duration : 500 } );
+ window.dirtyStore = [];
+
pCRUD.request({
method : 'open-ils.permacrud.search.ppl.atomic',
timeout : 10,
@@ -96,11 +99,10 @@
if (!window.perm_rows) window.perm_rows = [];
var r = window.perm_data_model.getRow(row);
if (r) {
- window.perm_rows[row] = new ppl().fromHash(window.perm_data_model.getRow(row));
+ window.perm_rows[row] = new ccs().fromHash(window.perm_data_model.getRow(row));
setTimeout(
'dojo.query(".perm_grid_trans_desc_' + row + '").'+
'instantiate(openils.widget.TranslatorPopup,{field:"description",'+
- 'unique:window.perm_rows['+row+'].code(),'+
'targetObject:"window.perm_rows['+row+']"});'+
'perm_grid.rowHeightChanged('+row+')',
0
Modified: trunk/Open-ILS/web/conify/global/permission/perm_list.js
===================================================================
--- trunk/Open-ILS/web/conify/global/permission/perm_list.js 2008-07-22 20:41:29 UTC (rev 10087)
+++ trunk/Open-ILS/web/conify/global/permission/perm_list.js 2008-07-22 20:42:00 UTC (rev 10088)
@@ -42,9 +42,7 @@
var virgin_out_id = -1;
var highlighter = {};
-var dirtyStore = [];
-
function status_update (markup) {
if (parent !== window && parent.status_update) parent.status_update( markup );
}
More information about the open-ils-commits
mailing list