From 270fa234708c5048bb3c106638a9301b321251fb Mon Sep 17 00:00:00 2001 From: Kyle Huckins Date: Fri, 18 Oct 2019 18:05:57 +0000 Subject: [PATCH] LP1849212: Course Reserves database and IDL - Create MANAGE_RESERVES permission. - Create IDL Object for Courses. - Create table within asset schema for Courses, containing an id, a name, a course number, a section number, and an owning library. - Add IDL Class and asset table to map actor.usr and asset.course_module_course, along with an optional string value for the user's role in the course. If desired, this can later be fleshed out into a separate course role table. - Create IDL Class & Table for Course Materials - Create IDL Class & Table for Non-Cataloged Course Materials - YAOUS introduced to allow opting into the Course Materials module functionality. - Change instances of non-cat-course_materials to non_cat_course_materials Signed-off-by: Kyle Huckins Signed-off-by: Jane Sandberg Signed-off-by: Michele Morgan Signed-off-by: Galen Charlton --- Open-ILS/examples/fm_IDL.xml | 104 ++++++++++++++++++ Open-ILS/src/sql/Pg/040.schema.asset.sql | 30 +++++ Open-ILS/src/sql/Pg/950.data.seed-values.sql | 16 ++- .../XXXX.schema.course-materials-module.sql | 68 ++++++++++++ 4 files changed, 217 insertions(+), 1 deletion(-) create mode 100644 Open-ILS/src/sql/Pg/upgrade/XXXX.schema.course-materials-module.sql diff --git a/Open-ILS/examples/fm_IDL.xml b/Open-ILS/examples/fm_IDL.xml index 6b9640c8af..146f0a8152 100644 --- a/Open-ILS/examples/fm_IDL.xml +++ b/Open-ILS/examples/fm_IDL.xml @@ -3111,6 +3111,110 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/Open-ILS/src/sql/Pg/040.schema.asset.sql b/Open-ILS/src/sql/Pg/040.schema.asset.sql index 198632a617..2d21799560 100644 --- a/Open-ILS/src/sql/Pg/040.schema.asset.sql +++ b/Open-ILS/src/sql/Pg/040.schema.asset.sql @@ -1105,5 +1105,35 @@ CREATE VIEW asset.active_copy_alert AS FROM asset.copy_alert WHERE ack_time IS NULL; +CREATE TABLE asset.course_module_course ( + id SERIAL PRIMARY KEY, + name TEXT NOT NULL, + course_number TEXT NOT NULL, + section_number TEXT, + owning_lib INT REFERENCES actor.org_unit (id) +); + +CREATE TABLE asset.course_module_course_users ( + id SERIAL PRIMARY KEY, + course INT NOT NULL REFERENCES asset.course_module_course (id), + usr INT NOT NULL REFERENCES actor.usr (id), + usr_role TEXT +); + +CREATE TABLE asset.course_module_course_materials ( + id SERIAL PRIMARY KEY, + course INT NOT NULL REFERENCES asset.course_module_course (id), + item INT NOT NULL REFERENCES asset.copy (id), + relationship TEXT +); + +CREATE TABLE asset.course_module_non_cat_course_materials ( + id SERIAL PRIMARY KEY, + course INT NOT NULL REFERENCES asset.course_module_course (id), + item TEXT NOT NULL, + url TEXT, + relationship TEXT +); + COMMIT; 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 28be205a48..8f6353d21f 100644 --- a/Open-ILS/src/sql/Pg/950.data.seed-values.sql +++ b/Open-ILS/src/sql/Pg/950.data.seed-values.sql @@ -1940,7 +1940,9 @@ INSERT INTO permission.perm_list ( id, code, description ) VALUES ( 622, 'VIEW_BOOKING_RESOURCE', oils_i18n_gettext(622, 'View booking resources', 'ppl', 'description')), ( 623, 'UPDATE_ORG_UNIT_SETTING.opac.matomo', oils_i18n_gettext(623, - 'Allows a user to configure Matomo Analytics org unit settings', 'ppl', 'description')) + 'Allows a user to configure Matomo Analytics org unit settings', 'ppl', 'description')), + ( 624, 'MANAGE_RESERVES', oils_i18n_gettext(623, + 'Allows user to manage Courses, Course Materials, and associate Users with Courses.', 'ppl', 'description')) ; @@ -2454,6 +2456,7 @@ INSERT INTO permission.grp_perm_map (grp, perm, depth, grantable) 'CREATE_CIRC_DURATION', 'CREATE_PRECAT', 'DELETE_CIRC_DURATION', + 'MANAGE_RESERVES', 'MARK_ITEM_MISSING_PIECES', 'UPDATE_CIRC_DURATION', 'UPDATE_HOLD_REQUEST_TIME', @@ -3829,6 +3832,17 @@ INSERT into config.org_unit_setting_type 'coust', 'description'), 'bool', null) +,( 'circ.course_materials_opt_in', 'circ', + oils_i18n_gettext( + 'circ.course_materials_opt_in', + 'Opt Org Unit into the Course Materials Module', + 'coust', 'label'), + oils_i18n_gettext( + 'circ.course_materials_opt_in', + 'If enabled, the Org Unit will utilize Course Material functionality.' + 'coust', 'description'), + 'bool', null) + ,( 'circ.password_reset_request_per_user_limit', 'sec', oils_i18n_gettext('circ.password_reset_request_per_user_limit', 'Maximum concurrently active self-serve password reset requests per user', diff --git a/Open-ILS/src/sql/Pg/upgrade/XXXX.schema.course-materials-module.sql b/Open-ILS/src/sql/Pg/upgrade/XXXX.schema.course-materials-module.sql new file mode 100644 index 0000000000..23dd2729f7 --- /dev/null +++ b/Open-ILS/src/sql/Pg/upgrade/XXXX.schema.course-materials-module.sql @@ -0,0 +1,68 @@ +BEGIN; + +SELECT evergreen.upgrade_deps_block_check('XXXX', :eg_version); + +CREATE TABLE asset.course_module_course ( + id SERIAL PRIMARY KEY, + name TEXT NOT NULL, + course_number TEXT NOT NULL, + section_number TEXT, + owning_lib INT REFERENCES actor.org_unit (id) +); + +CREATE TABLE asset.course_module_course_users ( + id SERIAL PRIMARY KEY, + course INT NOT NULL REFERENCES asset.course_module_course (id), + usr INT NOT NULL REFERENCES actor.usr (id), + usr_role TEXT +); + +CREATE TABLE asset.course_module_course_materials ( + id SERIAL PRIMARY KEY, + course INT NOT NULL REFERENCES asset.course_module_course (id), + item INT NOT NULL REFERENCES asset.copy (id), + relationship TEXT +); + +CREATE TABLE asset.course_module_non_cat_course_materials ( + id SERIAL PRIMARY KEY, + course INT NOT NULL REFERENCES asset.course_module_course (id), + item TEXT NOT NULL, + url TEXT, + relationship TEXT +); + +INSERT INTO permission.perm_list(id, code, description) + VALUES ( + 624, + 'MANAGE_RESERVES', + oils_i18n_gettext( + 624, + 'Allows user to manage Courses, Course Materials, and associate Users with Courses.', + 'ppl', + 'description' + ) + ); + +INSERT INTO permission.grp_perm_map(perm, grp, depth) VALUES (624, 9, 0), (624, 11, 0), (624, 12, 0), (624, 13, 0); + +INSERT INTO config.org_unit_setting_type + (grp, name, datatype, label, description) +VALUES ( + 'circ', + 'circ.course_materials_opt_in', 'bool', + oils_i18n_gettext( + 'circ.course_materials_opt_in', + 'Opt Org Unit into the Course Materials Module', + 'coust', + 'label' + ), + oils_i18n_gettext( + 'circ.course_materials_opt_in', + 'If enabled, the Org Unit will utilize Course Material functionality.' + 'coust', + 'description' + ) +); + +COMMIT; -- 2.43.2