Index: openacs-4/packages/courses/tcl/course-procs.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/courses/tcl/course-procs.xql,v diff -u -r1.4 -r1.5 --- openacs-4/packages/courses/tcl/course-procs.xql 4 Feb 2005 23:05:52 -0000 1.4 +++ openacs-4/packages/courses/tcl/course-procs.xql 8 Feb 2005 23:07:52 -0000 1.5 @@ -8,10 +8,10 @@ - + - select item_id from cr_items - where name = :name and parent_id = :parent_id and content_type = 'course_catalog' + select item_id from cr_revisions + where revision_id = :revision_id @@ -27,29 +27,36 @@ update cr_items set live_revision = :revision_id - where name = :name + where item_id = ( select item_id from cr_revisions where revision_id = :revision_id ) - + - update cr_items - set name = :name - where item_id = :item_id + select course_id from course_catalog where course_key = :name select count (rel_id) - from acs_rels where rel_type = 'course_catalog_rel' and object_id_one = :course_id + from acs_rels where object_id_one = :course_id + + + select rel_id + from acs_rels where object_id_one = :object_one and object_id_two = :object_two + + + + select count (rel_id) - from acs_rels where rel_type = 'course_catalog_rel' and object_id_two = :community_id + from acs_rels where rel_type = 'course_catalog_com_rel' + and object_id_two = :community_id @@ -58,7 +65,8 @@ select rel_id from acs_rels where - rel_type = 'course_catalog_rel' and object_id_one = :course_id + (rel_type = 'course_catalog_class_rel' or rel_type = 'course_catalog_com_rel') + and object_id_one = :course_id