From a1f5d0a6cd9ee1bec44d47518f6610184acbc071 Mon Sep 17 00:00:00 2001 From: miker Date: Thu, 4 Mar 2010 19:49:03 +0000 Subject: [PATCH] MORE: convert from permacrud to pcrud -- not as big as it looks -- and move some startup logic to the top (even though yslow will hate me) git-svn-id: svn://svn.open-ils.org/ILS/trunk@15698 dcc99617-32d9-48b4-a31d-7c20da2025e4 --- .../web/conify/global/permission/perm_list.html | 223 +++++++++------------ Open-ILS/web/conify/global/permission/perm_list.js | 24 +-- 2 files changed, 105 insertions(+), 142 deletions(-) diff --git a/Open-ILS/web/conify/global/permission/perm_list.html b/Open-ILS/web/conify/global/permission/perm_list.html index fad15ade02..6d72ac65e9 100644 --- a/Open-ILS/web/conify/global/permission/perm_list.html +++ b/Open-ILS/web/conify/global/permission/perm_list.html @@ -62,95 +62,87 @@ - - - - -
- - if (dirtyStore.length > 0) { - var confirmation = confirm(ppl_strings.CONFIRM_EXIT_PPL); - if (confirmation) { - for (var i in window.dirtyStore) { - window.current_perm = window.dirtyStore[i]; - save_perm(true); - } - } - } + - }); - } - }).send(); -]]> - + +
&conify.perm_list.new_permission.label;
@@ -166,37 +158,26 @@ }); var err = false; - pCRUD.request({ - method : 'open-ils.permacrud.create.ppl', - timeout : 10, - params : [ ses, new_fm_obj ], + pCRUD.create(new_fm_objnew_fm_obj, { onerror : function (r) { highlighter.red.play(); status_update( ppl_strings.ERROR_CALLING_METHOD_PPL ); err = true; }, - oncomplete : function (r) { - var res = r.recv(); - if ( res && res.content() ) { - var new_item_hash = res.content().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); - highlighter.green.play(); - } else { - highlighter.red.play(); - status_update( ppl_strings.ERROR_CREATING_PERMISSION ); - err = true; - } + oncomplete : function (r, list) { + 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); + highlighter.green.play(); } - }).send(); + }); ]]>
-