Index: openacs-4/packages/dotlrn-calendar/tcl/dotlrn-calendar-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/dotlrn-calendar/tcl/dotlrn-calendar-procs.tcl,v diff -u -r1.52 -r1.53 --- openacs-4/packages/dotlrn-calendar/tcl/dotlrn-calendar-procs.tcl 13 May 2002 06:00:06 -0000 1.52 +++ openacs-4/packages/dotlrn-calendar/tcl/dotlrn-calendar-procs.tcl 14 May 2002 21:42:16 -0000 1.53 @@ -202,7 +202,8 @@ -object_id $group_calendar_id \ -privilege "read" - return $group_calendar_id + # this should return the package_id + return $package_id } ad_proc -public remove_applet_from_community { @@ -317,13 +318,16 @@ } { Remove a user entirely } { - # FIXME remove the mapping?? - set workspace_portal_id [dotlrn::get_workspace_portal_id $user_id] + # FIXME - not tested + set portal_id [dotlrn::get_workspace_portal_id $user_id] set calendar_id [calendar_have_private_p -return_id 1 $user_id] - calendar_portlet::remove_self_from_page $workspace_portal_id $calendar_id + set args [ns_set create args] + ns_set put $args user_id $user_id + ns_set put $args calendar_id $calendar_id + set list_args [list $portal_id $args] - calendar_full_portlet::remove_self_from_page $workspace_portal_id $calendar_id + remove_portlet $portal_id $args } ad_proc -public add_user_to_community { @@ -350,11 +354,16 @@ } { Remove a user from a community } { - set g_cal_id [get_group_calendar_id -community_id $community_id] - set workspace_portal_id [dotlrn::get_workspace_portal_id $user_id] + set portal_id [dotlrn::get_workspace_portal_id $user_id] + set calendar_id [get_group_calendar_id -community_id $community_id] - calendar_portlet::remove_self_from_page $workspace_portal_id $g_cal_id - calendar_full_portlet::remove_self_from_page $workspace_portal_id $g_cal_id + set args [ns_set create args] + ns_set put $args user_id $user_id + ns_set put $args community_id $community_id + ns_set put $args calendar_id $calendar_id + set list_args [list $portal_id $args] + + remove_portlet $portal_id $args } ad_proc -public add_portlet { @@ -370,15 +379,30 @@ } ad_proc -public remove_portlet { + portal_id args } { A helper proc to remove the underlying portlet from the given portal. - @param args a list-ified array of args defined in remove_applet_from_community - } { - ns_log notice "** Error in [get_pretty_name]: 'remove_portlet' not implemented!" - ad_return_complaint 1 "Please notifiy the administrator of this error: - ** Error in [get_pretty_name]: 'remove_portlet' not implemented!" + @param portal_id + @param args A list of key-value pairs (possibly user_id, community_id, and more) + } { + set user_id [ns_set get $args "user_id"] + set community_id [ns_set get $args "community_id"] + + if {![empty_string_p $user_id]} { + # the portal_id is a user's portal + set calendar_id [ns_set get $args "calendar_id"] + } elseif {![empty_string_p $community_id]} { + # the portal_id is a community portal + ad_return_complaint 1 "dotlrn_calendar aks1 unimplimented" + } else { + # the portal_id is a portal template + ad_return_complaint 1 "dotlrn_calendar aks2 unimplimented" + } + + calendar_portlet::remove_self_from_page $portal_id $calendar_id + calendar_full_portlet::remove_self_from_page $portal_id $calendar_id } ad_proc -public clone {