From e14abbde87d0f03b6943505f09c66e0d2d589f7a Mon Sep 17 00:00:00 2001 From: Dan Scott Date: Wed, 21 Nov 2012 09:24:09 -0500 Subject: [PATCH] Tweak wording of patron account expiry warning A warning is something that comes in advance of an event, so a pre-warning would be a warning about the warning, which is a bit weird. Hopefully this language will be a little simpler and easier for users to understand. Also, fetch the value of the setting once and stuff it in a variable; vars are cheap and things might be a little more legible. Also, add a release note entry for the new feature. Signed-off-by: Dan Scott Signed-off-by: Ben Shum --- Open-ILS/src/sql/Pg/950.data.seed-values.sql | 10 +++++----- .../Pg/upgrade/0745.data.prewarn_expire_setting.sql | 10 +++++----- Open-ILS/xul/staff_client/server/patron/display.js | 11 ++++++----- .../circulation_patron_expiry_warning.txt | 9 +++++++++ 4 files changed, 25 insertions(+), 15 deletions(-) create mode 100644 docs/RELEASE_NOTES_NEXT/circulation_patron_expiry_warning.txt 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 fe719f0c9e..e89a2e84b6 100644 --- a/Open-ILS/src/sql/Pg/950.data.seed-values.sql +++ b/Open-ILS/src/sql/Pg/950.data.seed-values.sql @@ -11863,17 +11863,17 @@ INSERT INTO config.org_unit_setting_type INSERT INTO config.org_unit_setting_type (name, grp, label, description, datatype) VALUES ( - 'circ.prewarn_expire_setting', + 'circ.patron_expires_soon_warning', 'circ', oils_i18n_gettext( - 'circ.prewarn_expire_setting', - 'Pre-warning for patron expiration', + 'circ.patron_expires_soon_warning', + 'Warn when patron account is about to expire', 'coust', 'label' ), oils_i18n_gettext( - 'circ.prewarn_expire_setting', - 'Pre-warning for patron expiration. This setting defines the number of days before patron expiration to display a message suggesting it is time to renew the patron account. Value is in number of days, for example: 3 for 3 days.', + 'circ.patron_expires_soon_warning', + 'Warn when patron account is about to expire. If set, the staff client displays a warning this many days before the expiry of a patron account. Value is in number of days, for example: 3 for 3 days.', 'coust', 'description' ), diff --git a/Open-ILS/src/sql/Pg/upgrade/0745.data.prewarn_expire_setting.sql b/Open-ILS/src/sql/Pg/upgrade/0745.data.prewarn_expire_setting.sql index aec58b6eed..b9d40bca86 100644 --- a/Open-ILS/src/sql/Pg/upgrade/0745.data.prewarn_expire_setting.sql +++ b/Open-ILS/src/sql/Pg/upgrade/0745.data.prewarn_expire_setting.sql @@ -10,17 +10,17 @@ SELECT evergreen.upgrade_deps_block_check('0745', :eg_version); INSERT INTO config.org_unit_setting_type (name, grp, label, description, datatype) VALUES ( - 'circ.prewarn_expire_setting', + 'circ.patron_expires_soon_warning', 'circ', oils_i18n_gettext( - 'circ.prewarn_expire_setting', - 'Pre-warning for patron expiration', + 'circ.patron_expires_soon_warning', + 'Warn when patron account is about to expire', 'coust', 'label' ), oils_i18n_gettext( - 'circ.prewarn_expire_setting', - 'Pre-warning for patron expiration. This setting defines the number of days before patron expiration to display a message suggesting it is time to renew the patron account. Value is in number of days, for example: 3 for 3 days.', + 'circ.patron_expires_soon_warning', + 'Warn when patron account is about to expire. If set, the staff client displays a warning this many days before the expiry of a patron account. Value is in number of days, for example: 3 for 3 days.', 'coust', 'description' ), diff --git a/Open-ILS/xul/staff_client/server/patron/display.js b/Open-ILS/xul/staff_client/server/patron/display.js index d68d6a2c17..3530f713d7 100644 --- a/Open-ILS/xul/staff_client/server/patron/display.js +++ b/Open-ILS/xul/staff_client/server/patron/display.js @@ -983,11 +983,12 @@ patron.display.prototype = { var preexpire = new Date(); var preexpire_value; - if (obj.OpenILS.data.hash.aous['circ.prewarn_expire_setting']) { - if (typeof obj.OpenILS.data.hash.aous['circ.prewarn_expire_setting'] == "string") { - preexpire_value = parseInt(obj.OpenILS.data.hash.aous['circ.prewarn_expire_setting']); + var preexpire_setting = obj.OpenILS.data.hash.aous['circ.patron_expires_soon_warning']; + if (preexpire_setting) { + if (typeof preexpire_setting == "string") { + preexpire_value = parseInt(preexpire_setting); } else { - preexpire_value = obj.OpenILS.data.hash.aous['circ.prewarn_expire_setting']; + preexpire_value = preexpire_setting; } preexpire.setDate(preexpire.getDate() + preexpire_value); } @@ -996,7 +997,7 @@ patron.display.prototype = { if (expire < now) { msg += $("patronStrings").getString('staff.patron.display.init.network_request.account_expired'); obj.stop_checkouts = true; - } else if (expire < preexpire && obj.OpenILS.data.hash.aous['circ.prewarn_expire_setting']) { + } else if (expire < preexpire && preexpire_setting) { msg += $("patronStrings").getString('staff.patron.display.init.network_request.account_expire_soon'); } } diff --git a/docs/RELEASE_NOTES_NEXT/circulation_patron_expiry_warning.txt b/docs/RELEASE_NOTES_NEXT/circulation_patron_expiry_warning.txt new file mode 100644 index 0000000000..eebe3eb869 --- /dev/null +++ b/docs/RELEASE_NOTES_NEXT/circulation_patron_expiry_warning.txt @@ -0,0 +1,9 @@ +New feature: "Warn patrons when their account is about to expire" +================================================================= +To give staff the ability to warn patrons when their account is about to +expire, the staff client can display an alert message on the patron information +window. A new library setting, `Warn patrons when their account is about to +expire` in the *Circulation* section of the *Library Settings Editor*, +determines how many days in advance of a patron's account expiry date the alert +should be displayed. By default, warnings about upcoming patron account expiry +dates are not displayed. -- 2.43.2