JBAS-1586 Teach Ecard new profile
authorBill Erickson <berickxx@gmail.com>
Fri, 16 Sep 2016 17:53:34 +0000 (13:53 -0400)
committerBill Erickson <berickxx@gmail.com>
Thu, 21 Mar 2019 19:46:23 +0000 (15:46 -0400)
* Entry for permission.grp_tree
* Hold policy configuration to prevent holds for new profile
* Entry in patron editor UI for sorting the new profile in the group selector.

Signed-off-by: Bill Erickson <berickxx@gmail.com>
KCLS/sql/schema/deploy/teacher-group.sql [new file with mode: 0644]
KCLS/sql/schema/revert/teacher-group.sql [new file with mode: 0644]
KCLS/sql/schema/sqitch.plan
KCLS/sql/schema/verify/teacher-group.sql [new file with mode: 0644]
Open-ILS/web/js/ui/default/actor/user/register.js

diff --git a/KCLS/sql/schema/deploy/teacher-group.sql b/KCLS/sql/schema/deploy/teacher-group.sql
new file mode 100644 (file)
index 0000000..c4c4a51
--- /dev/null
@@ -0,0 +1,27 @@
+-- Deploy kcls-evergreen:teacher-group to pg
+-- requires: student-groups
+
+BEGIN;
+
+DO $$
+BEGIN
+    IF evergreen.insert_on_deploy() THEN
+
+    INSERT INTO permission.grp_tree 
+        (id, name, parent, usergroup, perm_interval) VALUES 
+        (903, 'Teacher Ecard', 900, TRUE, '2 years');
+
+    -- hold matchpoints have to match the group exactly to overcome
+    -- conflicting match weights.
+    INSERT INTO config.hold_matrix_matchpoint (
+        active, usr_grp, requestor_grp, ref_flag, holdable, 
+        distance_is_from_owner, include_frozen_holds, stop_blocked_user, 
+        strict_ou_match
+    ) VALUES (TRUE, 903, 1, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE);
+
+    END IF; -- insert_on_deploy
+END $$;
+
+
+
+COMMIT;
diff --git a/KCLS/sql/schema/revert/teacher-group.sql b/KCLS/sql/schema/revert/teacher-group.sql
new file mode 100644 (file)
index 0000000..97fd465
--- /dev/null
@@ -0,0 +1,15 @@
+-- Revert kcls-evergreen:teacher-group from pg
+
+BEGIN;
+
+DO $$
+BEGIN
+    IF evergreen.insert_on_deploy() THEN
+
+    DELETE FROM config.hold_matrix_matchpoint WHERE usr_grp = 903;
+    DELETE FROM permission.grp_tree WHERE id = 903;
+
+    END IF; -- insert-on-deploy
+END $$;
+
+COMMIT;
index 9307f30..52cad6b 100644 (file)
@@ -31,3 +31,4 @@ payflow-hosted-org-settings [vand-auth-edit-date] 2016-07-06T18:39:40Z Bill Eric
 sip-act-type-freegalsip [payflow-hosted-org-settings] 2016-08-19T20:24:01Z Bill Erickson <berickxx@gmail.com> # User activity type for freegalsip login
 audit-table-maint [payflow-hosted-org-settings] 2016-07-22T14:49:08Z Bill Erickson <berickxx@gmail.com> # Audit table cleanup functions
 payflow-hosted-static-silent-post-url [payflow-hosted-org-settings] 2016-08-17T13:14:48Z Bill Erickson <berickxx@gmail.com> # Fall back to PP silent post URL
+teacher-group [student-groups] 2016-09-16T17:43:41Z Bill Erickson <berickxx@gmail.com> # Teach ecard group and policy configs
diff --git a/KCLS/sql/schema/verify/teacher-group.sql b/KCLS/sql/schema/verify/teacher-group.sql
new file mode 100644 (file)
index 0000000..b7422b8
--- /dev/null
@@ -0,0 +1,7 @@
+-- Verify kcls-evergreen:teacher-group on pg
+
+BEGIN;
+
+-- XXX Add verifications here.
+
+ROLLBACK;
index cb018d9..30a12af 100644 (file)
@@ -1415,6 +1415,7 @@ function trimGrpTree(autoWidget) {
         35,   //Outreach Service
         34,   //Outreach Staff Only
         901,  //Student Ecard
+        903,  //Teacher Ecard
         902,  //Classroom Databases
         40,   //ILL
         89,   //CMS Recall 89