Index: openacs-4/packages/dotlrn/dotlrn.info =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/dotlrn/dotlrn.info,v diff -u -r1.6 -r1.7 --- openacs-4/packages/dotlrn/dotlrn.info 5 Nov 2001 22:34:23 -0000 1.6 +++ openacs-4/packages/dotlrn/dotlrn.info 6 Nov 2001 21:46:46 -0000 1.7 @@ -32,8 +32,12 @@ + + + + @@ -47,6 +51,9 @@ + + + @@ -90,6 +97,7 @@ + Index: openacs-4/packages/dotlrn/sql/oracle/dotlrn-classes-create.sql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/dotlrn/sql/oracle/Attic/dotlrn-classes-create.sql,v diff -u -r1.3 -r1.4 --- openacs-4/packages/dotlrn/sql/oracle/dotlrn-classes-create.sql 8 Oct 2001 21:38:37 -0000 1.3 +++ openacs-4/packages/dotlrn/sql/oracle/dotlrn-classes-create.sql 6 Nov 2001 21:46:48 -0000 1.4 @@ -195,3 +195,4 @@ end; / show errors + 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.4 -r1.5 --- openacs-4/packages/dotlrn/sql/oracle/dotlrn-communities-create.sql 5 Oct 2001 15:14:21 -0000 1.4 +++ openacs-4/packages/dotlrn/sql/oracle/dotlrn-communities-create.sql 6 Nov 2001 21:46:48 -0000 1.5 @@ -41,19 +41,6 @@ ); -create table dotlrn_community_memberships ( - rel_id integer not null - constraint dlrn_comm_mem_fk references acs_rels(rel_id) - constraint dlrn_comm_mem_pk primary key, - community_id integer not null - constraint dlrn_comm_mem_comm_id_fk references dotlrn_communities(community_id), - user_id integer not null - constraint dlrn_comm_mem_user_id_fk references users(user_id), - page_id integer not null - constraint dlrn_comm_mem_page_id_fk references portals(portal_id) -); - - create table dotlrn_community_applets ( community_id integer not null constraint dlrn_comm_appl_comm_id_fk references dotlrn_communities(community_id), @@ -274,3 +261,4 @@ / show errors + Index: openacs-4/packages/dotlrn/sql/oracle/dotlrn-create.sql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/dotlrn/sql/oracle/dotlrn-create.sql,v diff -u -r1.4 -r1.5 --- openacs-4/packages/dotlrn/sql/oracle/dotlrn-create.sql 5 Nov 2001 22:34:23 -0000 1.4 +++ openacs-4/packages/dotlrn/sql/oracle/dotlrn-create.sql 6 Nov 2001 21:46:48 -0000 1.5 @@ -17,4 +17,5 @@ @dotlrn-classes-create.sql @dotlrn-applet-sc-create.sql @dotlrn-init.sql - +@dotlrn-community-memberships-create.sql +@dotlrn-community-memberships-packages-create.sql Index: openacs-4/packages/dotlrn/sql/oracle/dotlrn-init.sql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/dotlrn/sql/oracle/dotlrn-init.sql,v diff -u -r1.4 -r1.5 --- openacs-4/packages/dotlrn/sql/oracle/dotlrn-init.sql 8 Oct 2001 21:38:37 -0000 1.4 +++ openacs-4/packages/dotlrn/sql/oracle/dotlrn-init.sql 6 Nov 2001 21:46:48 -0000 1.5 @@ -43,7 +43,7 @@ pretty_plural => 'dotLRN Clubs', description => 'dotLRN Clubs - e.g. Alumni' ); - + -- year attribute year_attr_id:= acs_attribute.create_attribute ( object_type => 'dotlrn_class', @@ -167,3 +167,21 @@ / show errors + +-- One more object type + +declare +begin + acs_object_type.create_type ( + supertype => 'dotlrn_community', + object_type => 'dotlrn_class_instance', + pretty_name => 'dotLRN Class Instace', + pretty_plural => 'dotLRN Class Instances', + table_name => 'dotlrn_class_instances', + id_column => 'class_instance_id', + package_name => 'dotlrn_class_instance', + name_method => 'acs_object.name' + ); +end; +/ +show errors Index: openacs-4/packages/dotlrn/sql/oracle/dotlrn-users-package-create.sql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/dotlrn/sql/oracle/Attic/dotlrn-users-package-create.sql,v diff -u -r1.2 -r1.3 --- openacs-4/packages/dotlrn/sql/oracle/dotlrn-users-package-create.sql 5 Nov 2001 22:34:23 -0000 1.2 +++ openacs-4/packages/dotlrn/sql/oracle/dotlrn-users-package-create.sql 6 Nov 2001 21:46:48 -0000 1.3 @@ -53,3 +53,22 @@ end; / show errors + + + +declare +begin + acs_object_type.create_type ( + supertype => 'user', + object_type => 'dotlrn_user', + pretty_name => 'dotLRN User', + pretty_plural => 'dotLRN Users', + table_name => 'dotlrn_users', + id_column => 'user_id', + package_name => 'dotlrn_user', + name_method => 'acs_object.name' + ); +end; +/ +show errors + 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.12 -r1.13 --- openacs-4/packages/dotlrn/tcl/community-procs.tcl 5 Nov 2001 22:34:23 -0000 1.12 +++ openacs-4/packages/dotlrn/tcl/community-procs.tcl 6 Nov 2001 21:46:49 -0000 1.13 @@ -99,6 +99,7 @@ ad_proc -public list_users { community_id + {-rel_type "dotlrn_member_rel"} } { Returns the list of users with a membership_id, a user_id, first name, last name, email, and role } { @@ -122,14 +123,16 @@ Assigns a user to a particular role for that class. Roles in DOTLRN can be student, prof, ta, admin } { db_transaction { - # Set up the relationship - set rel_id [relation_add -member_state approved $rel_type $community_id $user_id] - # Set up a portal page for that user and that community set page_id [portal::create $user_id] - # Insert the membership - db_dml insert_membership {} + # Create the form with the page_id + set vars(page_id) $page_id + template::form::create add_member_form + template::form::set_values add_member_form vars + + # Set up the relationship + set rel_id [relation_add -form_id add_member_form -member_state approved $rel_type $community_id $user_id] # do the callbacks applets_dispatch $community_id AddUser [list $community_id $user_id] @@ -148,15 +151,12 @@ # Get a few important things, like rel_id and portal page_id db_1row select_rel_info {} - - # Remove the membership - db_dml delete_membership {} - - # Remove the page - portal::delete $page_id - + # Remove it relation_remove $rel_id + + # Remove the page + portal::delete $page_id } } Index: openacs-4/packages/dotlrn/tcl/dotlrn-main-portlet-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/dotlrn/tcl/dotlrn-main-portlet-procs.tcl,v diff -u -r1.1 -r1.2 --- openacs-4/packages/dotlrn/tcl/dotlrn-main-portlet-procs.tcl 5 Nov 2001 22:34:23 -0000 1.1 +++ openacs-4/packages/dotlrn/tcl/dotlrn-main-portlet-procs.tcl 6 Nov 2001 21:46:49 -0000 1.2 @@ -56,9 +56,26 @@ array set config $cf - # Figure out what to show here (Ben) - return "" + set user_id [ad_get_user_id] + # This is not templated. OH NO. I am a horrible, horrible, little man. (ben) + + set return_html "
    \n" + + ns_log Notice "DOTLRN-SHOW: UL" + + db_foreach select_communities_for_one_user {} { + ns_log Notice "DOTLRN-SHOW: LI" + append return_html "
  • $community_name\n" + } + + ns_log Notice "DOTLRN-SHOW: /UL" + + append return_html "
" + + # return it all + return $return_html + } ad_proc -public remove_self_from_page { Index: openacs-4/packages/dotlrn/tcl/dotlrn-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/dotlrn/tcl/dotlrn-procs.tcl,v diff -u -r1.5 -r1.6 --- openacs-4/packages/dotlrn/tcl/dotlrn-procs.tcl 8 Oct 2001 21:38:37 -0000 1.5 +++ openacs-4/packages/dotlrn/tcl/dotlrn-procs.tcl 6 Nov 2001 21:46:49 -0000 1.6 @@ -18,29 +18,6 @@ namespace eval dotlrn { - ad_proc install { - } { - Does some installation that cannot be done in SQL - } { - db_transaction { - # Create the rel types - rel_types::new -supertype membership_rel -role_two admin admin_rel "Administration Relation" "Administration Relations" dotlrn_community 0 "" party 0 "" - rel_types::new -supertype membership_rel -role_two student student_rel "Student Relation" "Student Relations" dotlrn_community 0 "" party 0 "" - rel_types::new -supertype admin_rel -role_two admin instructor_rel "Instructor Relation" "Instructor Relations" dotlrn_community 0 "" party 0 "" - rel_types::new -supertype admin_rel -role_two admin ta_rel "TA Relation" "TA Relations" dotlrn_community 0 "" party 0 "" - - # Add what's permissible (we would do this in SQL if the above could be done in SQL...) - rel_types::add_permissible dotlrn_class admin_rel - rel_types::add_permissible dotlrn_class student_rel - rel_types::add_permissible dotlrn_class ta_rel - rel_types::add_permissible dotlrn_class instructor_rel - - rel_types::add_permissible dotlrn_club admin_rel - # rel_types::add_permissible dotlrn_club membership_rel - } - } - - ad_proc -public class_group_type_key { } { Returns the group type key used for class groups Index: openacs-4/packages/dotlrn/tcl/dotlrn-security-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/dotlrn/tcl/dotlrn-security-procs.tcl,v diff -u -r1.2 -r1.3 --- openacs-4/packages/dotlrn/tcl/dotlrn-security-procs.tcl 5 Nov 2001 22:34:23 -0000 1.2 +++ openacs-4/packages/dotlrn/tcl/dotlrn-security-procs.tcl 6 Nov 2001 21:46:49 -0000 1.3 @@ -32,7 +32,7 @@ set page_id [portal::create $user_id] # Add the basic dotLRN class listing portlet - # NOT IMPLEMENTED YET! + dotlrn_main_portlet::add_self_to_page $page_id {} # Update the user and set the portal page correctly db_dml update_user_page_id {} Index: openacs-4/packages/dotlrn/www/index.adp =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/dotlrn/www/index.adp,v diff -u -r1.4 -r1.5 --- openacs-4/packages/dotlrn/www/index.adp 5 Nov 2001 22:34:23 -0000 1.4 +++ openacs-4/packages/dotlrn/www/index.adp 6 Nov 2001 21:46:51 -0000 1.5 @@ -3,4 +3,6 @@ Configure this page. +

+ @rendered_page@ Index: openacs-4/packages/dotlrn/www/index.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/dotlrn/www/index.tcl,v diff -u -r1.6 -r1.7 --- openacs-4/packages/dotlrn/www/index.tcl 5 Nov 2001 22:34:23 -0000 1.6 +++ openacs-4/packages/dotlrn/www/index.tcl 6 Nov 2001 21:46:51 -0000 1.7 @@ -9,6 +9,18 @@ classes:multirow } +# Check if this is a community type level thing +if {[ad_parameter community_type_level_p] == 1} { + ad_returnredirect "one-community-type" + return +} + +# Check if this is a community level thing +if {[ad_parameter community_level_p] == 1} { + ad_returnredirect "one-community" + return +} + # Make sure user is logged in set user_id [ad_maybe_redirect_for_registration] Index: openacs-4/packages/dotlrn/www/one-community-admin.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/dotlrn/www/one-community-admin.tcl,v diff -u -r1.2 -r1.3 --- openacs-4/packages/dotlrn/www/one-community-admin.tcl 8 Oct 2001 21:38:37 -0000 1.2 +++ openacs-4/packages/dotlrn/www/one-community-admin.tcl 6 Nov 2001 21:46:51 -0000 1.3 @@ -16,7 +16,7 @@ set user_id [ad_conn user_id] -# What community type are we at? +# What community are we at? set community_id [dotlrn_community::get_community_id] # Load some community type info @@ -43,7 +43,6 @@ } } - set context_bar {Admin} ad_return_template Index: openacs-4/packages/dotlrn/www/one-community-type.adp =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/dotlrn/www/one-community-type.adp,v diff -u -r1.4 -r1.5 --- openacs-4/packages/dotlrn/www/one-community-type.adp 9 Oct 2001 14:35:58 -0000 1.4 +++ openacs-4/packages/dotlrn/www/one-community-type.adp 6 Nov 2001 21:46:51 -0000 1.5 @@ -21,7 +21,7 @@

Active Communities of this Type