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

Evergreen Git git at git.evergreen-ils.org
Tue Jan 10 14:34:15 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  b8fd484b3fd1f49d01e8556951a23eda6a49ee76 (commit)
      from  1f8f87ae3708140672a3ce3f2a9d49ce308b276f (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 b8fd484b3fd1f49d01e8556951a23eda6a49ee76
Author: Lebbeous Fogle-Weekley <lebbeous at esilibrary.com>
Date:   Tue Jan 10 12:59:57 2012 -0500

    Add a "staff_alert" column to config.standing_penalty, and ...
    
    ... consult this when deciding whether to show the stop sign page in the
    patron interface of the staff client, rather than explicitly checking
    for the id of the ALERT_NOTE config.standing_penalty.
    
    Now only show the standing penalty if the staff_alert value is true,
    instead of unconditionally showing it for all penalties with a
    block_list value.  This allows staff to configure blocking penalties
    that do not alert.
    
    Signed-off-by: Bill Erickson <berick at esilibrary.com>
    Signed-off-by: Lebbeous Fogle-Weekley <lebbeous at esilibrary.com>

diff --git a/Open-ILS/examples/fm_IDL.xml b/Open-ILS/examples/fm_IDL.xml
index e9c6f1a..8c481ec 100644
--- a/Open-ILS/examples/fm_IDL.xml
+++ b/Open-ILS/examples/fm_IDL.xml
@@ -2962,6 +2962,7 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA
 			<field name="name"  reporter:datatype="text"/>
 			<field name="label"  reporter:datatype="text" oils_persist:i18n="true"/>
 			<field name="block_list" reporter:datatype="text"/>
+			<field name="staff_alert" reporter:datatype="bool"/>
 			<field name="org_depth" reporter:datatype="int"/>
 		</fields>
 		<links/>
diff --git a/Open-ILS/src/sql/Pg/002.schema.config.sql b/Open-ILS/src/sql/Pg/002.schema.config.sql
index 542d0ad..eaf5c15 100644
--- a/Open-ILS/src/sql/Pg/002.schema.config.sql
+++ b/Open-ILS/src/sql/Pg/002.schema.config.sql
@@ -86,7 +86,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 ('0666', :eg_version); -- phasefx/miker
+INSERT INTO config.upgrade_log (version, applied_to) VALUES ('0667', :eg_version); -- senator/berick
 
 CREATE TABLE config.bib_source (
 	id		SERIAL	PRIMARY KEY,
@@ -122,26 +122,27 @@ CREATE TABLE config.standing_penalty (
 	name		TEXT	NOT NULL UNIQUE,
 	label		TEXT	NOT NULL,
 	block_list	TEXT,
+	staff_alert	BOOL	NOT NULL DEFAULT FALSE,
 	org_depth	INTEGER
 );
-INSERT INTO config.standing_penalty (id,name,label,block_list)
-	VALUES (1,'PATRON_EXCEEDS_FINES','Patron exceeds fine threshold','CIRC|HOLD|RENEW');
-INSERT INTO config.standing_penalty (id,name,label,block_list)
-	VALUES (2,'PATRON_EXCEEDS_OVERDUE_COUNT','Patron exceeds max overdue item threshold','CIRC|HOLD|RENEW');
-INSERT INTO config.standing_penalty (id,name,label,block_list)
-	VALUES (3,'PATRON_EXCEEDS_CHECKOUT_COUNT','Patron exceeds max checked out item threshold','CIRC');
-INSERT INTO config.standing_penalty (id,name,label,block_list)
-	VALUES (4,'PATRON_EXCEEDS_COLLECTIONS_WARNING','Patron exceeds pre-collections warning fine threshold','CIRC|HOLD|RENEW');
+INSERT INTO config.standing_penalty (id,name,label,block_list,staff_alert)
+	VALUES (1,'PATRON_EXCEEDS_FINES','Patron exceeds fine threshold','CIRC|HOLD|RENEW', TRUE);
+INSERT INTO config.standing_penalty (id,name,label,block_list,staff_alert)
+	VALUES (2,'PATRON_EXCEEDS_OVERDUE_COUNT','Patron exceeds max overdue item threshold','CIRC|HOLD|RENEW', TRUE);
+INSERT INTO config.standing_penalty (id,name,label,block_list,staff_alert)
+	VALUES (3,'PATRON_EXCEEDS_CHECKOUT_COUNT','Patron exceeds max checked out item threshold','CIRC', TRUE);
+INSERT INTO config.standing_penalty (id,name,label,block_list,staff_alert)
+	VALUES (4,'PATRON_EXCEEDS_COLLECTIONS_WARNING','Patron exceeds pre-collections warning fine threshold','CIRC|HOLD|RENEW', TRUE);
 
-INSERT INTO config.standing_penalty (id,name,label) VALUES (20,'ALERT_NOTE','Alerting Note, no blocks');
+INSERT INTO config.standing_penalty (id,name,label,staff_alert) VALUES (20,'ALERT_NOTE','Alerting Note, no blocks',TRUE);
 INSERT INTO config.standing_penalty (id,name,label) VALUES (21,'SILENT_NOTE','Note, no blocks');
-INSERT INTO config.standing_penalty (id,name,label,block_list) VALUES (22,'STAFF_C','Alerting block on Circ','CIRC');
-INSERT INTO config.standing_penalty (id,name,label,block_list) VALUES (23,'STAFF_CH','Alerting block on Circ and Hold','CIRC|HOLD');
-INSERT INTO config.standing_penalty (id,name,label,block_list) VALUES (24,'STAFF_CR','Alerting block on Circ and Renew','CIRC|RENEW');
-INSERT INTO config.standing_penalty (id,name,label,block_list) VALUES (25,'STAFF_CHR','Alerting block on Circ, Hold and Renew','CIRC|HOLD|RENEW');
-INSERT INTO config.standing_penalty (id,name,label,block_list) VALUES (26,'STAFF_HR','Alerting block on Hold and Renew','HOLD|RENEW');
-INSERT INTO config.standing_penalty (id,name,label,block_list) VALUES (27,'STAFF_H','Alerting block on Hold','HOLD');
-INSERT INTO config.standing_penalty (id,name,label,block_list) VALUES (28,'STAFF_R','Alerting block on Renew','RENEW');
+INSERT INTO config.standing_penalty (id,name,label,block_list,staff_alert) VALUES (22,'STAFF_C','Alerting block on Circ','CIRC');
+INSERT INTO config.standing_penalty (id,name,label,block_list,staff_alert) VALUES (23,'STAFF_CH','Alerting block on Circ and Hold','CIRC|HOLD', TRUE);
+INSERT INTO config.standing_penalty (id,name,label,block_list,staff_alert) VALUES (24,'STAFF_CR','Alerting block on Circ and Renew','CIRC|RENEW', TRUE);
+INSERT INTO config.standing_penalty (id,name,label,block_list,staff_alert) VALUES (25,'STAFF_CHR','Alerting block on Circ, Hold and Renew','CIRC|HOLD|RENEW', TRUE);
+INSERT INTO config.standing_penalty (id,name,label,block_list,staff_alert) VALUES (26,'STAFF_HR','Alerting block on Hold and Renew','HOLD|RENEW', TRUE);
+INSERT INTO config.standing_penalty (id,name,label,block_list,staff_alert) VALUES (27,'STAFF_H','Alerting block on Hold','HOLD', TRUE);
+INSERT INTO config.standing_penalty (id,name,label,block_list,staff_alert) VALUES (28,'STAFF_R','Alerting block on Renew','RENEW', TRUE);
 INSERT INTO config.standing_penalty (id,name,label) VALUES (29,'INVALID_PATRON_ADDRESS','Patron has an invalid address');
 INSERT INTO config.standing_penalty (id,name,label) VALUES (30,'PATRON_IN_COLLECTIONS','Patron has been referred to a collections agency');
 
diff --git a/Open-ILS/src/sql/Pg/upgrade/0667.schema.alerting-penalties.sql b/Open-ILS/src/sql/Pg/upgrade/0667.schema.alerting-penalties.sql
new file mode 100644
index 0000000..7a96137
--- /dev/null
+++ b/Open-ILS/src/sql/Pg/upgrade/0667.schema.alerting-penalties.sql
@@ -0,0 +1,12 @@
+BEGIN;
+
+SELECT evergreen.upgrade_deps_block_check('0667', :eg_version);
+
+ALTER TABLE config.standing_penalty ADD staff_alert BOOL NOT NULL DEFAULT FALSE;
+
+-- 20 is ALERT_NOTE
+-- for backwards compat, set all blocking penalties to alerts
+UPDATE config.standing_penalty SET staff_alert = TRUE 
+    WHERE id = 20 OR block_list IS NOT NULL;
+
+COMMIT;
diff --git a/Open-ILS/xul/staff_client/server/patron/display.js b/Open-ILS/xul/staff_client/server/patron/display.js
index 1eec41f..2e17b8b 100644
--- a/Open-ILS/xul/staff_client/server/patron/display.js
+++ b/Open-ILS/xul/staff_client/server/patron/display.js
@@ -963,7 +963,7 @@ patron.display.prototype = {
                 if (!penalties) { penalties = []; }
                 var dl_flag_opened = false;
                 for (var i = 0; i < penalties.length; i++) {
-                    if (penalties[i].standing_penalty().block_list() || penalties[i].standing_penalty().id() == 20 /* ALERT_NOTE */) {
+                    if (get_bool(penalties[i].standing_penalty().staff_alert())) {
                         if (!dl_flag_opened) {
                             msg += '<dl>';
                             dl_flag_opened = true;

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

Summary of changes:
 Open-ILS/examples/fm_IDL.xml                       |    1 +
 Open-ILS/src/sql/Pg/002.schema.config.sql          |   37 ++++++++++---------
 .../Pg/upgrade/0667.schema.alerting-penalties.sql  |   12 ++++++
 Open-ILS/xul/staff_client/server/patron/display.js |    2 +-
 4 files changed, 33 insertions(+), 19 deletions(-)
 create mode 100644 Open-ILS/src/sql/Pg/upgrade/0667.schema.alerting-penalties.sql


hooks/post-receive
-- 
Evergreen ILS


More information about the open-ils-commits mailing list