Index: openacs-4/packages/acs-subsite/tcl/group-procs-oracle.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-subsite/tcl/group-procs-oracle.xql,v diff -u -r1.3 -r1.3.4.1 --- openacs-4/packages/acs-subsite/tcl/group-procs-oracle.xql 23 Feb 2002 02:43:45 -0000 1.3 +++ openacs-4/packages/acs-subsite/tcl/group-procs-oracle.xql 4 Jul 2003 12:51:14 -0000 1.3.4.1 @@ -34,4 +34,21 @@ + + + select role.pretty_name, + gr.rel_type + from group_rels gr, + acs_rel_types rt, + acs_rel_roles role + where gr.group_id = :group_id + and rt.rel_type = gr.rel_type + and role.role = rt.role_two + and rt.object_type_two = :object_type + order by decode(gr.rel_type, 'membership_rel', 0, 1)||role.pretty_name + + + + + Index: openacs-4/packages/acs-subsite/tcl/group-procs-postgresql.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-subsite/tcl/group-procs-postgresql.xql,v diff -u -r1.6 -r1.6.2.1 --- openacs-4/packages/acs-subsite/tcl/group-procs-postgresql.xql 28 Aug 2002 13:43:46 -0000 1.6 +++ openacs-4/packages/acs-subsite/tcl/group-procs-postgresql.xql 4 Jul 2003 12:51:14 -0000 1.6.2.1 @@ -36,5 +36,24 @@ + + + + + select role.pretty_name, + gr.rel_type + from group_rels gr, + acs_rel_types rt, + acs_rel_roles role + where gr.group_id = :group_id + and rt.rel_type = gr.rel_type + and role.role = rt.role_two + and rt.object_type_two = :object_type + order by (case when gr.rel_type = 'membership_rel' then 0 else 1 end)||role.pretty_name + + + + + Index: openacs-4/packages/acs-subsite/tcl/group-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-subsite/tcl/group-procs.tcl,v diff -u -r1.3 -r1.3.2.1 --- openacs-4/packages/acs-subsite/tcl/group-procs.tcl 28 Aug 2002 13:33:59 -0000 1.3 +++ openacs-4/packages/acs-subsite/tcl/group-procs.tcl 4 Jul 2003 12:51:14 -0000 1.3.2.1 @@ -305,3 +305,21 @@ } +ad_proc -public group::get_rel_types_options { + {-group_id:required} + {-object_type "person"} +} { + Get the valid relationship-types for this group in a format suitable for a select widget in the form builder. + The label used is the name of the role for object two. + + @param group_id The ID of the group for which to get options. + + @param object_type The object type which must occupy side two of the relationship. Typically 'person' or 'group'. + + @return a list of lists with label (role two pretty name) and ID (rel_type) +} { + # LARS: + # The query has a hack to make sure 'membership_rel' appears before all other rel types + return [db_list_of_lists select_rel_types {}] +} + Index: openacs-4/packages/acs-subsite/tcl/group-procs.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-subsite/tcl/Attic/group-procs.xql,v diff -u -r1.2 -r1.2.4.1 --- openacs-4/packages/acs-subsite/tcl/group-procs.xql 23 Feb 2002 02:43:45 -0000 1.2 +++ openacs-4/packages/acs-subsite/tcl/group-procs.xql 4 Jul 2003 12:51:14 -0000 1.2.4.1 @@ -38,4 +38,6 @@ + +