Index: openacs-4/packages/acs-subsite/www/admin/rel-segments/constraints/new-oracle.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-subsite/www/admin/rel-segments/constraints/new-oracle.xql,v diff -u -r1.1 -r1.2 --- openacs-4/packages/acs-subsite/www/admin/rel-segments/constraints/new-oracle.xql 15 May 2001 16:59:00 -0000 1.1 +++ openacs-4/packages/acs-subsite/www/admin/rel-segments/constraints/new-oracle.xql 20 Jun 2018 09:06:10 -0000 1.2 @@ -3,20 +3,6 @@ oracle8.1.6 - - - - select s.segment_name, - acs_rel_type.role_pretty_name(t.role_one) as role_one_name, - acs_rel_type.role_pretty_name(t.role_two) as role_two_name - from rel_segments s, acs_rel_types t - where s.rel_type = t.rel_type - and s.segment_id = :rel_segment - - - - - Index: openacs-4/packages/acs-subsite/www/admin/rel-segments/constraints/new-postgresql.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-subsite/www/admin/rel-segments/constraints/new-postgresql.xql,v diff -u -r1.2 -r1.3 --- openacs-4/packages/acs-subsite/www/admin/rel-segments/constraints/new-postgresql.xql 9 Sep 2001 17:42:04 -0000 1.2 +++ openacs-4/packages/acs-subsite/www/admin/rel-segments/constraints/new-postgresql.xql 20 Jun 2018 09:06:10 -0000 1.3 @@ -3,20 +3,6 @@ postgresql7.1 - - - - select s.segment_name, - acs_rel_type__role_pretty_name(t.role_one) as role_one_name, - acs_rel_type__role_pretty_name(t.role_two) as role_two_name - from rel_segments s, acs_rel_types t - where s.rel_type = t.rel_type - and s.segment_id = :rel_segment - - - - - Index: openacs-4/packages/acs-subsite/www/admin/rel-segments/constraints/new.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-subsite/www/admin/rel-segments/constraints/new.tcl,v diff -u -r1.8 -r1.9 --- openacs-4/packages/acs-subsite/www/admin/rel-segments/constraints/new.tcl 21 Jan 2018 00:35:29 -0000 1.8 +++ openacs-4/packages/acs-subsite/www/admin/rel-segments/constraints/new.tcl 20 Jun 2018 09:06:10 -0000 1.9 @@ -39,8 +39,20 @@ set package_id [ad_conn package_id] -db_1row select_rel_properties {} +db_1row select_rel_properties { + select s.segment_name, + (select pretty_name from acs_rel_roles + where role = t.role_one) as role_one_name, + (select pretty_name from acs_rel_roles + where role = t.role_two) as role_two_name + from rel_segments s, acs_rel_types t + where s.rel_type = t.rel_type + and s.segment_id = :rel_segment +} +set role_one_name [lang::util::localize $role_one_name] +set role_two_name [lang::util::localize $role_two_name] + template::form create constraint_new template::element create constraint_new rel_segment \ @@ -71,14 +83,17 @@ -options $option_list \ -label "Add constraint for which side?" -set segment_list [db_list_of_lists select_segments { +set segment_list [list] +db_foreach select_segments { select s.segment_name, s.segment_id from application_group_segments s where s.segment_id <> :rel_segment and s.package_id = :package_id order by lower(s.segment_name) -}] +} { + lappend segment_list [list [lang::util::localize $segment_name] $segment_id] +} if { [llength $segment_list] == 0 } { ad_return_complaint 1 \