Index: openacs-4/packages/dotlrn/sql/oracle/community-memberships-create.sql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/dotlrn/sql/oracle/community-memberships-create.sql,v diff -u -r1.1 -r1.2 --- openacs-4/packages/dotlrn/sql/oracle/community-memberships-create.sql 6 May 2002 23:55:01 -0000 1.1 +++ openacs-4/packages/dotlrn/sql/oracle/community-memberships-create.sql 21 May 2002 07:46:02 -0000 1.2 @@ -39,11 +39,9 @@ acs_rels.object_id_one as community_id, acs_rels.object_id_two as user_id, acs_rels.rel_type, - (select acs_rel_roles.pretty_name - from acs_rel_roles - where acs_rel_roles.role = (select acs_rel_types.role_two - from acs_rel_types - where acs_rel_types.rel_type = acs_rels.rel_type)) as role, + (select acs_rel_types.role_two + from acs_rel_types + where acs_rel_types.rel_type = acs_rels.rel_type) as role, membership_rels.member_state from dotlrn_member_rels, acs_rels, Index: openacs-4/packages/dotlrn/sql/postgresql/dotlrn-community-memberships-create.sql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/dotlrn/sql/postgresql/Attic/dotlrn-community-memberships-create.sql,v diff -u -r1.2 -r1.3 --- openacs-4/packages/dotlrn/sql/postgresql/dotlrn-community-memberships-create.sql 29 Mar 2002 19:14:44 -0000 1.2 +++ openacs-4/packages/dotlrn/sql/postgresql/dotlrn-community-memberships-create.sql 21 May 2002 07:46:02 -0000 1.3 @@ -46,11 +46,9 @@ acs_rels.object_id_one as community_id, acs_rels.object_id_two as user_id, acs_rels.rel_type, - (select acs_rel_roles.pretty_name - from acs_rel_roles - where acs_rel_roles.role = (select acs_rel_types.role_two - from acs_rel_types - where acs_rel_types.rel_type = acs_rels.rel_type)) as role, + (select acs_rel_types.role_two + from acs_rel_types + where acs_rel_types.rel_type = acs_rels.rel_type) as role, dotlrn_member_rels.portal_id, membership_rels.member_state from dotlrn_member_rels, Index: openacs-4/packages/dotlrn/tcl/community-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/dotlrn/tcl/community-procs.tcl,v diff -u -r1.127 -r1.128 --- openacs-4/packages/dotlrn/tcl/community-procs.tcl 21 May 2002 06:52:34 -0000 1.127 +++ openacs-4/packages/dotlrn/tcl/community-procs.tcl 21 May 2002 07:46:03 -0000 1.128 @@ -444,8 +444,11 @@ } ad_proc -private get_roles { - {-community_id:required} + {-community_id ""} } { + if {[empty_string_p $community_id]} { + set community_id [get_community_id] + } set default_roles [eval concat [get_default_roles -community_id $community_id]] set attributes [eval concat [get_attributes -community_id $community_id]] @@ -476,6 +479,27 @@ return $roles } + ad_proc -public get_role_pretty_name { + {-community_id ""} + {-rel_type:required} + } { + get the pretty name for the role associated with this rel_type + } { + if {[empty_string_p $community_id]} { + set community_id [get_community_id] + } + + set roles [eval concat [get_roles -community_id $community_id]] + set i [lsearch -exact $roles $rel_type] + set pretty_name "" + + if {$i > -1} { + set pretty_name [lindex $roles [expr $i + 2]] + } + + return $pretty_name + } + ad_proc -public get_all_roles {} { return the list of roles used in dotLRN } { Index: openacs-4/packages/dotlrn/www/members-chunk-table.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/dotlrn/www/members-chunk-table.tcl,v diff -u -r1.7 -r1.8 --- openacs-4/packages/dotlrn/www/members-chunk-table.tcl 19 May 2002 15:02:13 -0000 1.7 +++ openacs-4/packages/dotlrn/www/members-chunk-table.tcl 21 May 2002 07:46:03 -0000 1.8 @@ -91,14 +91,8 @@ lappend table_def [list \ role \ "Role" \ - {decode(role, 'Professor', 1, - 'Administrator', 2, - 'Teaching Assistant', 3, - 'Course Assistant', 4, - 'Course Administrator', 5, - 'Student', 6, - 'Member', 7) asc, last_name $order} \ - {$role} + {decode(role, 'instructor', 1, 'admin', 2, 'teaching_assistant', 3, 'course_assistant', 4, 'course_admin', 5, 'student', 6, 'member', 7) asc, last_name $order} \ + "\[dotlrn_community::get_role_pretty_name -community_id $community_id -rel_type \$rel_type\]" ] if {$site_wide_admin_p} { Index: openacs-4/packages/dotlrn/www/my-communities-oracle.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/dotlrn/www/my-communities-oracle.xql,v diff -u -r1.6 -r1.7 --- openacs-4/packages/dotlrn/www/my-communities-oracle.xql 1 May 2002 01:19:47 -0000 1.6 +++ openacs-4/packages/dotlrn/www/my-communities-oracle.xql 21 May 2002 07:46:03 -0000 1.7 @@ -11,7 +11,9 @@ dotlrn_communities.description, dotlrn_communities.package_id, dotlrn_community.url(dotlrn_communities.community_id) as url, + dotlrn_member_rels_approved.rel_type, dotlrn_member_rels_approved.role, + '' as role_pretty_name, decode(dotlrn_community.admin_p(dotlrn_communities.community_id, dotlrn_member_rels_approved.user_id),'f',0,1) as admin_p from dotlrn_communities, dotlrn_member_rels_approved Index: openacs-4/packages/dotlrn/www/my-communities.adp =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/dotlrn/www/my-communities.adp,v diff -u -r1.10 -r1.11 --- openacs-4/packages/dotlrn/www/my-communities.adp 18 May 2002 22:42:11 -0000 1.10 +++ openacs-4/packages/dotlrn/www/my-communities.adp 21 May 2002 07:46:03 -0000 1.11 @@ -24,7 +24,7 @@ @communities.pretty_name@ - @communities.role@ + @communities.role_pretty_name@ [ Index: openacs-4/packages/dotlrn/www/my-communities.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/dotlrn/www/my-communities.tcl,v diff -u -r1.4 -r1.5 --- openacs-4/packages/dotlrn/www/my-communities.tcl 29 Mar 2002 19:14:46 -0000 1.4 +++ openacs-4/packages/dotlrn/www/my-communities.tcl 21 May 2002 07:46:03 -0000 1.5 @@ -32,6 +32,8 @@ set referer "my-communities" } -db_multirow communities select_my_communities {} +db_multirow communities select_my_communities {} { + set role_pretty_name [dotlrn_community::get_role_pretty_name -community_id $community_id -rel_type $rel_type] +} ad_return_template Index: openacs-4/packages/dotlrn/www/admin/user-oracle.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/dotlrn/www/admin/user-oracle.xql,v diff -u -r1.7 -r1.8 --- openacs-4/packages/dotlrn/www/admin/user-oracle.xql 28 Apr 2002 04:08:42 -0000 1.7 +++ openacs-4/packages/dotlrn/www/admin/user-oracle.xql 21 May 2002 07:46:03 -0000 1.8 @@ -29,7 +29,9 @@ select dotlrn_class_instances_full.*, + dotlrn_member_rels_approved.rel_type, dotlrn_member_rels_approved.role, + '' as role_pretty_name, acs_permission.permission_p(dotlrn_class_instances_full.class_instance_id, :user_id, 'admin') as admin_p from dotlrn_class_instances_full, dotlrn_member_rels_approved @@ -45,7 +47,9 @@ select dotlrn_clubs_full.*, + dotlrn_member_rels_approved.rel_type, dotlrn_member_rels_approved.role, + '' as role_pretty_name, acs_permission.permission_p(dotlrn_clubs_full.club_id, :user_id, 'admin') as admin_p from dotlrn_clubs_full, dotlrn_member_rels_approved @@ -60,7 +64,9 @@ select dotlrn_communities.*, dotlrn_community.url(dotlrn_communities.community_id) as url, + dotlrn_member_rels_approved.rel_type, dotlrn_member_rels_approved.role, + '' as role_pretty_name, acs_permission.permission_p(dotlrn_communities.community_id, :user_id, 'admin') as admin_p from dotlrn_communities, dotlrn_member_rels_approved Index: openacs-4/packages/dotlrn/www/admin/user.adp =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/dotlrn/www/admin/user.adp,v diff -u -r1.11 -r1.12 --- openacs-4/packages/dotlrn/www/admin/user.adp 18 May 2002 22:42:11 -0000 1.11 +++ openacs-4/packages/dotlrn/www/admin/user.adp 21 May 2002 07:46:03 -0000 1.12 @@ -118,7 +118,7 @@
  • @member_classes.pretty_name@ @member_classes.term_name@ @member_classes.term_year@ - (@member_classes.role@) + (@member_classes.role_pretty_name@)
  • @@ -133,7 +133,7 @@
  • @member_clubs.pretty_name@ - (@member_clubs.role@) + (@member_clubs.role_pretty_name@)
  • @@ -148,7 +148,7 @@
  • @member_subgroups.pretty_name@ - (@member_subgroups.role@) + (@member_subgroups.role_pretty_name@)
  • Index: openacs-4/packages/dotlrn/www/admin/user.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/dotlrn/www/admin/user.tcl,v diff -u -r1.7 -r1.8 --- openacs-4/packages/dotlrn/www/admin/user.tcl 8 May 2002 14:35:07 -0000 1.7 +++ openacs-4/packages/dotlrn/www/admin/user.tcl 21 May 2002 07:46:03 -0000 1.8 @@ -69,9 +69,15 @@ set change_state_links "\[[join [ad_registration_finite_state_machine_admin_links $member_state $email_verified_p $user_id $return_url] " | "]\]" -db_multirow member_classes select_member_classes {} -db_multirow member_clubs select_member_clubs {} -db_multirow member_subgroups select_member_subgroups {} +db_multirow member_classes select_member_classes {} { + set role_pretty_name [dotlrn_community::get_role_pretty_name -community_id $class_instance_id -rel_type $rel_type] +} +db_multirow member_clubs select_member_clubs {} { + set role_pretty_name [dotlrn_community::get_role_pretty_name -community_id $club_id -rel_type $rel_type] +} +db_multirow member_subgroups select_member_subgroups {} { + set role_pretty_name [dotlrn_community::get_role_pretty_name -community_id $community_id -rel_type $rel_type] +} set context_bar [list [list users Users] "$first_names $last_name"]