From fc7f9c064b75a12377855731769b550eca5ddc7e Mon Sep 17 00:00:00 2001 From: miker Date: Sun, 30 Mar 2008 00:59:24 +0000 Subject: [PATCH] we can add (mostly) and update permissions now git-svn-id: svn://svn.open-ils.org/ILS/branches/dojo-admin@9162 dcc99617-32d9-48b4-a31d-7c20da2025e4 --- .../web/conify/global/permission/perm_list.html | 213 +++++++++++++-------- Open-ILS/web/conify/global/permission/perm_list.js | 36 +++- 2 files changed, 161 insertions(+), 88 deletions(-) diff --git a/Open-ILS/web/conify/global/permission/perm_list.html b/Open-ILS/web/conify/global/permission/perm_list.html index b042df118e..480be87c7f 100644 --- a/Open-ILS/web/conify/global/permission/perm_list.html +++ b/Open-ILS/web/conify/global/permission/perm_list.html @@ -21,7 +21,12 @@ #perm_grid { border: 0px; width: 100%; - height: 88%; + height: 100%; + } + + #grid_container { + width: 100%; + height: 100%; } @@ -48,7 +53,7 @@ -
+
-
-
- +
+ New Permission: +
+
-
+
+
+
+ + + --> +
+
-
- - - - + + +
diff --git a/Open-ILS/web/conify/global/permission/perm_list.js b/Open-ILS/web/conify/global/permission/perm_list.js index fb103e8ebe..b91b425766 100644 --- a/Open-ILS/web/conify/global/permission/perm_list.js +++ b/Open-ILS/web/conify/global/permission/perm_list.js @@ -8,6 +8,8 @@ dojo.require('dijit.form.TextBox'); dojo.require('dijit.form.ValidationTextBox'); dojo.require('dijit.form.Textarea'); dojo.require('dijit.layout.ContentPane'); +dojo.require('dijit.layout.LayoutContainer'); +dojo.require('dijit.layout.BorderContainer'); dojo.require('dojox.widget.Toaster'); dojo.require('dojox.fx'); dojo.require('dojox.grid.Grid'); @@ -34,10 +36,6 @@ function save_perm () { var modified_ppl = new ppl().fromStoreItem( current_perm ); modified_ppl.ischanged( 1 ); - new_kid_button.disabled = false; - save_out_button.disabled = false; - delete_out_button.disabled = false; - pCRUD.request({ method : 'open-ils.permacrud.update.ppl', timeout : 10, @@ -60,3 +58,33 @@ function save_perm () { }).send(); } +function save_them_all (event) { + + perm_store.fetch({ + query : { ischanged : 1 }, + onItem : function (item, req) { try { if (this.isItem( item )) window.dirtyStore.push( item ); } catch (e) { /* meh */ } }, + scope : perm_store + }); + + var confirmation = true; + + + if (event && dirtyStore.length > 0) { + confirmation = confirm( + 'There are unsaved modified Permissions! '+ + 'OK to save these changes, Cancel to abandon them.' + ); + } + + if (confirmation) { + for (var i in window.dirtyStore) { + window.current_perm = window.dirtyStore[i]; + save_perm(true); + } + + window.dirtyStore = []; + } +} + +dojo.addOnUnload( save_them_all ); + -- 2.11.0