Index: openacs-4/packages/courses/www/cc-admin/course-list.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/courses/www/cc-admin/course-list.tcl,v diff -u -r1.3 -r1.4 --- openacs-4/packages/courses/www/cc-admin/course-list.tcl 3 Feb 2005 22:41:28 -0000 1.3 +++ openacs-4/packages/courses/www/cc-admin/course-list.tcl 8 Feb 2005 23:07:53 -0000 1.4 @@ -7,11 +7,18 @@ } -set user_id [auth::get_user_id] +set user_id [ad_conn user_id] set context [list "[_ courses.course_list]"] set page_title "[_ courses.course_list]" -set return_url "/courses/cc-admin/course-list" +set return_url "course-list" +set cc_package_id [apm_package_id_from_key "courses"] +if {[permission::permission_p -party_id $user_id -object_id $cc_package_id -privilege "admin"]} { + set admin_p 1 +} else { + set admin_p 0 +} + set asm_package_id [apm_package_id_from_key assessment] if { [acs_user::site_wide_admin_p] } { @@ -21,56 +28,10 @@ } -db_multirow -extend { asm_name rel } course_list $query {} { +db_multirow -extend { asm_name rel item_id creation_user } course_list $query {} { set asm_name [db_string get_asm_name { } -default "[_ courses.not_associated]"] + set item_id [course_catalog::get_item_id -revision_id $course_id] + set creation_user [course_catalog::get_creation_user -object_id $item_id] set rel [course_catalog::has_relation -course_id $course_id] } -template::list::create \ - -name course_list \ - -multirow course_list \ - -key course_id \ - -bulk_action_method post \ - -bulk_action_export_vars { - }\ - -row_pretty_plural "[_ courses.courses]" \ - -elements { - key { - label "[_ courses.course_key]" - display_template { - \ - - @course_list.course_key@ - } - } - name { - label "[_ courses.course_name]" - display_template { - @course_list.course_name@ - } - } - info { - label "[_ courses.course_info]" - display_template { - @course_list.course_info@ - } - } - assessment_id { - label "[_ courses.asm]:" - display_template { - @course_list.asm_name@ - } - } - dotlrn { - label "[_ courses.dotlrn]" - display_template { - - #courses.no# (#courses.associate#) - - - #courses.yes# (#courses.watch#) - - } - } - } \ No newline at end of file