Index: openacs-4/packages/curriculum/www/remove-from-bar.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/curriculum/www/remove-from-bar.tcl,v diff -u -r1.1 -r1.2 --- openacs-4/packages/curriculum/www/remove-from-bar.tcl 3 Jun 2003 10:40:53 -0000 1.1 +++ openacs-4/packages/curriculum/www/remove-from-bar.tcl 10 Jun 2003 09:30:07 -0000 1.2 @@ -7,7 +7,7 @@ @cvs-id $Id$ } { - curriculum_id + curriculum_id:integer,optional {return_url "."} } @@ -17,14 +17,25 @@ # "cu_user_curriculum_map", which holds the row(s) the user DOESN'T want. if [set user_id [ad_conn user_id]] { + + if { [info exists curriculum_id] } { - db_transaction { + # Just remove the this one curriculum. db_dml user_curriculum_map_insert {*SQL*} - # Force the bat to update. - curriculum::elements_flush + } else { + + db_foreach desired_curriculums {*SQL*} { + db_dml user_curriculum_map_insert {*SQL*} + } if_no_rows { + # Don't do a thing! + } + } + # Force the bar to update. + curriculum::elements_flush + } ns_returnredirect $return_url