Index: openacs-4/packages/dotlrn-catalog/catalog/dotlrn-catalog.en_US.ISO-8859-1.xml =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/dotlrn-catalog/catalog/dotlrn-catalog.en_US.ISO-8859-1.xml,v diff -u -r1.8 -r1.9 --- openacs-4/packages/dotlrn-catalog/catalog/dotlrn-catalog.en_US.ISO-8859-1.xml 19 Feb 2005 03:43:11 -0000 1.8 +++ openacs-4/packages/dotlrn-catalog/catalog/dotlrn-catalog.en_US.ISO-8859-1.xml 3 Mar 2005 22:32:16 -0000 1.9 @@ -1,6 +1,7 @@ + Actions Add this course to one category. Admin Manage Category Tree Index: openacs-4/packages/dotlrn-catalog/tcl/dotlrn-catalog-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/dotlrn-catalog/tcl/dotlrn-catalog-procs.tcl,v diff -u -r1.3 -r1.4 --- openacs-4/packages/dotlrn-catalog/tcl/dotlrn-catalog-procs.tcl 22 Feb 2005 14:54:40 -0000 1.3 +++ openacs-4/packages/dotlrn-catalog/tcl/dotlrn-catalog-procs.tcl 3 Mar 2005 22:33:36 -0000 1.4 @@ -240,3 +240,36 @@ } return $return_list } + +ad_proc -private dotlrn_catalog::get_categories_widget { +} { + Returns a list of all objects associated to one category under the dotlrn catalog tree_id + @tree_id@ The tree_id that holds the objects +} { + set return_list "" + set name "" + set cc_package_id [apm_package_id_from_key "dotlrn-catalog"] + + # The tree id from categories + set tree_list [category_tree::get_mapped_trees $cc_package_id] + if { [string equal [lindex [lindex $tree_list 0] 1] "dotlrn-course-catalog"] } { + set tree_id [lindex [lindex $tree_list 0] 0] + } else { + set tree_id "" + } + + + set categories [category_tree::get_tree $tree_id] + + foreach cat $categories { + set name "" + set j [lindex $cat 3] + for { set i 0} { $i < $j } {incr i} { + append name "." + } + append name " [lindex $cat 1]" + lappend return_list [list $name [lindex $cat 0]] + } + + return $return_list +} Index: openacs-4/packages/dotlrn-catalog/www/dt-admin/course-add-edit.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/dotlrn-catalog/www/dt-admin/course-add-edit.tcl,v diff -u -r1.6 -r1.7 --- openacs-4/packages/dotlrn-catalog/www/dt-admin/course-add-edit.tcl 22 Feb 2005 14:54:40 -0000 1.6 +++ openacs-4/packages/dotlrn-catalog/www/dt-admin/course-add-edit.tcl 3 Mar 2005 22:32:16 -0000 1.7 @@ -24,6 +24,7 @@ set user_id [ad_conn user_id] set cc_package_id [apm_package_id_from_key "dotlrn-catalog"] + # Check for create permissions over dotlrn-catalog package permission::require_permission -party_id $user_id -object_id $cc_package_id -privilege "create" @@ -90,9 +91,10 @@ ad_form -extend -name add_course -form $elements ad_form -extend -name add_course -form { - {category_ids:integer(category),multiple,optional + {category_ids:integer(multiselect),multiple,optional {label "[_ dotlrn-catalog.categories]"} {html {size 4}} + {options [dotlrn_catalog::get_categories_widget]} {value "-1"} } } @@ -140,6 +142,13 @@ if { ![string equal $category_ids "-1"] } { category::map_object -object_id $course_id $category_ids } + + if { [string equal $return_url "course-list"] } { + set return_url "$return_url" + } else { + set return_url "$return_url?course_id=$course_id&course_name=$course_name&course_key=$course_key&index=$index" + } + } -new_request { set context [list [list course-list "[_ dotlrn-catalog.course_list]"] "[_ dotlrn-catalog.new_course]"] set page_title "[_ dotlrn-catalog.new_course]" @@ -149,7 +158,7 @@ set page_title "[_ dotlrn-catalog.edit_course]" db_1row get_course_info { } db_string get_course_assessment { } -default "[_ dotlrn-catalog.not_associated]" - set return_url "$return_url?course_id=$course_id&course_name=$course_name&course_key=$course_key&index=$index" + set category_ids [category::get_mapped_categories $course_id] } -after_submit { ad_returnredirect "$return_url" } Index: openacs-4/packages/dotlrn-catalog/www/dt-admin/course-list.adp =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/dotlrn-catalog/www/dt-admin/course-list.adp,v diff -u -r1.6 -r1.7 --- openacs-4/packages/dotlrn-catalog/www/dt-admin/course-list.adp 23 Feb 2005 20:35:47 -0000 1.6 +++ openacs-4/packages/dotlrn-catalog/www/dt-admin/course-list.adp 3 Mar 2005 22:32:16 -0000 1.7 @@ -10,10 +10,8 @@ } -#dotlrn-catalog.new_course# - - | #dotlrn-catalog.admin_categories# + #dotlrn-catalog.admin_categories# | #dotlrn-catalog.grant_per# @@ -27,6 +25,10 @@
- +
+#dotlrn-catalog.new_course# + + + Index: openacs-4/packages/dotlrn-catalog/www/dt-admin/course-list.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/dotlrn-catalog/www/dt-admin/course-list.tcl,v diff -u -r1.7 -r1.8 --- openacs-4/packages/dotlrn-catalog/www/dt-admin/course-list.tcl 23 Feb 2005 20:35:47 -0000 1.7 +++ openacs-4/packages/dotlrn-catalog/www/dt-admin/course-list.tcl 3 Mar 2005 22:32:16 -0000 1.8 @@ -67,9 +67,6 @@ label "[_ dotlrn-catalog.course_key]" display_template {
- \ - @course_list.course_key@
} @@ -118,11 +115,25 @@ \#dotlrn-catalog.manage_per\# } } - delete { + view { + label "[_ dotlrn-catalog.versions]" + display_template { - + [_ dotlrn-catalog.versions] } + } + actions { + + label "[_ dotlrn-catalog.admin] [_ dotlrn-catalog.Actions]" + display_template { +
+ + +
+ } + } } db_multirow -extend { asm_name rel item_id creation_user category_name } course_list $query {} { Index: openacs-4/packages/dotlrn-catalog/www/dt-admin/revision-list.adp =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/dotlrn-catalog/www/dt-admin/revision-list.adp,v diff -u -r1.3 -r1.4 --- openacs-4/packages/dotlrn-catalog/www/dt-admin/revision-list.adp 21 Feb 2005 19:22:13 -0000 1.3 +++ openacs-4/packages/dotlrn-catalog/www/dt-admin/revision-list.adp 3 Mar 2005 22:32:16 -0000 1.4 @@ -2,7 +2,13 @@ @page_title@ @context;noquote@ + + +
+
+
+
Index: openacs-4/packages/dotlrn-catalog/www/dt-admin/revision-list.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/dotlrn-catalog/www/dt-admin/revision-list.tcl,v diff -u -r1.2 -r1.3 --- openacs-4/packages/dotlrn-catalog/www/dt-admin/revision-list.tcl 22 Feb 2005 14:54:40 -0000 1.2 +++ openacs-4/packages/dotlrn-catalog/www/dt-admin/revision-list.tcl 3 Mar 2005 22:32:16 -0000 1.3 @@ -35,4 +35,8 @@ set asm_name [db_string get_asm_name { } -default "[_ dotlrn-catalog.not_associated]"] set rel [dotlrn_catalog::has_relation -course_id $course_id] } +db_multirow -extend { asm_name rel } live_course get_live_course { } { + set asm_name [db_string get_asm_name { } -default "[_ dotlrn-catalog.not_associated]"] + set rel [dotlrn_catalog::has_relation -course_id $course_id] +} Index: openacs-4/packages/dotlrn-catalog/www/dt-admin/revision-list.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/dotlrn-catalog/www/dt-admin/revision-list.xql,v diff -u -r1.2 -r1.3 --- openacs-4/packages/dotlrn-catalog/www/dt-admin/revision-list.xql 22 Feb 2005 14:54:40 -0000 1.2 +++ openacs-4/packages/dotlrn-catalog/www/dt-admin/revision-list.xql 3 Mar 2005 22:32:16 -0000 1.3 @@ -6,10 +6,23 @@ select dc.course_id, dc.course_key, dc.course_name, dc.course_info, dc.assessment_id, ci.live_revision from dotlrn_catalog dc, cr_items ci where ci.item_id = :item_id and - dc.course_id in (select revision_id from cr_revisions where item_id = :item_id ) + dc.course_id in (select revision_id from cr_revisions where item_id = :item_id ) + and ci.live_revision <> dc.course_id order by dc.course_id asc + + + + select dc.course_id, dc.course_key, dc.course_name, dc.course_info, dc.assessment_id, ci.live_revision + from dotlrn_catalog dc, cr_items ci + where ci.item_id = :item_id and + dc.course_id in (select revision_id from cr_revisions where item_id = :item_id ) + and ci.live_revision=dc.course_id + + + + select cr.title from