Index: openacs-4/packages/dotlrn-catalog/lib/dotlrn-chunk.adp =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/dotlrn-catalog/lib/dotlrn-chunk.adp,v diff -u -r1.1 -r1.2 --- openacs-4/packages/dotlrn-catalog/lib/dotlrn-chunk.adp 14 Feb 2005 22:46:11 -0000 1.1 +++ openacs-4/packages/dotlrn-catalog/lib/dotlrn-chunk.adp 15 Feb 2005 16:37:41 -0000 1.2 @@ -1,8 +1,87 @@ <table> -<tr><td><b>#dotlrn-catalog.dep_name#:</b></td><td>@department_name;noquote@</td></tr> -<tr><td><b>#dotlrn-catalog.term_name#:</b></td><td>@term_name;noquote@</td></tr> -<tr><td><b>#dotlrn-catalog.subject_name#:</b></td><td>@class_name;noquote@</td></tr> -<tr><td><b>#dotlrn-catalog.class_name#:</b></td><td><a href="@url@">@pretty_name;noquote@</a></td></tr> -<tr><td><b>#dotlrn-catalog.description#:</b></td><td>@description;noquote@</td></tr> +<tr> + <td> + <table> + <tr><td><b>#dotlrn-catalog.dep_name#:</b></td><td>@department_name;noquote@</td></tr> + <tr><td><b>#dotlrn-catalog.term_name#:</b></td><td>@term_name;noquote@</td></tr> + <tr><td><b>#dotlrn-catalog.subject_name#:</b></td><td>@class_name;noquote@</td></tr> + <tr><td><b>#dotlrn-catalog.class_name#:</b></td><td><a href="@url@">@pretty_name;noquote@</a></td></tr> + <tr><td><b>#dotlrn-catalog.description#:</b></td><td>@description;noquote@</td></tr> + </table> + </td> + <td> + <table> + <tr> + <td valign="top"> + <if @n_profs@ gt 0> + <ul> + @instructor_role_pretty_plural@: + <multiple name="users"> + <if @users.rel_type@ eq "dotlrn_instructor_rel"> + <li> + <%= [acs_community_member_link -user_id $users(user_id) -label "$users(first_names) $users(last_name)"] %> + <if @email_p@ eq 1> + (<%= [email_image::get_user_email -user_id $users(user_id)] %>) + </if> + <else> + (<a href="mailto:@users.email@">@users.email@</a>) + </else> + </if> + </multiple> + </if> + <else> + <li><small>#dotlrn-portlet.no_instructor_members#</small> + </else> + </ul> + </td></tr> + <tr> + <td valign="top"> + <if @n_tas@ gt 0> + <ul> + @teaching_assistant_role_pretty_plural@: + <multiple name="users"> + <if @users.rel_type@ eq "dotlrn_ta_rel"> + <li> + <%= [acs_community_member_link -user_id $users(user_id) -label "$users(first_names) $users(last_name)"] %> + <if @email_p@ eq 1> + (<%= [email_image::get_user_email -user_id $users(user_id)] %>) + </if> + <else> + (<a href="mailto:@users.email@">@users.email@</a>) + </else> + </li> + </if> + </multiple> + </ul> + </if> + </td></tr> + <tr><td valign="top"> + <if @n_cas@ gt 0> + <ul> + @course_assistant_role_pretty_plural@: + <multiple name="users"> + <if @users.rel_type@ eq "dotlrn_ca_rel"> + <li> + <%= [acs_community_member_link -user_id $users(user_id) -label "$users(first_names) $users(last_name)"] %> + <if @email_p@ eq 1> + (<%= [email_image::get_user_email -user_id $users(user_id)] %>) + </if> + <else> + (<a href="mailto:@users.email@">@users.email@</a>) + </else> + </li> + </if> + </multiple> + </ul> + </if> + </td></tr> + </table> + </td> +</tr> </table> <br> + + + + + Index: openacs-4/packages/dotlrn-catalog/lib/dotlrn-chunk.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/dotlrn-catalog/lib/dotlrn-chunk.tcl,v diff -u -r1.1 -r1.2 --- openacs-4/packages/dotlrn-catalog/lib/dotlrn-chunk.tcl 14 Feb 2005 22:46:11 -0000 1.1 +++ openacs-4/packages/dotlrn-catalog/lib/dotlrn-chunk.tcl 15 Feb 2005 16:37:41 -0000 1.2 @@ -8,3 +8,42 @@ } db_1row get_class_info { } + +set community_id [dotlrn_community::get_community_id_from_url -url $url ] + +# get all the users in a list of ns_sets +set all_users_list [dotlrn_community::list_users $community_id] + +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" + +# 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 \ + -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] + +if { [catch {[email_image::get_folder_id] } errmsg] } { + set email_p 0 +} else { + set email_p 1 +} \ No newline at end of file