Index: openacs-4/packages/dotlrn-bboard/tcl/dotlrn-bboard-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/dotlrn-bboard/tcl/dotlrn-bboard-procs.tcl,v diff -u -N -r1.30 -r1.31 --- openacs-4/packages/dotlrn-bboard/tcl/dotlrn-bboard-procs.tcl 16 Apr 2002 13:57:07 -0000 1.30 +++ openacs-4/packages/dotlrn-bboard/tcl/dotlrn-bboard-procs.tcl 30 Apr 2002 21:34:33 -0000 1.31 @@ -157,30 +157,42 @@ } { Add a user to a specific dotlrn community } { - # Get the portal_id by callback - set portal_id [dotlrn_community::get_portal_id $community_id $user_id] - # Get the package_id by callback - set package_id [dotlrn_community::get_applet_package_id $community_id dotlrn_bboard] + set package_id [dotlrn_community::get_applet_package_id \ + $community_id \ + dotlrn_bboard + ] - # Allow user to see the bboard forums - # nothing for now + # Get the personal per comm portal_id by callback + set portal_id [dotlrn_community::get_portal_id $community_id $user_id] - # Make bboard DS available to this page - bboard_portlet::make_self_available $portal_id + if {[exists_and_not_null $portal_id]} { + # we have personal per comm portals - # Call the portal element to be added correctly - set element_id [bboard_portlet::add_self_to_page $portal_id $package_id] + # Make bboard DS available to this page + bboard_portlet::make_self_available $portal_id + + # Call the portal element to be added correctly + set element_id [bboard_portlet::add_self_to_page \ + $portal_id \ + $package_id + ] - # Make sure that the group name is not displayed here - portal::set_element_param $element_id "display_group_name_p" "f" - + # Make sure that the group name is not displayed here + portal::set_element_param $element_id \ + "display_group_name_p" \ + "f" + } + # Now for the user workspace set workspace_portal_id [dotlrn::get_workspace_portal_id $user_id] # Add the portlet here - if { $workspace_portal_id != "" } { - set element_id [bboard_portlet::add_self_to_page $workspace_portal_id $package_id] + if {[exists_and_not_null $workspace_portal_id]} { + set element_id [bboard_portlet::add_self_to_page \ + $workspace_portal_id \ + $package_id + ] # Make sure that the group name IS displayed here portal::set_element_param $element_id "display_group_name_p" "t" 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 -N -r1.42 -r1.43 --- openacs-4/packages/dotlrn-calendar/tcl/dotlrn-calendar-procs.tcl 16 Apr 2002 13:57:07 -0000 1.42 +++ openacs-4/packages/dotlrn-calendar/tcl/dotlrn-calendar-procs.tcl 30 Apr 2002 21:34:33 -0000 1.43 @@ -199,12 +199,14 @@ return $group_calendar_id } - ad_proc -public remove_applet { + ad_proc -public remove_applet_from_community { community_id package_id } { remove the applet from the community } { + ad_return_complaint 1 "aks1" + # XXX # Remove all instances of the calendar portlet! (this is some @@ -269,46 +271,38 @@ } { Add a user to a community } { - # Get the portal_id by callback + + # Get the user per comm portal_id by callback set portal_id [dotlrn_community::get_portal_id $community_id $user_id] - # get the group_calendar_id by callback - set g_cal_id [portal::get_element_param \ - [lindex [portal::get_element_ids_by_ds \ - [portal::get_portal_template_id $portal_id] \ - [calendar_portlet::my_name]] 0] \ - "calendar_id"] + if { [exists_and_not_null $portal_id] } { + # get the group_calendar_id by callback + set g_cal_id [portal::get_element_param \ + [lindex [portal::get_element_ids_by_ds \ + [portal::get_portal_template_id $portal_id] \ + [calendar_portlet::my_name]] 0] \ + "calendar_id"] - # Make the calendar DS available to this page - calendar_portlet::make_self_available $portal_id + # Make the calendar DS available to this page + calendar_portlet::make_self_available $portal_id - # Call the portal element to be added correctly - calendar_portlet::add_self_to_page \ - $portal_id $g_cal_id + # Call the portal element to be added correctly + calendar_portlet::add_self_to_page $portal_id $g_cal_id + } - # Now for the user workspace # set this calendar_id in the workspace portal set workspace_portal_id [dotlrn::get_workspace_portal_id $user_id] # get the comm's calendar_id, and add it as a param to the # ws portal's calendar portal element - if { $workspace_portal_id != "" } { + if { [exists_and_not_null $workspace_portal_id] } { calendar_portlet::add_self_to_page $workspace_portal_id $g_cal_id - calendar_full_portlet::add_self_to_page $workspace_portal_id $g_cal_id + calendar_full_portlet::add_self_to_page \ + $workspace_portal_id \ + $g_cal_id } - - # Ben's fix: we do NOT assign permissions individually - # This means I have to go fix the way permissions are assigned - # at applet creation time (ben) - # - # aks debug - # ns_log notice "aks13 $user_id $g_cal_id calendar_read" - # ad_permission_grant $user_id $g_cal_id calendar_read - # ad_permission_grant $user_id $g_cal_id calendar_show - # ns_log notice "aks14 read + show granted to user $user_id and cal $g_cal_id" - } ad_proc -public remove_user { Index: openacs-4/packages/dotlrn-dotlrn/tcl/dotlrn-dotlrn-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/dotlrn-dotlrn/tcl/dotlrn-dotlrn-procs.tcl,v diff -u -N -r1.19 -r1.20 --- openacs-4/packages/dotlrn-dotlrn/tcl/dotlrn-dotlrn-procs.tcl 16 Apr 2002 13:57:07 -0000 1.19 +++ openacs-4/packages/dotlrn-dotlrn/tcl/dotlrn-dotlrn-procs.tcl 30 Apr 2002 21:34:33 -0000 1.20 @@ -117,12 +117,10 @@ # Get the portal_id by callback set portal_id [dotlrn_community::get_portal_id $community_id $user_id] - # Allow user to see the dotlrn forums - # nothing for now - - # Make dotlrn DS available to this page - dotlrn_portlet::make_self_available $portal_id - dotlrn_portlet::add_self_to_page $portal_id $community_id + if { [exists_and_not_null $portal_id] } { + dotlrn_portlet::make_self_available $portal_id + dotlrn_portlet::add_self_to_page $portal_id $community_id + } } ad_proc -public remove_user { Index: openacs-4/packages/dotlrn-faq/tcl/dotlrn-faq-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/dotlrn-faq/tcl/dotlrn-faq-procs.tcl,v diff -u -N -r1.24 -r1.25 --- openacs-4/packages/dotlrn-faq/tcl/dotlrn-faq-procs.tcl 16 Apr 2002 13:57:07 -0000 1.24 +++ openacs-4/packages/dotlrn-faq/tcl/dotlrn-faq-procs.tcl 30 Apr 2002 21:35:52 -0000 1.25 @@ -130,26 +130,28 @@ } { Called when a user is added to a specific dotlrn community } { + # Get the faq applet's package_id by callback + set package_id [dotlrn_community::get_applet_package_id \ + $community_id \ + dotlrn_faq + ] + # Get the portal_id by callback set portal_id [dotlrn_community::get_portal_id $community_id $user_id] - # Get the faq applet's package_id by callback - set package_id [dotlrn_community::get_applet_package_id $community_id dotlrn_faq] + if { [exists_and_not_null $portal_id] } { + # Make faq DS available to this page + faq_portlet::make_self_available $portal_id + + # Call the portal element to be added correctly + faq_portlet::add_self_to_page $portal_id $package_id + } - # Allow user to see the faq forums - # nothing for now - - # Make faq DS available to this page - faq_portlet::make_self_available $portal_id - - # Call the portal element to be added correctly - faq_portlet::add_self_to_page $portal_id $package_id - # Now for the user workspace set workspace_portal_id [dotlrn::get_workspace_portal_id $user_id] # Add the portlet here - if { $workspace_portal_id != "" } { + if { [exists_and_not_null $workspace_portal_id] } { faq_portlet::add_self_to_page $workspace_portal_id $package_id } } Index: openacs-4/packages/dotlrn-fs/tcl/dotlrn-fs-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/dotlrn-fs/tcl/dotlrn-fs-procs.tcl,v diff -u -N -r1.52 -r1.53 --- openacs-4/packages/dotlrn-fs/tcl/dotlrn-fs-procs.tcl 30 Apr 2002 02:26:00 -0000 1.52 +++ openacs-4/packages/dotlrn-fs/tcl/dotlrn-fs-procs.tcl 30 Apr 2002 21:35:52 -0000 1.53 @@ -418,22 +418,23 @@ } { Add a user to a to a specifc dotlrn community } { - # Get the portal_id by callback - set portal_id [dotlrn_community::get_portal_id $community_id $user_id] - # Get the package_id by callback set package_id [dotlrn_community::get_applet_package_id \ $community_id \ "dotlrn_fs" \ ] - # Call the portal element to be added correctly - # fs portlet needs folder_id too - set folder_id [fs::get_root_folder -package_id $package_id] + # Get the user's per comm portal_id by callback + set portal_id [dotlrn_community::get_portal_id $community_id $user_id] - # Make file storage available at community-user page level - fs_portlet::add_self_to_page $portal_id $package_id $folder_id + if { [exists_and_not_null $portal_id] } { + # fs portlet needs folder_id too + set folder_id [fs::get_root_folder -package_id $package_id] + # Make file storage available at community-user page level + fs_portlet::add_self_to_page $portal_id $package_id $folder_id + } + # get the user's portal set portal_id [dotlrn::get_workspace_portal_id $user_id] @@ -443,9 +444,12 @@ ] # add the portlet here - if {![empty_string_p $portal_id]} { + if {[exists_and_not_null $portal_id]} { fs_portlet::add_self_to_page \ - -page_id $page_id $portal_id $package_id $folder_id + -page_id $page_id \ + $portal_id \ + $package_id \ + $folder_id } } Index: openacs-4/packages/dotlrn-news/tcl/dotlrn-news-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/dotlrn-news/tcl/dotlrn-news-procs.tcl,v diff -u -N -r1.15 -r1.16 --- openacs-4/packages/dotlrn-news/tcl/dotlrn-news-procs.tcl 16 Apr 2002 13:58:05 -0000 1.15 +++ openacs-4/packages/dotlrn-news/tcl/dotlrn-news-procs.tcl 30 Apr 2002 21:35:52 -0000 1.16 @@ -122,22 +122,27 @@ } { Add a user to a specifc dotlrn community } { + + # Get the package_id by callback + set package_id [dotlrn_community::get_applet_package_id \ + $community_id \ + dotlrn_news + ] -# ad_return_complaint 1 "$community_id $user_id" - # Get the portal_id by callback + # Get the personal per comm portal_id by callback set portal_id [dotlrn_community::get_portal_id $community_id $user_id] - # Get the package_id by callback - set package_id [dotlrn_community::get_applet_package_id $community_id dotlrn_news] + if {[exists_and_not_null $portal_id]} { + # we have personal per comm portals + # Allow user to see the news folders + # nothing for now + + # Make news DS available to this page + news_portlet::make_self_available $portal_id - # Allow user to see the news folders - # nothing for now + news_portlet::add_self_to_page $portal_id $package_id + } - # Make news DS available to this page - news_portlet::make_self_available $portal_id - - news_portlet::add_self_to_page $portal_id $package_id - # Now for the user workspace set workspace_portal_id [dotlrn::get_workspace_portal_id $user_id] Index: openacs-4/packages/dotlrn-research/tcl/dotlrn-research-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/dotlrn-research/tcl/dotlrn-research-procs.tcl,v diff -u -N -r1.6 -r1.7 --- openacs-4/packages/dotlrn-research/tcl/dotlrn-research-procs.tcl 16 Apr 2002 13:58:07 -0000 1.6 +++ openacs-4/packages/dotlrn-research/tcl/dotlrn-research-procs.tcl 30 Apr 2002 21:35:52 -0000 1.7 @@ -122,12 +122,13 @@ } { Add a user to a to a specifc dotlrn community } { - # Get the portal_id by callback + # we have a per user comm portal set portal_id [dotlrn_community::get_portal_id $community_id $user_id] - # Call the portal element to be added correctly - # Make research paper applet available at community-user page level - research_portlet::add_self_to_page $portal_id "" $community_id + if { [exists_and_not_null $portal_id] } { + research_portlet::make_self_available $portal_id + research_portlet::add_self_to_page $portal_id "" $community_id + } } ad_proc -public remove_user_from_community {