Index: openacs-4/packages/dotlrn-portlet/www/dotlrn-members-staff-portlet.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/dotlrn-portlet/www/dotlrn-members-staff-portlet.tcl,v diff -u -r1.9 -r1.10 --- openacs-4/packages/dotlrn-portlet/www/dotlrn-members-staff-portlet.tcl 11 Dec 2002 14:06:31 -0000 1.9 +++ openacs-4/packages/dotlrn-portlet/www/dotlrn-members-staff-portlet.tcl 29 May 2003 18:05:27 -0000 1.10 @@ -31,36 +31,40 @@ set referer [ad_conn url] set community_id $config(community_id) -set admin_p [dotlrn::user_can_admin_community_p -user_id $user_id -community_id $community_id] -set read_private_data_p [dotlrn::user_can_read_private_data_p -user_id $user_id] +if { ![string equal $community_id 0] } { -# get all the users in a list of ns_sets -set all_users_list [dotlrn_community::list_users $community_id] + set admin_p [dotlrn::user_can_admin_community_p -user_id $user_id -community_id $community_id] + set read_private_data_p [dotlrn::user_can_read_private_data_p -user_id $user_id] -set n_profs 0 -set n_tas 0 -set n_cas 0 + # get all the users in a list of ns_sets + set all_users_list [dotlrn_community::list_users $community_id] -# count how many of some types -foreach one_user_set $all_users_list { - if {[string equal [ns_set get $one_user_set rel_type] "dotlrn_instructor_rel"]} { - incr n_profs - } elseif {[string equal [ns_set get $one_user_set rel_type] "dotlrn_ta_rel"]} { - incr n_tas - } elseif {[string equal [ns_set get $one_user_set rel_type] "dotlrn_ca_rel"]} { - incr n_cas + set n_profs 0 + set n_tas 0 + set n_cas 0 + + # count how many of some types + foreach one_user_set $all_users_list { + if {[string equal [ns_set get $one_user_set rel_type] "dotlrn_instructor_rel"]} { + incr n_profs + } elseif {[string equal [ns_set get $one_user_set rel_type] "dotlrn_ta_rel"]} { + incr n_tas + } elseif {[string equal [ns_set get $one_user_set rel_type] "dotlrn_ca_rel"]} { + incr n_cas + } } -} -# stuff into a multirow -template::util::list_of_ns_sets_to_multirow \ - -rows $all_users_list \ - -var_name "users" + # stuff into a multirow + template::util::list_of_ns_sets_to_multirow \ + -rows $all_users_list \ + -var_name "users" -# Used in en_US version of some messages in adp -set instructor_role_pretty_plural [dotlrn_community::get_role_pretty_plural -community_id $community_id \ + # Used in en_US version of some messages in adp + set instructor_role_pretty_plural [dotlrn_community::get_role_pretty_plural -community_id $community_id \ -rel_type dotlrn_instructor_rel] -set teaching_assistant_role_pretty_plural [dotlrn_community::get_role_pretty_plural -community_id $community_id \ + set teaching_assistant_role_pretty_plural [dotlrn_community::get_role_pretty_plural -community_id $community_id \ -rel_type dotlrn_ta_rel] -set course_assistant_role_pretty_plural [dotlrn_community::get_role_pretty_plural -community_id $community_id \ - -rel_type dotlrn_ca_rel] \ No newline at end of file + set course_assistant_role_pretty_plural [dotlrn_community::get_role_pretty_plural -community_id $community_id \ + -rel_type dotlrn_ca_rel] +} +