Index: openacs-4/packages/courses/catalog/courses.en_US.ISO-8859-1.xml =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/courses/catalog/courses.en_US.ISO-8859-1.xml,v diff -u -r1.4 -r1.5 --- openacs-4/packages/courses/catalog/courses.en_US.ISO-8859-1.xml 3 Feb 2005 22:41:27 -0000 1.4 +++ openacs-4/packages/courses/catalog/courses.en_US.ISO-8859-1.xml 4 Feb 2005 23:05:52 -0000 1.5 @@ -4,9 +4,15 @@ Add Course Assessment Associate + Associate more classes or communities Associate this course Associate to this class + Associate to this community + Already Associated + Class Class Name + Community Name: + Community Course Administration Course Catalog Index Course Info: @@ -26,6 +32,7 @@ Grant permissions to other users Granted is associated to: + Check/uncheck all rows Make This Course Live New Course Version No @@ -46,6 +53,7 @@ See All Revisions Subject Name Term Name + Check/uncheck this row, and select an action to perform below To User Name: users to grant permissions that match that search Index: openacs-4/packages/courses/tcl/course-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/courses/tcl/course-procs.tcl,v diff -u -r1.3 -r1.4 --- openacs-4/packages/courses/tcl/course-procs.tcl 3 Feb 2005 22:41:27 -0000 1.3 +++ openacs-4/packages/courses/tcl/course-procs.tcl 4 Feb 2005 23:05:52 -0000 1.4 @@ -76,25 +76,43 @@ db_exec_plsql add_relation { } } -ad_proc -private course_catalog::has_relation { +ad_proc -private course_catalog::has_relation_rel_id { -course_id:required } { Returns the class_id of dotlrn_class_instance related to course_id, returns 0 otherwise. @course_id The id of the course in course_catalog } { - return [db_string has_relation { } -default 0] + return [db_string has_relation_rel_id { } -default 0] } -ad_proc -private course_catalog::has_relation_rel_id { +ad_proc -private course_catalog::has_relation { -course_id:required } { - Returns the class_id of dotlrn_class_instance related to course_id, returns 0 otherwise. + Returns 1 if there is a class_id of dotlrn_class_instance related to course_id, returns 0 otherwise. @course_id The id of the course in course_catalog } { - return [db_string has_relation_rel_id { } -default 0] + if { [db_string has_relation { } -default 0] == 0 } { + return 0 + } else { + return 1 + } } +ad_proc -private course_catalog::com_has_relation { + -community_id:required +} { + Returns 1 if there is a community of dotlrn related to course_id, returns 0 otherwise. + @community_id The id of the community in dotlrn +} { + if { [db_string com_has_relation { } -default 0] == 0 } { + return 0 + } else { + return 1 + } +} + + ad_proc -private course_catalog::check_live_latest { -revision_id:required } { 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.3 -r1.4 --- openacs-4/packages/courses/tcl/course-procs.xql 3 Feb 2005 22:41:27 -0000 1.3 +++ openacs-4/packages/courses/tcl/course-procs.xql 4 Feb 2005 23:05:52 -0000 1.4 @@ -41,12 +41,19 @@ - select object_id_two - from acs_rels where - rel_type = 'course_catalog_rel' and object_id_one = :course_id + select count (rel_id) + from acs_rels where rel_type = 'course_catalog_rel' and object_id_one = :course_id + + + select count (rel_id) + from acs_rels where rel_type = 'course_catalog_rel' and object_id_two = :community_id + + + + select rel_id Index: openacs-4/packages/courses/www/admin/grant-list.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/courses/www/admin/grant-list.tcl,v diff -u -r1.2 -r1.3 --- openacs-4/packages/courses/www/admin/grant-list.tcl 3 Feb 2005 22:41:27 -0000 1.2 +++ openacs-4/packages/courses/www/admin/grant-list.tcl 4 Feb 2005 23:05:53 -0000 1.3 @@ -30,6 +30,7 @@ } {user_email:text(text),optional {label "[_ courses.search_user_email]"} + {help_text "[_ courses.search_email_help]"} } } Index: openacs-4/packages/courses/www/cc-admin/associate-course.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/courses/www/cc-admin/associate-course.tcl,v diff -u -r1.2 -r1.3 --- openacs-4/packages/courses/www/cc-admin/associate-course.tcl 3 Feb 2005 22:41:28 -0000 1.2 +++ openacs-4/packages/courses/www/cc-admin/associate-course.tcl 4 Feb 2005 23:05:53 -0000 1.3 @@ -6,14 +6,16 @@ @creation date 31-01-2005 } { course_id:notnull - class_id:notnull + object_id:multiple { return_url ""} } -course_catalog::add_relation -course_id $course_id -class_id $class_id +foreach object $object_id { + course_catalog::add_relation -course_id $course_id -class_id $object +} if { [string equal $return_url ""] } { - ad_returnredirect "/courses/cc-admin/dotlrn-list" + ad_returnredirect "/courses/cc-admin/dotlrn-list?course_id=$course_id" } else { ad_returnredirect "$return_url" } Index: openacs-4/packages/courses/www/cc-admin/dotlrn-list.adp =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/courses/www/cc-admin/dotlrn-list.adp,v diff -u -r1.1 -r1.2 --- openacs-4/packages/courses/www/cc-admin/dotlrn-list.adp 2 Feb 2005 17:26:55 -0000 1.1 +++ openacs-4/packages/courses/www/cc-admin/dotlrn-list.adp 4 Feb 2005 23:05:53 -0000 1.2 @@ -3,6 +3,18 @@ @context;noquote@ -

#courses.associate# @course_key@ #courses.to#:

+

#courses.associate# @course_key@ #courses.to# #courses.class#:

+ +

#courses.associate# #courses.to# #courses.class#:

+
+ + + +

#courses.associate# @course_key@ #courses.to# #courses.community#:

+
+ +

#courses.associate# #courses.to# #courses.community#:

+
+ \ No newline at end of file Index: openacs-4/packages/courses/www/cc-admin/dotlrn-list.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/courses/www/cc-admin/dotlrn-list.tcl,v diff -u -r1.2 -r1.3 --- openacs-4/packages/courses/www/cc-admin/dotlrn-list.tcl 3 Feb 2005 22:41:28 -0000 1.2 +++ openacs-4/packages/courses/www/cc-admin/dotlrn-list.tcl 4 Feb 2005 23:05:53 -0000 1.3 @@ -23,20 +23,41 @@ set asm_package_id [apm_package_id_from_key assessment] -db_multirow classes_list get_dotlrn_classes {} +db_multirow -extend { rel } classes_list get_dotlrn_classes {} { + set rel [course_catalog::has_relation -course_id $object_id] +} template::list::create \ -name dotlrn_classes \ -multirow classes_list \ - -key class_id \ + -key object_id \ + -has_checkboxes\ + -bulk_actions {"\#courses.associate\#" "associate-course" "\#courses.associate_to_class\#" }\ -bulk_action_method post \ - -bulk_action_export_vars {}\ + -bulk_action_export_vars { + course_id + }\ -row_pretty_plural "[_ courses.dotlrn_classes]" \ -elements { + check_box { + class "list-narrow" + label "" + display_template { + + + + + + + } + } class { label "[_ courses.class_name]" display_template { - @classes_list.pretty_name@ + @classes_list.pretty_name@ } } dep_name { @@ -59,7 +80,60 @@ } associate { display_template { - #courses.associate# + + #courses.associate# + + + #courses.associated# + } } } + +db_multirow -extend { rel } com_list get_dotlrn_communities { } { + set rel [course_catalog::com_has_relation -community_id $object_id] +} + +template::list::create \ + -name dotlrn_communities \ + -multirow com_list \ + -key object_id \ + -has_checkboxes \ + -bulk_actions {"\#courses.associate\#" "associate-course" "\#courses.associate_to_com\#" }\ + -bulk_action_method post \ + -bulk_action_export_vars { + course_id + }\ + -row_pretty_plural "[_ courses.dotlrn_classes]" \ + -elements { + check_box { + class "list-narrow" + label "" + display_template { + + + + + + + } + } + community { + label "[_ courses.com_name]" + display_template { + @com_list.pretty_name@ + } + } + associate { + display_template { + + #courses.associate# + + + #courses.associated# + + } + } + } Index: openacs-4/packages/courses/www/cc-admin/dotlrn-list.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/courses/www/cc-admin/dotlrn-list.xql,v diff -u -r1.1 -r1.2 --- openacs-4/packages/courses/www/cc-admin/dotlrn-list.xql 2 Feb 2005 17:26:55 -0000 1.1 +++ openacs-4/packages/courses/www/cc-admin/dotlrn-list.xql 4 Feb 2005 23:05:53 -0000 1.2 @@ -3,10 +3,16 @@ - select class_instance_id as class_id, department_name, term_name, class_name, pretty_name, url + select class_instance_id as object_id, department_name, term_name, class_name, pretty_name, url from dotlrn_class_instances_full order by department_name, term_name, class_name, pretty_name + + + select community_id as object_id, pretty_name, url from dotlrn_clubs_full order by pretty_name + + + \ No newline at end of file Index: openacs-4/packages/courses/www/cc-admin/grant-user-list.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/courses/www/cc-admin/grant-user-list.xql,v diff -u -r1.2 -r1.3 --- openacs-4/packages/courses/www/cc-admin/grant-user-list.xql 3 Feb 2005 22:41:28 -0000 1.2 +++ openacs-4/packages/courses/www/cc-admin/grant-user-list.xql 4 Feb 2005 23:05:53 -0000 1.3 @@ -13,21 +13,15 @@ select first_names, last_name, user_id as p_user_id from cc_users where user_id <> :user_id and (lower(first_names) like '%$user_name%' - or lower(last_name) like '%$user_name%') and user_id in ( - select grantee_id from acs_permissions where privilege = 'create' and - object_id = :cc_package_id - ) order by first_names, last_name + or lower(last_name) like '%$user_name%') order by first_names, last_name
select first_names, last_name, user_id as p_user_id from cc_users where user_id <> :user_id - and lower(email) like '%$user_email%' and user_id in ( - select grantee_id from acs_permissions where privilege = 'create' and - object_id = :cc_package_id - ) order by email + and lower(email) like '%$user_email%' order by email @@ -36,10 +30,7 @@ select first_names, last_name, user_id as p_user_id from cc_users where user_id <> :user_id lower(first_names) like '%$user_name%' or lower(last_name) like '%$user_name%') - and lower(email) like '%$user_email%' and user_id in ( - select grantee_id from acs_permissions where privilege = 'create' and - object_id = :cc_package_id - ) order by email + and lower(email) like '%$user_email%' order by email Index: openacs-4/packages/courses/www/cc-admin/revision-list.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/courses/www/cc-admin/revision-list.tcl,v diff -u -r1.3 -r1.4 --- openacs-4/packages/courses/www/cc-admin/revision-list.tcl 3 Feb 2005 22:41:28 -0000 1.3 +++ openacs-4/packages/courses/www/cc-admin/revision-list.tcl 4 Feb 2005 23:05:53 -0000 1.4 @@ -44,9 +44,6 @@ key { label "[_ courses.course_key]" display_template { - - -       @course_list.course_key@ } } Index: openacs-4/packages/courses/www/cc-admin/watch-association.adp =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/courses/www/cc-admin/watch-association.adp,v diff -u -r1.1 -r1.2 --- openacs-4/packages/courses/www/cc-admin/watch-association.adp 2 Feb 2005 17:26:55 -0000 1.1 +++ openacs-4/packages/courses/www/cc-admin/watch-association.adp 4 Feb 2005 23:05:53 -0000 1.2 @@ -2,12 +2,11 @@ @page_title@ @context;noquote@ +

@course_key;noquote@ #courses.is_assoc#

- - - - - - -
#courses.dep_name#:@department_name;noquote@
#courses.term_name#:@term_name;noquote@
#courses.term_name#:@class_name;noquote@
#courses.class_name#:@pretty_name;noquote@
#courses.description#:@description;noquote@
+ + + + +#courses.associate_more# \ No newline at end of file Index: openacs-4/packages/courses/www/cc-admin/watch-association.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/courses/www/cc-admin/watch-association.tcl,v diff -u -r1.2 -r1.3 --- openacs-4/packages/courses/www/cc-admin/watch-association.tcl 3 Feb 2005 22:41:28 -0000 1.2 +++ openacs-4/packages/courses/www/cc-admin/watch-association.tcl 4 Feb 2005 23:05:53 -0000 1.3 @@ -1,7 +1,6 @@ ad_page_contract { - Displays a information about course_catalog(course_id) and dotlrn_class_instance - list of all revisions for one course - + Shows all associations that course_id has + @author Miguel Marin (miguelmarin@viaro.net) @author Viaro Networks www.viaro.net @creation date 28-01-2005 @@ -19,8 +18,6 @@ # Check if users has admin permission to edit course_catalog permission::require_permission -party_id $user_id -object_id $course_id -privilege "admin" +set inlcludes "" +db_multirow relations relation { } -set class_id [course_catalog::has_relation -course_id $course_id] - -db_1row get_class_info { } - Index: openacs-4/packages/courses/www/cc-admin/watch-association.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/courses/www/cc-admin/watch-association.xql,v diff -u -r1.1 -r1.2 --- openacs-4/packages/courses/www/cc-admin/watch-association.xql 2 Feb 2005 17:26:55 -0000 1.1 +++ openacs-4/packages/courses/www/cc-admin/watch-association.xql 4 Feb 2005 23:05:53 -0000 1.2 @@ -9,4 +9,11 @@ + + + select object_id_two as class_id from acs_rels + where object_id_one = :course_id + + + \ No newline at end of file