From: erickson Date: Wed, 21 Oct 2009 20:03:51 +0000 (+0000) Subject: added claims never checked out field to patron editor along with associated permissio... X-Git-Url: https://old-git.evergreen-ils.org/?a=commitdiff_plain;h=7b0c9d84c1dfe95a4171228fc4d68687c662af02;p=contrib%2FConifer.git added claims never checked out field to patron editor along with associated permission for changing the value git-svn-id: svn://svn.open-ils.org/ILS/trunk@14541 dcc99617-32d9-48b4-a31d-7c20da2025e4 --- diff --git a/Open-ILS/src/sql/Pg/002.schema.config.sql b/Open-ILS/src/sql/Pg/002.schema.config.sql index b1663f1cf2..e79f10508c 100644 --- a/Open-ILS/src/sql/Pg/002.schema.config.sql +++ b/Open-ILS/src/sql/Pg/002.schema.config.sql @@ -51,7 +51,7 @@ CREATE TABLE config.upgrade_log ( install_date TIMESTAMP WITH TIME ZONE NOT NULL DEFAULT NOW() ); -INSERT INTO config.upgrade_log (version) VALUES ('0044'); -- berick +INSERT INTO config.upgrade_log (version) VALUES ('0045'); -- berick CREATE TABLE config.bib_source ( diff --git a/Open-ILS/src/sql/Pg/950.data.seed-values.sql b/Open-ILS/src/sql/Pg/950.data.seed-values.sql index 3029533986..ea51a24e7d 100644 --- a/Open-ILS/src/sql/Pg/950.data.seed-values.sql +++ b/Open-ILS/src/sql/Pg/950.data.seed-values.sql @@ -1228,7 +1228,8 @@ INSERT INTO permission.perm_list VALUES (346,'UPDATE_BILL_NOTE', oils_i18n_gettext(346,'Allows staff to edit the note for a bill on a transaction', 'ppl', 'description')), (347,'UPDATE_PAYMENT_NOTE', oils_i18n_gettext(347,'Allows staff to edit the note for a payment on a transaction', 'ppl', 'description')), - (348, 'UPDATE_RECORD', oils_i18n_gettext(348, 'Allow a user to update and undelete records.', 'ppl', 'description')); + (348, 'UPDATE_RECORD', oils_i18n_gettext(348, 'Allow a user to update and undelete records.', 'ppl', 'description')), + (349, 'UPDATE_PATRON_CLAIM_NEVER_CHECKED_OUT_COUNT', oils_i18n_gettext(349,'Allows staff to manually change a patron''s claims never checkout out count', 'ppl', 'description')); SELECT SETVAL('permission.perm_list_id_seq'::TEXT, 1000); diff --git a/Open-ILS/src/sql/Pg/upgrade/0045.data.patron-claim-never-checkout-out-perm.sql b/Open-ILS/src/sql/Pg/upgrade/0045.data.patron-claim-never-checkout-out-perm.sql new file mode 100644 index 0000000000..e2bd4851d6 --- /dev/null +++ b/Open-ILS/src/sql/Pg/upgrade/0045.data.patron-claim-never-checkout-out-perm.sql @@ -0,0 +1,13 @@ +BEGIN; + +INSERT INTO config.upgrade_log (version) VALUES ('0045'); + +INSERT INTO permission.perm_list + VALUES ( + 349, + 'UPDATE_PATRON_CLAIM_NEVER_CHECKED_OUT_COUNT', + oils_i18n_gettext(349,'Allows staff to manually change a patron''s claims never checkout out count', 'ppl', 'description') + ); + +COMMIT; + diff --git a/Open-ILS/web/js/ui/default/actor/user/register.js b/Open-ILS/web/js/ui/default/actor/user/register.js index 50d1d150a6..5f7999e673 100644 --- a/Open-ILS/web/js/ui/default/actor/user/register.js +++ b/Open-ILS/web/js/ui/default/actor/user/register.js @@ -39,7 +39,6 @@ var addrTemplateRows; var cgi; var cloneUser; var cloneUserObj; -var claimReturnedPermList; if(!window.xulG) var xulG = null; @@ -111,6 +110,7 @@ function load() { loadStatCats(); loadSurveys(); checkClaimsReturnCountPerm(); + checkClaimsNoCheckoutCountPerm(); } /* @@ -381,6 +381,23 @@ function checkClaimsReturnCountPerm() { ); } + +function checkClaimsNoCheckoutCountPerm() { + new openils.User().getPermOrgList( + 'UPDATE_PATRON_CLAIM_NEVER_CHECKED_OUT_COUNT', + function(orgList) { + var cr = findWidget('au', 'claims_never_checked_out_count'); + if(orgList.indexOf(patron.home_ou()) == -1) + cr.widget.attr('disabled', true); + else + cr.widget.attr('disabled', false); + }, + true, + true + ); +} + + function attachWidgetEvents(fmcls, fmfield, widget) { if(fmcls == 'ac') { @@ -462,7 +479,11 @@ function attachWidgetEvents(fmcls, fmfield, widget) { case 'home_ou': dojo.connect(widget.widget, 'onChange', - function(newVal) { checkClaimsReturnCountPerm(); }); + function(newVal) { + checkClaimsReturnCountPerm(); + checkClaimsNoCheckoutCountPerm(); + } + ); return; } diff --git a/Open-ILS/web/templates/default/actor/user/register.tt2 b/Open-ILS/web/templates/default/actor/user/register.tt2 index e918ef6fc0..9e4a093b75 100644 --- a/Open-ILS/web/templates/default/actor/user/register.tt2 +++ b/Open-ILS/web/templates/default/actor/user/register.tt2 @@ -113,6 +113,7 @@ + User Settings