Index: openacs-4/packages/dotlrn/sql/oracle/dotlrn-communities-create.sql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/dotlrn/sql/oracle/Attic/dotlrn-communities-create.sql,v diff -u -r1.22 -r1.23 --- openacs-4/packages/dotlrn/sql/oracle/dotlrn-communities-create.sql 19 Jan 2002 22:54:20 -0000 1.22 +++ openacs-4/packages/dotlrn/sql/oracle/dotlrn-communities-create.sql 11 Feb 2002 05:16:58 -0000 1.23 @@ -31,6 +31,8 @@ references groups (group_id) constraint dotlrn_communities_pk primary key, + parent_community_id constraint dotlrn_c_parent_comm_id_fk + references dotlrn_communities(community_id), community_type not null constraint dotlrn_c_community_type_fk references dotlrn_community_types (community_type), 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.54 -r1.55 --- openacs-4/packages/dotlrn/tcl/community-procs.tcl 10 Feb 2002 22:16:53 -0000 1.54 +++ openacs-4/packages/dotlrn/tcl/community-procs.tcl 11 Feb 2002 05:16:58 -0000 1.55 @@ -118,7 +118,16 @@ return [db_string select_node_id {}] } + ad_proc -public get_community_node_id { + community_id + } { + get the node ID of a community + } { + return [db_string select_node_id {}] + } + ad_proc -public new { + {-parent_community_id ""} {-description ""} {-community_type:required} {-object_type "dotlrn_community"} @@ -146,6 +155,11 @@ set community_id [package_instantiate_object \ -extra_vars $extra_vars $object_type] + # Update parent community ID if necessary + if {![empty_string_p $parent_community_id]} { + db_dml update_parent_community_id {} + } + set user_id [ad_conn user_id] # Create portal template page @@ -182,7 +196,11 @@ dotlrn_community::create_rel_segments -community_id $community_id # Set up the node - set parent_node_id [get_type_node_id $community_type] + if {[empty_string_p $parent_community_id]} { + set parent_node_id [get_type_node_id $community_type] + } else { + set parent_node_id [get_community_node_id $parent_community_id] + } # Create the node set new_node_id [site_node_create $parent_node_id $community_key] Index: openacs-4/packages/dotlrn/tcl/community-procs.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/dotlrn/tcl/community-procs.xql,v diff -u -r1.23 -r1.24 --- openacs-4/packages/dotlrn/tcl/community-procs.xql 23 Jan 2002 00:15:43 -0000 1.23 +++ openacs-4/packages/dotlrn/tcl/community-procs.xql 11 Feb 2002 05:16:58 -0000 1.24 @@ -29,6 +29,19 @@ + + +select node_id from site_nodes where object_id= (select package_id from dotlrn_communities where community_id= :community_id) + + + + + +update dotlrn_communities set parent_community_id= :parent_community_id +where community_id= :community_id + + + update dotlrn_communities set portal_template_id = :portal_template_id, portal_id = :portal_id, admin_portal_id= :admin_portal_id where community_id = :community_id Index: openacs-4/packages/dotlrn/www/admin/user-new-2.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/dotlrn/www/admin/user-new-2.tcl,v diff -u -r1.14 -r1.15 --- openacs-4/packages/dotlrn/www/admin/user-new-2.tcl 8 Feb 2002 20:50:57 -0000 1.14 +++ openacs-4/packages/dotlrn/www/admin/user-new-2.tcl 11 Feb 2002 05:16:59 -0000 1.15 @@ -56,7 +56,9 @@ } ad_returnredirect $referer - ad_script_abort + # I don't think a script abort is the right thing (ben) + # ad_script_abort + return } db_1row select_user_info {