Index: openacs-4/packages/acs-subsite/tcl/rel-types-procs-postgresql.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-subsite/tcl/rel-types-procs-postgresql.xql,v diff -u -r1.7 -r1.8 --- openacs-4/packages/acs-subsite/tcl/rel-types-procs-postgresql.xql 4 Jun 2005 12:38:26 -0000 1.7 +++ openacs-4/packages/acs-subsite/tcl/rel-types-procs-postgresql.xql 18 Nov 2005 10:40:01 -0000 1.8 @@ -76,5 +76,10 @@ + + + select acs_rel_type__drop_role(:role) + + Index: openacs-4/packages/acs-subsite/tcl/rel-types-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-subsite/tcl/rel-types-procs.tcl,v diff -u -r1.7 -r1.8 --- openacs-4/packages/acs-subsite/tcl/rel-types-procs.tcl 4 Jun 2005 12:38:26 -0000 1.7 +++ openacs-4/packages/acs-subsite/tcl/rel-types-procs.tcl 18 Nov 2005 10:40:01 -0000 1.8 @@ -288,5 +288,36 @@ } return $return_code } -} + + ad_proc -public delete_role { + {-role} + } { + + Drop a Relationship Role. + + @author Nick Carroll (nick.c@rroll.net) + @creation-date 2005-11-18 + + @param role The role to delete. + + @return Returns 1 if successful, otherwise 0. + } { + set return_code 1 + + db_transaction { + # Create the message key (refer to rel_types::create_role). + # Required to unregister translations. + set message_key "role_${role}" + + # Unegister the language keys + lang::message::unregister acs-translations $message_key + lang::message::unregister acs-translations "${message_key}_plural" + + db_exec_plsql drop_role {} + } on_error { + set return_code 0 + } + return $return_code + } +}