Index: openacs-4/packages/courses/courses.info =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/courses/courses.info,v diff -u -r1.4 -r1.5 --- openacs-4/packages/courses/courses.info 8 Feb 2005 23:07:51 -0000 1.4 +++ openacs-4/packages/courses/courses.info 9 Feb 2005 22:54:02 -0000 1.5 @@ -8,13 +8,13 @@ t courses - + Miguel Marin 2005-02-02 Viaro Networks 0 - + 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.6 -r1.7 --- openacs-4/packages/courses/catalog/courses.en_US.ISO-8859-1.xml 8 Feb 2005 23:07:51 -0000 1.6 +++ openacs-4/packages/courses/catalog/courses.en_US.ISO-8859-1.xml 9 Feb 2005 22:54:02 -0000 1.7 @@ -1,6 +1,7 @@ - + + and has Assessment Associate Associate this course @@ -11,6 +12,7 @@ Class Name Community Name: Community + Confirm Delete Of Course Administration Course Catalog Index Course Info: @@ -19,30 +21,39 @@ Course Name: Courses Create a new version of + Delete + Delete Course + Delete This Course Department Name Description + Do you Still want to delete it? DotLRN DotLRN Classes DotLRN Communities DotLRN List New Course Version Email: + Enroll Grant Grant List Grant Permissions Grant permissions to other users Granted + Grant/Revoke + and has No associations to dotLRN class or community + has one association to dotLRN class or community is associated to: Check/uncheck all rows Make This Course Live Manage Permissions - Name Already Taken + <b>The course key is already taken</b> New Course New Course Version No Not Allowed Not Associate Not Associated + One Course Information Permission: Revision List Revisions @@ -57,10 +68,14 @@ See All Versions Subject Name Term Name + This course has Check/uncheck this row, and select an action to perform below To + associations to dotLRN classes or communities User Name: users to grant permissions that match that search + Version + Versions Watch Watch Association Yes Index: openacs-4/packages/courses/lib/course-chunk.adp =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/courses/lib/course-chunk.adp,v diff -u -r1.1 -r1.2 --- openacs-4/packages/courses/lib/course-chunk.adp 8 Feb 2005 23:08:42 -0000 1.1 +++ openacs-4/packages/courses/lib/course-chunk.adp 9 Feb 2005 22:54:02 -0000 1.2 @@ -32,29 +32,42 @@ #courses.no# - + (#courses.associate#) - #courses.yes# (#courses.watch#) + + #courses.yes# (#courses.watch#) + + + #courses.yes# (#courses.watch#) + - - + + + #courses.enroll# + - + + + + + + - #courses.manage_per# + #courses.manage_per# + #courses.delete# - +
Index: openacs-4/packages/courses/lib/course-chunk.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/courses/lib/course-chunk.tcl,v diff -u -r1.1 -r1.2 --- openacs-4/packages/courses/lib/course-chunk.tcl 8 Feb 2005 23:08:42 -0000 1.1 +++ openacs-4/packages/courses/lib/course-chunk.tcl 9 Feb 2005 22:54:02 -0000 1.2 @@ -8,3 +8,10 @@ } set dotlrn_url [dotlrn::get_url] +if { ![info exists index] } { + set index "" +} + +if { ![info exists asmid] } { + set asmid "-1" +} \ No newline at end of file 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.5 -r1.6 --- openacs-4/packages/courses/tcl/course-procs.tcl 8 Feb 2005 23:07:52 -0000 1.5 +++ openacs-4/packages/courses/tcl/course-procs.tcl 9 Feb 2005 22:54:02 -0000 1.6 @@ -154,15 +154,12 @@ } ad_proc -private course_catalog::delete_relation { - -course_id:required + -rel_id:required } { - Deletes the relation of course_catalog and dotrln class - @course_id The id of the object_id_one + Deletes the relation of course_catalog and dotrln class or community + @rel_id The id of the realtion } { - set rel_id [course_catalog::has_relation_rel_id -course_id $course_id] - if { ![string equal $rel_id "0"] } { - db_exec_plsql remove_relation { } - } + db_exec_plsql remove_relation { } } ad_proc -private course_catalog::grant_permissions { @@ -205,4 +202,30 @@ permission::revoke -party_id $party_id -object_id $assessment_id -privilege "admin" } } +} + +ad_proc -private course_catalog::check_rev_assoc { + -item_id:required +} { + Returns a list with number of revisions, number of associations to item_id + @item_id@ The item_id to check +} { + set rev_num [db_string revision_count { } -default 0] + set assoc_num [db_string association_count { } -default 0] + set return_list [list] + lappend return_list $rev_num + lappend return_list $assoc_num + return $return_list +} + +ad_proc -private course_catalog::course_delete { + -item_id:required +} { + Deletes item_id and all the associations to that item_id (revisions, relations) + @item_id@ The item_id to delete +} { + db_foreach relation { } { + course_catalog::delete_relation -rel_id $rel_id + } + content::item::delete -item_id $item_id } \ No newline at end of file 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.5 -r1.6 --- openacs-4/packages/courses/tcl/course-procs.xql 8 Feb 2005 23:07:52 -0000 1.5 +++ openacs-4/packages/courses/tcl/course-procs.xql 9 Feb 2005 22:54:02 -0000 1.6 @@ -113,9 +113,24 @@ + + + select count(revision_id) from cr_revisions where item_id = :item_id + + - + + + select count(rel_id) from acs_rels where object_id_one in ( + select revision_id from cr_revisions where item_id = :item_id ) + + + + + select rel_id from acs_rels where object_id_one in ( + select revision_id from cr_revisions where item_id = :item_id ) + + - - + Index: openacs-4/packages/courses/www/course-info.adp =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/courses/www/course-info.adp,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/courses/www/course-info.adp 9 Feb 2005 22:54:41 -0000 1.1 @@ -0,0 +1,6 @@ + +@page_title@ +@context;noquote@ +
+ + Index: openacs-4/packages/courses/www/course-info.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/courses/www/course-info.tcl,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/courses/www/course-info.tcl 9 Feb 2005 22:54:41 -0000 1.1 @@ -0,0 +1,23 @@ +ad_page_contract { + Displays information of one course + @author Miguel Marin (miguelmarin@viaro.net) + @author Viaro Networks www.viaro.net + @creation-date 09-02-2005 +} { + course_id:notnull + course_key:notnull + course_name:notnull +} +set page_title "$course_key [_ courses.course_info]" +set context [list "[_ courses.one_course_info]"] + +set return_url "index" +set asm_package_id [apm_package_id_from_key assessment] + +db_1row get_course_info { } + +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] + Index: openacs-4/packages/courses/www/course-info.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/courses/www/course-info.xql,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/courses/www/course-info.xql 9 Feb 2005 22:54:41 -0000 1.1 @@ -0,0 +1,23 @@ + + + + + + select cc.course_info, cc.assessment_id, cr.item_id + from course_catalog cc, cr_revisions cr + where cr.revision_id = :course_id and cc.course_id = :course_id + + + + + + select cr.title from + cr_folders cf, cr_items ci, cr_revisions cr, as_assessments a + where cr.revision_id = ci.latest_revision and a.assessment_id = cr.revision_id and + ci.parent_id = cf.folder_id and cf.package_id = :asm_package_id and + ci.item_id = :assessment_id order by cr.title + + + + + \ No newline at end of file Index: openacs-4/packages/courses/www/index.adp =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/courses/www/index.adp,v diff -u -r1.3 -r1.4 --- openacs-4/packages/courses/www/index.adp 8 Feb 2005 23:07:52 -0000 1.3 +++ openacs-4/packages/courses/www/index.adp 9 Feb 2005 22:54:02 -0000 1.4 @@ -4,3 +4,8 @@
+ + + @course_list.course_key@ ---> @course_list.course_name@ +
+
\ No newline at end of file Index: openacs-4/packages/courses/www/index.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/courses/www/index.tcl,v diff -u -r1.4 -r1.5 --- openacs-4/packages/courses/www/index.tcl 8 Feb 2005 23:07:52 -0000 1.4 +++ openacs-4/packages/courses/www/index.tcl 9 Feb 2005 22:54:02 -0000 1.5 @@ -19,4 +19,6 @@ set create_p 1 } else { set create_p 0 -} \ No newline at end of file +} + +db_multirow course_list get_course_list { } \ No newline at end of file Index: openacs-4/packages/courses/www/index.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/courses/www/index.xql,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/courses/www/index.xql 9 Feb 2005 22:54:41 -0000 1.1 @@ -0,0 +1,12 @@ + + + + + + select cc.course_id, cc.course_key, cc.course_name, cc.course_info, cc.assessment_id, ci.item_id + from course_catalog cc, cr_items ci + where cc.course_id = ci.live_revision + + + + \ No newline at end of file Index: openacs-4/packages/courses/www/cc-admin/add-edit-course.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/courses/www/cc-admin/Attic/add-edit-course.tcl,v diff -u -r1.5 -r1.6 --- openacs-4/packages/courses/www/cc-admin/add-edit-course.tcl 8 Feb 2005 23:07:53 -0000 1.5 +++ openacs-4/packages/courses/www/cc-admin/add-edit-course.tcl 9 Feb 2005 22:54:02 -0000 1.6 @@ -109,7 +109,6 @@ permission::grant -party_id $user_id -object_id $item_id -privilege "admin" } -edit_data { - # New revision in the CR set folder_id [course_catalog::get_folder_id] set item_id [course_catalog::get_item_id -revision_id $course_id] Index: openacs-4/packages/courses/www/cc-admin/course-delete.adp =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/courses/www/cc-admin/course-delete.adp,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/courses/www/cc-admin/course-delete.adp 9 Feb 2005 22:54:41 -0000 1.1 @@ -0,0 +1,27 @@ + +@page_title@ +@context;noquote@ +
+#courses.this_course# @rev_num@ + + #courses.version# + + + #courses.versions# + + + + #courses.has_no# + + + + #courses.and_has_one# + + + #courses.and_has# @assoc_num@ #courses.to_dotlrn# + + +
+#courses.do_you_still# +

+ \ No newline at end of file Index: openacs-4/packages/courses/www/cc-admin/course-delete.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/courses/www/cc-admin/course-delete.tcl,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/courses/www/cc-admin/course-delete.tcl 9 Feb 2005 22:54:41 -0000 1.1 @@ -0,0 +1,28 @@ +ad_page_contract { + Displays a delete confirmation message and deletes the course + @author Miguel Marin (miguelmarin@viaro.net) + @author Viaro Networks www.viaro.net + @creation-date 09-02-2005 +} { + object_id:notnull + course_key:notnull + creation_user:notnull +} + +set user_id [ad_conn user_id] +set page_title "[_ courses.confirm_delete] $course_key" +set context [list [list course-list "[_ courses.course_list]"] "[_ courses.delete_course]"] + +set rev_assoc [course_catalog::check_rev_assoc -item_id $object_id] +set rev_num [lindex $rev_assoc 0] +set assoc_num [lindex $rev_assoc 1] + +ad_form -name delete_course -export {course_key $course_key creation_user $creation_user } -cancel_url "course-list" -form { + {object_id:text(hidden) + { value $object_id } + } +} -on_submit { + course_catalog::course_delete -item_id $object_id +} -after_submit { + ad_returnredirect "course-list" +} \ No newline at end of file Index: openacs-4/packages/courses/www/cc-admin/course-list.adp =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/courses/www/cc-admin/course-list.adp,v diff -u -r1.2 -r1.3 --- openacs-4/packages/courses/www/cc-admin/course-list.adp 8 Feb 2005 23:07:53 -0000 1.2 +++ openacs-4/packages/courses/www/cc-admin/course-list.adp 9 Feb 2005 22:54:02 -0000 1.3 @@ -1,7 +1,7 @@ @page_title@ @context;noquote@ -#courses.new_course# + #courses.new_course# | #courses.grant_per# Index: openacs-4/packages/courses/www/cc-admin/course-list.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/courses/www/cc-admin/course-list.xql,v diff -u -r1.2 -r1.3 --- openacs-4/packages/courses/www/cc-admin/course-list.xql 2 Feb 2005 23:01:00 -0000 1.2 +++ openacs-4/packages/courses/www/cc-admin/course-list.xql 9 Feb 2005 22:54:02 -0000 1.3 @@ -3,10 +3,10 @@ - select course_id, course_key, course_name, course_info, assessment_id, item_id - from course_catalog, cr_items - where course_id = live_revision and - item_id in ( + select cc.course_id, cc.course_key, cc.course_name, cc.course_info, cc.assessment_id, ci.item_id + from course_catalog cc, cr_items ci + where cc.course_id = ci.live_revision and + ci.item_id in ( select object_id from acs_permissions where grantee_id = :user_id and privilege = 'admin') @@ -15,9 +15,9 @@ - select course_id, course_key, course_name, course_info, assessment_id - from course_catalog, cr_items - where course_id = live_revision + select cc.course_id, cc.course_key, cc.course_name, cc.course_info, cc.assessment_id, ci.item_id + from course_catalog cc, cr_items ci + where cc.course_id = ci.live_revision Index: openacs-4/packages/courses/www/cc-admin/revision-list.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/courses/www/cc-admin/revision-list.xql,v diff -u -r1.2 -r1.3 --- openacs-4/packages/courses/www/cc-admin/revision-list.xql 8 Feb 2005 23:07:53 -0000 1.2 +++ openacs-4/packages/courses/www/cc-admin/revision-list.xql 9 Feb 2005 22:54:02 -0000 1.3 @@ -3,10 +3,10 @@ - select course_id, course_key, course_name, course_info, assessment_id, live_revision - from course_catalog, cr_items - where item_id = :item_id and - course_id in (select revision_id from cr_revisions where item_id = :item_id ) + select cc.course_id, cc.course_key, cc.course_name, cc.course_info, cc.assessment_id, ci.live_revision + from course_catalog cc, cr_items ci + where ci.item_id = :item_id and + cc.course_id in (select revision_id from cr_revisions where item_id = :item_id ) 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.4 -r1.5 --- openacs-4/packages/courses/www/cc-admin/watch-association.tcl 8 Feb 2005 23:07:53 -0000 1.4 +++ openacs-4/packages/courses/www/cc-admin/watch-association.tcl 9 Feb 2005 22:54:02 -0000 1.5 @@ -8,15 +8,23 @@ { return_url "" } course_id:notnull course_key:notnull + { course_name "" } } -set page_title "[_ courses.watch_assoc]" -set context [list [list course-list "[_ courses.course_list]"] "[_ courses.watch_assoc]"] +if { [string equal $return_url "index"] } { + set context [list [list ../course-info?course_id=$course_id&course_key=$course_key&course_name=$course_name "[_ courses.one_course_info]"] "[_ courses.watch_assoc]"] +} else { + set context [list [list course-list "[_ courses.course_list]"] "[_ courses.watch_assoc]"] +} +set page_title "[_ courses.watch_assoc]" set user_id [ad_conn user_id] -# Check if users has admin permission to edit course_catalog -permission::require_permission -party_id $user_id -object_id $course_id -privilege "admin" +# Allows that an unregiser user watch this page +if { ![string equal $user_id "0"] } { + # Check if users has admin permission to edit course_catalog + permission::require_permission -party_id $user_id -object_id $course_id -privilege "admin" +} db_multirow relations relation { }