Add a "staff_alert" column to config.standing_penalty, and ... user/senator/alerting-penalties
authorLebbeous Fogle-Weekley <lebbeous@esilibrary.com>
Tue, 10 Jan 2012 17:59:57 +0000 (12:59 -0500)
committerLebbeous Fogle-Weekley <lebbeous@esilibrary.com>
Tue, 10 Jan 2012 17:59:57 +0000 (12:59 -0500)
... 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.

Signed-off-by: Lebbeous Fogle-Weekley <lebbeous@esilibrary.com>
Open-ILS/examples/fm_IDL.xml
Open-ILS/src/sql/Pg/002.schema.config.sql
Open-ILS/src/sql/Pg/upgrade/XXXX.schema.alerting-penalties.sql [new file with mode: 0644]
Open-ILS/xul/staff_client/server/patron/display.js

index 07b9815..b0b4753 100644 (file)
@@ -2943,6 +2943,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/>
index 1333f27..d1243fc 100644 (file)
@@ -122,6 +122,7 @@ 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)
@@ -133,7 +134,7 @@ INSERT INTO config.standing_penalty (id,name,label,block_list)
 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) 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');
diff --git a/Open-ILS/src/sql/Pg/upgrade/XXXX.schema.alerting-penalties.sql b/Open-ILS/src/sql/Pg/upgrade/XXXX.schema.alerting-penalties.sql
new file mode 100644 (file)
index 0000000..31b6cff
--- /dev/null
@@ -0,0 +1,10 @@
+BEGIN;
+
+SELECT evergreen.upgrade_deps_block_check('XXXX', :eg_version);
+
+ALTER TABLE config.standing_penalty ADD staff_alert BOOL NOT NULL DEFAULT FALSE;
+
+-- 20 is ALERT_NOTE
+UPDATE config.standing_penalty SET staff_alert = TRUE WHERE id = 20;
+
+COMMIT;
index 3cf9f96..ca490bc 100644 (file)
@@ -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 (penalties[i].standing_penalty().block_list() || penalties[i].standing_penalty().staff_alert()) {
                         if (!dl_flag_opened) {
                             msg += '<dl>';
                             dl_flag_opened = true;