From: Kyle Huckins Date: Sun, 13 Mar 2022 04:44:56 +0000 (+0000) Subject: lp1923057 Course Materials disassociate Rework X-Git-Url: https://old-git.evergreen-ils.org/?a=commitdiff_plain;h=4b56dc2dbca62c6f6d723921b24769180adf52d9;p=working%2FEvergreen.git lp1923057 Course Materials disassociate Rework - Adds a "Currently Associated" boolean and Removal time for course materials - When disassociating a course material, the time will still show up in the admin grid for course materials, marked as not currently associated. Signed-off-by: Kyle Huckins --- diff --git a/Open-ILS/examples/fm_IDL.xml b/Open-ILS/examples/fm_IDL.xml index 671205919b..43d5ef866c 100644 --- a/Open-ILS/examples/fm_IDL.xml +++ b/Open-ILS/examples/fm_IDL.xml @@ -3318,10 +3318,12 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA + + diff --git a/Open-ILS/src/eg2/src/app/staff/admin/local/course-reserves/course-associate-material.component.html b/Open-ILS/src/eg2/src/app/staff/admin/local/course-reserves/course-associate-material.component.html index 8e08856558..76b78304a8 100644 --- a/Open-ILS/src/eg2/src/app/staff/admin/local/course-reserves/course-associate-material.component.html +++ b/Open-ILS/src/eg2/src/app/staff/admin/local/course-reserves/course-associate-material.component.html @@ -239,6 +239,9 @@ + + + diff --git a/Open-ILS/src/perlmods/lib/OpenILS/Application/Courses.pm b/Open-ILS/src/perlmods/lib/OpenILS/Application/Courses.pm index 6e7c7528d7..6ec25fadb1 100644 --- a/Open-ILS/src/perlmods/lib/OpenILS/Application/Courses.pm +++ b/Open-ILS/src/perlmods/lib/OpenILS/Application/Courses.pm @@ -244,9 +244,13 @@ sub detach_material { } if ($acmcm->item) { _resetItemFields($e, $authtoken, $acmcm); - } + } + + $acmcm->edit_time(); + $acmcm->removal_time(); + $acmcm->is_active('f'); - $e->delete_asset_course_module_course_materials($acmcm) or return $e->die_event; + $e->update_asset_course_module_course_materials($acmcm) or return $e->die_event; $e->commit; return 1; } diff --git a/Open-ILS/src/perlmods/lib/OpenILS/WWW/EGCatLoader/Course.pm b/Open-ILS/src/perlmods/lib/OpenILS/WWW/EGCatLoader/Course.pm index 260221f4d0..5caca93870 100644 --- a/Open-ILS/src/perlmods/lib/OpenILS/WWW/EGCatLoader/Course.pm +++ b/Open-ILS/src/perlmods/lib/OpenILS/WWW/EGCatLoader/Course.pm @@ -36,7 +36,7 @@ sub load_course { $ctx->{course_materials} = $U->simplereq( 'open-ils.courses', 'open-ils.courses.course_materials.retrieve.fleshed.atomic', - {course => $course_id} + {course => $course_id, is_active => 't'} ); return Apache2::Const::OK; } diff --git a/Open-ILS/src/sql/Pg/040.schema.asset.sql b/Open-ILS/src/sql/Pg/040.schema.asset.sql index 5fa0c53845..79e56c9d31 100644 --- a/Open-ILS/src/sql/Pg/040.schema.asset.sql +++ b/Open-ILS/src/sql/Pg/040.schema.asset.sql @@ -1143,6 +1143,7 @@ CREATE TABLE asset.course_module_course_materials ( original_status INT REFERENCES config.copy_status, original_circ_modifier TEXT, --REFERENCES config.circ_modifier original_callnumber INT REFERENCES asset.call_number, + is_active BOOL NOT NULL DEFAULT true, ADD COLUMN creator BIGINT NOT NULL REFERENCES actor.usr (id) DEFERRABLE INITIALLY DEFERRED, @@ -1151,6 +1152,7 @@ CREATE TABLE asset.course_module_course_materials ( DEFERRABLE INITIALLY DEFERRED, ADD COLUMN create_time TIMESTAMP WITH TIME ZONE DEFAULT NOW(), ADD COLUMN edit_time TIMESTAMP WITH TIME ZONE DEFAULT NOW(); + ADD COLUMN removal_time TIMESTAMP WITH TIME ZONE; unique (course, item, record) ); diff --git a/Open-ILS/src/sql/Pg/upgrade/xxxx.schema.lp1923057-course-material-removal-time.sql b/Open-ILS/src/sql/Pg/upgrade/xxxx.schema.lp1923057-course-material-removal-time.sql new file mode 100644 index 0000000000..e405a011b6 --- /dev/null +++ b/Open-ILS/src/sql/Pg/upgrade/xxxx.schema.lp1923057-course-material-removal-time.sql @@ -0,0 +1,8 @@ +BEGIN; + +SELECT evergreen.upgrade_deps_block_check('XXXX', :eg_version); +ALTER TABLE asset.course_module_course_materials + ADD COLUMN is_active BOOL NOT NULL DEFAULT true, + ADD COLUMN removal_time TIMESTAMP WITH TIME ZONE; + +COMMIT; \ No newline at end of file