From 8d380dd630a7a976dc779a66a3846696e7758906 Mon Sep 17 00:00:00 2001 From: phasefx Date: Mon, 30 Aug 2010 16:49:00 +0000 Subject: [PATCH] option to not include claims returned circs in summary sidebar and under-button tallies git-svn-id: svn://svn.open-ils.org/ILS/trunk@17385 dcc99617-32d9-48b4-a31d-7c20da2025e4 --- Open-ILS/src/sql/Pg/002.schema.config.sql | 2 +- Open-ILS/src/sql/Pg/950.data.seed-values.sql | 17 +++++++++++++++++ ...org-setting-circ.do_not_tally_claims_returned.sql | 20 ++++++++++++++++++++ Open-ILS/xul/staff_client/server/patron/summary.js | 15 +++++++++++++-- 4 files changed, 51 insertions(+), 3 deletions(-) create mode 100644 Open-ILS/src/sql/Pg/upgrade/0383.data.org-setting-circ.do_not_tally_claims_returned.sql diff --git a/Open-ILS/src/sql/Pg/002.schema.config.sql b/Open-ILS/src/sql/Pg/002.schema.config.sql index 8d57dbdb8..f0e2147c3 100644 --- a/Open-ILS/src/sql/Pg/002.schema.config.sql +++ b/Open-ILS/src/sql/Pg/002.schema.config.sql @@ -68,7 +68,7 @@ CREATE TABLE config.upgrade_log ( install_date TIMESTAMP WITH TIME ZONE NOT NULL DEFAULT NOW() ); -INSERT INTO config.upgrade_log (version) VALUES ('0381'); -- dbs +INSERT INTO config.upgrade_log (version) VALUES ('0383'); -- phasefx CREATE TABLE config.bib_source ( id SERIAL PRIMARY KEY, 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 9c0abaf9e..947a291ed 100644 --- a/Open-ILS/src/sql/Pg/950.data.seed-values.sql +++ b/Open-ILS/src/sql/Pg/950.data.seed-values.sql @@ -6725,4 +6725,21 @@ INSERT INTO actor.org_unit_setting (org_unit, name, value) VALUES ,(1, 'cat.label.font.weight', '"normal"') ; +-- 0383.data.org-setting-circ.do_not_tally_claims_returned.sql + +INSERT INTO config.org_unit_setting_type ( name, label, description, datatype ) VALUES ( + 'circ.do_not_tally_claims_returned', + oils_i18n_gettext( + 'circ.do_not_tally_claims_returned', + 'Circulation: Do not include outstanding Claims Returned circulations in lump sum tallies in Patron Display.', + 'coust', + 'label'), + oils_i18n_gettext( + 'circ.do_not_tally_claims_returned', + 'In the Patron Display interface, the number of total active circulations for a given patron is presented in the Summary sidebar and underneath the Items Out navigation button. This setting will prevent Claims Returned circulations from counting toward these tallies.', + 'coust', + 'description'), + 'bool' +); + diff --git a/Open-ILS/src/sql/Pg/upgrade/0383.data.org-setting-circ.do_not_tally_claims_returned.sql b/Open-ILS/src/sql/Pg/upgrade/0383.data.org-setting-circ.do_not_tally_claims_returned.sql new file mode 100644 index 000000000..78196054e --- /dev/null +++ b/Open-ILS/src/sql/Pg/upgrade/0383.data.org-setting-circ.do_not_tally_claims_returned.sql @@ -0,0 +1,20 @@ +BEGIN; + +INSERT INTO config.upgrade_log (version) VALUES ('0383'); -- phasefx + +INSERT INTO config.org_unit_setting_type ( name, label, description, datatype ) VALUES ( + 'circ.do_not_tally_claims_returned', + oils_i18n_gettext( + 'circ.do_not_tally_claims_returned', + 'Circulation: Do not include outstanding Claims Returned circulations in lump sum tallies in Patron Display.', + 'coust', + 'label'), + oils_i18n_gettext( + 'circ.do_not_tally_claims_returned', + 'In the Patron Display interface, the number of total active circulations for a given patron is presented in the Summary sidebar and underneath the Items Out navigation button. This setting will prevent Claims Returned circulations from counting toward these tallies.', + 'coust', + 'description'), + 'bool' +); + +COMMIT; diff --git a/Open-ILS/xul/staff_client/server/patron/summary.js b/Open-ILS/xul/staff_client/server/patron/summary.js index 821cfee3a..38a612c09 100644 --- a/Open-ILS/xul/staff_client/server/patron/summary.js +++ b/Open-ILS/xul/staff_client/server/patron/summary.js @@ -369,13 +369,24 @@ patron.summary.prototype = { function(req) { try { var robj = req.getResultObject(); - util.widgets.set_text(e, robj.out + robj.overdue + robj.claims_returned + robj.long_overdue ); + var do_not_tally_claims_returned = String( obj.OpenILS.data.hash.aous['circ.do_not_tally_claims_returned'] ) == 'true'; + util.widgets.set_text(e, + robj.out + + robj.overdue + + (do_not_tally_claims_returned ? 0 : robj.claims_returned) + + robj.long_overdue + ); if (e2) util.widgets.set_text(e2, robj.overdue ); if (e3) util.widgets.set_text(e3, robj.claims_returned ); if (e4) util.widgets.set_text(e4, robj.long_overdue ); if (e5) util.widgets.set_text(e5, robj.lost ); if (under_btn) util.widgets.set_text(under_btn, - String( robj.out + robj.overdue + robj.claims_returned + robj.long_overdue) + String( + robj.out + + robj.overdue + + (do_not_tally_claims_returned ? 0 : robj.claims_returned) + + robj.long_overdue + ) /* + ( robj.overdue > 0 ? '*' : '' ) */ ); } catch(E) { -- 2.11.0