- 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.
Signed-off-by: Kyle Huckins <khuckins@catalyte.io>
Changes to be committed:
modified: Open-ILS/examples/fm_IDL.xml
modified: Open-ILS/src/sql/Pg/040.schema.asset.sql
renamed: Open-ILS/src/sql/Pg/upgrade/XXXX.data.manage-reserves-permission.sql -> Open-ILS/src/sql/Pg/upgrade/XXXX.schema.course-materials-module.sql
</actions>
</permacrud>
</class>
+ <class id="acmc" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="asset::course_module_course" oils_persist:tablename="asset.course_module_course" reporter:label="Course">
+ <fields oils_persist:primary="id" oils_persist:sequence="asset.course_module_course_id_seq">
+ <field reporter:label="ID" name="id" reporter:datatype="id" />
+ <field reporter:label="Title" name="name" reporter:datatype="text" />
+ <field reporter:label="Course Number" name="course_number" reporter:datatype="text" />
+ <field reporter:label="Section Number" name="section_number" reporter:datatype="text" />
+ <field reporter:label="Owning Library" name="owning_lib" reporter:datatype="link" />
+ </fields>
+ <links>
+ <link field="owning_lib" reltype="has_a" key="id" map="" class="aou" />
+ </links>
+ <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
+ <actions>
+ <create permission="MANAGE_RESERVES" context_field="owning_lib"/>
+ <retrieve/>
+ <update permission="MANAGE_RESERVES" context_field="owning_lib"/>
+ <delete permission="MANAGE_RESERVES" context_field="owning_lib"/>
+ </actions>
+ </permacrud>
+ </class>
<class id="acnc" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="asset::call_number_class" oils_persist:tablename="asset.call_number_class" reporter:label="Call number classification scheme">
<fields oils_persist:primary="id" oils_persist:sequence="asset.call_number_class_id_seq">
<field reporter:label="Call number class ID" name="id" reporter:datatype="id"/>
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)
+);
+
COMMIT;
+++ /dev/null
-BEGIN;
-
-SELECT evergreen.upgrade_deps_block_check('XXXX', :eg_version);
-
-INSERT INTO permission.perm_list(id, code, description)
- VALUES (
- 620,
- 'MANAGE_RESERVES',
- oils_i18n_gettext(
- 620,
- 'Allows user to manage Courses, Course Materials, and associate Users with Courses.',
- 'ppl',
- 'description'
- )
- );
-
-INSERT INTO permission.grp_perm_map(perm, grp, depth) VALUES (620, 9, 0), (620, 11, 0), (20, 12, 0), (620, 13, 0);
-
-COMMIT;
\ No newline at end of file
--- /dev/null
+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)
+);
+
+INSERT INTO permission.perm_list(id, code, description)
+ VALUES (
+ 620,
+ 'MANAGE_RESERVES',
+ oils_i18n_gettext(
+ 620,
+ 'Allows user to manage Courses, Course Materials, and associate Users with Courses.',
+ 'ppl',
+ 'description'
+ )
+ );
+
+INSERT INTO permission.grp_perm_map(perm, grp, depth) VALUES (620, 9, 0), (620, 11, 0), (20, 12, 0), (620, 13, 0);
+
+COMMIT;
\ No newline at end of file