[open-ils-commits] [GIT] Evergreen ILS branch master updated. e14abbde87d0f03b6943505f09c66e0d2d589f7a

Evergreen Git git at git.evergreen-ils.org
Wed Nov 21 10:06:29 EST 2012


This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "Evergreen ILS".

The branch, master has been updated
       via  e14abbde87d0f03b6943505f09c66e0d2d589f7a (commit)
       via  7ff7b24c442e7d007b27d14ed6924cc4301fc4d2 (commit)
       via  b6e866ab65d7d9658b59d8812e3ca2aada1c0efb (commit)
       via  136dd85b33c6ffddbf587dcdccbb5c07d9cf0189 (commit)
      from  60c5146f4a4ce942329afcaba1c9df23e0ccd557 (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
commit e14abbde87d0f03b6943505f09c66e0d2d589f7a
Author: Dan Scott <dscott at laurentian.ca>
Date:   Wed Nov 21 09:24:09 2012 -0500

    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 <dscott at laurentian.ca>
    Signed-off-by: Ben Shum <bshum at biblio.org>

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 fe719f0..e89a2e8 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 aec58b6..b9d40bc 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 d68d6a2..3530f71 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 0000000..eebe3eb
--- /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.

commit 7ff7b24c442e7d007b27d14ed6924cc4301fc4d2
Author: Dan Scott <dscott at laurentian.ca>
Date:   Wed Nov 21 07:08:04 2012 -0500

    Wrap upgrade script for patron expiry warning
    
    Signed-off-by: Dan Scott <dscott at laurentian.ca>
    Signed-off-by: Ben Shum <bshum at biblio.org>

diff --git a/Open-ILS/src/sql/Pg/002.schema.config.sql b/Open-ILS/src/sql/Pg/002.schema.config.sql
index 7b5b2c3..0886d9e 100644
--- a/Open-ILS/src/sql/Pg/002.schema.config.sql
+++ b/Open-ILS/src/sql/Pg/002.schema.config.sql
@@ -87,7 +87,7 @@ CREATE TRIGGER no_overlapping_deps
     BEFORE INSERT OR UPDATE ON config.db_patch_dependencies
     FOR EACH ROW EXECUTE PROCEDURE evergreen.array_overlap_check ('deprecates');
 
-INSERT INTO config.upgrade_log (version, applied_to) VALUES ('0744', :eg_version); -- Dyrcona/dbwells
+INSERT INTO config.upgrade_log (version, applied_to) VALUES ('0745', :eg_version); -- mrpeters-isl/bshum/dbs
 
 CREATE TABLE config.bib_source (
 	id		SERIAL	PRIMARY KEY,
diff --git a/Open-ILS/src/sql/Pg/upgrade/XXXX.data.prewarn_expire_setting.sql b/Open-ILS/src/sql/Pg/upgrade/0745.data.prewarn_expire_setting.sql
similarity index 75%
rename from Open-ILS/src/sql/Pg/upgrade/XXXX.data.prewarn_expire_setting.sql
rename to Open-ILS/src/sql/Pg/upgrade/0745.data.prewarn_expire_setting.sql
index 151761b..aec58b6 100644
--- a/Open-ILS/src/sql/Pg/upgrade/XXXX.data.prewarn_expire_setting.sql
+++ b/Open-ILS/src/sql/Pg/upgrade/0745.data.prewarn_expire_setting.sql
@@ -1,6 +1,11 @@
+-- Evergreen DB patch 0745.data.prewarn_expire_setting.sql
+--
+-- Configuration setting to warn staff when an account is about to expire
+--
 BEGIN;
 
-SELECT evergreen.upgrade_deps_block_check('XXXX', :eg_version);
+-- check whether patch can be applied
+SELECT evergreen.upgrade_deps_block_check('0745', :eg_version);
 
 INSERT INTO config.org_unit_setting_type
     (name, grp, label, description, datatype)

commit b6e866ab65d7d9658b59d8812e3ca2aada1c0efb
Author: Ben Shum <bshum at biblio.org>
Date:   Wed Nov 14 13:30:11 2012 -0500

    Add library setting to control pre-expire warning for patrons
    
    Thanks to some more inspiration by Thomas Berezansky, this change adds a
    library setting to control when the pre-expire warning will be displayed.
    
    Signed-off-by: Ben Shum <bshum at biblio.org>
    Signed-off-by: Dan Scott <dscott at laurentian.ca>

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 394e7bc..fe719f0 100644
--- a/Open-ILS/src/sql/Pg/950.data.seed-values.sql
+++ b/Open-ILS/src/sql/Pg/950.data.seed-values.sql
@@ -11859,3 +11859,23 @@ INSERT INTO config.org_unit_setting_type
         ),
         'bool'
     );
+
+INSERT INTO config.org_unit_setting_type
+    (name, grp, label, description, datatype)
+    VALUES (
+        'circ.prewarn_expire_setting',
+        'circ',
+        oils_i18n_gettext(
+            'circ.prewarn_expire_setting',
+            'Pre-warning for patron expiration',
+            '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.',
+            'coust',
+            'description'
+        ),
+        'integer'
+    );
diff --git a/Open-ILS/src/sql/Pg/upgrade/XXXX.data.prewarn_expire_setting.sql b/Open-ILS/src/sql/Pg/upgrade/XXXX.data.prewarn_expire_setting.sql
new file mode 100644
index 0000000..151761b
--- /dev/null
+++ b/Open-ILS/src/sql/Pg/upgrade/XXXX.data.prewarn_expire_setting.sql
@@ -0,0 +1,25 @@
+BEGIN;
+
+SELECT evergreen.upgrade_deps_block_check('XXXX', :eg_version);
+
+INSERT INTO config.org_unit_setting_type
+    (name, grp, label, description, datatype)
+    VALUES (
+        'circ.prewarn_expire_setting',
+        'circ',
+        oils_i18n_gettext(
+            'circ.prewarn_expire_setting',
+            'Pre-warning for patron expiration',
+            '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.',
+            'coust',
+            'description'
+        ),
+        'integer'
+    );
+
+COMMIT;
diff --git a/Open-ILS/xul/staff_client/server/patron/display.js b/Open-ILS/xul/staff_client/server/patron/display.js
index 393fa32..d68d6a2 100644
--- a/Open-ILS/xul/staff_client/server/patron/display.js
+++ b/Open-ILS/xul/staff_client/server/patron/display.js
@@ -973,9 +973,6 @@ patron.display.prototype = {
                 if (patron.expire_date()) {
                     var now = new Date();
                     now = now.getTime()/1000;
-                     var preexpire = new Date();
-                     preexpire.setDate(preexpire.getDate() + 28);
-                     preexpire = preexpire.getTime()/1000;
 
                     var expire_parts = patron.expire_date().substr(0,10).split('-');
                     expire_parts[1] = expire_parts[1] - 1;
@@ -984,11 +981,23 @@ patron.display.prototype = {
                     expire.setFullYear(expire_parts[0], expire_parts[1], expire_parts[2]);
                     expire = expire.getTime()/1000
 
+                    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']);  
+                        } else {
+                            preexpire_value = obj.OpenILS.data.hash.aous['circ.prewarn_expire_setting'];
+                        }
+                        preexpire.setDate(preexpire.getDate() + preexpire_value);
+                    }
+                    preexpire = preexpire.getTime()/1000;
+
                     if (expire < now) {
                         msg += $("patronStrings").getString('staff.patron.display.init.network_request.account_expired');
                         obj.stop_checkouts = true;
-                    } else if (expire < preexpire) {
-                         msg += $("patronStrings").getString('staff.patron.display.init.network_request.account_expire_soon');   
+                    } else if (expire < preexpire && obj.OpenILS.data.hash.aous['circ.prewarn_expire_setting']) {
+                        msg += $("patronStrings").getString('staff.patron.display.init.network_request.account_expire_soon');
                     }
                 }
                 var penalties = patron.standing_penalties();

commit 136dd85b33c6ffddbf587dcdccbb5c07d9cf0189
Author: Michael Peters <mrpeters at library.in.gov>
Date:   Thu Nov 8 14:14:42 2012 -0500

    Warn on card expiring within 28 days
    
    Thank you to Thomas Berzansky for pointing out a simple way of
    accomplishing this, since we were already checking and alerting
    if card was already expired.
    
    This places an alert on the "stop sign" page if the card expires
    within 28 days from the current date.
    
    Interval can be configured by editing preexpire.setDate in display.js.
    
    Signed-off-by: Michael Peters <mrpeters at library.in.gov>
    Signed-off-by: Ben Shum <bshum at biblio.org>
    Signed-off-by: Dan Scott <dscott at laurentian.ca>

diff --git a/Open-ILS/xul/staff_client/server/locale/en-US/patron.properties b/Open-ILS/xul/staff_client/server/locale/en-US/patron.properties
index 55b750c..567a40c 100644
--- a/Open-ILS/xul/staff_client/server/locale/en-US/patron.properties
+++ b/Open-ILS/xul/staff_client/server/locale/en-US/patron.properties
@@ -102,6 +102,7 @@ staff.patron.display.init.network_request.alert_message=Alert message: "%1$s"<br
 staff.patron.display.init.network_request.inactive_card=Patron account retrieved with an INACTIVE card.<br/><br/>
 staff.patron.display.init.network_request.account_barred=Patron account is BARRED.<br/><br/>
 staff.patron.display.init.network_request.account_inactive=Patron account is INACTIVE.<br/><br/>
+staff.patron.display.init.network_request.account_expire_soon=Patron account will expire soon.  Please renew.<br/><br/>
 staff.patron.display.init.network_request.account_expired=Patron account is EXPIRED.<br/><br/>
 staff.patron.display.init.holds_ready=Holds available: %1$s
 staff.patron.display.init.network_request.window_title=Alert
diff --git a/Open-ILS/xul/staff_client/server/patron/display.js b/Open-ILS/xul/staff_client/server/patron/display.js
index 2deb0c8..393fa32 100644
--- a/Open-ILS/xul/staff_client/server/patron/display.js
+++ b/Open-ILS/xul/staff_client/server/patron/display.js
@@ -973,6 +973,9 @@ patron.display.prototype = {
                 if (patron.expire_date()) {
                     var now = new Date();
                     now = now.getTime()/1000;
+                     var preexpire = new Date();
+                     preexpire.setDate(preexpire.getDate() + 28);
+                     preexpire = preexpire.getTime()/1000;
 
                     var expire_parts = patron.expire_date().substr(0,10).split('-');
                     expire_parts[1] = expire_parts[1] - 1;
@@ -983,7 +986,9 @@ patron.display.prototype = {
 
                     if (expire < now) {
                         msg += $("patronStrings").getString('staff.patron.display.init.network_request.account_expired');
-                    obj.stop_checkouts = true;
+                        obj.stop_checkouts = true;
+                    } else if (expire < preexpire) {
+                         msg += $("patronStrings").getString('staff.patron.display.init.network_request.account_expire_soon');   
                     }
                 }
                 var penalties = patron.standing_penalties();

-----------------------------------------------------------------------

Summary of changes:
 Open-ILS/src/sql/Pg/002.schema.config.sql          |    2 +-
 Open-ILS/src/sql/Pg/950.data.seed-values.sql       |   20 +++++++++++++
 .../upgrade/0745.data.prewarn_expire_setting.sql   |   30 ++++++++++++++++++++
 .../server/locale/en-US/patron.properties          |    1 +
 Open-ILS/xul/staff_client/server/patron/display.js |   17 ++++++++++-
 .../circulation_patron_expiry_warning.txt          |    9 ++++++
 6 files changed, 77 insertions(+), 2 deletions(-)
 create mode 100644 Open-ILS/src/sql/Pg/upgrade/0745.data.prewarn_expire_setting.sql
 create mode 100644 docs/RELEASE_NOTES_NEXT/circulation_patron_expiry_warning.txt


hooks/post-receive
-- 
Evergreen ILS


More information about the open-ils-commits mailing list