<body class="tundra" id='pagebody'>
<div dojoType="dijit.layout.LayoutContainer" id="grid_container" jsId="grid_container" orientation="vertical">
- <div dojoType="dijit.layout.LayoutContainer" orientation="horizontal" style="margin-top: 5px;" layoutAlign="top">
+ <div dojoType="dijit.Toolbar" orientation="horizontal" style="margin-top: 5px;" layoutAlign="top">
<span>&conify.perm_list.new_permission.label;</span>
<div dojoType="dijit.form.TextBox" id="new_perm_code" jsId="new_perm_code" label="&conify.perm_list.new_code.label;"></div>
<button dojoType="dijit.form.Button" id="save_new_perm_code" jsId="save_new_perm_code" label="&conify.perm_list.add_button.label;" onClick="saveNewPermCode()"></button>
+
+ <span dojoType="dijit.ToolbarSeparator"></span>
+
+
+ <button jsId="save_ppl_button" dojoType="dijit.form.Button" label="&conify.perm_list.save_changes.label;" onClick="save_them_all()"></button>
+ <button jsId="delete_ppl_button" dojoType="dijit.form.Button" label="&conify.perm_list.delete_selected.label;" onClick="delete_them()"></button>
</div>
<div dojoType="dijit.layout.ContentPane" style="width:100%; height:100%;" layoutAlign="client">
<div id="perm_grid" dojoType="dojox.grid.DataGrid" store="perm_store" structure="perm_grid_layout" jsId="perm_grid"></div>
-
- <div dojoType="dijit.layout.ContentPane" orientation="horizontal" style="margin-bottom: 5px;" layoutAlign="bottom">
- <button jsId="save_ppl_button" dojoType="dijit.form.Button" label="&conify.perm_list.save_changes.label;" onClick="save_them_all()"></button>
- <button jsId="delete_ppl_button" dojoType="dijit.form.Button" label="&conify.perm_list.delete_selected.label;" onClick="delete_them()"></button>
- </div>
</div>
</div>
</body>
</html>
+
+
dojo.require('dijit.layout.ContentPane');
dojo.require('dijit.layout.LayoutContainer');
dojo.require('dijit.layout.BorderContainer');
+dojo.require('dijit.Toolbar');
+dojo.require('dijit.ToolbarSeparator');
dojo.require('dojox.widget.Toaster');
dojo.require('dojox.fx');
dojo.require('openils.XUL');
var highlighter = {};
+
+dojo.addOnLoad(function()
+{
+ highlighter.green = dojox.fx.highlight( { color : '#B4FFB4', node : 'perm_grid', duration : 500 } );
+ highlighter.red = dojox.fx.highlight( { color : '#FF2018', node : 'perm_grid', duration : 500 } );
+});
+
function status_update (markup) {
if (parent !== window && parent.status_update) parent.status_update( markup );
}
get : function (row) {
var r = perm_grid.getItem(row);
if (r) {
- perm_rows[row] = new ccs().fromHash(perm_grid.getItem(row));
+ perm_rows[row] = new ccs().fromHash(r);
setTimeout(
'dojo.query(".perm_grid_trans_desc_' + row + '").'+
'instantiate(openils.widget.TranslatorPopup,{field:"description",'+
var new_item_hash = list[0].toHash();
perm_store.newItem( new_item_hash );
status_update( dojo.string.substitute(ppl_strings.SUCCESS_CREATING_PERMISSION, [new_item_hash.code]) );
- perm_grid.model.sort(-1);
+ perm_grid.sort(-1);
highlighter.green.play();
}
});
{
var selected_rows = perm_grid.selection.getSelected();
var selected_items = [];
-
- for (var i in selected_rows) {
- selected_items.push(
- perm_grid.model.getRow( selected_rows[i] ).__dojo_data_item
- );
- }
perm_grid.selection.clear();
- for (var i in selected_items) {
- current_perm = selected_items[i];
+ for (var i in selected_rows) {
+ current_perm = selected_rows[i];
if ( confirm( dojo.string.substitute(ppl_strings.CONFIRM_DELETE, [perm_store.getValue(current_perm, 'code')]) ) ) {