From: miker Date: Wed, 2 Apr 2008 20:29:59 +0000 (+0000) Subject: nearly there ... saving perm maps and then hold/circ rules X-Git-Url: https://old-git.evergreen-ils.org/?a=commitdiff_plain;h=5f6ac0ada98e302f50e8ef2ec03ea8885f43deac;p=Evergreen.git nearly there ... saving perm maps and then hold/circ rules git-svn-id: svn://svn.open-ils.org/ILS/branches/dojo-admin@9201 dcc99617-32d9-48b4-a31d-7c20da2025e4 --- diff --git a/Open-ILS/web/conify/global/actor/org_unit.html b/Open-ILS/web/conify/global/actor/org_unit.html index 493754a541..ffa50f31a3 100644 --- a/Open-ILS/web/conify/global/actor/org_unit.html +++ b/Open-ILS/web/conify/global/actor/org_unit.html @@ -37,8 +37,6 @@ - - diff --git a/Open-ILS/web/conify/global/actor/org_unit_type.html b/Open-ILS/web/conify/global/actor/org_unit_type.html index c7202735a4..e8f19a6fc3 100644 --- a/Open-ILS/web/conify/global/actor/org_unit_type.html +++ b/Open-ILS/web/conify/global/actor/org_unit_type.html @@ -37,8 +37,6 @@ - - diff --git a/Open-ILS/web/conify/global/permission/grp_tree.html b/Open-ILS/web/conify/global/permission/grp_tree.html index 7a4bdd085c..c76dbcbd1d 100644 --- a/Open-ILS/web/conify/global/permission/grp_tree.html +++ b/Open-ILS/web/conify/global/permission/grp_tree.html @@ -48,10 +48,8 @@ - + - - @@ -68,6 +66,7 @@
-
-
- +
+
+ +
+ +
+
+ + + +
+ +
New permission mapping:
+ + + + + + + + + +
Permission: +
+ +
Depth: +
+
+ - perm_grid.setStructure(current_perm_grid_layout); -
-
-
- diff --git a/Open-ILS/web/conify/global/permission/grp_tree.js b/Open-ILS/web/conify/global/permission/grp_tree.js index c60b0ecfab..3a11b96398 100644 --- a/Open-ILS/web/conify/global/permission/grp_tree.js +++ b/Open-ILS/web/conify/global/permission/grp_tree.js @@ -68,3 +68,64 @@ function save_group () { }).send(); } +function save_perm_map () { + + var modified_pgpm = new pgpm().fromStoreItem( current_perm ); + modified_pgpm.ischanged( 1 ); + + new_kid_button.disabled = false; + save_out_button.disabled = false; + delete_out_button.disabled = false; + + server.pCRUD.request({ + method : 'open-ils.permacrud.update.pgpm', + timeout : 10, + params : [ ses, modified_pgpm ], + onerror : function (r) { + highlighter.editor_pane.red.play(); + status_update( 'Problem saving permission data for ' + group_store.getValue( current_group, 'name' ) ); + }, + oncomplete : function (r) { + var res = r.recv(); + if ( res && res.content() ) { + group_store.setValue( current_perm, 'ischanged', 0 ); + highlighter.editor_pane.green.play(); + status_update( 'Saved permission changes to ' + group_store.getValue( current_group, 'name' ) ); + } else { + highlighter.editor_pane.red.play(); + status_update( 'Problem saving permission data for ' + group_store.getValue( current_group, 'name' ) ); + } + }, + }).send(); +} + +function save_them_all (event) { + + perm_map_store.fetch({ + query : { ischanged : 1 }, + onItem : function (item, req) { try { if (this.isItem( item )) window.dirtyMapStore.push( item ); } catch (e) { /* meh */ } }, + scope : perm_map_store + }); + + var confirmation = true; + + + if (event && dirtyMapStore.length > 0) { + confirmation = confirm( + 'There are unsaved modified Permission Maps! '+ + 'OK to save these changes, Cancel to abandon them.' + ); + } + + if (confirmation) { + for (var i in window.dirtyMapStore) { + window.current_perm = window.dirtyMapStore[i]; + save_perm_map(true); + } + + window.dirtyMapStore = []; + } +} + +dojo.addOnUnload( save_them_all ); + diff --git a/Open-ILS/web/conify/global/permission/perm_list.html b/Open-ILS/web/conify/global/permission/perm_list.html index 9bb1d78c02..278dbb77c0 100644 --- a/Open-ILS/web/conify/global/permission/perm_list.html +++ b/Open-ILS/web/conify/global/permission/perm_list.html @@ -40,8 +40,6 @@ - -